Documentation
¶
Index ¶
- Constants
- Variables
- func AppendBytes32(data ...[]byte) []byte
- func GetAccountProof(dividendAccounts []DividendAccount, userAddr string) ([]byte, uint64, error)
- func GetAccountRootHash(dividendAccounts []DividendAccount) ([]byte, error)
- func GetAccountTree(dividendAccounts []DividendAccount) (*merkletree.MerkleTree, error)
- func VerifyAccountProof(dividendAccounts []DividendAccount, userAddr, proofToVerify string) (bool, error)
- type DividendAccount
- func (da DividendAccount) CalculateHash() ([]byte, error)
- func (*DividendAccount) Descriptor() ([]byte, []int)
- func (this *DividendAccount) Equal(that interface{}) bool
- func (da DividendAccount) Equals(other merkletree.Content) (bool, error)
- func (m *DividendAccount) GetFeeAmount() string
- func (m *DividendAccount) GetUser() string
- func (m *DividendAccount) Marshal() (dAtA []byte, err error)
- func (m *DividendAccount) MarshalTo(dAtA []byte) (int, error)
- func (m *DividendAccount) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*DividendAccount) ProtoMessage()
- func (m *DividendAccount) Reset()
- func (m *DividendAccount) Size() (n int)
- func (m *DividendAccount) String() string
- func (m *DividendAccount) Unmarshal(dAtA []byte) error
- func (m *DividendAccount) XXX_DiscardUnknown()
- func (m *DividendAccount) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DividendAccount) XXX_Merge(src proto.Message)
- func (m *DividendAccount) XXX_Size() int
- func (m *DividendAccount) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const ( ErrMsgEventAlreadyProcessed = "event already processed" ErrMsgOldEventsNotAllowed = "old events are not allowed" ErrMsgSideTxRejected = "sideTx didn't get yes votes" ErrMsgValidationFailed = "failed to validate msg" ErrMsgFailedToFetchValidator = "failed to fetch validator from store" ErrMsgFailedToGetValidatorSet = "failed to get validator set" ErrMsgValidatorAlreadyExists = "validator has been a validator before, hence cannot join with same id" ErrMsgNoProposerInValidatorSet = "no proposer in validator set" ErrMsgInvalidProposerInMsg = "invalid proposer in msg" ErrMsgInvalidProposerAddress = "invalid proposer address" ErrMsgNonceMismatch = "nonce in message doesn't match with nonce in log" ErrMsgIDMismatch = "id in message doesn't match with id in log" ErrMsgUnableToSetSequence = "unable to set the sequence" ErrMsgBlocksNotInContinuity = "blocks not in continuity" ErrMsgBlockNumberMismatch = "blockNumber in message doesn't match blockNumber in receipt" ErrMsgPubKeyFirstByteMismatch = "public key first byte mismatch" ErrMsgInvalidPubKey = "public key is invalid" ErrMsgConvertSignerToBytes = "error in converting signer address to bytes" ErrMsgConvertEventLogSignerToBytes = "error in converting event log signer address to bytes" ErrMsgConvertHexToBytes = "error in converting hex address to bytes" ErrMsgFailedToFetchParams = "error in fetching params from store" ErrMsgFailedToGetChainParams = "failed to get chain params" ErrMsgFailedToGetChainManagerParams = "failed to get chain manager params" ErrMsgErrorInGettingChainManagerParams = "error in getting chain manager params" ErrMsgErrorFetchingLog = "error fetching log from txHash" ErrMsgInvalidAmount = "invalid amount for validator" ErrMsgAmountMismatch = "amount in message doesn't match Amount in event logs" ErrAlertVoteExtensionRejected = "alert, vote extension rejected. This should not happen; the validator could be malicious!" ErrAlertNonRpVoteExtensionRejected = "alert, non-rp vote extension rejected. This should not happen; the validator could be malicious!" ErrAlertMilestonePropositionVoteExtensionRejected = "alert, milestone proposition vote extension rejected. This should not happen; the validator could be malicious!" )
View Source
const ( AttributeKeyTxHash = "txhash" AttributeKeyTxLogIndex = "tx-log-index" AttributeKeySideTxResult = "side-tx-result" EventTypeFeeTransfer = "fee-transfer" AttributeKeyProposer = "proposer" AttributeKeyDenom = "denom" AttributeKeyAmount = "amount" )
View Source
const ( // LogKeyError is the standard attribute key for error logging LogKeyError = "error" // LogKeySequence is used for logging sequence IDs in event processing LogKeySequence = "sequence" LogKeyValidatorID = "validatorId" LogKeyValidatorNonce = "validatorNonce" LogKeyMsgNonce = "msgNonce" LogKeyMsgBlockNumber = "msgBlockNumber" LogKeyMsgID = "msgId" LogKeyLogIndex = "logIndex" LogKeyBlockNumber = "blockNumber" LogKeyReceiptBlockNumber = "receiptBlockNumber" LogKeyNonceFromTx = "nonceFromTx" LogKeyValidatorIdFromTx = "validatorIdFromTx" LogKeyMsgAmount = "msgAmount" LogKeyNewAmount = "newAmount" LogKeyAmountFromEvent = "amountFromEvent" LogKeyProposer = "proposer" LogKeySigner = "signer" )
View Source
const (
// DefaultLogIndexUnit is the default tx hash and log index unit (used to calculate sequence ID)
DefaultLogIndexUnit = 100000
)
Variables ¶
Functions ¶
func AppendBytes32 ¶
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 {
// Address of the user who owns this dividend account.
User string `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
// Total amount of fees accumulated in this account.
FeeAmount string `protobuf:"bytes,2,opt,name=fee_amount,json=feeAmount,proto3" json:"fee_amount,omitempty"`
}
DividendAccount contains the burned fees for a user. Tracks accumulated fees that can be withdrawn by validators.
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) 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
Source Files
¶
Click to show internal directories.
Click to hide internal directories.