Documentation ¶
Index ¶
- Constants
- Variables
- func NewAddress(adr []byte) *address
- func NewDataTriesHolder() *dataTriesHolder
- func NewEmptyPeerAccount() *peerAccount
- func NewJournalEntryAccount(account AccountHandler) (*journalEntryAccount, error)
- func NewJournalEntryAccountCreation(address []byte, updater Updater) (*journalEntryAccountCreation, error)
- func NewJournalEntryCode(codeHash []byte, updater Updater) (*journalEntryCode, error)
- func NewJournalEntryDataTrieUpdates(trieUpdates map[string][]byte, account baseAccountHandler) (*journalEntryDataTrieUpdates, error)
- func NewPeerAccount(addressContainer AddressContainer) (*peerAccount, error)
- func NewUserAccount(addressContainer AddressContainer) (*userAccount, error)
- type AccountFactory
- type AccountHandler
- type AccountsAdapter
- type AccountsDB
- func (adb *AccountsDB) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (adb *AccountsDB) Commit() ([]byte, error)
- func (adb *AccountsDB) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
- func (adb *AccountsDB) GetExistingAccount(addressContainer AddressContainer) (AccountHandler, error)
- func (adb *AccountsDB) IsInterfaceNil() bool
- func (adb *AccountsDB) IsPruningEnabled() bool
- func (adb *AccountsDB) JournalLen() int
- func (adb *AccountsDB) LoadAccount(addressContainer AddressContainer) (AccountHandler, error)
- func (adb *AccountsDB) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
- func (adb *AccountsDB) RecreateTrie(rootHash []byte) error
- func (adb *AccountsDB) RemoveAccount(addressContainer AddressContainer) error
- func (adb *AccountsDB) RevertToSnapshot(snapshot int) error
- func (adb *AccountsDB) RootHash() ([]byte, error)
- func (adb *AccountsDB) SaveAccount(account AccountHandler) error
- func (adb *AccountsDB) SetStateCheckpoint(rootHash []byte)
- func (adb *AccountsDB) SnapshotState(rootHash []byte)
- type AccountsDbIdentifier
- type AddressContainer
- type AddressConverter
- type DataTrieTracker
- type ErrMissingTrie
- type ErrorTrieNotNormalized
- type ErrorWrongSize
- type JournalEntry
- type PeerAccountData
- func (*PeerAccountData) Descriptor() ([]byte, []int)
- func (this *PeerAccountData) Equal(that interface{}) bool
- func (m *PeerAccountData) GetAccumulatedFees() *math_big.Int
- func (m *PeerAccountData) GetBLSPublicKey() []byte
- func (m *PeerAccountData) GetCurrentShardId() uint32
- func (m *PeerAccountData) GetJailTime() TimePeriod
- func (m *PeerAccountData) GetLeaderSuccessRate() SignRate
- func (m *PeerAccountData) GetNextShardId() uint32
- func (m *PeerAccountData) GetNodeInWaitingList() bool
- func (m *PeerAccountData) GetNonce() uint64
- func (m *PeerAccountData) GetNumSelectedInSuccessBlocks() uint32
- func (m *PeerAccountData) GetPastJailTimes() []TimePeriod
- func (m *PeerAccountData) GetRating() uint32
- func (m *PeerAccountData) GetRewardAddress() []byte
- func (m *PeerAccountData) GetSchnorrPublicKey() []byte
- func (m *PeerAccountData) GetStake() *math_big.Int
- func (m *PeerAccountData) GetTempRating() uint32
- func (m *PeerAccountData) GetUnStakedNonce() uint64
- func (m *PeerAccountData) GetValidatorSuccessRate() SignRate
- func (this *PeerAccountData) GoString() string
- func (m *PeerAccountData) Marshal() (dAtA []byte, err error)
- func (m *PeerAccountData) MarshalTo(dAtA []byte) (int, error)
- func (m *PeerAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*PeerAccountData) ProtoMessage()
- func (m *PeerAccountData) Reset()
- func (m *PeerAccountData) Size() (n int)
- func (this *PeerAccountData) String() string
- func (m *PeerAccountData) Unmarshal(dAtA []byte) error
- func (m *PeerAccountData) XXX_DiscardUnknown()
- func (m *PeerAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PeerAccountData) XXX_Merge(src proto.Message)
- func (m *PeerAccountData) XXX_Size() int
- func (m *PeerAccountData) XXX_Unmarshal(b []byte) error
- type PeerAccountHandler
- type PeerAccountsDB
- type SignRate
- func (*SignRate) Descriptor() ([]byte, []int)
- func (this *SignRate) Equal(that interface{}) bool
- func (m *SignRate) GetNrFailure() uint32
- func (m *SignRate) GetNrSuccess() uint32
- func (this *SignRate) GoString() string
- func (m *SignRate) Marshal() (dAtA []byte, err error)
- func (m *SignRate) MarshalTo(dAtA []byte) (int, error)
- func (m *SignRate) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*SignRate) ProtoMessage()
- func (m *SignRate) Reset()
- func (m *SignRate) Size() (n int)
- func (this *SignRate) String() string
- func (m *SignRate) Unmarshal(dAtA []byte) error
- func (m *SignRate) XXX_DiscardUnknown()
- func (m *SignRate) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *SignRate) XXX_Merge(src proto.Message)
- func (m *SignRate) XXX_Size() int
- func (m *SignRate) XXX_Unmarshal(b []byte) error
- type TimePeriod
- func (*TimePeriod) Descriptor() ([]byte, []int)
- func (this *TimePeriod) Equal(that interface{}) bool
- func (m *TimePeriod) GetEndTime() TimeStamp
- func (m *TimePeriod) GetStartTime() TimeStamp
- func (this *TimePeriod) GoString() string
- func (m *TimePeriod) Marshal() (dAtA []byte, err error)
- func (m *TimePeriod) MarshalTo(dAtA []byte) (int, error)
- func (m *TimePeriod) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TimePeriod) ProtoMessage()
- func (m *TimePeriod) Reset()
- func (m *TimePeriod) Size() (n int)
- func (this *TimePeriod) String() string
- func (m *TimePeriod) Unmarshal(dAtA []byte) error
- func (m *TimePeriod) XXX_DiscardUnknown()
- func (m *TimePeriod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimePeriod) XXX_Merge(src proto.Message)
- func (m *TimePeriod) XXX_Size() int
- func (m *TimePeriod) XXX_Unmarshal(b []byte) error
- type TimeStamp
- func (*TimeStamp) Descriptor() ([]byte, []int)
- func (this *TimeStamp) Equal(that interface{}) bool
- func (m *TimeStamp) GetEpoch() uint64
- func (m *TimeStamp) GetRound() uint64
- func (this *TimeStamp) GoString() string
- func (m *TimeStamp) Marshal() (dAtA []byte, err error)
- func (m *TimeStamp) MarshalTo(dAtA []byte) (int, error)
- func (m *TimeStamp) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*TimeStamp) ProtoMessage()
- func (m *TimeStamp) Reset()
- func (m *TimeStamp) Size() (n int)
- func (this *TimeStamp) String() string
- func (m *TimeStamp) Unmarshal(dAtA []byte) error
- func (m *TimeStamp) XXX_DiscardUnknown()
- func (m *TimeStamp) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *TimeStamp) XXX_Merge(src proto.Message)
- func (m *TimeStamp) XXX_Size() int
- func (m *TimeStamp) XXX_Unmarshal(b []byte) error
- type TrackableDataTrie
- func (tdaw *TrackableDataTrie) ClearDataCaches()
- func (tdaw *TrackableDataTrie) DataTrie() data.Trie
- func (tdaw *TrackableDataTrie) DirtyData() map[string][]byte
- func (tdaw *TrackableDataTrie) IsInterfaceNil() bool
- func (tdaw *TrackableDataTrie) OriginalValue(key []byte) []byte
- func (tdaw *TrackableDataTrie) RetrieveValue(key []byte) ([]byte, error)
- func (tdaw *TrackableDataTrie) SaveKeyValue(key []byte, value []byte)
- func (tdaw *TrackableDataTrie) SetDataTrie(tr data.Trie)
- type TriesHolder
- type Updater
- type UserAccountData
- func (*UserAccountData) Descriptor() ([]byte, []int)
- func (this *UserAccountData) Equal(that interface{}) bool
- func (m *UserAccountData) GetAddress() []byte
- func (m *UserAccountData) GetBalance() *math_big.Int
- func (m *UserAccountData) GetCodeHash() []byte
- func (m *UserAccountData) GetDeveloperReward() *math_big.Int
- func (m *UserAccountData) GetNonce() uint64
- func (m *UserAccountData) GetOwnerAddress() []byte
- func (m *UserAccountData) GetRootHash() []byte
- func (this *UserAccountData) GoString() string
- func (m *UserAccountData) Marshal() (dAtA []byte, err error)
- func (m *UserAccountData) MarshalTo(dAtA []byte) (int, error)
- func (m *UserAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*UserAccountData) ProtoMessage()
- func (m *UserAccountData) Reset()
- func (m *UserAccountData) Size() (n int)
- func (this *UserAccountData) String() string
- func (m *UserAccountData) Unmarshal(dAtA []byte) error
- func (m *UserAccountData) XXX_DiscardUnknown()
- func (m *UserAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *UserAccountData) XXX_Merge(src proto.Message)
- func (m *UserAccountData) XXX_Size() int
- func (m *UserAccountData) XXX_Unmarshal(b []byte) error
- type UserAccountHandler
- type ValidatorApiResponse
- func (*ValidatorApiResponse) Descriptor() ([]byte, []int)
- func (this *ValidatorApiResponse) Equal(that interface{}) bool
- func (m *ValidatorApiResponse) GetNrLeaderFailure() uint32
- func (m *ValidatorApiResponse) GetNrLeaderSuccess() uint32
- func (m *ValidatorApiResponse) GetNrValidatorFailure() uint32
- func (m *ValidatorApiResponse) GetNrValidatorSuccess() uint32
- func (m *ValidatorApiResponse) GetRating() float32
- func (m *ValidatorApiResponse) GetTempRating() float32
- func (this *ValidatorApiResponse) GoString() string
- func (m *ValidatorApiResponse) Marshal() (dAtA []byte, err error)
- func (m *ValidatorApiResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorApiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorApiResponse) ProtoMessage()
- func (m *ValidatorApiResponse) Reset()
- func (m *ValidatorApiResponse) Size() (n int)
- func (this *ValidatorApiResponse) String() string
- func (m *ValidatorApiResponse) Unmarshal(dAtA []byte) error
- func (m *ValidatorApiResponse) XXX_DiscardUnknown()
- func (m *ValidatorApiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorApiResponse) XXX_Merge(src proto.Message)
- func (m *ValidatorApiResponse) XXX_Size() int
- func (m *ValidatorApiResponse) XXX_Unmarshal(b []byte) error
- type ValidatorInfo
- func (*ValidatorInfo) Descriptor() ([]byte, []int)
- func (this *ValidatorInfo) Equal(that interface{}) bool
- func (m *ValidatorInfo) GetAccumulatedFees() *math_big.Int
- func (m *ValidatorInfo) GetIndex() uint32
- func (m *ValidatorInfo) GetLeaderFailure() uint32
- func (m *ValidatorInfo) GetLeaderSuccess() uint32
- func (m *ValidatorInfo) GetList() string
- func (m *ValidatorInfo) GetNumSelectedInSuccessBlocks() uint32
- func (m *ValidatorInfo) GetPublicKey() []byte
- func (m *ValidatorInfo) GetRating() uint32
- func (m *ValidatorInfo) GetRewardAddress() []byte
- func (m *ValidatorInfo) GetShardId() uint32
- func (m *ValidatorInfo) GetTempRating() uint32
- func (m *ValidatorInfo) GetValidatorFailure() uint32
- func (m *ValidatorInfo) GetValidatorSuccess() uint32
- func (this *ValidatorInfo) GoString() string
- func (vi *ValidatorInfo) IsInterfaceNil() bool
- func (m *ValidatorInfo) Marshal() (dAtA []byte, err error)
- func (m *ValidatorInfo) MarshalTo(dAtA []byte) (int, error)
- func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ValidatorInfo) ProtoMessage()
- func (m *ValidatorInfo) Reset()
- func (m *ValidatorInfo) Size() (n int)
- func (this *ValidatorInfo) String() string
- func (m *ValidatorInfo) Unmarshal(dAtA []byte) error
- func (m *ValidatorInfo) XXX_DiscardUnknown()
- func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ValidatorInfo) XXX_Merge(src proto.Message)
- func (m *ValidatorInfo) XXX_Size() int
- func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error
Constants ¶
const HashLength = 32
HashLength defines how many bytes are used in a hash
Variables ¶
var ( ErrInvalidLengthPeerAccountData = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowPeerAccountData = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupPeerAccountData = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthUserAccountData = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowUserAccountData = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupUserAccountData = fmt.Errorf("proto: unexpected end of group") )
var ( ErrInvalidLengthValidatorInfo = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowValidatorInfo = fmt.Errorf("proto: integer overflow") ErrUnexpectedEndOfGroupValidatorInfo = fmt.Errorf("proto: unexpected end of group") )
var ErrAccNotFound = errors.New("account was not found")
ErrAccNotFound signals that account was not found in state trie
var ErrBech32ConvertError = errors.New("can't convert bech32 string")
ErrBech32ConvertError signals that conversion the 5bit alphabet to 8bit failed
var ErrBech32WrongAddr = errors.New("wrong bech32 string")
ErrBech32WrongAddr signals that the string provided might not be in bech32 format
var ErrEmptyAddress = errors.New("empty Address")
ErrEmptyAddress defines the error when trying to work with an empty address
var ErrInsufficientFunds = errors.New("insufficient funds")
ErrInsufficientFunds signals the funds are insufficient for the move balance operation but the transaction fee is covered by the current balance
var ErrInvalidAddressLength = errors.New("invalid address length")
ErrInvalidAddressLength signals that address length is invalid
var ErrNegativeValue = errors.New("negative values are not permited")
ErrNegativeValue signals that an operation has been attempted with a negative value
var ErrNilAccountFactory = errors.New("account factory is nil")
ErrNilAccountFactory signals that a nil account factory was provided
var ErrNilAccountHandler = errors.New("account wrapper is nil")
ErrNilAccountHandler signals that a nil account wrapper was provided
var ErrNilAccountTracker = errors.New("nil account tracker provided")
ErrNilAccountTracker signals that a nil account tracker has been provided
var ErrNilAccountsAdapter = errors.New("nil AccountsAdapter")
ErrNilAccountsAdapter defines the error when trying to revert on nil accounts
var ErrNilAddressContainer = errors.New("nil AddressContainer")
ErrNilAddressContainer defines the error when trying to work with a nil address
var ErrNilBLSPublicKey = errors.New("bls public key is nil")
ErrNilBLSPublicKey signals that the provided BLS public key is nil
var ErrNilCode = errors.New("nil smart contract code")
ErrNilCode signals that a nil code was provided
var ErrNilHasher = errors.New("nil hasher")
ErrNilHasher signals that an operation has been attempted to or with a nil hasher implementation
var ErrNilMarshalizer = errors.New("nil marshalizer")
ErrNilMarshalizer signals that an operation has been attempted to or with a nil marshalizer implementation
var ErrNilOrEmptyDataTrieUpdates = errors.New("no data trie updates")
ErrNilOrEmptyDataTrieUpdates signals that there are no data trie updates
var ErrNilOrEmptyKey = errors.New("key is empty or nil")
ErrNilOrEmptyKey signals that key empty key was provided
var ErrNilPubKeysBytes = errors.New("nil public key bytes")
ErrNilPubKeysBytes signals that an operation has been attempted to or with a nil public key slice
var ErrNilSchnorrPublicKey = errors.New("schnorr public key is nil")
ErrNilSchnorrPublicKey signals that the provided schnorr public is nil
var ErrNilShardCoordinator = errors.New("shard coordinator is nil")
ErrNilShardCoordinator signals that nil shard coordinator was provided
var ErrNilStake = errors.New("stake is nil")
ErrNilStake signals that the provided stake is nil
var ErrNilTrackableDataTrie = errors.New("nil trackable data trie")
ErrNilTrackableDataTrie signals that a nil trackable data trie has been provided
var ErrNilTrie = errors.New("trie is nil")
ErrNilTrie signals that a trie is nil and no operation can be made
var ErrNilUpdater = errors.New("updater is nil")
ErrNilUpdater signals that a nil updater has been provided
var ErrOperationNotPermitted = errors.New("operation in account not permitted")
ErrOperationNotPermitted signals that operation is not permitted
var ErrSnapshotValueOutOfBounds = errors.New("snapshot value out of bounds")
ErrSnapshotValueOutOfBounds signals that the snapshot value is out of bounds
var ErrUnknownAccountType = errors.New("account type is unknown")
ErrUnknownAccountType signals that the provided account type is unknown
var ErrUnknownShardId = errors.New("shard id is not valid")
ErrUnknownShardId signals that shard id is not valid
var ErrWrongTypeAssertion = errors.New("wrong type assertion")
ErrWrongTypeAssertion signals that a wrong type assertion occurred
Functions ¶
func NewAddress ¶
func NewAddress(adr []byte) *address
NewAddress creates a new Address with the same byte slice as the parameter received
func NewDataTriesHolder ¶
func NewDataTriesHolder() *dataTriesHolder
NewDataTriesHolder creates a new instance of dataTriesHolder
func NewEmptyPeerAccount ¶
func NewEmptyPeerAccount() *peerAccount
NewEmptyPeerAccount returns an empty peerAccount
func NewJournalEntryAccount ¶
func NewJournalEntryAccount(account AccountHandler) (*journalEntryAccount, error)
NewJournalEntryAccount creates a new instance of JournalEntryAccount
func NewJournalEntryAccountCreation ¶
func NewJournalEntryAccountCreation(address []byte, updater Updater) (*journalEntryAccountCreation, error)
NewJournalEntryAccountCreation creates a new instance of JournalEntryAccountCreation
func NewJournalEntryCode ¶
NewJournalEntryCode creates a new instance of JournalEntryCode
func NewJournalEntryDataTrieUpdates ¶
func NewJournalEntryDataTrieUpdates(trieUpdates map[string][]byte, account baseAccountHandler) (*journalEntryDataTrieUpdates, error)
NewJournalEntryDataTrieUpdates outputs a new JournalEntryDataTrieUpdates implementation used to revert an account's data trie
func NewPeerAccount ¶
func NewPeerAccount(addressContainer AddressContainer) (*peerAccount, error)
NewPeerAccount creates new simple account wrapper for an PeerAccountContainer (that has just been initialized)
func NewUserAccount ¶
func NewUserAccount(addressContainer AddressContainer) (*userAccount, error)
NewUserAccount creates new simple account wrapper for an AccountContainer (that has just been initialized)
Types ¶
type AccountFactory ¶
type AccountFactory interface { CreateAccount(address AddressContainer) (AccountHandler, error) IsInterfaceNil() bool }
AccountFactory creates an account of different types
type AccountHandler ¶
type AccountHandler interface { AddressContainer() AddressContainer IncreaseNonce(nonce uint64) GetNonce() uint64 IsInterfaceNil() bool }
AccountHandler models a state account, which can journalize and revert It knows about code and data, as data structures not hashes
type AccountsAdapter ¶
type AccountsAdapter interface { GetExistingAccount(addressContainer AddressContainer) (AccountHandler, error) LoadAccount(address AddressContainer) (AccountHandler, error) SaveAccount(account AccountHandler) error RemoveAccount(addressContainer AddressContainer) error Commit() ([]byte, error) JournalLen() int RevertToSnapshot(snapshot int) error RootHash() ([]byte, error) RecreateTrie(rootHash []byte) error PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier) SnapshotState(rootHash []byte) SetStateCheckpoint(rootHash []byte) IsPruningEnabled() bool GetAllLeaves(rootHash []byte) (map[string][]byte, error) IsInterfaceNil() bool }
AccountsAdapter is used for the structure that manages the accounts on top of a trie.PatriciaMerkleTrie implementation
type AccountsDB ¶
type AccountsDB struct {
// contains filtered or unexported fields
}
AccountsDB is the struct used for accessing accounts. This struct is concurrent safe.
func NewAccountsDB ¶
func NewAccountsDB( trie data.Trie, hasher hashing.Hasher, marshalizer marshal.Marshalizer, accountFactory AccountFactory, ) (*AccountsDB, error)
NewAccountsDB creates a new account manager
func (*AccountsDB) CancelPrune ¶
func (adb *AccountsDB) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune clears the trie's evictionWaitingList
func (*AccountsDB) Commit ¶
func (adb *AccountsDB) Commit() ([]byte, error)
Commit will persist all data inside the trie
func (*AccountsDB) GetAllLeaves ¶
func (adb *AccountsDB) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
GetAllLeaves returns all the leaves from a given rootHash
func (*AccountsDB) GetExistingAccount ¶
func (adb *AccountsDB) GetExistingAccount(addressContainer AddressContainer) (AccountHandler, error)
GetExistingAccount returns an existing account if exists or nil if missing
func (*AccountsDB) IsInterfaceNil ¶
func (adb *AccountsDB) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsDB) IsPruningEnabled ¶
func (adb *AccountsDB) IsPruningEnabled() bool
IsPruningEnabled returns true if state pruning is enabled
func (*AccountsDB) JournalLen ¶
func (adb *AccountsDB) JournalLen() int
JournalLen will return the number of entries
func (*AccountsDB) LoadAccount ¶
func (adb *AccountsDB) LoadAccount(addressContainer AddressContainer) (AccountHandler, error)
LoadAccount fetches the account based on the address. Creates an empty account if the account is missing.
func (*AccountsDB) PruneTrie ¶
func (adb *AccountsDB) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
PruneTrie removes old values from the trie database
func (*AccountsDB) RecreateTrie ¶
func (adb *AccountsDB) RecreateTrie(rootHash []byte) error
RecreateTrie is used to reload the trie based on an existing rootHash
func (*AccountsDB) RemoveAccount ¶
func (adb *AccountsDB) RemoveAccount(addressContainer AddressContainer) error
RemoveAccount removes the account data from underlying trie. It basically calls Update with empty slice
func (*AccountsDB) RevertToSnapshot ¶
func (adb *AccountsDB) RevertToSnapshot(snapshot int) error
RevertToSnapshot apply Revert method over accounts object and removes entries from the list Calling with 0 will revert everything. If the snapshot value is out of bounds, an err will be returned
func (*AccountsDB) RootHash ¶
func (adb *AccountsDB) RootHash() ([]byte, error)
RootHash returns the main trie's root hash
func (*AccountsDB) SaveAccount ¶
func (adb *AccountsDB) SaveAccount(account AccountHandler) error
SaveAccount saves in the trie all changes made to the account.
func (*AccountsDB) SetStateCheckpoint ¶
func (adb *AccountsDB) SetStateCheckpoint(rootHash []byte)
SetStateCheckpoint sets a checkpoint for the state trie
func (*AccountsDB) SnapshotState ¶
func (adb *AccountsDB) SnapshotState(rootHash []byte)
SnapshotState triggers the snapshotting process of the state trie
type AccountsDbIdentifier ¶
type AccountsDbIdentifier byte
AccountsDbIdentifier is the type of accounts db
const ( // UserAccountsState is the user accounts UserAccountsState AccountsDbIdentifier = 0 // PeerAccountsState is the peer accounts PeerAccountsState AccountsDbIdentifier = 1 )
type AddressContainer ¶
AddressContainer models what an Address struct should do
type AddressConverter ¶
type AddressConverter interface { AddressLen() int CreateAddressFromPublicKeyBytes(pubKey []byte) (AddressContainer, error) ConvertToHex(addressContainer AddressContainer) (string, error) CreateAddressFromHex(hexAddress string) (AddressContainer, error) PrepareAddressBytes(addressBytes []byte) ([]byte, error) IsInterfaceNil() bool }
AddressConverter is used to convert to/from AddressContainer
type DataTrieTracker ¶
type DataTrieTracker interface { ClearDataCaches() DirtyData() map[string][]byte OriginalValue(key []byte) []byte RetrieveValue(key []byte) ([]byte, error) SaveKeyValue(key []byte, value []byte) SetDataTrie(tr data.Trie) DataTrie() data.Trie IsInterfaceNil() bool }
DataTrieTracker models what how to manipulate data held by a SC account
type ErrMissingTrie ¶
type ErrMissingTrie struct {
// contains filtered or unexported fields
}
ErrMissingTrie is an error-compatible struct holding the root hash of the trie that is missing
func NewErrMissingTrie ¶
func NewErrMissingTrie(rootHash []byte) *ErrMissingTrie
NewErrMissingTrie returns a new instantiated struct
func (*ErrMissingTrie) Error ¶
func (e *ErrMissingTrie) Error() string
Error returns the error as string
type ErrorTrieNotNormalized ¶
type ErrorTrieNotNormalized struct {
// contains filtered or unexported fields
}
ErrorTrieNotNormalized is an error-compatible struct holding the hash length that is not normalized
func NewErrorTrieNotNormalized ¶
func NewErrorTrieNotNormalized(exp int, actual int) *ErrorTrieNotNormalized
NewErrorTrieNotNormalized returns a new instantiated struct
func (*ErrorTrieNotNormalized) Error ¶
func (e *ErrorTrieNotNormalized) Error() string
Error returns the error as string
type ErrorWrongSize ¶
ErrorWrongSize is an error-compatible struct holding 2 values: Expected and Got
func NewErrorWrongSize ¶
func NewErrorWrongSize(exp int, got int) *ErrorWrongSize
NewErrorWrongSize returns a new instantiated struct
func (*ErrorWrongSize) Error ¶
func (e *ErrorWrongSize) Error() string
Error returns the error as string
type JournalEntry ¶
type JournalEntry interface { Revert() (AccountHandler, error) IsInterfaceNil() bool }
JournalEntry will be used to implement different state changes to be able to easily revert them
type PeerAccountData ¶
type PeerAccountData struct { BLSPublicKey []byte `protobuf:"bytes,1,opt,name=BLSPublicKey,proto3" json:"BLSPublicKey,omitempty"` SchnorrPublicKey []byte `protobuf:"bytes,2,opt,name=SchnorrPublicKey,proto3" json:"SchnorrPublicKey,omitempty"` RewardAddress []byte `protobuf:"bytes,3,opt,name=RewardAddress,proto3" json:"RewardAddress,omitempty"` Stake *math_big.Int `` /* 142-byte string literal not displayed */ JailTime TimePeriod `protobuf:"bytes,5,opt,name=JailTime,proto3" json:"JailTime"` PastJailTimes []TimePeriod `protobuf:"bytes,6,rep,name=PastJailTimes,proto3" json:"PastJailTimes"` CurrentShardId uint32 `protobuf:"varint,7,opt,name=CurrentShardId,proto3" json:"CurrentShardId,omitempty"` NextShardId uint32 `protobuf:"varint,8,opt,name=NextShardId,proto3" json:"NextShardId,omitempty"` NodeInWaitingList bool `protobuf:"varint,9,opt,name=NodeInWaitingList,proto3" json:"NodeInWaitingList,omitempty"` UnStakedNonce uint64 `protobuf:"varint,10,opt,name=UnStakedNonce,proto3" json:"UnStakedNonce,omitempty"` ValidatorSuccessRate SignRate `protobuf:"bytes,11,opt,name=ValidatorSuccessRate,proto3" json:"ValidatorSuccessRate"` LeaderSuccessRate SignRate `protobuf:"bytes,12,opt,name=LeaderSuccessRate,proto3" json:"LeaderSuccessRate"` Rating uint32 `protobuf:"varint,13,opt,name=Rating,proto3" json:"Rating,omitempty"` Nonce uint64 `protobuf:"varint,14,opt,name=Nonce,proto3" json:"Nonce,omitempty"` TempRating uint32 `protobuf:"varint,15,opt,name=TempRating,proto3" json:"TempRating,omitempty"` AccumulatedFees *math_big.Int `` /* 163-byte string literal not displayed */ NumSelectedInSuccessBlocks uint32 `protobuf:"varint,17,opt,name=NumSelectedInSuccessBlocks,proto3" json:"NumSelectedInSuccessBlocks,omitempty"` }
func (*PeerAccountData) Descriptor ¶
func (*PeerAccountData) Descriptor() ([]byte, []int)
func (*PeerAccountData) Equal ¶
func (this *PeerAccountData) Equal(that interface{}) bool
func (*PeerAccountData) GetAccumulatedFees ¶
func (m *PeerAccountData) GetAccumulatedFees() *math_big.Int
func (*PeerAccountData) GetBLSPublicKey ¶
func (m *PeerAccountData) GetBLSPublicKey() []byte
func (*PeerAccountData) GetCurrentShardId ¶
func (m *PeerAccountData) GetCurrentShardId() uint32
func (*PeerAccountData) GetJailTime ¶
func (m *PeerAccountData) GetJailTime() TimePeriod
func (*PeerAccountData) GetLeaderSuccessRate ¶
func (m *PeerAccountData) GetLeaderSuccessRate() SignRate
func (*PeerAccountData) GetNextShardId ¶
func (m *PeerAccountData) GetNextShardId() uint32
func (*PeerAccountData) GetNodeInWaitingList ¶
func (m *PeerAccountData) GetNodeInWaitingList() bool
func (*PeerAccountData) GetNonce ¶
func (m *PeerAccountData) GetNonce() uint64
func (*PeerAccountData) GetNumSelectedInSuccessBlocks ¶
func (m *PeerAccountData) GetNumSelectedInSuccessBlocks() uint32
func (*PeerAccountData) GetPastJailTimes ¶
func (m *PeerAccountData) GetPastJailTimes() []TimePeriod
func (*PeerAccountData) GetRating ¶
func (m *PeerAccountData) GetRating() uint32
func (*PeerAccountData) GetRewardAddress ¶
func (m *PeerAccountData) GetRewardAddress() []byte
func (*PeerAccountData) GetSchnorrPublicKey ¶
func (m *PeerAccountData) GetSchnorrPublicKey() []byte
func (*PeerAccountData) GetStake ¶
func (m *PeerAccountData) GetStake() *math_big.Int
func (*PeerAccountData) GetTempRating ¶
func (m *PeerAccountData) GetTempRating() uint32
func (*PeerAccountData) GetUnStakedNonce ¶
func (m *PeerAccountData) GetUnStakedNonce() uint64
func (*PeerAccountData) GetValidatorSuccessRate ¶
func (m *PeerAccountData) GetValidatorSuccessRate() SignRate
func (*PeerAccountData) GoString ¶
func (this *PeerAccountData) GoString() string
func (*PeerAccountData) Marshal ¶
func (m *PeerAccountData) Marshal() (dAtA []byte, err error)
func (*PeerAccountData) MarshalToSizedBuffer ¶
func (m *PeerAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*PeerAccountData) ProtoMessage ¶
func (*PeerAccountData) ProtoMessage()
func (*PeerAccountData) Reset ¶
func (m *PeerAccountData) Reset()
func (*PeerAccountData) Size ¶
func (m *PeerAccountData) Size() (n int)
func (*PeerAccountData) String ¶
func (this *PeerAccountData) String() string
func (*PeerAccountData) Unmarshal ¶
func (m *PeerAccountData) Unmarshal(dAtA []byte) error
func (*PeerAccountData) XXX_DiscardUnknown ¶
func (m *PeerAccountData) XXX_DiscardUnknown()
func (*PeerAccountData) XXX_Marshal ¶
func (m *PeerAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PeerAccountData) XXX_Merge ¶
func (m *PeerAccountData) XXX_Merge(src proto.Message)
func (*PeerAccountData) XXX_Size ¶
func (m *PeerAccountData) XXX_Size() int
func (*PeerAccountData) XXX_Unmarshal ¶
func (m *PeerAccountData) XXX_Unmarshal(b []byte) error
type PeerAccountHandler ¶
type PeerAccountHandler interface { GetBLSPublicKey() []byte SetBLSPublicKey([]byte) error GetSchnorrPublicKey() []byte SetSchnorrPublicKey([]byte) error GetRewardAddress() []byte SetRewardAddress([]byte) error GetStake() *big.Int SetStake(*big.Int) error GetAccumulatedFees() *big.Int SetAccumulatedFees(*big.Int) GetJailTime() TimePeriod SetJailTime(TimePeriod) GetCurrentShardId() uint32 SetCurrentShardId(uint32) GetNextShardId() uint32 SetNextShardId(uint32) GetNodeInWaitingList() bool SetNodeInWaitingList(bool) GetUnStakedNonce() uint64 SetUnStakedNonce(uint64) IncreaseLeaderSuccessRate(uint32) DecreaseLeaderSuccessRate(uint32) IncreaseValidatorSuccessRate(uint32) DecreaseValidatorSuccessRate(uint32) GetNumSelectedInSuccessBlocks() uint32 IncreaseNumSelectedInSuccessBlocks() GetLeaderSuccessRate() SignRate GetValidatorSuccessRate() SignRate GetRating() uint32 SetRating(uint32) GetTempRating() uint32 SetTempRating(uint32) ResetAtNewEpoch() error AccountHandler }
PeerAccountHandler models a peer state account, which can journalize a normal account's data
with some extra features like signing statistics or rating information
type PeerAccountsDB ¶
type PeerAccountsDB struct {
*AccountsDB
}
PeerAccountsDB will save and synchronize data from peer processor, plus will synchronize with nodesCoordinator
func NewPeerAccountsDB ¶
func NewPeerAccountsDB( trie data.Trie, hasher hashing.Hasher, marshalizer marshal.Marshalizer, accountFactory AccountFactory, ) (*PeerAccountsDB, error)
NewPeerAccountsDB creates a new account manager
type SignRate ¶
type SignRate struct { NrSuccess uint32 `protobuf:"varint,1,opt,name=NrSuccess,proto3" json:"NrSuccess,omitempty"` NrFailure uint32 `protobuf:"varint,2,opt,name=NrFailure,proto3" json:"NrFailure,omitempty"` }
SignRate is used to keep the number of success and failed signings
func (*SignRate) Descriptor ¶
func (*SignRate) GetNrFailure ¶
func (*SignRate) GetNrSuccess ¶
func (*SignRate) MarshalToSizedBuffer ¶
func (*SignRate) ProtoMessage ¶
func (*SignRate) ProtoMessage()
func (*SignRate) XXX_DiscardUnknown ¶
func (m *SignRate) XXX_DiscardUnknown()
func (*SignRate) XXX_Marshal ¶
func (*SignRate) XXX_Unmarshal ¶
type TimePeriod ¶
type TimePeriod struct { StartTime TimeStamp `protobuf:"bytes,1,opt,name=StartTime,proto3" json:"StartTime"` EndTime TimeStamp `protobuf:"bytes,2,opt,name=EndTime,proto3" json:"EndTime"` }
TimePeriod holds start and end time
func (*TimePeriod) Descriptor ¶
func (*TimePeriod) Descriptor() ([]byte, []int)
func (*TimePeriod) Equal ¶
func (this *TimePeriod) Equal(that interface{}) bool
func (*TimePeriod) GetEndTime ¶
func (m *TimePeriod) GetEndTime() TimeStamp
func (*TimePeriod) GetStartTime ¶
func (m *TimePeriod) GetStartTime() TimeStamp
func (*TimePeriod) GoString ¶
func (this *TimePeriod) GoString() string
func (*TimePeriod) Marshal ¶
func (m *TimePeriod) Marshal() (dAtA []byte, err error)
func (*TimePeriod) MarshalToSizedBuffer ¶
func (m *TimePeriod) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*TimePeriod) ProtoMessage ¶
func (*TimePeriod) ProtoMessage()
func (*TimePeriod) Reset ¶
func (m *TimePeriod) Reset()
func (*TimePeriod) Size ¶
func (m *TimePeriod) Size() (n int)
func (*TimePeriod) String ¶
func (this *TimePeriod) String() string
func (*TimePeriod) Unmarshal ¶
func (m *TimePeriod) Unmarshal(dAtA []byte) error
func (*TimePeriod) XXX_DiscardUnknown ¶
func (m *TimePeriod) XXX_DiscardUnknown()
func (*TimePeriod) XXX_Marshal ¶
func (m *TimePeriod) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*TimePeriod) XXX_Merge ¶
func (m *TimePeriod) XXX_Merge(src proto.Message)
func (*TimePeriod) XXX_Size ¶
func (m *TimePeriod) XXX_Size() int
func (*TimePeriod) XXX_Unmarshal ¶
func (m *TimePeriod) XXX_Unmarshal(b []byte) error
type TimeStamp ¶
type TimeStamp struct { Epoch uint64 `protobuf:"varint,1,opt,name=Epoch,proto3" json:"Epoch,omitempty"` Round uint64 `protobuf:"varint,2,opt,name=Round,proto3" json:"Round,omitempty"` }
TimeStamp is a moment defined by epoch and round
func (*TimeStamp) Descriptor ¶
func (*TimeStamp) MarshalToSizedBuffer ¶
func (*TimeStamp) ProtoMessage ¶
func (*TimeStamp) ProtoMessage()
func (*TimeStamp) XXX_DiscardUnknown ¶
func (m *TimeStamp) XXX_DiscardUnknown()
func (*TimeStamp) XXX_Marshal ¶
func (*TimeStamp) XXX_Unmarshal ¶
type TrackableDataTrie ¶
type TrackableDataTrie struct {
// contains filtered or unexported fields
}
TrackableDataTrie wraps a PatriciaMerkelTrie adding modifying data capabilities
func NewTrackableDataTrie ¶
func NewTrackableDataTrie(identifier []byte, tr data.Trie) *TrackableDataTrie
NewTrackableDataTrie returns an instance of DataTrieTracker
func (*TrackableDataTrie) ClearDataCaches ¶
func (tdaw *TrackableDataTrie) ClearDataCaches()
ClearDataCaches empties the dirtyData map and original map
func (*TrackableDataTrie) DataTrie ¶
func (tdaw *TrackableDataTrie) DataTrie() data.Trie
DataTrie sets the internal data trie
func (*TrackableDataTrie) DirtyData ¶
func (tdaw *TrackableDataTrie) DirtyData() map[string][]byte
DirtyData returns the map of (key, value) pairs that contain the data needed to be saved in the data trie
func (*TrackableDataTrie) IsInterfaceNil ¶
func (tdaw *TrackableDataTrie) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TrackableDataTrie) OriginalValue ¶
func (tdaw *TrackableDataTrie) OriginalValue(key []byte) []byte
OriginalValue returns the value for a key stored in originalData map which is acting like a cache
func (*TrackableDataTrie) RetrieveValue ¶
func (tdaw *TrackableDataTrie) RetrieveValue(key []byte) ([]byte, error)
RetrieveValue fetches the value from a particular key searching the account data store The search starts with dirty map, continues with original map and ends with the trie Data must have been retrieved from its trie
func (*TrackableDataTrie) SaveKeyValue ¶
func (tdaw *TrackableDataTrie) SaveKeyValue(key []byte, value []byte)
SaveKeyValue stores in dirtyData the data keys "touched" It does not care if the data is really dirty as calling this check here will be sub-optimal
func (*TrackableDataTrie) SetDataTrie ¶
func (tdaw *TrackableDataTrie) SetDataTrie(tr data.Trie)
SetDataTrie sets the internal data trie
type TriesHolder ¶
type TriesHolder interface { Put([]byte, data.Trie) Get([]byte) data.Trie GetAll() []data.Trie Reset() IsInterfaceNil() bool }
TriesHolder is used to store multiple tries
type UserAccountData ¶
type UserAccountData struct { Nonce uint64 `protobuf:"varint,1,opt,name=Nonce,proto3" json:"Nonce,omitempty"` Balance *math_big.Int `` /* 146-byte string literal not displayed */ CodeHash []byte `protobuf:"bytes,3,opt,name=CodeHash,proto3" json:"CodeHash,omitempty"` RootHash []byte `protobuf:"bytes,4,opt,name=RootHash,proto3" json:"RootHash,omitempty"` Address []byte `protobuf:"bytes,5,opt,name=Address,proto3" json:"Address,omitempty"` DeveloperReward *math_big.Int `` /* 162-byte string literal not displayed */ OwnerAddress []byte `protobuf:"bytes,7,opt,name=OwnerAddress,proto3" json:"OwnerAddress,omitempty"` }
func (*UserAccountData) Descriptor ¶
func (*UserAccountData) Descriptor() ([]byte, []int)
func (*UserAccountData) Equal ¶
func (this *UserAccountData) Equal(that interface{}) bool
func (*UserAccountData) GetAddress ¶
func (m *UserAccountData) GetAddress() []byte
func (*UserAccountData) GetBalance ¶
func (m *UserAccountData) GetBalance() *math_big.Int
func (*UserAccountData) GetCodeHash ¶
func (m *UserAccountData) GetCodeHash() []byte
func (*UserAccountData) GetDeveloperReward ¶
func (m *UserAccountData) GetDeveloperReward() *math_big.Int
func (*UserAccountData) GetNonce ¶
func (m *UserAccountData) GetNonce() uint64
func (*UserAccountData) GetOwnerAddress ¶
func (m *UserAccountData) GetOwnerAddress() []byte
func (*UserAccountData) GetRootHash ¶
func (m *UserAccountData) GetRootHash() []byte
func (*UserAccountData) GoString ¶
func (this *UserAccountData) GoString() string
func (*UserAccountData) Marshal ¶
func (m *UserAccountData) Marshal() (dAtA []byte, err error)
func (*UserAccountData) MarshalToSizedBuffer ¶
func (m *UserAccountData) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*UserAccountData) ProtoMessage ¶
func (*UserAccountData) ProtoMessage()
func (*UserAccountData) Reset ¶
func (m *UserAccountData) Reset()
func (*UserAccountData) Size ¶
func (m *UserAccountData) Size() (n int)
func (*UserAccountData) String ¶
func (this *UserAccountData) String() string
func (*UserAccountData) Unmarshal ¶
func (m *UserAccountData) Unmarshal(dAtA []byte) error
func (*UserAccountData) XXX_DiscardUnknown ¶
func (m *UserAccountData) XXX_DiscardUnknown()
func (*UserAccountData) XXX_Marshal ¶
func (m *UserAccountData) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*UserAccountData) XXX_Merge ¶
func (m *UserAccountData) XXX_Merge(src proto.Message)
func (*UserAccountData) XXX_Size ¶
func (m *UserAccountData) XXX_Size() int
func (*UserAccountData) XXX_Unmarshal ¶
func (m *UserAccountData) XXX_Unmarshal(b []byte) error
type UserAccountHandler ¶
type UserAccountHandler interface { SetCode(code []byte) GetCode() []byte SetCodeHash([]byte) GetCodeHash() []byte SetRootHash([]byte) GetRootHash() []byte SetDataTrie(trie data.Trie) DataTrie() data.Trie DataTrieTracker() DataTrieTracker AddToBalance(value *big.Int) error SubFromBalance(value *big.Int) error GetBalance() *big.Int ClaimDeveloperRewards([]byte) (*big.Int, error) AddToDeveloperReward(*big.Int) GetDeveloperReward() *big.Int ChangeOwnerAddress([]byte, []byte) error SetOwnerAddress([]byte) GetOwnerAddress() []byte AccountHandler }
UserAccountHandler models a user account, which can journalize account's data with some extra features like balance, developer rewards, owner
type ValidatorApiResponse ¶
type ValidatorApiResponse struct { NrLeaderSuccess uint32 `protobuf:"varint,1,opt,name=NrLeaderSuccess,proto3" json:"nrLeaderSuccess"` NrLeaderFailure uint32 `protobuf:"varint,2,opt,name=NrLeaderFailure,proto3" json:"nrLeaderFailure"` NrValidatorSuccess uint32 `protobuf:"varint,3,opt,name=NrValidatorSuccess,proto3" json:"nrValidatorSuccess"` NrValidatorFailure uint32 `protobuf:"varint,4,opt,name=NrValidatorFailure,proto3" json:"nrValidatorFailure"` Rating float32 `protobuf:"fixed32,5,opt,name=Rating,proto3" json:"rating"` TempRating float32 `protobuf:"fixed32,6,opt,name=TempRating,proto3" json:"tempRating"` }
ValidatorApiResponse represents the data which is fetched from each validator for returning it in API call
func (*ValidatorApiResponse) Descriptor ¶
func (*ValidatorApiResponse) Descriptor() ([]byte, []int)
func (*ValidatorApiResponse) Equal ¶
func (this *ValidatorApiResponse) Equal(that interface{}) bool
func (*ValidatorApiResponse) GetNrLeaderFailure ¶
func (m *ValidatorApiResponse) GetNrLeaderFailure() uint32
func (*ValidatorApiResponse) GetNrLeaderSuccess ¶
func (m *ValidatorApiResponse) GetNrLeaderSuccess() uint32
func (*ValidatorApiResponse) GetNrValidatorFailure ¶
func (m *ValidatorApiResponse) GetNrValidatorFailure() uint32
func (*ValidatorApiResponse) GetNrValidatorSuccess ¶
func (m *ValidatorApiResponse) GetNrValidatorSuccess() uint32
func (*ValidatorApiResponse) GetRating ¶
func (m *ValidatorApiResponse) GetRating() float32
func (*ValidatorApiResponse) GetTempRating ¶
func (m *ValidatorApiResponse) GetTempRating() float32
func (*ValidatorApiResponse) GoString ¶
func (this *ValidatorApiResponse) GoString() string
func (*ValidatorApiResponse) Marshal ¶
func (m *ValidatorApiResponse) Marshal() (dAtA []byte, err error)
func (*ValidatorApiResponse) MarshalTo ¶
func (m *ValidatorApiResponse) MarshalTo(dAtA []byte) (int, error)
func (*ValidatorApiResponse) MarshalToSizedBuffer ¶
func (m *ValidatorApiResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorApiResponse) ProtoMessage ¶
func (*ValidatorApiResponse) ProtoMessage()
func (*ValidatorApiResponse) Reset ¶
func (m *ValidatorApiResponse) Reset()
func (*ValidatorApiResponse) Size ¶
func (m *ValidatorApiResponse) Size() (n int)
func (*ValidatorApiResponse) String ¶
func (this *ValidatorApiResponse) String() string
func (*ValidatorApiResponse) Unmarshal ¶
func (m *ValidatorApiResponse) Unmarshal(dAtA []byte) error
func (*ValidatorApiResponse) XXX_DiscardUnknown ¶
func (m *ValidatorApiResponse) XXX_DiscardUnknown()
func (*ValidatorApiResponse) XXX_Marshal ¶
func (m *ValidatorApiResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorApiResponse) XXX_Merge ¶
func (m *ValidatorApiResponse) XXX_Merge(src proto.Message)
func (*ValidatorApiResponse) XXX_Size ¶
func (m *ValidatorApiResponse) XXX_Size() int
func (*ValidatorApiResponse) XXX_Unmarshal ¶
func (m *ValidatorApiResponse) XXX_Unmarshal(b []byte) error
type ValidatorInfo ¶
type ValidatorInfo struct { PublicKey []byte `protobuf:"bytes,1,opt,name=PublicKey,proto3" json:"PublicKey,omitempty"` ShardId uint32 `protobuf:"varint,2,opt,name=ShardId,proto3" json:"ShardId,omitempty"` List string `protobuf:"bytes,3,opt,name=List,proto3" json:"List,omitempty"` Index uint32 `protobuf:"varint,4,opt,name=Index,proto3" json:"Index,omitempty"` TempRating uint32 `protobuf:"varint,5,opt,name=TempRating,proto3" json:"TempRating,omitempty"` Rating uint32 `protobuf:"varint,6,opt,name=Rating,proto3" json:"Rating,omitempty"` RewardAddress []byte `protobuf:"bytes,7,opt,name=RewardAddress,proto3" json:"RewardAddress,omitempty"` LeaderSuccess uint32 `protobuf:"varint,8,opt,name=LeaderSuccess,proto3" json:"LeaderSuccess,omitempty"` LeaderFailure uint32 `protobuf:"varint,9,opt,name=LeaderFailure,proto3" json:"LeaderFailure,omitempty"` ValidatorSuccess uint32 `protobuf:"varint,10,opt,name=ValidatorSuccess,proto3" json:"ValidatorSuccess,omitempty"` ValidatorFailure uint32 `protobuf:"varint,11,opt,name=ValidatorFailure,proto3" json:"ValidatorFailure,omitempty"` NumSelectedInSuccessBlocks uint32 `protobuf:"varint,12,opt,name=NumSelectedInSuccessBlocks,proto3" json:"NumSelectedInSuccessBlocks,omitempty"` AccumulatedFees *math_big.Int `` /* 163-byte string literal not displayed */ }
func (*ValidatorInfo) Descriptor ¶
func (*ValidatorInfo) Descriptor() ([]byte, []int)
func (*ValidatorInfo) Equal ¶
func (this *ValidatorInfo) Equal(that interface{}) bool
func (*ValidatorInfo) GetAccumulatedFees ¶
func (m *ValidatorInfo) GetAccumulatedFees() *math_big.Int
func (*ValidatorInfo) GetIndex ¶
func (m *ValidatorInfo) GetIndex() uint32
func (*ValidatorInfo) GetLeaderFailure ¶
func (m *ValidatorInfo) GetLeaderFailure() uint32
func (*ValidatorInfo) GetLeaderSuccess ¶
func (m *ValidatorInfo) GetLeaderSuccess() uint32
func (*ValidatorInfo) GetList ¶
func (m *ValidatorInfo) GetList() string
func (*ValidatorInfo) GetNumSelectedInSuccessBlocks ¶
func (m *ValidatorInfo) GetNumSelectedInSuccessBlocks() uint32
func (*ValidatorInfo) GetPublicKey ¶
func (m *ValidatorInfo) GetPublicKey() []byte
func (*ValidatorInfo) GetRating ¶
func (m *ValidatorInfo) GetRating() uint32
func (*ValidatorInfo) GetRewardAddress ¶
func (m *ValidatorInfo) GetRewardAddress() []byte
func (*ValidatorInfo) GetShardId ¶
func (m *ValidatorInfo) GetShardId() uint32
func (*ValidatorInfo) GetTempRating ¶
func (m *ValidatorInfo) GetTempRating() uint32
func (*ValidatorInfo) GetValidatorFailure ¶
func (m *ValidatorInfo) GetValidatorFailure() uint32
func (*ValidatorInfo) GetValidatorSuccess ¶
func (m *ValidatorInfo) GetValidatorSuccess() uint32
func (*ValidatorInfo) GoString ¶
func (this *ValidatorInfo) GoString() string
func (*ValidatorInfo) IsInterfaceNil ¶
func (vi *ValidatorInfo) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ValidatorInfo) Marshal ¶
func (m *ValidatorInfo) Marshal() (dAtA []byte, err error)
func (*ValidatorInfo) MarshalToSizedBuffer ¶
func (m *ValidatorInfo) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ValidatorInfo) ProtoMessage ¶
func (*ValidatorInfo) ProtoMessage()
func (*ValidatorInfo) Reset ¶
func (m *ValidatorInfo) Reset()
func (*ValidatorInfo) Size ¶
func (m *ValidatorInfo) Size() (n int)
func (*ValidatorInfo) String ¶
func (this *ValidatorInfo) String() string
func (*ValidatorInfo) Unmarshal ¶
func (m *ValidatorInfo) Unmarshal(dAtA []byte) error
func (*ValidatorInfo) XXX_DiscardUnknown ¶
func (m *ValidatorInfo) XXX_DiscardUnknown()
func (*ValidatorInfo) XXX_Marshal ¶
func (m *ValidatorInfo) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ValidatorInfo) XXX_Merge ¶
func (m *ValidatorInfo) XXX_Merge(src proto.Message)
func (*ValidatorInfo) XXX_Size ¶
func (m *ValidatorInfo) XXX_Size() int
func (*ValidatorInfo) XXX_Unmarshal ¶
func (m *ValidatorInfo) XXX_Unmarshal(b []byte) error