mock

package
v1.1.15 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInterceptedMetaBlockMock added in v1.0.102

func NewInterceptedMetaBlockMock(hdr data.HeaderHandler, hash []byte) *interceptedMetaBlockMock

NewInterceptedMetaBlockMock -

func NewMultiShardsCoordinatorMock added in v1.0.102

func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock

NewMultiShardsCoordinatorMock -

func NewMultipleShardsCoordinatorMock added in v1.0.102

func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock

NewMultipleShardsCoordinatorMock -

Types

type AccountsStub added in v1.1.15

type AccountsStub struct {
	GetExistingAccountCalled func(addressContainer []byte) (state.AccountHandler, error)
	LoadAccountCalled        func(container []byte) (state.AccountHandler, error)
	SaveAccountCalled        func(account state.AccountHandler) error
	RemoveAccountCalled      func(addressContainer []byte) error
	CommitCalled             func() ([]byte, error)
	JournalLenCalled         func() int
	RevertToSnapshotCalled   func(snapshot int) error
	RootHashCalled           func() ([]byte, error)
	RecreateTrieCalled       func(rootHash []byte) error
	PruneTrieCalled          func(rootHash []byte, identifier data.TriePruningIdentifier)
	CancelPruneCalled        func(rootHash []byte, identifier data.TriePruningIdentifier)
	SnapshotStateCalled      func(rootHash []byte)
	SetStateCheckpointCalled func(rootHash []byte)
	IsPruningEnabledCalled   func() bool
	GetAllLeavesCalled       func(rootHash []byte) (chan core.KeyValueHolder, error)
	RecreateAllTriesCalled   func(rootHash []byte) (map[string]data.Trie, error)
	GetNumCheckpointsCalled  func() uint32
}

AccountsStub -

func (*AccountsStub) CancelPrune added in v1.1.15

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

CancelPrune -

func (*AccountsStub) Commit added in v1.1.15

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

Commit -

func (*AccountsStub) GetAllLeaves added in v1.1.15

func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)

GetAllLeaves -

func (*AccountsStub) GetExistingAccount added in v1.1.15

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

GetExistingAccount -

func (*AccountsStub) GetNumCheckpoints added in v1.1.15

func (as *AccountsStub) GetNumCheckpoints() uint32

GetNumCheckpoints -

func (*AccountsStub) IsInterfaceNil added in v1.1.15

func (as *AccountsStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountsStub) IsPruningEnabled added in v1.1.15

func (as *AccountsStub) IsPruningEnabled() bool

IsPruningEnabled -

func (*AccountsStub) JournalLen added in v1.1.15

func (as *AccountsStub) JournalLen() int

JournalLen -

func (*AccountsStub) LoadAccount added in v1.1.15

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

LoadAccount -

func (*AccountsStub) PruneTrie added in v1.1.15

func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)

PruneTrie -

func (*AccountsStub) RecreateAllTries added in v1.1.15

func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)

RecreateAllTries -

func (*AccountsStub) RecreateTrie added in v1.1.15

func (as *AccountsStub) RecreateTrie(rootHash []byte) error

RecreateTrie -

func (*AccountsStub) RemoveAccount added in v1.1.15

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

RemoveAccount -

func (*AccountsStub) RevertToSnapshot added in v1.1.15

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

RevertToSnapshot -

func (*AccountsStub) RootHash added in v1.1.15

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

RootHash -

func (*AccountsStub) SaveAccount added in v1.1.15

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

SaveAccount -

func (*AccountsStub) SetStateCheckpoint added in v1.1.15

func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)

SetStateCheckpoint -

func (*AccountsStub) SnapshotState added in v1.1.15

func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)

SnapshotState -

type ActionHandlerStub added in v1.1.1

type ActionHandlerStub struct {
	EpochStartActionCalled  func(hdr data.HeaderHandler)
	EpochStartPrepareCalled func(metaHdr data.HeaderHandler, body data.BodyHandler)
	NotifyOrderCalled       func() uint32
}

ActionHandlerStub -

func (*ActionHandlerStub) EpochStartAction added in v1.1.1

func (ahs *ActionHandlerStub) EpochStartAction(hdr data.HeaderHandler)

EpochStartAction -

func (*ActionHandlerStub) EpochStartPrepare added in v1.1.1

func (ahs *ActionHandlerStub) EpochStartPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

EpochStartPrepare -

func (*ActionHandlerStub) NotifyOrder added in v1.1.1

func (ahs *ActionHandlerStub) NotifyOrder() uint32

NotifyOrder -

type AddressMock added in v1.0.102

type AddressMock struct {
	// contains filtered or unexported fields
}

AddressMock is the struct holding a mock address

func NewAddressMock added in v1.0.102

func NewAddressMock(adr []byte) *AddressMock

NewAddressMock creates a new Address with the same byte slice as the parameter received

func (*AddressMock) Bytes added in v1.0.102

func (adr *AddressMock) Bytes() []byte

Bytes returns the data corresponding to this address

func (*AddressMock) IsInterfaceNil added in v1.0.102

func (adr *AddressMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type AppStatusHandlerStub added in v1.0.127

type AppStatusHandlerStub struct {
	AddUint64Handler      func(key string, value uint64)
	IncrementHandler      func(key string)
	DecrementHandler      func(key string)
	SetUInt64ValueHandler func(key string, value uint64)
	SetInt64ValueHandler  func(key string, value int64)
	SetStringValueHandler func(key string, value string)
	CloseHandler          func()
}

AppStatusHandlerStub is a stub implementation of AppStatusHandler

func (*AppStatusHandlerStub) AddUint64 added in v1.0.127

func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)

AddUint64 will call the handler of the stub for incrementing

func (*AppStatusHandlerStub) Close added in v1.0.127

func (ashs *AppStatusHandlerStub) Close()

Close will call the handler of the stub for closing

func (*AppStatusHandlerStub) Decrement added in v1.0.127

func (ashs *AppStatusHandlerStub) Decrement(key string)

Decrement will call the handler of the stub for decrementing

func (*AppStatusHandlerStub) Increment added in v1.0.127

func (ashs *AppStatusHandlerStub) Increment(key string)

Increment will call the handler of the stub for incrementing

func (*AppStatusHandlerStub) IsInterfaceNil added in v1.0.127

func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*AppStatusHandlerStub) SetInt64Value added in v1.0.127

func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)

SetInt64Value will call the handler of the stub for setting an int64 value

func (*AppStatusHandlerStub) SetStringValue added in v1.0.127

func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)

SetStringValue will call the handler of the stub for setting an string value

func (*AppStatusHandlerStub) SetUInt64Value added in v1.0.127

func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)

SetUInt64Value will call the handler of the stub for setting an uint64 value

type ArgumentParserMock added in v1.0.133

type ArgumentParserMock struct {
	ParseCallDataCalled               func(data string) (string, [][]byte, error)
	ParseDeployDataCalled             func(data string) (*parsers.DeployArgs, error)
	CreateDataFromStorageUpdateCalled func(storageUpdates []*vmcommon.StorageUpdate) string
	GetStorageUpdatesCalled           func(data string) ([]*vmcommon.StorageUpdate, error)
}

ArgumentParserMock -

func (*ArgumentParserMock) CreateDataFromStorageUpdate added in v1.0.133

func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string

CreateDataFromStorageUpdate -

func (*ArgumentParserMock) GetStorageUpdates added in v1.0.133

func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)

GetStorageUpdates -

func (*ArgumentParserMock) IsInterfaceNil added in v1.0.133

func (ap *ArgumentParserMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ArgumentParserMock) ParseCallData added in v1.0.133

func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error)

ParseCallData -

func (*ArgumentParserMock) ParseDeployData added in v1.0.133

func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error)

ParseDeployData -

type ChainStorerStub

type ChainStorerStub struct {
	AddStorerCalled func(key dataRetriever.UnitType, s storage.Storer)
	GetStorerCalled func(unitType dataRetriever.UnitType) storage.Storer
	HasCalled       func(unitType dataRetriever.UnitType, key []byte) error
	GetCalled       func(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
	PutCalled       func(unitType dataRetriever.UnitType, key []byte, value []byte) error
	GetAllCalled    func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
	DestroyCalled   func() error
	CloseAllCalled  func() error
}

ChainStorerStub is a mock implementation of the ChainStorer interface

func (*ChainStorerStub) AddStorer

func (bc *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer will add a new storer to the chain map

func (*ChainStorerStub) CloseAll

func (bc *ChainStorerStub) CloseAll() error

CloseAll -

func (*ChainStorerStub) Destroy

func (bc *ChainStorerStub) Destroy() error

Destroy removes the underlying files/resources used by the storage service

func (*ChainStorerStub) Get

func (bc *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get returns the value for the given key if found in the selected storage unit, nil otherwise. It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error

func (*ChainStorerStub) GetAll

func (bc *ChainStorerStub) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)

GetAll gets all the elements with keys in the keys array, from the selected storage unit It can report an error if the provided unit type is not supported, if there is a missing key in the unit, or if the underlying implementation of the storage unit reports an error.

func (*ChainStorerStub) GetStorer

func (bc *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) storage.Storer

GetStorer returns the storer from the chain map or nil if the storer was not found

func (*ChainStorerStub) Has

func (bc *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error

Has returns true if the key is found in the selected Unit or false otherwise It can return an error if the provided unit type is not supported or if the underlying implementation of the storage unit reports an error.

func (*ChainStorerStub) IsInterfaceNil

func (bc *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChainStorerStub) Put

func (bc *ChainStorerStub) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error

Put stores the key, value pair in the selected storage unit It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error

func (*ChainStorerStub) SetEpochForPutOperation added in v1.0.109

func (bc *ChainStorerStub) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation won't do anything

type ChanceComputerStub added in v1.1.1

type ChanceComputerStub struct {
	GetChanceCalled func(rating uint32) uint32
}

ChanceComputerStub -

func (*ChanceComputerStub) GetChance added in v1.1.1

func (c *ChanceComputerStub) GetChance(rating uint32) uint32

GetChance -

func (*ChanceComputerStub) IsInterfaceNil added in v1.1.1

func (c *ChanceComputerStub) IsInterfaceNil() bool

IsInterfaceNil -

type DataTrieTrackerStub added in v1.1.15

type DataTrieTrackerStub struct {
	ClearDataCachesCalled func()
	DirtyDataCalled       func() map[string][]byte
	RetrieveValueCalled   func(key []byte) ([]byte, error)
	SaveKeyValueCalled    func(key []byte, value []byte) error
	SetDataTrieCalled     func(tr data.Trie)
	DataTrieCalled        func() data.Trie
}

DataTrieTrackerStub -

func (*DataTrieTrackerStub) ClearDataCaches added in v1.1.15

func (dtts *DataTrieTrackerStub) ClearDataCaches()

ClearDataCaches -

func (*DataTrieTrackerStub) DataTrie added in v1.1.15

func (dtts *DataTrieTrackerStub) DataTrie() data.Trie

DataTrie -

func (*DataTrieTrackerStub) DirtyData added in v1.1.15

func (dtts *DataTrieTrackerStub) DirtyData() map[string][]byte

DirtyData -

func (*DataTrieTrackerStub) IsInterfaceNil added in v1.1.15

func (dtts *DataTrieTrackerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*DataTrieTrackerStub) RetrieveValue added in v1.1.15

func (dtts *DataTrieTrackerStub) RetrieveValue(key []byte) ([]byte, error)

RetrieveValue -

func (*DataTrieTrackerStub) SaveKeyValue added in v1.1.15

func (dtts *DataTrieTrackerStub) SaveKeyValue(key []byte, value []byte) error

SaveKeyValue -

func (*DataTrieTrackerStub) SetDataTrie added in v1.1.15

func (dtts *DataTrieTrackerStub) SetDataTrie(tr data.Trie)

SetDataTrie -

type EpochNotifierStub added in v1.1.1

type EpochNotifierStub struct {
	CheckEpochCalled            func(epoch uint32)
	CurrentEpochCalled          func() uint32
	RegisterNotifyHandlerCalled func(handler core.EpochSubscriberHandler)
}

EpochNotifierStub -

func (*EpochNotifierStub) CheckEpoch added in v1.1.1

func (ens *EpochNotifierStub) CheckEpoch(epoch uint32)

CheckEpoch -

func (*EpochNotifierStub) CurrentEpoch added in v1.1.1

func (ens *EpochNotifierStub) CurrentEpoch() uint32

CurrentEpoch -

func (*EpochNotifierStub) IsInterfaceNil added in v1.1.1

func (ens *EpochNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochNotifierStub) RegisterNotifyHandler added in v1.1.1

func (ens *EpochNotifierStub) RegisterNotifyHandler(handler core.EpochSubscriberHandler)

RegisterNotifyHandler -

type EpochStartNotifierStub

type EpochStartNotifierStub struct {
	NotifyAllCalled                  func(hdr data.HeaderHandler)
	NotifyAllPrepareCalled           func(hdr data.HeaderHandler, body data.BodyHandler)
	NotifyEpochChangeConfirmedCalled func(epoch uint32)
}

EpochStartNotifierStub -

func (*EpochStartNotifierStub) IsInterfaceNil

func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartNotifierStub) NotifyAll

func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)

NotifyAll -

func (*EpochStartNotifierStub) NotifyAllPrepare

func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

NotifyAllPrepare -

func (*EpochStartNotifierStub) NotifyEpochChangeConfirmed added in v1.0.120

func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)

NotifyEpochChangeConfirmed -

type GasScheduleNotifierMock added in v1.1.12

type GasScheduleNotifierMock struct {
	GasSchedule map[string]map[string]uint64
}

GasScheduleNotifierMock -

func NewGasScheduleNotifierMock added in v1.1.12

func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock

NewGasScheduleNotifierMock -

func (*GasScheduleNotifierMock) IsInterfaceNil added in v1.1.12

func (g *GasScheduleNotifierMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*GasScheduleNotifierMock) LatestGasSchedule added in v1.1.12

func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64

LatestGasSchedule -

func (*GasScheduleNotifierMock) RegisterNotifyHandler added in v1.1.12

func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler)

RegisterNotifyHandler -

func (*GasScheduleNotifierMock) UnRegisterAll added in v1.1.12

func (g *GasScheduleNotifierMock) UnRegisterAll()

UnRegisterAll -

type HasherMock

type HasherMock struct {
}

HasherMock that will be used for testing

func (HasherMock) Compute

func (sha HasherMock) Compute(s string) []byte

Compute will output the SHA's equivalent of the input string

func (HasherMock) EmptyHash

func (sha HasherMock) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (HasherMock) IsInterfaceNil

func (sha HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size

func (HasherMock) Size() int

Size return the required size in bytes

type HeaderIntegrityVerifierStub added in v1.1.1

type HeaderIntegrityVerifierStub struct {
	VerifyCalled     func(header data.HeaderHandler) error
	GetVersionCalled func(epoch uint32) string
}

HeaderIntegrityVerifierStub -

func (*HeaderIntegrityVerifierStub) GetVersion added in v1.1.1

func (h *HeaderIntegrityVerifierStub) GetVersion(epoch uint32) string

GetVersion -

func (*HeaderIntegrityVerifierStub) IsInterfaceNil added in v1.1.1

func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderIntegrityVerifierStub) Verify added in v1.1.1

Verify -

type HeaderValidatorStub

type HeaderValidatorStub struct {
	IsHeaderConstructionValidCalled func(currHdr, prevHdr data.HeaderHandler) error
}

HeaderValidatorStub -

func (*HeaderValidatorStub) IsHeaderConstructionValid

func (hvs *HeaderValidatorStub) IsHeaderConstructionValid(currHdr, prevHdr data.HeaderHandler) error

IsHeaderConstructionValid -

func (*HeaderValidatorStub) IsInterfaceNil

func (hvs *HeaderValidatorStub) IsInterfaceNil() bool

IsInterfaceNil returns if underlying object is true

type HeadersByHashSyncerStub added in v1.0.104

type HeadersByHashSyncerStub struct {
	SyncMissingHeadersByHashCalled func(shardIDs []uint32, headersHashes [][]byte, ctx context.Context) error
	GetHeadersCalled               func() (map[string]data.HeaderHandler, error)
	ClearFieldsCalled              func()
}

HeadersByHashSyncerStub --

func (*HeadersByHashSyncerStub) ClearFields added in v1.0.104

func (hhss *HeadersByHashSyncerStub) ClearFields()

ClearFields --

func (*HeadersByHashSyncerStub) GetHeaders added in v1.0.104

func (hhss *HeadersByHashSyncerStub) GetHeaders() (map[string]data.HeaderHandler, error)

GetHeaders --

func (*HeadersByHashSyncerStub) IsInterfaceNil added in v1.0.104

func (hhss *HeadersByHashSyncerStub) IsInterfaceNil() bool

IsInterfaceNil --

func (*HeadersByHashSyncerStub) SyncMissingHeadersByHash added in v1.0.104

func (hhss *HeadersByHashSyncerStub) SyncMissingHeadersByHash(shardIDs []uint32, headersHashes [][]byte, ctx context.Context) error

SyncMissingHeadersByHash --

type HeadersCacherStub

type HeadersCacherStub struct {
	AddCalled                           func(headerHash []byte, header data.HeaderHandler)
	RemoveHeaderByHashCalled            func(headerHash []byte)
	RemoveHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32)
	GetHeaderByNonceAndShardIdCalled    func(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
	GetHeaderByHashCalled               func(hash []byte) (data.HeaderHandler, error)
	ClearCalled                         func()
	RegisterHandlerCalled               func(handler func(header data.HeaderHandler, shardHeaderHash []byte))
	NoncesCalled                        func(shardId uint32) []uint64
	LenCalled                           func() int
	MaxSizeCalled                       func() int
	GetNumHeadersCalled                 func(shardId uint32) int
}

HeadersCacherStub -

func (*HeadersCacherStub) AddHeader

func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)

AddHeader -

func (*HeadersCacherStub) Clear

func (hcs *HeadersCacherStub) Clear()

Clear -

func (*HeadersCacherStub) GetHeaderByHash

func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)

GetHeaderByHash -

func (*HeadersCacherStub) GetHeadersByNonceAndShardId

func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)

GetHeadersByNonceAndShardId -

func (*HeadersCacherStub) GetNumHeaders

func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int

GetNumHeaders -

func (*HeadersCacherStub) IsInterfaceNil

func (hcs *HeadersCacherStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeadersCacherStub) Len

func (hcs *HeadersCacherStub) Len() int

Len -

func (*HeadersCacherStub) MaxSize

func (hcs *HeadersCacherStub) MaxSize() int

MaxSize -

func (*HeadersCacherStub) Nonces

func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64

Nonces -

func (*HeadersCacherStub) RegisterHandler

func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))

RegisterHandler -

func (*HeadersCacherStub) RemoveHeaderByHash

func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)

RemoveHeaderByHash -

func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId

func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)

RemoveHeaderByNonceAndShardId -

type ImportStartHandlerStub added in v1.0.133

type ImportStartHandlerStub struct {
	SetStartImportCalled            func() error
	ResetStartImportCalled          func() error
	ShouldStartImportCalled         func() bool
	IsAfterExportBeforeImportCalled func() bool
}

ImportStartHandlerStub -

func (*ImportStartHandlerStub) IsAfterExportBeforeImport added in v1.0.133

func (ish *ImportStartHandlerStub) IsAfterExportBeforeImport() bool

IsAfterExportBeforeImport -

func (*ImportStartHandlerStub) IsInterfaceNil added in v1.0.133

func (ish *ImportStartHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ImportStartHandlerStub) ResetStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) ResetStartImport() error

ResetStartImport -

func (*ImportStartHandlerStub) SetStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) SetStartImport() error

SetStartImport -

func (*ImportStartHandlerStub) ShouldStartImport added in v1.0.133

func (ish *ImportStartHandlerStub) ShouldStartImport() bool

ShouldStartImport -

type KeyGenMock added in v1.0.104

type KeyGenMock struct {
}

KeyGenMock -

func (*KeyGenMock) CheckPublicKeyValid added in v1.0.120

func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error

CheckPublicKeyValid -

func (*KeyGenMock) GeneratePair added in v1.0.104

func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGenMock) IsInterfaceNil added in v1.0.104

func (keyGen *KeyGenMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*KeyGenMock) PrivateKeyFromByteArray added in v1.0.104

func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGenMock) PublicKeyFromByteArray added in v1.0.104

func (keyGen *KeyGenMock) PublicKeyFromByteArray(_ []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGenMock) Suite added in v1.0.104

func (keyGen *KeyGenMock) Suite() crypto.Suite

Suite -

type LatestStorageDataProviderStub added in v1.0.111

type LatestStorageDataProviderStub struct {
	GetParentDirAndLastEpochCalled func() (string, uint32, error)
	GetCalled                      func() (storage.LatestDataFromStorage, error)
	GetShardsFromDirectoryCalled   func(path string) ([]string, error)
}

LatestStorageDataProviderStub -

func (*LatestStorageDataProviderStub) Get added in v1.0.111

Get -

func (*LatestStorageDataProviderStub) GetParentDirAndLastEpoch added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)

GetParentDirAndLastEpoch -

func (*LatestStorageDataProviderStub) GetShardsFromDirectory added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)

GetShardsFromDirectory -

func (*LatestStorageDataProviderStub) IsInterfaceNil added in v1.0.111

func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil --

type MarshalizerMock

type MarshalizerMock struct {
	Fail bool
}

MarshalizerMock that will be used for testing

func (*MarshalizerMock) IsInterfaceNil

func (mm *MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshalizerMock) Marshal

func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)

Marshal converts the input object in a slice of bytes

func (*MarshalizerMock) Unmarshal

func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error

Unmarshal applies the serialized values over an instantiated object

type MessengerStub added in v1.0.102

type MessengerStub struct {
	ConnectedPeersCalled           func() []core.PeerID
	RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error
	UnjoinAllTopicsCalled          func() error
	IDCalled                       func() core.PeerID
}

MessengerStub -

func (*MessengerStub) ConnectedPeers added in v1.0.102

func (m *MessengerStub) ConnectedPeers() []core.PeerID

ConnectedPeers -

func (*MessengerStub) ConnectedPeersOnTopic added in v1.0.102

func (m *MessengerStub) ConnectedPeersOnTopic(_ string) []core.PeerID

ConnectedPeersOnTopic -

func (*MessengerStub) CreateTopic added in v1.0.102

func (m *MessengerStub) CreateTopic(_ string, _ bool) error

CreateTopic -

func (*MessengerStub) HasTopic added in v1.0.102

func (m *MessengerStub) HasTopic(_ string) bool

HasTopic -

func (*MessengerStub) ID added in v1.1.1

func (m *MessengerStub) ID() core.PeerID

ID -

func (*MessengerStub) IsInterfaceNil added in v1.0.102

func (m *MessengerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MessengerStub) RegisterMessageProcessor added in v1.0.102

func (m *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error

RegisterMessageProcessor -

func (*MessengerStub) SendToConnectedPeer added in v1.0.102

func (m *MessengerStub) SendToConnectedPeer(_ string, _ []byte, _ core.PeerID) error

SendToConnectedPeer -

func (*MessengerStub) UnjoinAllTopics added in v1.0.132

func (m *MessengerStub) UnjoinAllTopics() error

UnjoinAllTopics -

func (*MessengerStub) UnregisterAllMessageProcessors added in v1.0.102

func (m *MessengerStub) UnregisterAllMessageProcessors() error

UnregisterAllMessageProcessors -

func (*MessengerStub) UnregisterMessageProcessor added in v1.0.102

func (m *MessengerStub) UnregisterMessageProcessor(_ string) error

UnregisterMessageProcessor -

type MetaBlockInterceptorProcessorStub added in v1.0.116

type MetaBlockInterceptorProcessorStub struct {
	GetEpochStartMetaBlockCalled func() (*block.MetaBlock, error)
}

MetaBlockInterceptorProcessorStub -

func (*MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock added in v1.0.116

func (m *MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock(_ context.Context) (*block.MetaBlock, error)

GetEpochStartMetaBlock -

func (*MetaBlockInterceptorProcessorStub) IsInterfaceNil added in v1.0.116

func (m *MetaBlockInterceptorProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*MetaBlockInterceptorProcessorStub) RegisterHandler added in v1.0.133

func (m *MetaBlockInterceptorProcessorStub) RegisterHandler(_ func(topic string, hash []byte, data interface{}))

RegisterHandler -

func (*MetaBlockInterceptorProcessorStub) Save added in v1.0.116

Save -

func (*MetaBlockInterceptorProcessorStub) SignalEndOfProcessing added in v1.0.116

func (m *MetaBlockInterceptorProcessorStub) SignalEndOfProcessing(_ []process.InterceptedData)

SignalEndOfProcessing -

func (*MetaBlockInterceptorProcessorStub) Validate added in v1.0.116

Validate -

type NodeInfoMock added in v1.0.104

type NodeInfoMock struct {
	// contains filtered or unexported fields
}

NodeInfoMock -

func NewNodeInfo added in v1.0.104

func NewNodeInfo(address []byte, pubKey []byte, shardId uint32, initialRating uint32) *NodeInfoMock

NewNodeInfo -

func (*NodeInfoMock) AddressBytes added in v1.0.115

func (n *NodeInfoMock) AddressBytes() []byte

AddressBytes -

func (*NodeInfoMock) AssignedShard added in v1.0.104

func (n *NodeInfoMock) AssignedShard() uint32

AssignedShard -

func (*NodeInfoMock) GetInitialRating added in v1.0.149

func (n *NodeInfoMock) GetInitialRating() uint32

GetInitialRating -

func (*NodeInfoMock) IsInterfaceNil added in v1.0.104

func (n *NodeInfoMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeInfoMock) PubKeyBytes added in v1.0.115

func (n *NodeInfoMock) PubKeyBytes() []byte

PubKeyBytes -

type NodeShufflerMock added in v1.0.104

type NodeShufflerMock struct {
}

NodeShufflerMock -

func (*NodeShufflerMock) IsInterfaceNil added in v1.0.104

func (nsm *NodeShufflerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeShufflerMock) UpdateNodeLists added in v1.0.104

func (nsm *NodeShufflerMock) UpdateNodeLists(args sharding.ArgsUpdateNodes) (*sharding.ResUpdateNodes, error)

UpdateNodeLists -

func (*NodeShufflerMock) UpdateParams added in v1.0.104

func (nsm *NodeShufflerMock) UpdateParams(
	_ uint32,
	_ uint32,
	_ float32,
	_ bool,
)

UpdateParams -

type NodesCoordinatorStub added in v1.0.102

type NodesCoordinatorStub struct {
	ComputeValidatorsGroupCalled        func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]sharding.Validator, error)
	GetValidatorsPublicKeysCalled       func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorsRewardsAddressesCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorWithPublicKeyCalled     func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error)
	GetAllValidatorsPublicKeysCalled    func() (map[uint32][][]byte, error)
	ConsensusGroupSizeCalled            func(shardID uint32) int
}

NodesCoordinatorStub -

func (*NodesCoordinatorStub) ComputeAdditionalLeaving added in v1.0.115

func (ncm *NodesCoordinatorStub) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)

ComputeAdditionalLeaving -

func (*NodesCoordinatorStub) ComputeConsensusGroup added in v1.0.102

func (ncm *NodesCoordinatorStub) ComputeConsensusGroup(
	randomness []byte,
	round uint64,
	shardId uint32,
	epoch uint32,
) (validatorsGroup []sharding.Validator, err error)

ComputeConsensusGroup -

func (*NodesCoordinatorStub) ConsensusGroupSize added in v1.0.102

func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int

ConsensusGroupSize -

func (*NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllEligibleValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllLeavingValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllWaitingValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetChance added in v1.0.102

func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32

GetChance -

func (*NodesCoordinatorStub) GetConsensusValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetConsensusValidatorsPublicKeys(
	randomness []byte,
	round uint64,
	shardId uint32,
	epoch uint32,
) ([]string, error)

GetConsensusValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetConsensusWhitelistedNodes added in v1.0.102

func (ncm *NodesCoordinatorStub) GetConsensusWhitelistedNodes(
	_ uint32,
) (map[string]struct{}, error)

GetConsensusWhitelistedNodes return the whitelisted nodes allowed to send consensus messages, for each of the shards

func (*NodesCoordinatorStub) GetNumTotalEligible added in v1.0.102

func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64

GetNumTotalEligible -

func (*NodesCoordinatorStub) GetOwnPublicKey added in v1.0.102

func (ncm *NodesCoordinatorStub) GetOwnPublicKey() []byte

GetOwnPublicKey -

func (*NodesCoordinatorStub) GetSavedStateKey added in v1.0.102

func (ncm *NodesCoordinatorStub) GetSavedStateKey() []byte

GetSavedStateKey -

func (*NodesCoordinatorStub) GetSelectedPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)

GetSelectedPublicKeys -

func (*NodesCoordinatorStub) GetValidatorWithPublicKey added in v1.0.102

func (ncm *NodesCoordinatorStub) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)

GetValidatorWithPublicKey -

func (*NodesCoordinatorStub) GetValidatorsIndexes added in v1.0.102

func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)

GetValidatorsIndexes -

func (*NodesCoordinatorStub) IsInterfaceNil added in v1.0.102

func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*NodesCoordinatorStub) LoadState added in v1.0.102

func (ncm *NodesCoordinatorStub) LoadState(_ []byte) error

LoadState -

func (*NodesCoordinatorStub) SetConfig added in v1.0.102

SetConfig -

func (*NodesCoordinatorStub) SetNodesPerShards added in v1.0.102

func (ncm *NodesCoordinatorStub) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, _ []sharding.Validator, _ uint32) error

SetNodesPerShards -

func (*NodesCoordinatorStub) ShardIdForEpoch added in v1.0.102

func (ncm *NodesCoordinatorStub) ShardIdForEpoch(_ uint32) (uint32, error)

ShardIdForEpoch returns the nodesCoordinator configured ShardId for specified epoch if epoch configuration exists, otherwise error

func (*NodesCoordinatorStub) ShuffleOutForEpoch added in v1.0.111

func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)

ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler

func (*NodesCoordinatorStub) ValidatorsWeights added in v1.0.102

func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)

ValidatorsWeights -

type NodesSetupStub added in v1.0.104

type NodesSetupStub struct {
	InitialNodesInfoForShardCalled       func(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
	InitialNodesInfoCalled               func() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
	GetStartTimeCalled                   func() int64
	GetRoundDurationCalled               func() uint64
	GetChainIdCalled                     func() string
	GetMinTransactionVersionCalled       func() uint32
	GetShardConsensusGroupSizeCalled     func() uint32
	GetMetaConsensusGroupSizeCalled      func() uint32
	NumberOfShardsCalled                 func() uint32
	MinNumberOfNodesCalled               func() uint32
	MinNumberOfNodesWithHysteresisCalled func() uint32
}

NodesSetupStub -

func (*NodesSetupStub) GetChainId added in v1.0.104

func (n *NodesSetupStub) GetChainId() string

GetChainId -

func (*NodesSetupStub) GetMetaConsensusGroupSize added in v1.0.104

func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32

GetMetaConsensusGroupSize -

func (*NodesSetupStub) GetMinTransactionVersion added in v1.0.137

func (n *NodesSetupStub) GetMinTransactionVersion() uint32

GetMinTransactionVersion -

func (*NodesSetupStub) GetRoundDuration added in v1.0.104

func (n *NodesSetupStub) GetRoundDuration() uint64

GetRoundDuration -

func (*NodesSetupStub) GetShardConsensusGroupSize added in v1.0.104

func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32

GetShardConsensusGroupSize -

func (*NodesSetupStub) GetStartTime added in v1.0.104

func (n *NodesSetupStub) GetStartTime() int64

GetStartTime -

func (*NodesSetupStub) InitialNodesInfo added in v1.0.104

InitialNodesInfo -

func (*NodesSetupStub) InitialNodesInfoForShard added in v1.0.104

func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)

InitialNodesInfoForShard -

func (*NodesSetupStub) IsInterfaceNil added in v1.0.104

func (n *NodesSetupStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesSetupStub) MinNumberOfNodes added in v1.0.110

func (n *NodesSetupStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*NodesSetupStub) MinNumberOfNodesWithHysteresis added in v1.1.3

func (n *NodesSetupStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

func (*NodesSetupStub) NumberOfShards added in v1.0.104

func (n *NodesSetupStub) NumberOfShards() uint32

NumberOfShards -

type PathManagerStub added in v1.0.104

type PathManagerStub struct {
	PathForEpochCalled  func(shardId string, epoch uint32, identifier string) string
	PathForStaticCalled func(shardId string, identifier string) string
}

PathManagerStub -

func (*PathManagerStub) IsInterfaceNil added in v1.0.104

func (p *PathManagerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PathManagerStub) PathForEpoch added in v1.0.104

func (p *PathManagerStub) PathForEpoch(shardId string, epoch uint32, identifier string) string

PathForEpoch -

func (*PathManagerStub) PathForStatic added in v1.0.104

func (p *PathManagerStub) PathForStatic(shardId string, identifier string) string

PathForStatic -

type PendingMiniBlockSyncHandlerStub added in v1.0.104

type PendingMiniBlockSyncHandlerStub struct {
	SyncPendingMiniBlocksCalled func(miniBlockHeaders []block.MiniBlockHeader, ctx context.Context) error
	GetMiniBlocksCalled         func() (map[string]*block.MiniBlock, error)
}

PendingMiniBlockSyncHandlerStub -

func (*PendingMiniBlockSyncHandlerStub) ClearFields added in v1.0.104

func (pm *PendingMiniBlockSyncHandlerStub) ClearFields()

ClearFields --

func (*PendingMiniBlockSyncHandlerStub) GetMiniBlocks added in v1.0.104

func (pm *PendingMiniBlockSyncHandlerStub) GetMiniBlocks() (map[string]*block.MiniBlock, error)

GetMiniBlocks -

func (*PendingMiniBlockSyncHandlerStub) IsInterfaceNil added in v1.0.104

func (pm *PendingMiniBlockSyncHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PendingMiniBlockSyncHandlerStub) SyncPendingMiniBlocks added in v1.0.104

func (pm *PendingMiniBlockSyncHandlerStub) SyncPendingMiniBlocks(miniBlockHeaders []block.MiniBlockHeader, ctx context.Context) error

SyncPendingMiniBlocks -

type PrivateKeyMock added in v1.0.104

type PrivateKeyMock struct {
}

PrivateKeyMock -

func (*PrivateKeyMock) GeneratePublic added in v1.0.104

func (sk *PrivateKeyMock) GeneratePublic() crypto.PublicKey

GeneratePublic -

func (*PrivateKeyMock) IsInterfaceNil added in v1.0.104

func (sk *PrivateKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyMock) Scalar added in v1.0.104

func (sk *PrivateKeyMock) Scalar() crypto.Scalar

Scalar -

func (*PrivateKeyMock) Suite added in v1.0.104

func (sk *PrivateKeyMock) Suite() crypto.Suite

Suite -

func (*PrivateKeyMock) ToByteArray added in v1.0.104

func (sk *PrivateKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

type PrivateKeyStub added in v1.0.104

type PrivateKeyStub struct {
	ToByteArrayStub    func() ([]byte, error)
	GeneratePublicStub func() crypto.PublicKey
	ScalarStub         func() crypto.Scalar
	SuiteStub          func() crypto.Suite
}

PrivateKeyStub provides stubs for a PrivateKey implementation

func (*PrivateKeyStub) GeneratePublic added in v1.0.104

func (privKey *PrivateKeyStub) GeneratePublic() crypto.PublicKey

GeneratePublic builds a public key for the current private key

func (*PrivateKeyStub) IsInterfaceNil added in v1.0.104

func (privKey *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar added in v1.0.104

func (privKey *PrivateKeyStub) Scalar() crypto.Scalar

Scalar returns the Scalar corresponding to this Private Key

func (*PrivateKeyStub) Suite added in v1.0.104

func (privKey *PrivateKeyStub) Suite() crypto.Suite

Suite returns the Suite (curve data) used for this private key

func (*PrivateKeyStub) ToByteArray added in v1.0.104

func (privKey *PrivateKeyStub) ToByteArray() ([]byte, error)

ToByteArray returns the byte array representation of the private key

type PubkeyConverterMock added in v1.0.104

type PubkeyConverterMock struct {
	// contains filtered or unexported fields
}

PubkeyConverterMock -

func NewPubkeyConverterMock added in v1.0.104

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode added in v1.0.104

func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterMock) Encode added in v1.0.104

func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterMock) IsInterfaceNil added in v1.0.104

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len added in v1.0.104

func (pcm *PubkeyConverterMock) Len() int

Len -

type PublicKeyMock added in v1.0.104

type PublicKeyMock struct {
}

PublicKeyMock -

func (*PublicKeyMock) IsInterfaceNil added in v1.0.104

func (sspk *PublicKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyMock) Point added in v1.0.104

func (sspk *PublicKeyMock) Point() crypto.Point

Point -

func (*PublicKeyMock) Suite added in v1.0.104

func (sspk *PublicKeyMock) Suite() crypto.Suite

Suite -

func (*PublicKeyMock) ToByteArray added in v1.0.104

func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

type PublicKeyStub added in v1.0.104

type PublicKeyStub struct {
	ToByteArrayStub func() ([]byte, error)
	PointStub       func() crypto.Point
	SuiteStub       func() crypto.Suite
}

PublicKeyStub provides stubs for a PublicKey implementation

func (*PublicKeyStub) IsInterfaceNil added in v1.0.104

func (pubKey *PublicKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyStub) Point added in v1.0.104

func (pubKey *PublicKeyStub) Point() crypto.Point

Point returns the Point corresponding to this Public Key

func (*PublicKeyStub) Suite added in v1.0.104

func (pubKey *PublicKeyStub) Suite() crypto.Suite

Suite returns the Suite (curve data) used for this private key

func (*PublicKeyStub) ToByteArray added in v1.0.104

func (pubKey *PublicKeyStub) ToByteArray() ([]byte, error)

ToByteArray returns the byte array representation of the public key

type RaterStub added in v1.0.104

type RaterStub struct {
	GetRatingCalled                func(string) uint32
	GetStartRatingCalled           func() uint32
	GetSignedBlocksThresholdCalled func() float32
	ComputeIncreaseProposerCalled  func(shardId uint32, rating uint32) uint32
	ComputeDecreaseProposerCalled  func(shardId uint32, rating uint32, consecutiveMissedBlocks uint32) uint32
	RevertIncreaseProposerCalled   func(shardId uint32, rating uint32, nrReverts uint32) uint32
	ComputeIncreaseValidatorCalled func(shardId uint32, rating uint32) uint32
	ComputeDecreaseValidatorCalled func(shardId uint32, rating uint32) uint32
	GetChanceCalled                func(rating uint32) uint32
}

RaterStub -

func (*RaterStub) ComputeDecreaseProposer added in v1.0.104

func (rm *RaterStub) ComputeDecreaseProposer(shardId uint32, currentRating uint32, consecutiveMisses uint32) uint32

ComputeDecreaseProposer -

func (*RaterStub) ComputeDecreaseValidator added in v1.0.104

func (rm *RaterStub) ComputeDecreaseValidator(shardId uint32, currentRating uint32) uint32

ComputeDecreaseValidator -

func (*RaterStub) ComputeIncreaseProposer added in v1.0.104

func (rm *RaterStub) ComputeIncreaseProposer(shardId uint32, currentRating uint32) uint32

ComputeIncreaseProposer -

func (*RaterStub) ComputeIncreaseValidator added in v1.0.104

func (rm *RaterStub) ComputeIncreaseValidator(shardId uint32, currentRating uint32) uint32

ComputeIncreaseValidator -

func (*RaterStub) GetChance added in v1.0.104

func (rm *RaterStub) GetChance(rating uint32) uint32

GetChance -

func (*RaterStub) GetRating added in v1.0.104

func (rm *RaterStub) GetRating(pk string) uint32

GetRating -

func (*RaterStub) GetSignedBlocksThreshold added in v1.0.104

func (rm *RaterStub) GetSignedBlocksThreshold() float32

GetSignedBlocksThreshold -

func (*RaterStub) GetStartRating added in v1.0.104

func (rm *RaterStub) GetStartRating() uint32

GetStartRating -

func (*RaterStub) IsInterfaceNil added in v1.0.104

func (rm *RaterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RaterStub) RevertIncreaseValidator added in v1.0.104

func (rm *RaterStub) RevertIncreaseValidator(shardId uint32, currentRating uint32, nrReverts uint32) uint32

RevertIncreaseValidator -

type RequestHandlerStub

type RequestHandlerStub struct {
	RequestShardHeaderCalled           func(shardId uint32, hash []byte)
	RequestMetaHeaderCalled            func(hash []byte)
	RequestMetaHeaderByNonceCalled     func(nonce uint64)
	RequestShardHeaderByNonceCalled    func(shardId uint32, nonce uint64)
	RequestTransactionHandlerCalled    func(destShardID uint32, txHashes [][]byte)
	RequestScrHandlerCalled            func(destShardID uint32, txHashes [][]byte)
	RequestRewardTxHandlerCalled       func(destShardID uint32, txHashes [][]byte)
	RequestMiniBlocksHandlerCalled     func(destShardID uint32, miniblockHashes [][]byte)
	RequestStartOfEpochMetaBlockCalled func(epoch uint32)
	SetNumPeersToQueryCalled           func(key string, intra int, cross int) error
	GetNumPeersToQueryCalled           func(key string) (int, int, error)
}

RequestHandlerStub -

func (*RequestHandlerStub) GetNumPeersToQuery added in v1.0.102

func (rhs *RequestHandlerStub) GetNumPeersToQuery(key string) (int, int, error)

GetNumPeersToQuery -

func (*RequestHandlerStub) IsInterfaceNil

func (rhs *RequestHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RequestHandlerStub) RequestInterval added in v1.0.102

func (rhs *RequestHandlerStub) RequestInterval() time.Duration

RequestInterval -

func (*RequestHandlerStub) RequestMetaHeader

func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)

RequestMetaHeader -

func (*RequestHandlerStub) RequestMetaHeaderByNonce

func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)

RequestMetaHeaderByNonce -

func (*RequestHandlerStub) RequestMiniBlock added in v1.0.67

func (rhs *RequestHandlerStub) RequestMiniBlock(_ uint32, _ []byte)

RequestMiniBlock -

func (*RequestHandlerStub) RequestMiniBlocks

func (rhs *RequestHandlerStub) RequestMiniBlocks(shardId uint32, miniblockHashes [][]byte)

RequestMiniBlocks -

func (*RequestHandlerStub) RequestRewardTransactions

func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)

RequestRewardTransactions -

func (*RequestHandlerStub) RequestShardHeader

func (rhs *RequestHandlerStub) RequestShardHeader(shardId uint32, hash []byte)

RequestShardHeader -

func (*RequestHandlerStub) RequestShardHeaderByNonce

func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardId uint32, nonce uint64)

RequestShardHeaderByNonce -

func (*RequestHandlerStub) RequestStartOfEpochMetaBlock

func (rhs *RequestHandlerStub) RequestStartOfEpochMetaBlock(epoch uint32)

RequestStartOfEpochMetaBlock -

func (*RequestHandlerStub) RequestTransaction

func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)

RequestTransaction -

func (*RequestHandlerStub) RequestTrieNodes added in v1.0.102

func (rhs *RequestHandlerStub) RequestTrieNodes(_ uint32, _ [][]byte, _ string)

RequestTrieNodes -

func (*RequestHandlerStub) RequestUnsignedTransactions

func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)

RequestUnsignedTransactions -

func (*RequestHandlerStub) SetEpoch added in v1.0.102

func (rhs *RequestHandlerStub) SetEpoch(_ uint32)

SetEpoch -

func (*RequestHandlerStub) SetNumPeersToQuery added in v1.0.102

func (rhs *RequestHandlerStub) SetNumPeersToQuery(key string, intra int, cross int) error

SetNumPeersToQuery -

type RewardsCreatorStub added in v1.1.15

type RewardsCreatorStub struct {
	CreateRewardsMiniBlocksCalled func(
		metaBlock *block.MetaBlock, validatorsInfo map[uint32][]*state.ValidatorInfo, computedEconomics *block.Economics,
	) (block.MiniBlockSlice, error)
	VerifyRewardsMiniBlocksCalled func(
		metaBlock *block.MetaBlock, validatorsInfo map[uint32][]*state.ValidatorInfo, computedEconomics *block.Economics,
	) error
	GetProtocolSustainabilityRewardsCalled func() *big.Int
	GetLocalTxCacheCalled                  func() epochStart.TransactionCacher
	CreateMarshalizedDataCalled            func(body *block.Body) map[string][][]byte
	GetRewardsTxsCalled                    func(body *block.Body) map[string]data.TransactionHandler
	SaveTxBlockToStorageCalled             func(metaBlock *block.MetaBlock, body *block.Body)
	DeleteTxsFromStorageCalled             func(metaBlock *block.MetaBlock, body *block.Body)
	RemoveBlockDataFromPoolsCalled         func(metaBlock *block.MetaBlock, body *block.Body)
}

RewardsCreatorStub -

func (*RewardsCreatorStub) CreateMarshalizedData added in v1.1.15

func (rcs *RewardsCreatorStub) CreateMarshalizedData(body *block.Body) map[string][][]byte

CreateMarshalizedData -

func (*RewardsCreatorStub) CreateRewardsMiniBlocks added in v1.1.15

func (rcs *RewardsCreatorStub) CreateRewardsMiniBlocks(
	metaBlock *block.MetaBlock,
	validatorsInfo map[uint32][]*state.ValidatorInfo,
	computedEconomics *block.Economics,
) (block.MiniBlockSlice, error)

CreateRewardsMiniBlocks -

func (*RewardsCreatorStub) DeleteTxsFromStorage added in v1.1.15

func (rcs *RewardsCreatorStub) DeleteTxsFromStorage(metaBlock *block.MetaBlock, body *block.Body)

DeleteTxsFromStorage -

func (*RewardsCreatorStub) GetLocalTxCache added in v1.1.15

func (rcs *RewardsCreatorStub) GetLocalTxCache() epochStart.TransactionCacher

GetLocalTxCache -

func (*RewardsCreatorStub) GetProtocolSustainabilityRewards added in v1.1.15

func (rcs *RewardsCreatorStub) GetProtocolSustainabilityRewards() *big.Int

GetProtocolSustainabilityRewards -

func (*RewardsCreatorStub) GetRewardsTxs added in v1.1.15

func (rcs *RewardsCreatorStub) GetRewardsTxs(body *block.Body) map[string]data.TransactionHandler

GetRewardsTxs -

func (*RewardsCreatorStub) IsInterfaceNil added in v1.1.15

func (rcs *RewardsCreatorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RewardsCreatorStub) RemoveBlockDataFromPools added in v1.1.15

func (rcs *RewardsCreatorStub) RemoveBlockDataFromPools(metaBlock *block.MetaBlock, body *block.Body)

RemoveBlockDataFromPools -

func (*RewardsCreatorStub) SaveTxBlockToStorage added in v1.1.15

func (rcs *RewardsCreatorStub) SaveTxBlockToStorage(metaBlock *block.MetaBlock, body *block.Body)

SaveTxBlockToStorage -

func (*RewardsCreatorStub) VerifyRewardsMiniBlocks added in v1.1.15

func (rcs *RewardsCreatorStub) VerifyRewardsMiniBlocks(
	metaBlock *block.MetaBlock,
	validatorsInfo map[uint32][]*state.ValidatorInfo,
	computedEconomics *block.Economics,
) error

VerifyRewardsMiniBlocks -

type RewardsHandlerStub added in v1.0.102

type RewardsHandlerStub struct {
	LeaderPercentageCalled                 func() float64
	ProtocolSustainabilityPercentageCalled func() float64
	ProtocolSustainabilityAddressCalled    func() string
	MinInflationRateCalled                 func() float64
	MaxInflationRateCalled                 func(year uint32) float64
	RewardsTopUpGradientPointCalled        func() *big.Int
	RewardsTopUpFactorCalled               func() float64
}

RewardsHandlerStub -

func (*RewardsHandlerStub) IsInterfaceNil added in v1.0.102

func (r *RewardsHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RewardsHandlerStub) LeaderPercentage added in v1.0.102

func (r *RewardsHandlerStub) LeaderPercentage() float64

LeaderPercentage -

func (*RewardsHandlerStub) MaxInflationRate added in v1.0.102

func (r *RewardsHandlerStub) MaxInflationRate(year uint32) float64

MaxInflationRate -

func (*RewardsHandlerStub) MinInflationRate added in v1.0.102

func (r *RewardsHandlerStub) MinInflationRate() float64

MinInflationRate -

func (*RewardsHandlerStub) ProtocolSustainabilityAddress added in v1.0.147

func (r *RewardsHandlerStub) ProtocolSustainabilityAddress() string

ProtocolSustainabilityAddress will return the protocol sustainability address

func (*RewardsHandlerStub) ProtocolSustainabilityPercentage added in v1.0.147

func (r *RewardsHandlerStub) ProtocolSustainabilityPercentage() float64

ProtocolSustainabilityPercentage will return the protocol sustainability percentage value

func (*RewardsHandlerStub) RewardsTopUpFactor added in v1.1.15

func (r *RewardsHandlerStub) RewardsTopUpFactor() float64

RewardsTopUpFactor -

func (*RewardsHandlerStub) RewardsTopUpGradientPoint added in v1.1.15

func (r *RewardsHandlerStub) RewardsTopUpGradientPoint() *big.Int

RewardsTopUpGradientPoint -

type RoundTimeDurationHandler added in v1.0.102

type RoundTimeDurationHandler struct {
	TimeDurationCalled func() time.Duration
}

RoundTimeDurationHandler -

func (*RoundTimeDurationHandler) IsInterfaceNil added in v1.0.102

func (r *RoundTimeDurationHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*RoundTimeDurationHandler) TimeDuration added in v1.0.102

func (r *RoundTimeDurationHandler) TimeDuration() time.Duration

TimeDuration -

type RounderStub

type RounderStub struct {
	RoundIndex int64

	IndexCalled         func() int64
	TimeDurationCalled  func() time.Duration
	TimeStampCalled     func() time.Time
	UpdateRoundCalled   func(time.Time, time.Time)
	RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration
}

RounderStub -

func (*RounderStub) Index

func (rndm *RounderStub) Index() int64

Index -

func (*RounderStub) IsInterfaceNil

func (rndm *RounderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RounderStub) RemainingTime

func (rndm *RounderStub) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration

RemainingTime -

func (*RounderStub) TimeDuration

func (rndm *RounderStub) TimeDuration() time.Duration

TimeDuration -

func (*RounderStub) TimeStamp

func (rndm *RounderStub) TimeStamp() time.Time

TimeStamp -

func (*RounderStub) UpdateRound

func (rndm *RounderStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)

UpdateRound -

type ShardCoordinatorStub added in v1.0.104

type ShardCoordinatorStub struct {
	NumberOfShardsCalled          func() uint32
	ComputeIdCalled               func(address []byte) uint32
	SelfIdCalled                  func() uint32
	SameShardCalled               func(firstAddress, secondAddress []byte) bool
	CommunicationIdentifierCalled func(destShardID uint32) string
}

ShardCoordinatorStub -

func (*ShardCoordinatorStub) CommunicationIdentifier added in v1.0.104

func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorStub) ComputeId added in v1.0.104

func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32

ComputeId -

func (*ShardCoordinatorStub) IsInterfaceNil added in v1.0.104

func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardCoordinatorStub) NumberOfShards added in v1.0.104

func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorStub) SameShard added in v1.0.104

func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool

SameShard -

func (*ShardCoordinatorStub) SelfId added in v1.0.104

func (coordinator *ShardCoordinatorStub) SelfId() uint32

SelfId -

type ShardIdHasMapStub

type ShardIdHasMapStub struct {
	LoadCalled   func(shardId uint32) ([]byte, bool)
	StoreCalled  func(shardId uint32, hash []byte)
	RangeCalled  func(f func(shardId uint32, hash []byte) bool)
	DeleteCalled func(shardId uint32)
}

ShardIdHasMapStub -

func (*ShardIdHasMapStub) Delete

func (sihsm *ShardIdHasMapStub) Delete(shardId uint32)

Delete -

func (*ShardIdHasMapStub) IsInterfaceNil

func (sihsm *ShardIdHasMapStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardIdHasMapStub) Load

func (sihsm *ShardIdHasMapStub) Load(shardId uint32) ([]byte, bool)

Load -

func (*ShardIdHasMapStub) Range

func (sihsm *ShardIdHasMapStub) Range(f func(shardId uint32, hash []byte) bool)

Range -

func (*ShardIdHasMapStub) Store

func (sihsm *ShardIdHasMapStub) Store(shardId uint32, hash []byte)

Store -

type SignerStub added in v1.0.104

type SignerStub struct {
	SignCalled   func(private crypto.PrivateKey, msg []byte) ([]byte, error)
	VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error
}

SignerStub -

func (*SignerStub) IsInterfaceNil added in v1.0.104

func (s *SignerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SignerStub) Sign added in v1.0.104

func (s *SignerStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)

Sign -

func (*SignerStub) Verify added in v1.0.104

func (s *SignerStub) Verify(public crypto.PublicKey, msg []byte, sig []byte) error

Verify -

type StakingDataProviderStub added in v1.1.15

type StakingDataProviderStub struct {
	CleanCalled                           func()
	PrepareStakingDataCalled              func(keys map[uint32][][]byte) error
	GetTotalStakeEligibleNodesCalled      func() *big.Int
	GetTotalTopUpStakeEligibleNodesCalled func() *big.Int
	GetNodeStakedTopUpCalled              func(blsKey []byte) (*big.Int, error)
	FillValidatorInfoCalled               func(blsKey []byte) error
	ComputeUnQualifiedNodesCalled         func(validatorInfos map[uint32][]*state.ValidatorInfo) ([][]byte, [][]byte, error)
}

StakingDataProviderStub -

func (*StakingDataProviderStub) Clean added in v1.1.15

func (sdps *StakingDataProviderStub) Clean()

Clean -

func (*StakingDataProviderStub) ComputeUnQualifiedNodes added in v1.1.15

func (sdps *StakingDataProviderStub) ComputeUnQualifiedNodes(validatorInfos map[uint32][]*state.ValidatorInfo) ([][]byte, [][]byte, error)

ComputeUnQualifiedNodes -

func (*StakingDataProviderStub) FillValidatorInfo added in v1.1.15

func (sdps *StakingDataProviderStub) FillValidatorInfo(blsKey []byte) error

FillValidatorInfo -

func (*StakingDataProviderStub) GetNodeStakedTopUp added in v1.1.15

func (sdps *StakingDataProviderStub) GetNodeStakedTopUp(blsKey []byte) (*big.Int, error)

GetNodeStakedTopUp -

func (*StakingDataProviderStub) GetTotalStakeEligibleNodes added in v1.1.15

func (sdps *StakingDataProviderStub) GetTotalStakeEligibleNodes() *big.Int

GetTotalStakeEligibleNodes -

func (*StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes added in v1.1.15

func (sdps *StakingDataProviderStub) GetTotalTopUpStakeEligibleNodes() *big.Int

GetTotalTopUpStakeEligibleNodes -

func (*StakingDataProviderStub) IsInterfaceNil added in v1.1.15

func (sdps *StakingDataProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StakingDataProviderStub) PrepareStakingDataForRewards added in v1.1.15

func (sdps *StakingDataProviderStub) PrepareStakingDataForRewards(keys map[uint32][][]byte) error

PrepareStakingDataForRewards -

type StorageManagerStub added in v1.0.104

type StorageManagerStub struct {
	DatabaseCalled                    func() data.DBWriteCacher
	TakeSnapshotCalled                func([]byte)
	SetCheckpointCalled               func([]byte)
	PruneCalled                       func([]byte)
	CancelPruneCalled                 func([]byte)
	MarkForEvictionCalled             func([]byte, data.ModifiedHashes) error
	GetDbThatContainsHashCalled       func([]byte) data.DBWriteCacher
	GetSnapshotThatContainsHashCalled func(rootHash []byte) data.SnapshotDbHandler
	IsPruningEnabledCalled            func() bool
	EnterSnapshotModeCalled           func()
	ExitSnapshotModeCalled            func()
	IsInterfaceNilCalled              func() bool
}

StorageManagerStub --

func (*StorageManagerStub) CancelPrune added in v1.0.104

func (sms *StorageManagerStub) CancelPrune([]byte, data.TriePruningIdentifier)

CancelPrune --

func (*StorageManagerStub) Database added in v1.0.104

func (sms *StorageManagerStub) Database() data.DBWriteCacher

Database --

func (*StorageManagerStub) EnterSnapshotMode added in v1.0.104

func (sms *StorageManagerStub) EnterSnapshotMode()

EnterSnapshotMode --

func (*StorageManagerStub) ExitSnapshotMode added in v1.0.104

func (sms *StorageManagerStub) ExitSnapshotMode()

ExitSnapshotMode --

func (*StorageManagerStub) GetSnapshotDbBatchDelay added in v1.0.149

func (sms *StorageManagerStub) GetSnapshotDbBatchDelay() int

GetSnapshotDbBatchDelay -

func (*StorageManagerStub) GetSnapshotThatContainsHash added in v1.0.129

func (sms *StorageManagerStub) GetSnapshotThatContainsHash(d []byte) data.SnapshotDbHandler

GetSnapshotThatContainsHash --

func (*StorageManagerStub) IsInterfaceNil added in v1.0.104

func (sms *StorageManagerStub) IsInterfaceNil() bool

IsInterfaceNil --

func (*StorageManagerStub) IsPruningEnabled added in v1.0.104

func (sms *StorageManagerStub) IsPruningEnabled() bool

IsPruningEnabled --

func (*StorageManagerStub) MarkForEviction added in v1.0.104

func (sms *StorageManagerStub) MarkForEviction(d []byte, m data.ModifiedHashes) error

MarkForEviction --

func (*StorageManagerStub) Prune added in v1.0.104

Prune --

func (*StorageManagerStub) SetCheckpoint added in v1.0.104

func (sms *StorageManagerStub) SetCheckpoint([]byte)

SetCheckpoint --

func (*StorageManagerStub) TakeSnapshot added in v1.0.104

func (sms *StorageManagerStub) TakeSnapshot([]byte)

TakeSnapshot --

type StorerMock

type StorerMock struct {
	// contains filtered or unexported fields
}

StorerMock -

func NewStorerMock

func NewStorerMock() *StorerMock

NewStorerMock -

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

ClearCache -

func (*StorerMock) Close

func (sm *StorerMock) Close() error

Close -

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

DestroyUnit -

func (*StorerMock) Get

func (sm *StorerMock) Get(key []byte) ([]byte, error)

Get -

func (*StorerMock) GetBulkFromEpoch added in v1.0.147

func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, _ uint32) (map[string][]byte, error)

GetBulkFromEpoch -

func (*StorerMock) GetFromEpoch

func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)

GetFromEpoch -

func (*StorerMock) Has

func (sm *StorerMock) Has(_ []byte) error

Has -

func (*StorerMock) HasInEpoch

func (sm *StorerMock) HasInEpoch(_ []byte, _ uint32) error

HasInEpoch -

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

func (sm *StorerMock) Put(key, data []byte) error

Put -

func (*StorerMock) PutInEpoch added in v1.1.1

func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error

PutInEpoch -

func (*StorerMock) RangeKeys added in v1.0.138

func (sm *StorerMock) RangeKeys(_ func(key []byte, val []byte) bool)

RangeKeys -

func (*StorerMock) Remove

func (sm *StorerMock) Remove(key []byte) error

Remove -

func (*StorerMock) SearchFirst

func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

type StorerStub

type StorerStub struct {
	PutCalled              func(key, data []byte) error
	PutInEpochCalled       func(key, data []byte, epoch uint32) error
	GetCalled              func(key []byte) ([]byte, error)
	GetFromEpochCalled     func(key []byte, epoch uint32) ([]byte, error)
	HasCalled              func(key []byte) error
	HasInEpochCalled       func(key []byte, epoch uint32) error
	SearchFirstCalled      func(key []byte) ([]byte, error)
	RemoveCalled           func(key []byte) error
	ClearCacheCalled       func()
	DestroyUnitCalled      func() error
	RangeKeysCalled        func(handler func(key []byte, val []byte) bool)
	GetBulkFromEpochCalled func(keys [][]byte, epoch uint32) (map[string][]byte, error)
}

StorerStub -

func (*StorerStub) ClearCache

func (ss *StorerStub) ClearCache()

ClearCache -

func (*StorerStub) Close

func (ss *StorerStub) Close() error

Close -

func (*StorerStub) DestroyUnit

func (ss *StorerStub) DestroyUnit() error

DestroyUnit -

func (*StorerStub) Get

func (ss *StorerStub) Get(key []byte) ([]byte, error)

Get -

func (*StorerStub) GetBulkFromEpoch added in v1.0.147

func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) (map[string][]byte, error)

GetBulkFromEpoch -

func (*StorerStub) GetFromEpoch

func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

GetFromEpoch -

func (*StorerStub) Has

func (ss *StorerStub) Has(key []byte) error

Has -

func (*StorerStub) HasInEpoch

func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error

HasInEpoch -

func (*StorerStub) IsInterfaceNil

func (ss *StorerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerStub) Put

func (ss *StorerStub) Put(key, data []byte) error

Put -

func (*StorerStub) PutInEpoch added in v1.1.1

func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error

PutInEpoch -

func (*StorerStub) RangeKeys added in v1.0.138

func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)

RangeKeys -

func (*StorerStub) Remove

func (ss *StorerStub) Remove(key []byte) error

Remove -

func (*StorerStub) SearchFirst

func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)

SearchFirst -

type SyncTimerStub

type SyncTimerStub struct {
	StartSyncingTimeCalled     func()
	ClockOffsetCalled          func() time.Duration
	FormattedCurrentTimeCalled func() string
	CurrentTimeCalled          func() time.Time
}

SyncTimerStub is a mock implementation of SyncTimer interface

func (*SyncTimerStub) ClockOffset

func (sts *SyncTimerStub) ClockOffset() time.Duration

ClockOffset is a mock implementation for ClockOffset

func (*SyncTimerStub) Close added in v1.0.116

func (sts *SyncTimerStub) Close() error

Close -

func (*SyncTimerStub) CurrentTime

func (sts *SyncTimerStub) CurrentTime() time.Time

CurrentTime is a mock implementation for CurrentTime

func (*SyncTimerStub) FormattedCurrentTime

func (sts *SyncTimerStub) FormattedCurrentTime() string

FormattedCurrentTime is a mock implementation for FormattedCurrentTime

func (*SyncTimerStub) IsInterfaceNil

func (sts *SyncTimerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SyncTimerStub) StartSyncingTime added in v1.0.116

func (sts *SyncTimerStub) StartSyncingTime()

StartSyncingTime is a mock implementation for StartSyncingTime

type TrieStub added in v1.0.104

type TrieStub struct {
	GetCalled                   func(key []byte) ([]byte, error)
	UpdateCalled                func(key, value []byte) error
	DeleteCalled                func(key []byte) error
	RootCalled                  func() ([]byte, error)
	CommitCalled                func() error
	RecreateCalled              func(root []byte) (data.Trie, error)
	CancelPruneCalled           func(rootHash []byte, identifier data.TriePruningIdentifier)
	PruneCalled                 func(rootHash []byte, identifier data.TriePruningIdentifier)
	ResetOldHashesCalled        func() [][]byte
	AppendToOldHashesCalled     func([][]byte)
	TakeSnapshotCalled          func(rootHash []byte)
	SetCheckpointCalled         func(rootHash []byte)
	GetSerializedNodesCalled    func([]byte, uint64) ([][]byte, uint64, error)
	DatabaseCalled              func() data.DBWriteCacher
	GetAllHashesCalled          func() ([][]byte, error)
	IsPruningEnabledCalled      func() bool
	ClosePersisterCalled        func() error
	GetAllLeavesOnChannelCalled func(rootHash []byte) (chan core.KeyValueHolder, error)
}

TrieStub -

func (*TrieStub) AppendToOldHashes added in v1.0.104

func (ts *TrieStub) AppendToOldHashes(hashes [][]byte)

AppendToOldHashes appends the given hashes to the trie's oldHashes variable

func (*TrieStub) CancelPrune added in v1.0.104

func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)

CancelPrune invalidates the hashes that correspond to the given root hash from the eviction waiting list

func (*TrieStub) ClosePersister added in v1.0.104

func (ts *TrieStub) ClosePersister() error

ClosePersister -

func (*TrieStub) Commit added in v1.0.104

func (ts *TrieStub) Commit() error

Commit -

func (*TrieStub) Database added in v1.0.104

func (ts *TrieStub) Database() data.DBWriteCacher

Database -

func (*TrieStub) Delete added in v1.0.104

func (ts *TrieStub) Delete(key []byte) error

Delete -

func (*TrieStub) EnterPruningBufferingMode added in v1.1.12

func (ts *TrieStub) EnterPruningBufferingMode()

EnterPruningBufferingMode -

func (*TrieStub) ExitPruningBufferingMode added in v1.1.12

func (ts *TrieStub) ExitPruningBufferingMode()

ExitPruningBufferingMode -

func (*TrieStub) Get added in v1.0.104

func (ts *TrieStub) Get(key []byte) ([]byte, error)

Get -

func (*TrieStub) GetAllHashes added in v1.0.137

func (ts *TrieStub) GetAllHashes() ([][]byte, error)

GetAllHashes -

func (*TrieStub) GetAllLeavesOnChannel added in v1.0.137

func (ts *TrieStub) GetAllLeavesOnChannel(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)

GetAllLeavesOnChannel -

func (*TrieStub) GetDirtyHashes added in v1.0.111

func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)

GetDirtyHashes -

func (*TrieStub) GetSerializedNodes added in v1.0.104

func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, uint64, error)

GetSerializedNodes -

func (*TrieStub) GetSnapshotDbBatchDelay added in v1.0.149

func (ts *TrieStub) GetSnapshotDbBatchDelay() int

GetSnapshotDbBatchDelay -

func (*TrieStub) IsInterfaceNil added in v1.0.104

func (ts *TrieStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TrieStub) IsPruningEnabled added in v1.0.104

func (ts *TrieStub) IsPruningEnabled() bool

IsPruningEnabled -

func (*TrieStub) Prune added in v1.0.104

func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier)

Prune removes from the database all the old hashes that correspond to the given root hash

func (*TrieStub) Recreate added in v1.0.104

func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)

Recreate -

func (*TrieStub) ResetOldHashes added in v1.0.104

func (ts *TrieStub) ResetOldHashes() [][]byte

ResetOldHashes resets the oldHashes and oldRoot variables and returns the old hashes

func (*TrieStub) Root added in v1.0.104

func (ts *TrieStub) Root() ([]byte, error)

Root -

func (*TrieStub) SetCheckpoint added in v1.0.104

func (ts *TrieStub) SetCheckpoint(rootHash []byte)

SetCheckpoint -

func (*TrieStub) SetNewHashes added in v1.0.111

func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)

SetNewHashes -

func (*TrieStub) String added in v1.0.104

func (ts *TrieStub) String() string

String -

func (*TrieStub) TakeSnapshot added in v1.0.104

func (ts *TrieStub) TakeSnapshot(rootHash []byte)

TakeSnapshot -

func (*TrieStub) Update added in v1.0.104

func (ts *TrieStub) Update(key, value []byte) error

Update -

type TriesHolderMock added in v1.0.104

type TriesHolderMock struct {
	PutCalled    func([]byte, data.Trie)
	RemoveCalled func([]byte, data.Trie)
	GetCalled    func([]byte) data.Trie
	GetAllCalled func() []data.Trie
	ResetCalled  func()
}

TriesHolderMock -

func (*TriesHolderMock) Get added in v1.0.104

func (thm *TriesHolderMock) Get(key []byte) data.Trie

Get -

func (*TriesHolderMock) GetAll added in v1.0.104

func (thm *TriesHolderMock) GetAll() []data.Trie

GetAll -

func (*TriesHolderMock) IsInterfaceNil added in v1.0.104

func (thm *TriesHolderMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TriesHolderMock) Put added in v1.0.104

func (thm *TriesHolderMock) Put(key []byte, trie data.Trie)

Put -

func (*TriesHolderMock) Replace added in v1.0.104

func (thm *TriesHolderMock) Replace(key []byte, trie data.Trie)

Replace -

func (*TriesHolderMock) Reset added in v1.0.104

func (thm *TriesHolderMock) Reset()

Reset -

type TxForCurrentBlockStub added in v1.1.15

type TxForCurrentBlockStub struct {
	CleanCalled func()
	GetTxCalled func(txHash []byte) (data.TransactionHandler, error)
	AddTxCalled func(txHash []byte, tx data.TransactionHandler)
}

TxForCurrentBlockStub -

func (*TxForCurrentBlockStub) AddTx added in v1.1.15

func (t *TxForCurrentBlockStub) AddTx(txHash []byte, tx data.TransactionHandler)

AddTx -

func (*TxForCurrentBlockStub) Clean added in v1.1.15

func (t *TxForCurrentBlockStub) Clean()

Clean -

func (*TxForCurrentBlockStub) GetTx added in v1.1.15

func (t *TxForCurrentBlockStub) GetTx(txHash []byte) (data.TransactionHandler, error)

GetTx -

func (*TxForCurrentBlockStub) IsInterfaceNil added in v1.1.15

func (t *TxForCurrentBlockStub) IsInterfaceNil() bool

IsInterfaceNil -

type Uint64ByteSliceConverterMock

type Uint64ByteSliceConverterMock struct {
	ToByteSliceCalled func(uint64) []byte
	ToUint64Called    func([]byte) (uint64, error)
}

Uint64ByteSliceConverterMock converts byte slice to/from uint64

func (*Uint64ByteSliceConverterMock) IsInterfaceNil

func (u *Uint64ByteSliceConverterMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Uint64ByteSliceConverterMock) ToByteSlice

func (u *Uint64ByteSliceConverterMock) ToByteSlice(p uint64) []byte

ToByteSlice is a mock implementation for Uint64ByteSliceConverter

func (*Uint64ByteSliceConverterMock) ToUint64

func (u *Uint64ByteSliceConverterMock) ToUint64(p []byte) (uint64, error)

ToUint64 is a mock implementation for Uint64ByteSliceConverter

type Uint64SyncMapCacherStub

type Uint64SyncMapCacherStub struct {
	ClearCalled           func()
	GetCalled             func(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
	MergeCalled           func(nonce uint64, src dataRetriever.ShardIdHashMap)
	RemoveCalled          func(nonce uint64, shardId uint32)
	RegisterHandlerCalled func(handler func(nonce uint64, shardId uint32, value []byte))
	HasCalled             func(nonce uint64, shardId uint32) bool
}

Uint64SyncMapCacherStub -

func (*Uint64SyncMapCacherStub) Clear

func (usmcs *Uint64SyncMapCacherStub) Clear()

Clear -

func (*Uint64SyncMapCacherStub) Get

Get -

func (*Uint64SyncMapCacherStub) Has

func (usmcs *Uint64SyncMapCacherStub) Has(nonce uint64, shardId uint32) bool

Has -

func (*Uint64SyncMapCacherStub) IsInterfaceNil

func (usmcs *Uint64SyncMapCacherStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Uint64SyncMapCacherStub) Merge

Merge -

func (*Uint64SyncMapCacherStub) RegisterHandler

func (usmcs *Uint64SyncMapCacherStub) RegisterHandler(handler func(nonce uint64, shardId uint32, value []byte))

RegisterHandler -

func (*Uint64SyncMapCacherStub) Remove

func (usmcs *Uint64SyncMapCacherStub) Remove(nonce uint64, shardId uint32)

Remove -

type UnitOpenerStub added in v1.0.111

type UnitOpenerStub struct {
}

UnitOpenerStub -

func (*UnitOpenerStub) GetMostRecentBootstrapStorageUnit added in v1.0.111

func (u *UnitOpenerStub) GetMostRecentBootstrapStorageUnit() (storage.Storer, error)

GetMostRecentBootstrapStorageUnit -

func (*UnitOpenerStub) IsInterfaceNil added in v1.0.111

func (u *UnitOpenerStub) IsInterfaceNil() bool

IsInterfaceNil -

type UserAccountStub added in v1.1.15

type UserAccountStub struct {
	AddToBalanceCalled    func(value *big.Int) error
	DataTrieTrackerCalled func() state.DataTrieTracker
}

UserAccountStub -

func (*UserAccountStub) AddToBalance added in v1.1.15

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

AddToBalance -

func (*UserAccountStub) AddToDeveloperReward added in v1.1.15

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

AddToDeveloperReward -

func (*UserAccountStub) AddressBytes added in v1.1.15

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

AddressBytes -

func (*UserAccountStub) ChangeOwnerAddress added in v1.1.15

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

ChangeOwnerAddress -

func (*UserAccountStub) ClaimDeveloperRewards added in v1.1.15

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

ClaimDeveloperRewards -

func (*UserAccountStub) DataTrie added in v1.1.15

func (u *UserAccountStub) DataTrie() data.Trie

DataTrie -

func (*UserAccountStub) DataTrieTracker added in v1.1.15

func (u *UserAccountStub) DataTrieTracker() state.DataTrieTracker

DataTrieTracker -

func (*UserAccountStub) GetBalance added in v1.1.15

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

GetBalance -

func (*UserAccountStub) GetCode added in v1.1.15

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

GetCode -

func (*UserAccountStub) GetCodeHash added in v1.1.15

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

GetCodeHash -

func (*UserAccountStub) GetCodeMetadata added in v1.1.15

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

GetCodeMetadata -

func (*UserAccountStub) GetDeveloperReward added in v1.1.15

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

GetDeveloperReward -

func (*UserAccountStub) GetNonce added in v1.1.15

func (u *UserAccountStub) GetNonce() uint64

GetNonce -

func (*UserAccountStub) GetOwnerAddress added in v1.1.15

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

GetOwnerAddress -

func (*UserAccountStub) GetRootHash added in v1.1.15

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

GetRootHash -

func (*UserAccountStub) GetUserName added in v1.1.15

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

GetUserName -

func (*UserAccountStub) IncreaseNonce added in v1.1.15

func (u *UserAccountStub) IncreaseNonce(_ uint64)

IncreaseNonce -

func (*UserAccountStub) IsInterfaceNil added in v1.1.15

func (u *UserAccountStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*UserAccountStub) SetCode added in v1.1.15

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

SetCode -

func (*UserAccountStub) SetCodeHash added in v1.1.15

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

SetCodeHash -

func (*UserAccountStub) SetCodeMetadata added in v1.1.15

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

SetCodeMetadata -

func (*UserAccountStub) SetDataTrie added in v1.1.15

func (u *UserAccountStub) SetDataTrie(_ data.Trie)

SetDataTrie -

func (*UserAccountStub) SetOwnerAddress added in v1.1.15

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

SetOwnerAddress -

func (*UserAccountStub) SetRootHash added in v1.1.15

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

SetRootHash -

func (*UserAccountStub) SetUserName added in v1.1.15

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

SetUserName -

func (*UserAccountStub) SubFromBalance added in v1.1.15

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

SubFromBalance -

type VMExecutionHandlerStub added in v1.1.15

type VMExecutionHandlerStub struct {
	RunSmartContractCreateCalled func(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
	RunSmartContractCallCalled   func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	GasScheduleChangeCalled      func(gasSchedule map[string]map[string]uint64)
}

VMExecutionHandlerStub -

func (*VMExecutionHandlerStub) GasScheduleChange added in v1.1.15

func (vm *VMExecutionHandlerStub) GasScheduleChange(gasSchedule map[string]map[string]uint64)

GasScheduleChange -

func (*VMExecutionHandlerStub) IsInterfaceNil added in v1.1.15

func (vm *VMExecutionHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*VMExecutionHandlerStub) RunSmartContractCall added in v1.1.15

func (vm *VMExecutionHandlerStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

RunSmartContractCall computes the result of a smart contract call and how the system must change after the execution

func (*VMExecutionHandlerStub) RunSmartContractCreate added in v1.1.15

func (vm *VMExecutionHandlerStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)

RunSmartContractCreate --

type ValidatorInfoSyncerStub added in v1.0.102

type ValidatorInfoSyncerStub struct {
}

ValidatorInfoSyncerStub -

func (*ValidatorInfoSyncerStub) IsInterfaceNil added in v1.0.102

func (vip *ValidatorInfoSyncerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorInfoSyncerStub) SyncMiniBlocks added in v1.0.102

func (vip *ValidatorInfoSyncerStub) SyncMiniBlocks(*block.MetaBlock) ([][]byte, data.BodyHandler, error)

SyncMiniBlocks -

type ValidatorStatisticsProcessorStub added in v0.0.5

type ValidatorStatisticsProcessorStub struct {
	ProcessCalled        func(validatorInfo data.ShardValidatorInfoHandler) error
	CommitCalled         func() ([]byte, error)
	IsInterfaceNilCalled func() bool
}

ValidatorStatisticsProcessorStub -

func (*ValidatorStatisticsProcessorStub) Commit added in v0.0.5

func (pm *ValidatorStatisticsProcessorStub) Commit() ([]byte, error)

Commit -

func (*ValidatorStatisticsProcessorStub) IsInterfaceNil added in v0.0.5

func (pm *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsProcessorStub) Process added in v0.0.5

Process -

type WhiteListHandlerStub added in v1.0.104

type WhiteListHandlerStub struct {
	RemoveCalled            func(keys [][]byte)
	AddCalled               func(keys [][]byte)
	IsWhiteListedCalled     func(interceptedData process.InterceptedData) bool
	IsForCurrentShardCalled func(interceptedData process.InterceptedData) bool
}

WhiteListHandlerStub -

func (*WhiteListHandlerStub) Add added in v1.0.104

func (w *WhiteListHandlerStub) Add(keys [][]byte)

Add -

func (*WhiteListHandlerStub) IsForCurrentShard added in v1.0.104

func (w *WhiteListHandlerStub) IsForCurrentShard(interceptedData process.InterceptedData) bool

IsForCurrentShard -

func (*WhiteListHandlerStub) IsInterfaceNil added in v1.0.104

func (w *WhiteListHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*WhiteListHandlerStub) IsWhiteListed added in v1.0.104

func (w *WhiteListHandlerStub) IsWhiteListed(interceptedData process.InterceptedData) bool

IsWhiteListed -

func (*WhiteListHandlerStub) Remove added in v1.0.104

func (w *WhiteListHandlerStub) Remove(keys [][]byte)

Remove -

Jump to

Keyboard shortcuts

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