state

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2025 License: GPL-3.0 Imports: 29 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthAccountWrapperMock        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowAccountWrapperMock          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupAccountWrapperMock = fmt.Errorf("proto: unexpected end of group")
)

Functions

func CreateTestingTriePruningStorer

func CreateTestingTriePruningStorer(coordinator sharding.Coordinator, notifier pruning.EpochStartNotifier) (storage.Storer, *persisterMap, error)

CreateTestingTriePruningStorer creates a new trie pruning storer that is used for testing

func NewPersistersMap

func NewPersistersMap() *persisterMap

NewPersistersMap returns a new persisterMap

Types

type AccountWrapMock

type AccountWrapMock struct {
	AccountWrapMockData

	CodeHash     []byte
	CodeMetadata []byte
	RootHash     []byte
	Owner        []byte

	Balance *big.Int

	SetNonceWithJournalCalled    func(nonce uint64) error           `json:"-"`
	SetCodeHashWithJournalCalled func(codeHash []byte) error        `json:"-"`
	SetCodeWithJournalCalled     func([]byte) error                 `json:"-"`
	AccountDataHandlerCalled     func() vmcommon.AccountDataHandler `json:"-"`
	// contains filtered or unexported fields
}

AccountWrapMock -

func NewAccountWrapMock

func NewAccountWrapMock(adr []byte) *AccountWrapMock

NewAccountWrapMock -

func (*AccountWrapMock) AccountDataHandler

func (awm *AccountWrapMock) AccountDataHandler() vmcommon.AccountDataHandler

AccountDataHandler -

func (*AccountWrapMock) AddToBalance

func (awm *AccountWrapMock) AddToBalance(val *big.Int) error

AddToBalance -

func (*AccountWrapMock) AddToDeveloperReward

func (awm *AccountWrapMock) AddToDeveloperReward(*big.Int)

AddToDeveloperReward -

func (*AccountWrapMock) AddressBytes

func (awm *AccountWrapMock) AddressBytes() []byte

AddressBytes -

func (*AccountWrapMock) ChangeOwnerAddress

func (awm *AccountWrapMock) ChangeOwnerAddress([]byte, []byte) error

ChangeOwnerAddress -

func (*AccountWrapMock) ClaimDeveloperRewards

func (awm *AccountWrapMock) ClaimDeveloperRewards([]byte) (*big.Int, error)

ClaimDeveloperRewards -

func (*AccountWrapMock) DataTrie

func (awm *AccountWrapMock) DataTrie() common.DataTrieHandler

DataTrie -

func (*AccountWrapMock) GetAllLeaves added in v1.6.0

GetAllLeaves -

func (*AccountWrapMock) GetBalance

func (awm *AccountWrapMock) GetBalance() *big.Int

GetBalance -

func (*AccountWrapMock) GetCode added in v1.6.0

func (awm *AccountWrapMock) GetCode() []byte

GetCode -

func (*AccountWrapMock) GetCodeHash

func (awm *AccountWrapMock) GetCodeHash() []byte

GetCodeHash -

func (*AccountWrapMock) GetCodeMetadata

func (awm *AccountWrapMock) GetCodeMetadata() []byte

GetCodeMetadata -

func (*AccountWrapMock) GetDeveloperReward

func (awm *AccountWrapMock) GetDeveloperReward() *big.Int

GetDeveloperReward -

func (*AccountWrapMock) GetNonce

func (awm *AccountWrapMock) GetNonce() uint64

GetNonce gets the nonce of the account

func (*AccountWrapMock) GetOwnerAddress

func (awm *AccountWrapMock) GetOwnerAddress() []byte

GetOwnerAddress -

func (*AccountWrapMock) GetRootHash

func (awm *AccountWrapMock) GetRootHash() []byte

GetRootHash -

func (*AccountWrapMock) GetUserName

func (awm *AccountWrapMock) GetUserName() []byte

GetUserName -

func (*AccountWrapMock) HasNewCode

func (awm *AccountWrapMock) HasNewCode() bool

HasNewCode -

func (*AccountWrapMock) IncreaseNonce

func (awm *AccountWrapMock) IncreaseNonce(val uint64)

IncreaseNonce adds the given value to the current nonce

func (*AccountWrapMock) IsGuarded added in v1.5.0

func (awm *AccountWrapMock) IsGuarded() bool

IsGuarded -

func (*AccountWrapMock) IsInterfaceNil

func (awm *AccountWrapMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*AccountWrapMock) RetrieveValue

func (awm *AccountWrapMock) RetrieveValue(key []byte) ([]byte, uint32, error)

RetrieveValue -

func (*AccountWrapMock) SaveDirtyData

func (awm *AccountWrapMock) SaveDirtyData(trie common.Trie) ([]core.TrieData, error)

SaveDirtyData -

func (*AccountWrapMock) SaveKeyValue

func (awm *AccountWrapMock) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue -

func (*AccountWrapMock) SetCode

func (awm *AccountWrapMock) SetCode(code []byte)

SetCode -

func (*AccountWrapMock) SetCodeHash

func (awm *AccountWrapMock) SetCodeHash(codeHash []byte)

SetCodeHash -

func (*AccountWrapMock) SetCodeMetadata

func (awm *AccountWrapMock) SetCodeMetadata(codeMetadata []byte)

SetCodeMetadata -

func (*AccountWrapMock) SetDataTrie

func (awm *AccountWrapMock) SetDataTrie(trie common.Trie)

SetDataTrie -

func (*AccountWrapMock) SetOwnerAddress

func (awm *AccountWrapMock) SetOwnerAddress(owner []byte)

SetOwnerAddress -

func (*AccountWrapMock) SetRootHash

func (awm *AccountWrapMock) SetRootHash(rootHash []byte)

SetRootHash -

func (*AccountWrapMock) SetTrackableDataTrie

func (awm *AccountWrapMock) SetTrackableDataTrie(tdt state.DataTrieTracker)

SetTrackableDataTrie -

func (*AccountWrapMock) SetUserName

func (awm *AccountWrapMock) SetUserName(_ []byte)

SetUserName -

func (*AccountWrapMock) SubFromBalance

func (awm *AccountWrapMock) SubFromBalance(val *big.Int) error

SubFromBalance -

type AccountWrapMockData

type AccountWrapMockData struct {
	MockValue int64 `protobuf:"varint,1,opt,name=MockValue,proto3" json:"MockValue"`
}

func (*AccountWrapMockData) Descriptor

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

func (*AccountWrapMockData) Equal

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

func (*AccountWrapMockData) GetMockValue

func (m *AccountWrapMockData) GetMockValue() int64

func (*AccountWrapMockData) GoString

func (this *AccountWrapMockData) GoString() string

func (*AccountWrapMockData) Marshal

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

func (*AccountWrapMockData) MarshalTo

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

func (*AccountWrapMockData) MarshalToSizedBuffer

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

func (*AccountWrapMockData) ProtoMessage

func (*AccountWrapMockData) ProtoMessage()

func (*AccountWrapMockData) Reset

func (m *AccountWrapMockData) Reset()

func (*AccountWrapMockData) Size

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

func (*AccountWrapMockData) String

func (this *AccountWrapMockData) String() string

func (*AccountWrapMockData) Unmarshal

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

func (*AccountWrapMockData) XXX_DiscardUnknown

func (m *AccountWrapMockData) XXX_DiscardUnknown()

func (*AccountWrapMockData) XXX_Marshal

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

func (*AccountWrapMockData) XXX_Merge

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

func (*AccountWrapMockData) XXX_Size

func (m *AccountWrapMockData) XXX_Size() int

func (*AccountWrapMockData) XXX_Unmarshal

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

type AccountsFactoryStub

type AccountsFactoryStub struct {
	CreateAccountCalled func(address []byte) (vmcommon.AccountHandler, error)
}

AccountsFactoryStub -

func (*AccountsFactoryStub) CreateAccount

func (afs *AccountsFactoryStub) CreateAccount(address []byte) (vmcommon.AccountHandler, error)

CreateAccount -

func (*AccountsFactoryStub) IsInterfaceNil

func (afs *AccountsFactoryStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type AccountsRepositoryStub

type AccountsRepositoryStub struct {
	GetAccountWithBlockInfoCalled        func(address []byte, options api.AccountQueryOptions) (vmcommon.AccountHandler, common.BlockInfo, error)
	GetCodeWithBlockInfoCalled           func(codeHash []byte, options api.AccountQueryOptions) ([]byte, common.BlockInfo, error)
	GetCurrentStateAccountsWrapperCalled func() state.AccountsAdapterAPI
	CloseCalled                          func() error
}

AccountsRepositoryStub -

func (*AccountsRepositoryStub) Close

func (stub *AccountsRepositoryStub) Close() error

Close -

func (*AccountsRepositoryStub) GetAccountWithBlockInfo

func (stub *AccountsRepositoryStub) GetAccountWithBlockInfo(address []byte, options api.AccountQueryOptions) (vmcommon.AccountHandler, common.BlockInfo, error)

GetAccountWithBlockInfo -

func (*AccountsRepositoryStub) GetCodeWithBlockInfo

func (stub *AccountsRepositoryStub) GetCodeWithBlockInfo(codeHash []byte, options api.AccountQueryOptions) ([]byte, common.BlockInfo, error)

GetCodeWithBlockInfo -

func (*AccountsRepositoryStub) GetCurrentStateAccountsWrapper

func (stub *AccountsRepositoryStub) GetCurrentStateAccountsWrapper() state.AccountsAdapterAPI

GetCurrentStateAccountsWrapper -

func (*AccountsRepositoryStub) IsInterfaceNil

func (stub *AccountsRepositoryStub) IsInterfaceNil() bool

IsInterfaceNil -

type AccountsStub

type AccountsStub struct {
	GetExistingAccountCalled      func(addressContainer []byte) (vmcommon.AccountHandler, error)
	GetAccountFromBytesCalled     func(address []byte, accountBytes []byte) (vmcommon.AccountHandler, error)
	LoadAccountCalled             func(container []byte) (vmcommon.AccountHandler, error)
	SaveAccountCalled             func(account vmcommon.AccountHandler) error
	RemoveAccountCalled           func(addressContainer []byte) error
	CommitCalled                  func() ([]byte, error)
	CommitInEpochCalled           func(uint32, uint32) ([]byte, error)
	JournalLenCalled              func() int
	RevertToSnapshotCalled        func(snapshot int) error
	RootHashCalled                func() ([]byte, error)
	RecreateTrieCalled            func(options common.RootHashHolder) error
	PruneTrieCalled               func(rootHash []byte, identifier state.TriePruningIdentifier, handler state.PruningHandler)
	CancelPruneCalled             func(rootHash []byte, identifier state.TriePruningIdentifier)
	SnapshotStateCalled           func(rootHash []byte, epoch uint32)
	IsPruningEnabledCalled        func() bool
	GetAllLeavesCalled            func(leavesChannels *common.TrieIteratorChannels, ctx context.Context, rootHash []byte, trieLeafParser common.TrieLeafParser) error
	RecreateAllTriesCalled        func(rootHash []byte) (map[string]common.Trie, error)
	GetCodeCalled                 func([]byte) []byte
	GetTrieCalled                 func([]byte) (common.Trie, error)
	GetStackDebugFirstEntryCalled func() []byte
	GetAccountWithBlockInfoCalled func(address []byte, options common.RootHashHolder) (vmcommon.AccountHandler, common.BlockInfo, error)
	GetCodeWithBlockInfoCalled    func(codeHash []byte, options common.RootHashHolder) ([]byte, common.BlockInfo, error)
	CloseCalled                   func() error
	SetSyncerCalled               func(syncer state.AccountsDBSyncer) error
	StartSnapshotIfNeededCalled   func() error
}

AccountsStub -

func (*AccountsStub) CancelPrune

func (as *AccountsStub) CancelPrune(rootHash []byte, identifier state.TriePruningIdentifier)

CancelPrune -

func (*AccountsStub) CleanCache added in v1.6.0

func (as *AccountsStub) CleanCache()

CleanCache -

func (*AccountsStub) Close

func (as *AccountsStub) Close() error

Close -

func (*AccountsStub) Commit

func (as *AccountsStub) Commit() ([]byte, error)

Commit -

func (*AccountsStub) CommitInEpoch

func (as *AccountsStub) CommitInEpoch(currentEpoch uint32, epochToCommit uint32) ([]byte, error)

CommitInEpoch -

func (*AccountsStub) GetAccountFromBytes

func (as *AccountsStub) GetAccountFromBytes(address []byte, accountBytes []byte) (vmcommon.AccountHandler, error)

GetAccountFromBytes -

func (*AccountsStub) GetAccountWithBlockInfo

func (as *AccountsStub) GetAccountWithBlockInfo(address []byte, options common.RootHashHolder) (vmcommon.AccountHandler, common.BlockInfo, error)

GetAccountWithBlockInfo -

func (*AccountsStub) GetAllLeaves

func (as *AccountsStub) GetAllLeaves(leavesChannels *common.TrieIteratorChannels, ctx context.Context, rootHash []byte, trieLeafParser common.TrieLeafParser) error

GetAllLeaves -

func (*AccountsStub) GetCode

func (as *AccountsStub) GetCode(codeHash []byte) []byte

GetCode -

func (*AccountsStub) GetCodeWithBlockInfo

func (as *AccountsStub) GetCodeWithBlockInfo(codeHash []byte, options common.RootHashHolder) ([]byte, common.BlockInfo, error)

GetCodeWithBlockInfo -

func (*AccountsStub) GetExistingAccount

func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (vmcommon.AccountHandler, error)

GetExistingAccount -

func (*AccountsStub) GetStackDebugFirstEntry

func (as *AccountsStub) GetStackDebugFirstEntry() []byte

GetStackDebugFirstEntry -

func (*AccountsStub) GetTrie

func (as *AccountsStub) GetTrie(codeHash []byte) (common.Trie, error)

GetTrie -

func (*AccountsStub) IsInterfaceNil

func (as *AccountsStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountsStub) IsPruningEnabled

func (as *AccountsStub) IsPruningEnabled() bool

IsPruningEnabled -

func (*AccountsStub) JournalLen

func (as *AccountsStub) JournalLen() int

JournalLen -

func (*AccountsStub) LoadAccount

func (as *AccountsStub) LoadAccount(address []byte) (vmcommon.AccountHandler, error)

LoadAccount -

func (*AccountsStub) PruneTrie

func (as *AccountsStub) PruneTrie(rootHash []byte, identifier state.TriePruningIdentifier, handler state.PruningHandler)

PruneTrie -

func (*AccountsStub) RecreateAllTries

func (as *AccountsStub) RecreateAllTries(rootHash []byte) (map[string]common.Trie, error)

RecreateAllTries -

func (*AccountsStub) RecreateTrie

func (as *AccountsStub) RecreateTrie(options common.RootHashHolder) error

RecreateTrie -

func (*AccountsStub) RemoveAccount

func (as *AccountsStub) RemoveAccount(addressContainer []byte) error

RemoveAccount -

func (*AccountsStub) RevertToSnapshot

func (as *AccountsStub) RevertToSnapshot(snapshot int) error

RevertToSnapshot -

func (*AccountsStub) RootHash

func (as *AccountsStub) RootHash() ([]byte, error)

RootHash -

func (*AccountsStub) SaveAccount

func (as *AccountsStub) SaveAccount(account vmcommon.AccountHandler) error

SaveAccount -

func (*AccountsStub) SetSyncer

func (as *AccountsStub) SetSyncer(syncer state.AccountsDBSyncer) error

SetSyncer -

func (*AccountsStub) SnapshotState

func (as *AccountsStub) SnapshotState(rootHash []byte, epoch uint32)

SnapshotState -

func (*AccountsStub) StartSnapshotIfNeeded

func (as *AccountsStub) StartSnapshotIfNeeded() error

StartSnapshotIfNeeded -

type BaseAccountMock added in v1.6.0

type BaseAccountMock struct {
	AddressBytesField []byte
	Nonce             uint64
}

BaseAccountMock -

func (*BaseAccountMock) AddressBytes added in v1.6.0

func (bam *BaseAccountMock) AddressBytes() []byte

AddressBytes -

func (*BaseAccountMock) GetNonce added in v1.6.0

func (bam *BaseAccountMock) GetNonce() uint64

GetNonce -

func (*BaseAccountMock) IncreaseNonce added in v1.6.0

func (bam *BaseAccountMock) IncreaseNonce(nonce uint64)

IncreaseNonce -

func (*BaseAccountMock) IsInterfaceNil added in v1.6.0

func (bam *BaseAccountMock) IsInterfaceNil() bool

IsInterfaceNil -

type EvictionWaitingListMock

type EvictionWaitingListMock struct {
	Cache     map[string]common.ModifiedHashes
	CacheSize uint
	OpMutex   sync.RWMutex
}

EvictionWaitingListMock is a mock implementation of state.DBRemoveCacher

func NewEvictionWaitingListMock

func NewEvictionWaitingListMock(size uint) *EvictionWaitingListMock

NewEvictionWaitingListMock creates a new instance of evictionWaitingList

func (*EvictionWaitingListMock) Close

func (ewl *EvictionWaitingListMock) Close() error

Close -

func (*EvictionWaitingListMock) Evict

func (ewl *EvictionWaitingListMock) Evict(rootHash []byte) (common.ModifiedHashes, error)

Evict returns and removes from the waiting list all the hashes from the position given by the root hash

func (*EvictionWaitingListMock) IsInterfaceNil

func (ewl *EvictionWaitingListMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*EvictionWaitingListMock) Put

func (ewl *EvictionWaitingListMock) Put(rootHash []byte, hashes common.ModifiedHashes) error

Put stores the given hashes in the eviction waiting list, in the position given by the root hash

func (*EvictionWaitingListMock) ShouldKeepHash

func (ewl *EvictionWaitingListMock) ShouldKeepHash(hash string, identifier state.TriePruningIdentifier) (bool, error)

ShouldKeepHash -

type PeerAccountHandlerMock added in v1.6.0

type PeerAccountHandlerMock struct {
	IncreaseLeaderSuccessRateValue          uint32
	DecreaseLeaderSuccessRateValue          uint32
	IncreaseValidatorSuccessRateValue       uint32
	DecreaseValidatorSuccessRateValue       uint32
	IncreaseValidatorIgnoredSignaturesValue uint32
	PreviousList                            string

	IncreaseLeaderSuccessRateCalled              func(uint32)
	DecreaseLeaderSuccessRateCalled              func(uint32)
	IncreaseValidatorSuccessRateCalled           func(uint32)
	DecreaseValidatorSuccessRateCalled           func(uint32)
	IncreaseValidatorIgnoredSignaturesRateCalled func(uint32)
	SetTempRatingCalled                          func(uint32)
	GetTempRatingCalled                          func() uint32
	SetAccumulatedFeesCalled                     func(*big.Int)
	GetAccumulatedFeesCalled                     func() *big.Int
	GetConsecutiveProposerMissesCalled           func() uint32
	SetConsecutiveProposerMissesCalled           func(rating uint32)
	SetListAndIndexCalled                        func(shardID uint32, list string, index uint32)
	GetListCalled                                func() string
	GetUnStakedEpochCalled                       func() uint32
	AddressBytesCalled                           func() []byte
}

PeerAccountHandlerMock -

func (*PeerAccountHandlerMock) AddToAccumulatedFees added in v1.6.0

func (p *PeerAccountHandlerMock) AddToAccumulatedFees(val *big.Int)

AddToAccumulatedFees -

func (*PeerAccountHandlerMock) AddressBytes added in v1.6.0

func (p *PeerAccountHandlerMock) AddressBytes() []byte

AddressBytes -

func (*PeerAccountHandlerMock) DataTrie added in v1.6.0

func (p *PeerAccountHandlerMock) DataTrie() common.Trie

DataTrie -

func (*PeerAccountHandlerMock) DecreaseLeaderSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) DecreaseLeaderSuccessRate(val uint32)

DecreaseLeaderSuccessRate -

func (*PeerAccountHandlerMock) DecreaseValidatorSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) DecreaseValidatorSuccessRate(val uint32)

DecreaseValidatorSuccessRate -

func (*PeerAccountHandlerMock) GetAccumulatedFees added in v1.6.0

func (p *PeerAccountHandlerMock) GetAccumulatedFees() *big.Int

GetAccumulatedFees -

func (*PeerAccountHandlerMock) GetBLSPublicKey added in v1.7.0

func (p *PeerAccountHandlerMock) GetBLSPublicKey() []byte

GetBLSPublicKey -

func (*PeerAccountHandlerMock) GetCode added in v1.6.0

func (p *PeerAccountHandlerMock) GetCode() []byte

GetCode -

func (*PeerAccountHandlerMock) GetCodeHash added in v1.6.0

func (p *PeerAccountHandlerMock) GetCodeHash() []byte

GetCodeHash -

func (*PeerAccountHandlerMock) GetConsecutiveProposerMisses added in v1.6.0

func (p *PeerAccountHandlerMock) GetConsecutiveProposerMisses() uint32

GetConsecutiveProposerMisses -

func (*PeerAccountHandlerMock) GetIndexInList added in v1.6.0

func (p *PeerAccountHandlerMock) GetIndexInList() uint32

GetIndexInList -

func (*PeerAccountHandlerMock) GetLeaderSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetLeaderSuccessRate() state.SignRate

GetLeaderSuccessRate -

func (*PeerAccountHandlerMock) GetList added in v1.6.0

func (p *PeerAccountHandlerMock) GetList() string

GetList -

func (*PeerAccountHandlerMock) GetNonce added in v1.6.0

func (p *PeerAccountHandlerMock) GetNonce() uint64

GetNonce -

func (*PeerAccountHandlerMock) GetNumSelectedInSuccessBlocks added in v1.6.0

func (p *PeerAccountHandlerMock) GetNumSelectedInSuccessBlocks() uint32

GetNumSelectedInSuccessBlocks -

func (*PeerAccountHandlerMock) GetPreviousIndexInList added in v1.7.0

func (p *PeerAccountHandlerMock) GetPreviousIndexInList() uint32

GetPreviousIndexInList -

func (*PeerAccountHandlerMock) GetPreviousList added in v1.7.0

func (p *PeerAccountHandlerMock) GetPreviousList() string

GetPreviousList -

func (*PeerAccountHandlerMock) GetRating added in v1.6.0

func (p *PeerAccountHandlerMock) GetRating() uint32

GetRating -

func (*PeerAccountHandlerMock) GetRewardAddress added in v1.6.0

func (p *PeerAccountHandlerMock) GetRewardAddress() []byte

GetRewardAddress -

func (*PeerAccountHandlerMock) GetRootHash added in v1.6.0

func (p *PeerAccountHandlerMock) GetRootHash() []byte

GetRootHash -

func (*PeerAccountHandlerMock) GetShardId added in v1.6.0

func (p *PeerAccountHandlerMock) GetShardId() uint32

GetShardId -

func (*PeerAccountHandlerMock) GetStake added in v1.6.0

func (p *PeerAccountHandlerMock) GetStake() *big.Int

GetStake -

func (*PeerAccountHandlerMock) GetTempRating added in v1.6.0

func (p *PeerAccountHandlerMock) GetTempRating() uint32

GetTempRating -

func (*PeerAccountHandlerMock) GetTotalLeaderSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetTotalLeaderSuccessRate() state.SignRate

GetTotalLeaderSuccessRate -

func (*PeerAccountHandlerMock) GetTotalValidatorIgnoredSignaturesRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetTotalValidatorIgnoredSignaturesRate() uint32

GetTotalValidatorIgnoredSignaturesRate -

func (*PeerAccountHandlerMock) GetTotalValidatorSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetTotalValidatorSuccessRate() state.SignRate

GetTotalValidatorSuccessRate -

func (*PeerAccountHandlerMock) GetUnStakedEpoch added in v1.6.0

func (p *PeerAccountHandlerMock) GetUnStakedEpoch() uint32

GetUnStakedEpoch -

func (*PeerAccountHandlerMock) GetValidatorIgnoredSignaturesRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetValidatorIgnoredSignaturesRate() uint32

GetValidatorIgnoredSignaturesRate -

func (*PeerAccountHandlerMock) GetValidatorSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) GetValidatorSuccessRate() state.SignRate

GetValidatorSuccessRate -

func (*PeerAccountHandlerMock) IncreaseLeaderSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) IncreaseLeaderSuccessRate(val uint32)

IncreaseLeaderSuccessRate -

func (*PeerAccountHandlerMock) IncreaseNonce added in v1.6.0

func (p *PeerAccountHandlerMock) IncreaseNonce(_ uint64)

IncreaseNonce -

func (*PeerAccountHandlerMock) IncreaseNumSelectedInSuccessBlocks added in v1.6.0

func (p *PeerAccountHandlerMock) IncreaseNumSelectedInSuccessBlocks()

IncreaseNumSelectedInSuccessBlocks -

func (*PeerAccountHandlerMock) IncreaseValidatorIgnoredSignaturesRate added in v1.6.0

func (p *PeerAccountHandlerMock) IncreaseValidatorIgnoredSignaturesRate(val uint32)

IncreaseValidatorIgnoredSignaturesRate -

func (*PeerAccountHandlerMock) IncreaseValidatorSuccessRate added in v1.6.0

func (p *PeerAccountHandlerMock) IncreaseValidatorSuccessRate(val uint32)

IncreaseValidatorSuccessRate -

func (*PeerAccountHandlerMock) IsInterfaceNil added in v1.6.0

func (p *PeerAccountHandlerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerAccountHandlerMock) ResetAtNewEpoch added in v1.6.0

func (p *PeerAccountHandlerMock) ResetAtNewEpoch()

ResetAtNewEpoch -

func (*PeerAccountHandlerMock) SetBLSPublicKey added in v1.6.0

func (p *PeerAccountHandlerMock) SetBLSPublicKey([]byte) error

SetBLSPublicKey -

func (*PeerAccountHandlerMock) SetCode added in v1.6.0

func (p *PeerAccountHandlerMock) SetCode(_ []byte)

SetCode -

func (*PeerAccountHandlerMock) SetCodeHash added in v1.6.0

func (p *PeerAccountHandlerMock) SetCodeHash(_ []byte)

SetCodeHash -

func (*PeerAccountHandlerMock) SetConsecutiveProposerMisses added in v1.6.0

func (p *PeerAccountHandlerMock) SetConsecutiveProposerMisses(consecutiveMisses uint32)

SetConsecutiveProposerMisses -

func (*PeerAccountHandlerMock) SetDataTrie added in v1.6.0

func (p *PeerAccountHandlerMock) SetDataTrie(_ common.Trie)

SetDataTrie -

func (*PeerAccountHandlerMock) SetListAndIndex added in v1.6.0

func (p *PeerAccountHandlerMock) SetListAndIndex(shardID uint32, list string, index uint32, _ bool)

SetListAndIndex -

func (*PeerAccountHandlerMock) SetPreviousList added in v1.7.1

func (p *PeerAccountHandlerMock) SetPreviousList(list string)

SetPreviousList -

func (*PeerAccountHandlerMock) SetRating added in v1.6.0

func (p *PeerAccountHandlerMock) SetRating(uint32)

SetRating -

func (*PeerAccountHandlerMock) SetRewardAddress added in v1.6.0

func (p *PeerAccountHandlerMock) SetRewardAddress([]byte) error

SetRewardAddress -

func (*PeerAccountHandlerMock) SetRootHash added in v1.6.0

func (p *PeerAccountHandlerMock) SetRootHash([]byte)

SetRootHash -

func (*PeerAccountHandlerMock) SetStake added in v1.6.0

func (p *PeerAccountHandlerMock) SetStake(_ *big.Int) error

SetStake -

func (*PeerAccountHandlerMock) SetTempRating added in v1.6.0

func (p *PeerAccountHandlerMock) SetTempRating(val uint32)

SetTempRating -

func (*PeerAccountHandlerMock) SetUnStakedEpoch added in v1.6.0

func (p *PeerAccountHandlerMock) SetUnStakedEpoch(_ uint32)

SetUnStakedEpoch -

type SignRate added in v1.6.0

type SignRate struct {
	NumSuccess uint32
	NumFailure uint32
}

SignRate -

func (*SignRate) GetNumFailure added in v1.6.0

func (s *SignRate) GetNumFailure() uint32

GetNumFailure -

func (*SignRate) GetNumSuccess added in v1.6.0

func (s *SignRate) GetNumSuccess() uint32

GetNumSuccess -

type SnapshotsManagerStub added in v1.7.0

type SnapshotsManagerStub struct {
	SnapshotStateCalled                     func(rootHash []byte, epoch uint32, trieStorageManager common.StorageManager)
	StartSnapshotAfterRestartIfNeededCalled func(trieStorageManager common.StorageManager) error
	IsSnapshotInProgressCalled              func() bool
	SetSyncerCalled                         func(syncer state.AccountsDBSyncer) error
}

SnapshotsManagerStub -

func (*SnapshotsManagerStub) IsInterfaceNil added in v1.7.0

func (s *SnapshotsManagerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SnapshotsManagerStub) IsSnapshotInProgress added in v1.7.0

func (s *SnapshotsManagerStub) IsSnapshotInProgress() bool

IsSnapshotInProgress -

func (*SnapshotsManagerStub) SetSyncer added in v1.7.0

func (s *SnapshotsManagerStub) SetSyncer(syncer state.AccountsDBSyncer) error

SetSyncer -

func (*SnapshotsManagerStub) SnapshotState added in v1.7.0

func (s *SnapshotsManagerStub) SnapshotState(rootHash []byte, epoch uint32, trieStorageManager common.StorageManager)

SnapshotState -

func (*SnapshotsManagerStub) StartSnapshotAfterRestartIfNeeded added in v1.7.0

func (s *SnapshotsManagerStub) StartSnapshotAfterRestartIfNeeded(trieStorageManager common.StorageManager) error

StartSnapshotAfterRestartIfNeeded -

type StateMetricsStub added in v1.6.0

type StateMetricsStub struct {
	UpdateMetricsOnSnapshotStartCalled      func()
	UpdateMetricsOnSnapshotCompletionCalled func(stats common.SnapshotStatisticsHandler)
	GetSnapshotMessageCalled                func() string
}

StateMetricsStub -

func (*StateMetricsStub) GetSnapshotMessage added in v1.6.0

func (s *StateMetricsStub) GetSnapshotMessage() string

GetSnapshotMessage -

func (*StateMetricsStub) IsInterfaceNil added in v1.6.0

func (s *StateMetricsStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StateMetricsStub) UpdateMetricsOnSnapshotCompletion added in v1.6.0

func (s *StateMetricsStub) UpdateMetricsOnSnapshotCompletion(stats common.SnapshotStatisticsHandler)

UpdateMetricsOnSnapshotCompletion -

func (*StateMetricsStub) UpdateMetricsOnSnapshotStart added in v1.6.0

func (s *StateMetricsStub) UpdateMetricsOnSnapshotStart()

UpdateMetricsOnSnapshotStart -

type StateUserAccountHandlerStub added in v1.5.0

type StateUserAccountHandlerStub struct {
	AddressBytesCalled          func() []byte
	IncreaseNonceCalled         func(nonce uint64)
	GetNonceCalled              func() uint64
	SetCodeCalled               func(code []byte)
	SetCodeMetadataCalled       func(codeMetadata []byte)
	GetCodeMetadataCalled       func() []byte
	SetCodeHashCalled           func([]byte)
	GetCodeHashCalled           func() []byte
	SetRootHashCalled           func([]byte)
	GetRootHashCalled           func() []byte
	SetDataTrieCalled           func(trie common.Trie)
	DataTrieCalled              func() common.DataTrieHandler
	RetrieveValueCalled         func(key []byte) ([]byte, uint32, error)
	SaveKeyValueCalled          func(key []byte, value []byte) error
	AddToBalanceCalled          func(value *big.Int) error
	SubFromBalanceCalled        func(value *big.Int) error
	GetBalanceCalled            func() *big.Int
	ClaimDeveloperRewardsCalled func([]byte) (*big.Int, error)
	AddToDeveloperRewardCalled  func(*big.Int)
	GetDeveloperRewardCalled    func() *big.Int
	ChangeOwnerAddressCalled    func([]byte, []byte) error
	SetOwnerAddressCalled       func([]byte)
	GetOwnerAddressCalled       func() []byte
	SetUserNameCalled           func(userName []byte)
	GetUserNameCalled           func() []byte
	IsGuardedCalled             func() bool
	GetAllLeavesCalled          func(leavesChannels *common.TrieIteratorChannels, ctx context.Context) error
}

StateUserAccountHandlerStub -

func (*StateUserAccountHandlerStub) AddToBalance added in v1.5.0

func (aas *StateUserAccountHandlerStub) AddToBalance(value *big.Int) error

AddToBalance -

func (*StateUserAccountHandlerStub) AddToDeveloperReward added in v1.5.0

func (aas *StateUserAccountHandlerStub) AddToDeveloperReward(val *big.Int)

AddToDeveloperReward -

func (*StateUserAccountHandlerStub) AddressBytes added in v1.5.0

func (aas *StateUserAccountHandlerStub) AddressBytes() []byte

AddressBytes -

func (*StateUserAccountHandlerStub) ChangeOwnerAddress added in v1.5.0

func (aas *StateUserAccountHandlerStub) ChangeOwnerAddress(senderAddr []byte, newOwnerAddr []byte) error

ChangeOwnerAddress -

func (*StateUserAccountHandlerStub) ClaimDeveloperRewards added in v1.5.0

func (aas *StateUserAccountHandlerStub) ClaimDeveloperRewards(senderAddr []byte) (*big.Int, error)

ClaimDeveloperRewards -

func (*StateUserAccountHandlerStub) DataTrie added in v1.5.0

DataTrie -

func (*StateUserAccountHandlerStub) GetAllLeaves added in v1.6.0

func (aas *StateUserAccountHandlerStub) GetAllLeaves(leavesChannels *common.TrieIteratorChannels, ctx context.Context) error

GetAllLeaves -

func (*StateUserAccountHandlerStub) GetBalance added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetBalance() *big.Int

GetBalance -

func (*StateUserAccountHandlerStub) GetCodeHash added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetCodeHash() []byte

GetCodeHash -

func (*StateUserAccountHandlerStub) GetCodeMetadata added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetCodeMetadata() []byte

GetCodeMetadata -

func (*StateUserAccountHandlerStub) GetDeveloperReward added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetDeveloperReward() *big.Int

GetDeveloperReward -

func (*StateUserAccountHandlerStub) GetNonce added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetNonce() uint64

GetNonce -

func (*StateUserAccountHandlerStub) GetOwnerAddress added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetOwnerAddress() []byte

GetOwnerAddress -

func (*StateUserAccountHandlerStub) GetRootHash added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetRootHash() []byte

GetRootHash -

func (*StateUserAccountHandlerStub) GetUserName added in v1.5.0

func (aas *StateUserAccountHandlerStub) GetUserName() []byte

GetUserName -

func (*StateUserAccountHandlerStub) IncreaseNonce added in v1.5.0

func (aas *StateUserAccountHandlerStub) IncreaseNonce(nonce uint64)

IncreaseNonce -

func (*StateUserAccountHandlerStub) IsGuarded added in v1.5.0

func (aas *StateUserAccountHandlerStub) IsGuarded() bool

IsGuarded -

func (*StateUserAccountHandlerStub) IsInterfaceNil added in v1.5.0

func (aas *StateUserAccountHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StateUserAccountHandlerStub) RetrieveValue added in v1.5.0

func (aas *StateUserAccountHandlerStub) RetrieveValue(key []byte) ([]byte, uint32, error)

RetrieveValue -

func (*StateUserAccountHandlerStub) SaveKeyValue added in v1.5.0

func (aas *StateUserAccountHandlerStub) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue -

func (*StateUserAccountHandlerStub) SetCode added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetCode(code []byte)

SetCode -

func (*StateUserAccountHandlerStub) SetCodeHash added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetCodeHash(codeHash []byte)

SetCodeHash -

func (*StateUserAccountHandlerStub) SetCodeMetadata added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetCodeMetadata(codeMetadata []byte)

SetCodeMetadata -

func (*StateUserAccountHandlerStub) SetDataTrie added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetDataTrie(trie common.Trie)

SetDataTrie -

func (*StateUserAccountHandlerStub) SetOwnerAddress added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetOwnerAddress(address []byte)

SetOwnerAddress -

func (*StateUserAccountHandlerStub) SetRootHash added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetRootHash(rootHash []byte)

SetRootHash -

func (*StateUserAccountHandlerStub) SetUserName added in v1.5.0

func (aas *StateUserAccountHandlerStub) SetUserName(userName []byte)

SetUserName -

func (*StateUserAccountHandlerStub) SubFromBalance added in v1.5.0

func (aas *StateUserAccountHandlerStub) SubFromBalance(value *big.Int) error

SubFromBalance -

type StoragePruningManagerStub

type StoragePruningManagerStub struct {
	MarkForEvictionCalled func(bytes []byte, bytes2 []byte, hashes common.ModifiedHashes, hashes2 common.ModifiedHashes) error
	PruneTrieCalled       func(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager, handler state.PruningHandler)
	CancelPruneCalled     func(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager)
	CloseCalled           func() error
}

StoragePruningManagerStub -

func (*StoragePruningManagerStub) CancelPrune

func (stub *StoragePruningManagerStub) CancelPrune(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager)

CancelPrune -

func (*StoragePruningManagerStub) Close

func (stub *StoragePruningManagerStub) Close() error

Close -

func (*StoragePruningManagerStub) IsInterfaceNil

func (stub *StoragePruningManagerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StoragePruningManagerStub) MarkForEviction

func (stub *StoragePruningManagerStub) MarkForEviction(bytes []byte, bytes2 []byte, hashes common.ModifiedHashes, hashes2 common.ModifiedHashes) error

MarkForEviction -

func (*StoragePruningManagerStub) PruneTrie

func (stub *StoragePruningManagerStub) PruneTrie(rootHash []byte, identifier state.TriePruningIdentifier, tsm common.StorageManager, handler state.PruningHandler)

PruneTrie -

type UserAccountStub

type UserAccountStub struct {
	Balance          *big.Int
	DeveloperRewards *big.Int
	UserName         []byte
	Owner            []byte
	Address          []byte
	CodeMetadata     []byte
	CodeHash         []byte
	Nonce            uint64

	AddToBalanceCalled       func(value *big.Int) error
	DataTrieTrackerCalled    func() state.DataTrieTracker
	IsGuardedCalled          func() bool
	AccountDataHandlerCalled func() vmcommon.AccountDataHandler
	RetrieveValueCalled      func(_ []byte) ([]byte, uint32, error)
	SetDataTrieCalled        func(dataTrie common.Trie)
	GetRootHashCalled        func() []byte
	SaveKeyValueCalled       func(key []byte, value []byte) error
}

UserAccountStub -

func (*UserAccountStub) AccountDataHandler added in v1.5.0

func (u *UserAccountStub) AccountDataHandler() vmcommon.AccountDataHandler

AccountDataHandler -

func (*UserAccountStub) AddToBalance

func (u *UserAccountStub) AddToBalance(value *big.Int) error

AddToBalance -

func (*UserAccountStub) AddToDeveloperReward

func (u *UserAccountStub) AddToDeveloperReward(*big.Int)

AddToDeveloperReward -

func (*UserAccountStub) AddressBytes

func (u *UserAccountStub) AddressBytes() []byte

AddressBytes -

func (*UserAccountStub) ChangeOwnerAddress

func (u *UserAccountStub) ChangeOwnerAddress([]byte, []byte) error

ChangeOwnerAddress -

func (*UserAccountStub) ClaimDeveloperRewards

func (u *UserAccountStub) ClaimDeveloperRewards([]byte) (*big.Int, error)

ClaimDeveloperRewards -

func (*UserAccountStub) DataTrie

func (u *UserAccountStub) DataTrie() common.DataTrieHandler

DataTrie -

func (*UserAccountStub) GetAllLeaves added in v1.6.0

GetAllLeaves -

func (*UserAccountStub) GetBalance

func (u *UserAccountStub) GetBalance() *big.Int

GetBalance -

func (*UserAccountStub) GetCode added in v1.6.0

func (u *UserAccountStub) GetCode() []byte

GetCode -

func (*UserAccountStub) GetCodeHash

func (u *UserAccountStub) GetCodeHash() []byte

GetCodeHash -

func (*UserAccountStub) GetCodeMetadata

func (u *UserAccountStub) GetCodeMetadata() []byte

GetCodeMetadata -

func (*UserAccountStub) GetDeveloperReward

func (u *UserAccountStub) GetDeveloperReward() *big.Int

GetDeveloperReward -

func (*UserAccountStub) GetNonce

func (u *UserAccountStub) GetNonce() uint64

GetNonce -

func (*UserAccountStub) GetOwnerAddress

func (u *UserAccountStub) GetOwnerAddress() []byte

GetOwnerAddress -

func (*UserAccountStub) GetRootHash

func (u *UserAccountStub) GetRootHash() []byte

GetRootHash -

func (*UserAccountStub) GetUserName

func (u *UserAccountStub) GetUserName() []byte

GetUserName -

func (*UserAccountStub) HasNewCode

func (u *UserAccountStub) HasNewCode() bool

HasNewCode -

func (*UserAccountStub) IncreaseNonce

func (u *UserAccountStub) IncreaseNonce(_ uint64)

IncreaseNonce -

func (*UserAccountStub) IsGuarded added in v1.5.0

func (u *UserAccountStub) IsGuarded() bool

IsGuarded -

func (*UserAccountStub) IsInterfaceNil

func (u *UserAccountStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*UserAccountStub) RetrieveValue

func (u *UserAccountStub) RetrieveValue(key []byte) ([]byte, uint32, error)

RetrieveValue -

func (*UserAccountStub) SaveDirtyData

func (u *UserAccountStub) SaveDirtyData(_ common.Trie) ([]core.TrieData, error)

SaveDirtyData -

func (*UserAccountStub) SaveKeyValue

func (u *UserAccountStub) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue -

func (*UserAccountStub) SetCode

func (u *UserAccountStub) SetCode(_ []byte)

SetCode -

func (*UserAccountStub) SetCodeHash

func (u *UserAccountStub) SetCodeHash([]byte)

SetCodeHash -

func (*UserAccountStub) SetCodeMetadata

func (u *UserAccountStub) SetCodeMetadata(_ []byte)

SetCodeMetadata -

func (*UserAccountStub) SetDataTrie

func (u *UserAccountStub) SetDataTrie(dataTrie common.Trie)

SetDataTrie -

func (*UserAccountStub) SetOwnerAddress

func (u *UserAccountStub) SetOwnerAddress([]byte)

SetOwnerAddress -

func (*UserAccountStub) SetRootHash

func (u *UserAccountStub) SetRootHash([]byte)

SetRootHash -

func (*UserAccountStub) SetUserName

func (u *UserAccountStub) SetUserName(_ []byte)

SetUserName -

func (*UserAccountStub) SubFromBalance

func (u *UserAccountStub) SubFromBalance(_ *big.Int) error

SubFromBalance -

Jump to

Keyboard shortcuts

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