types

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 18, 2025 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AttributeKeyTxHash       = "txhash"
	AttributeKeyTxLogIndex   = "tx-log-index"
	AttributeKeySideTxResult = "side-tx-result"
)
View Source
const (
	// DefaultLogIndexUnit is the default tx hash + log index unit (used to calculate sequence ID)
	DefaultLogIndexUnit = 100000
)

Variables

View Source
var (
	ErrInvalidLengthDividendAccount        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowDividendAccount          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupDividendAccount = fmt.Errorf("proto: unexpected end of group")
)

Functions

func AppendBytes32

func AppendBytes32(data ...[]byte) []byte

func GetAccountProof

func GetAccountProof(dividendAccounts []DividendAccount, userAddr string) ([]byte, uint64, error)

GetAccountProof returns proof of dividend Account

func GetAccountRootHash

func GetAccountRootHash(dividendAccounts []DividendAccount) ([]byte, error)

GetAccountRootHash returns rootHash of Validator Account State Tree

func GetAccountTree

func GetAccountTree(dividendAccounts []DividendAccount) (*merkletree.MerkleTree, error)

GetAccountTree returns rootHash of Validator Account State Tree

func VerifyAccountProof

func VerifyAccountProof(dividendAccounts []DividendAccount, userAddr, proofToVerify string) (bool, error)

VerifyAccountProof returns proof of dividend Account

Types

type DividendAccount

type DividendAccount struct {
	User      string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
	FeeAmount string `protobuf:"bytes,2,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount,omitempty"`
}

DividendAccount contains the burned fees

func SortDividendAccountByAddress

func SortDividendAccountByAddress(dividendAccounts []DividendAccount) ([]DividendAccount, error)

SortDividendAccountByAddress sorts DividendAccounts by address

func (DividendAccount) CalculateHash

func (da DividendAccount) CalculateHash() ([]byte, error)

CalculateHash hashes the values of a DividendAccount

func (*DividendAccount) Descriptor

func (*DividendAccount) Descriptor() ([]byte, []int)

func (*DividendAccount) Equal

func (this *DividendAccount) Equal(that interface{}) bool

func (DividendAccount) Equals

func (da DividendAccount) Equals(other merkletree.Content) (bool, error)

func (*DividendAccount) GetFeeAmount

func (m *DividendAccount) GetFeeAmount() string

func (*DividendAccount) GetUser

func (m *DividendAccount) GetUser() string

func (*DividendAccount) Marshal

func (m *DividendAccount) Marshal() (dAtA []byte, err error)

func (*DividendAccount) MarshalTo

func (m *DividendAccount) MarshalTo(dAtA []byte) (int, error)

func (*DividendAccount) MarshalToSizedBuffer

func (m *DividendAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)

func (*DividendAccount) ProtoMessage

func (*DividendAccount) ProtoMessage()

func (*DividendAccount) Reset

func (m *DividendAccount) Reset()

func (*DividendAccount) Size

func (m *DividendAccount) Size() (n int)

func (*DividendAccount) String

func (m *DividendAccount) String() string

func (*DividendAccount) Unmarshal

func (m *DividendAccount) Unmarshal(dAtA []byte) error

func (*DividendAccount) XXX_DiscardUnknown

func (m *DividendAccount) XXX_DiscardUnknown()

func (*DividendAccount) XXX_Marshal

func (m *DividendAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*DividendAccount) XXX_Merge

func (m *DividendAccount) XXX_Merge(src proto.Message)

func (*DividendAccount) XXX_Size

func (m *DividendAccount) XXX_Size() int

func (*DividendAccount) XXX_Unmarshal

func (m *DividendAccount) XXX_Unmarshal(b []byte) error

Directories

Path Synopsis
Package rest provides HTTP types and primitives for REST requests validation and responses handling.
Package rest provides HTTP types and primitives for REST requests validation and responses handling.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL