Documentation ¶
Index ¶
- Variables
- type AccountsStub
- func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) Commit() ([]byte, error)
- func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
- func (as *AccountsStub) GetCode(codeHash []byte) []byte
- func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)
- func (as *AccountsStub) GetNumCheckpoints() uint32
- func (as *AccountsStub) IsInterfaceNil() bool
- func (as *AccountsStub) IsPruningEnabled() bool
- func (as *AccountsStub) JournalLen() int
- func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
- func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)
- func (as *AccountsStub) RecreateTrie(rootHash []byte) error
- func (as *AccountsStub) RemoveAccount(addressContainer []byte) error
- func (as *AccountsStub) RevertToSnapshot(snapshot int) error
- func (as *AccountsStub) RootHash() ([]byte, error)
- func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
- func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)
- func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)
- type AlarmSchedulerStub
- type AppStatusHandlerStub
- func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
- func (ashs *AppStatusHandlerStub) Close()
- func (ashs *AppStatusHandlerStub) Decrement(key string)
- func (ashs *AppStatusHandlerStub) Increment(key string)
- func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
- func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
- func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
- func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) CloseAll() error
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) IsInterfaceNil() bool
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
- type ConnectedAddressesMock
- type DatabaseWriterStub
- func (dwm *DatabaseWriterStub) CheckAndCreateAlias(_ string, _ string) error
- func (dwm *DatabaseWriterStub) CheckAndCreateIndex(_ string) error
- func (dwm *DatabaseWriterStub) CheckAndCreatePolicy(_ string, _ *bytes.Buffer) error
- func (dwm *DatabaseWriterStub) CheckAndCreateTemplate(_ string, _ *bytes.Buffer) error
- func (dwm *DatabaseWriterStub) DoBulkRemove(index string, hashes []string) error
- func (dwm *DatabaseWriterStub) DoBulkRequest(buff *bytes.Buffer, index string) error
- func (dwm *DatabaseWriterStub) DoMultiGet(query map[string]interface{}, index string) (map[string]interface{}, error)
- func (dwm *DatabaseWriterStub) DoRequest(req *esapi.IndexRequest) error
- func (dwm *DatabaseWriterStub) IsInterfaceNil() bool
- type DispatcherMock
- type ElasticProcessorStub
- func (eim *ElasticProcessorStub) IsInterfaceNil() bool
- func (eim *ElasticProcessorStub) RemoveHeader(header data.HeaderHandler) error
- func (eim *ElasticProcessorStub) RemoveMiniblocks(header data.HeaderHandler, body *block.Body) error
- func (eim *ElasticProcessorStub) SaveAccounts(acc []state.UserAccountHandler) error
- func (eim *ElasticProcessorStub) SaveHeader(header data.HeaderHandler, signersIndexes []uint64, body *block.Body, ...) error
- func (eim *ElasticProcessorStub) SaveMiniblocks(header data.HeaderHandler, body *block.Body) (map[string]bool, error)
- func (eim *ElasticProcessorStub) SaveRoundsInfo(info []workItems.RoundInfo) error
- func (eim *ElasticProcessorStub) SaveShardStatistics(tpsBenchmark statistics.TPSBenchmark) error
- func (eim *ElasticProcessorStub) SaveShardValidatorsPubKeys(shardID, epoch uint32, shardValidatorsPubKeys [][]byte) error
- func (eim *ElasticProcessorStub) SaveTransactions(body *block.Body, header data.HeaderHandler, ...) error
- func (eim *ElasticProcessorStub) SaveValidatorsRating(index string, validatorsRatingInfo []workItems.ValidatorRatingInfo) error
- func (eim *ElasticProcessorStub) SetTxLogsProcessor(txLogsProc process.TransactionLogProcessorDatabase)
- type EpochNotifierStub
- type EpochStartNotifierStub
- func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
- func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHeader data.HeaderHandler, body data.BodyHandler)
- func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
- func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
- type EpochSubscriberHandlerStub
- type GasScheduleSubscribeHandlerStub
- type HasherMock
- type IntRandomizerStub
- type MarshalizerMock
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
- func (ncm *NodesCoordinatorMock) ComputeConsensusGroup(randomess []byte, round uint64, shardId uint32, epoch uint32) ([]sharding.Validator, error)
- func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int
- func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32
- func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) GetConsensusWhitelistedNodes(_ uint32) (map[string]struct{}, error)
- func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64
- func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
- func (ncm *NodesCoordinatorMock) GetSavedStateKey() []byte
- func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err error)
- func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
- func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)
- func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
- func (ncm *NodesCoordinatorMock) LoadState(_ []byte) error
- func (ncm *NodesCoordinatorMock) SetNodesPerShards(eligible map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, ...) error
- func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error)
- func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)
- func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)
- type PubkeyConverterMock
- type ReadCloserStub
- type ShardCoordinatorMock
- func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm *ShardCoordinatorMock) ComputeId(address []byte) uint32
- func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
- func (scm *ShardCoordinatorMock) NumberOfShards() uint32
- func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool
- func (scm *ShardCoordinatorMock) SelfId() uint32
- func (scm *ShardCoordinatorMock) SetSelfId(shardID uint32)
- type StableTagProviderStub
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) Close() error
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) (map[string][]byte, error)
- func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error
- func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
- func (ss *StorerStub) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")
ErrMockMarshalizer -
var ErrNilObjectToMarshal = errors.New("nil object to serialize from")
ErrNilObjectToMarshal -
Functions ¶
This section is empty.
Types ¶
type AccountsStub ¶ added in v1.1.6
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 GetCodeCalled func([]byte) []byte }
AccountsStub -
func (*AccountsStub) CancelPrune ¶ added in v1.1.6
func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune -
func (*AccountsStub) Commit ¶ added in v1.1.6
func (as *AccountsStub) Commit() ([]byte, error)
Commit -
func (*AccountsStub) GetAllLeaves ¶ added in v1.1.6
func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
GetAllLeaves -
func (*AccountsStub) GetCode ¶ added in v1.1.22
func (as *AccountsStub) GetCode(codeHash []byte) []byte
GetCode -
func (*AccountsStub) GetExistingAccount ¶ added in v1.1.6
func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)
GetExistingAccount -
func (*AccountsStub) GetNumCheckpoints ¶ added in v1.1.6
func (as *AccountsStub) GetNumCheckpoints() uint32
GetNumCheckpoints -
func (*AccountsStub) IsInterfaceNil ¶ added in v1.1.6
func (as *AccountsStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsStub) IsPruningEnabled ¶ added in v1.1.6
func (as *AccountsStub) IsPruningEnabled() bool
IsPruningEnabled -
func (*AccountsStub) JournalLen ¶ added in v1.1.6
func (as *AccountsStub) JournalLen() int
JournalLen -
func (*AccountsStub) LoadAccount ¶ added in v1.1.6
func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
LoadAccount -
func (*AccountsStub) PruneTrie ¶ added in v1.1.6
func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
PruneTrie -
func (*AccountsStub) RecreateAllTries ¶ added in v1.1.6
func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)
RecreateAllTries -
func (*AccountsStub) RecreateTrie ¶ added in v1.1.6
func (as *AccountsStub) RecreateTrie(rootHash []byte) error
RecreateTrie -
func (*AccountsStub) RemoveAccount ¶ added in v1.1.6
func (as *AccountsStub) RemoveAccount(addressContainer []byte) error
RemoveAccount -
func (*AccountsStub) RevertToSnapshot ¶ added in v1.1.6
func (as *AccountsStub) RevertToSnapshot(snapshot int) error
RevertToSnapshot -
func (*AccountsStub) RootHash ¶ added in v1.1.6
func (as *AccountsStub) RootHash() ([]byte, error)
RootHash -
func (*AccountsStub) SaveAccount ¶ added in v1.1.6
func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
SaveAccount -
func (*AccountsStub) SetStateCheckpoint ¶ added in v1.1.6
func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)
SetStateCheckpoint -
func (*AccountsStub) SnapshotState ¶ added in v1.1.6
func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)
SnapshotState -
type AlarmSchedulerStub ¶ added in v1.0.133
type AlarmSchedulerStub struct { AddCalled func(func(alarmID string), time.Duration, string) CancelCalled func(string) CloseCalled func() ResetCalled func(string) }
AlarmSchedulerStub -
func (*AlarmSchedulerStub) Add ¶ added in v1.0.133
func (a *AlarmSchedulerStub) Add(callback func(alarmID string), duration time.Duration, alarmID string)
Add -
func (*AlarmSchedulerStub) Cancel ¶ added in v1.0.133
func (a *AlarmSchedulerStub) Cancel(alarmID string)
Cancel -
func (*AlarmSchedulerStub) IsInterfaceNil ¶ added in v1.0.133
func (a *AlarmSchedulerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AlarmSchedulerStub) Reset ¶ added in v1.0.133
func (a *AlarmSchedulerStub) Reset(alarmID string)
Reset -
type AppStatusHandlerStub ¶
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 ¶
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
AddUint64 will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an string value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
type ChainStorerMock ¶
type ChainStorerMock 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 }
ChainStorerMock is a mock implementation of the ChainStorer interface
func (*ChainStorerMock) AddStorer ¶
func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
AddStorer will add a new storer to the chain map
func (*ChainStorerMock) CloseAll ¶ added in v1.1.17
func (bc *ChainStorerMock) CloseAll() error
CloseAll -
func (*ChainStorerMock) Destroy ¶
func (bc *ChainStorerMock) Destroy() error
Destroy removes the underlying files/resources used by the storage service
func (*ChainStorerMock) Get ¶
func (bc *ChainStorerMock) 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 (*ChainStorerMock) GetAll ¶
func (bc *ChainStorerMock) 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 (*ChainStorerMock) GetStorer ¶
func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
GetStorer returns the storer from the chain map or nil if the storer was not found
func (*ChainStorerMock) Has ¶
func (bc *ChainStorerMock) 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 (*ChainStorerMock) IsInterfaceNil ¶ added in v1.1.17
func (bc *ChainStorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChainStorerMock) Put ¶
func (bc *ChainStorerMock) 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 (*ChainStorerMock) SetEpochForPutOperation ¶ added in v1.1.17
func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
SetEpochForPutOperation won't do anything
type ConnectedAddressesMock ¶
type ConnectedAddressesMock struct { }
ConnectedAddressesMock represents a mock implementation of the ConnectedAddresses
func (*ConnectedAddressesMock) ConnectedAddresses ¶
func (cam *ConnectedAddressesMock) ConnectedAddresses() []string
ConnectedAddresses returns an empty slice of string
type DatabaseWriterStub ¶
type DatabaseWriterStub struct { DoRequestCalled func(req *esapi.IndexRequest) error DoBulkRequestCalled func(buff *bytes.Buffer, index string) error DoBulkRemoveCalled func(index string, hashes []string) error DoMultiGetCalled func(query map[string]interface{}, index string) (map[string]interface{}, error) }
DatabaseWriterStub --
func (*DatabaseWriterStub) CheckAndCreateAlias ¶ added in v1.1.6
func (dwm *DatabaseWriterStub) CheckAndCreateAlias(_ string, _ string) error
CheckAndCreateAlias -
func (*DatabaseWriterStub) CheckAndCreateIndex ¶
func (dwm *DatabaseWriterStub) CheckAndCreateIndex(_ string) error
CheckAndCreateIndex --
func (*DatabaseWriterStub) CheckAndCreatePolicy ¶ added in v1.1.6
func (dwm *DatabaseWriterStub) CheckAndCreatePolicy(_ string, _ *bytes.Buffer) error
CheckAndCreatePolicy -
func (*DatabaseWriterStub) CheckAndCreateTemplate ¶ added in v1.1.6
func (dwm *DatabaseWriterStub) CheckAndCreateTemplate(_ string, _ *bytes.Buffer) error
CheckAndCreateTemplate -
func (*DatabaseWriterStub) DoBulkRemove ¶ added in v1.1.6
func (dwm *DatabaseWriterStub) DoBulkRemove(index string, hashes []string) error
DoBulkRemove -
func (*DatabaseWriterStub) DoBulkRequest ¶
func (dwm *DatabaseWriterStub) DoBulkRequest(buff *bytes.Buffer, index string) error
DoBulkRequest --
func (*DatabaseWriterStub) DoMultiGet ¶ added in v1.0.131
func (dwm *DatabaseWriterStub) DoMultiGet(query map[string]interface{}, index string) (map[string]interface{}, error)
DoMultiGet --
func (*DatabaseWriterStub) DoRequest ¶
func (dwm *DatabaseWriterStub) DoRequest(req *esapi.IndexRequest) error
DoRequest --
func (*DatabaseWriterStub) IsInterfaceNil ¶ added in v1.1.6
func (dwm *DatabaseWriterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type DispatcherMock ¶ added in v1.1.6
type DispatcherMock struct { StartIndexDataCalled func() CloseCalled func() error AddCalled func(item workItems.WorkItemHandler) }
DispatcherMock -
func (*DispatcherMock) Add ¶ added in v1.1.6
func (dm *DispatcherMock) Add(item workItems.WorkItemHandler)
Add -
func (*DispatcherMock) IsInterfaceNil ¶ added in v1.1.6
func (dm *DispatcherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*DispatcherMock) StartIndexData ¶ added in v1.1.6
func (dm *DispatcherMock) StartIndexData()
StartIndexData -
type ElasticProcessorStub ¶ added in v1.1.6
type ElasticProcessorStub struct { SaveShardStatisticsCalled func(tpsBenchmark statistics.TPSBenchmark) error SaveHeaderCalled func(header data.HeaderHandler, signersIndexes []uint64, body *block.Body, notarizedHeadersHashes []string, txsSize int) error RemoveHeaderCalled func(header data.HeaderHandler) error RemoveMiniblocksCalled func(header data.HeaderHandler, body *block.Body) error SaveMiniblocksCalled func(header data.HeaderHandler, body *block.Body) (map[string]bool, error) SaveTransactionsCalled func(body *block.Body, header data.HeaderHandler, txPool map[string]data.TransactionHandler, selfShardID uint32, mbsInDb map[string]bool) error SaveValidatorsRatingCalled func(index string, validatorsRatingInfo []workItems.ValidatorRatingInfo) error SaveRoundsInfoCalled func(infos []workItems.RoundInfo) error SaveShardValidatorsPubKeysCalled func(shardID, epoch uint32, shardValidatorsPubKeys [][]byte) error SetTxLogsProcessorCalled func(txLogsProc process.TransactionLogProcessorDatabase) SaveAccountsCalled func(acc []state.UserAccountHandler) error }
ElasticProcessorStub -
func (*ElasticProcessorStub) IsInterfaceNil ¶ added in v1.1.6
func (eim *ElasticProcessorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ElasticProcessorStub) RemoveHeader ¶ added in v1.1.6
func (eim *ElasticProcessorStub) RemoveHeader(header data.HeaderHandler) error
RemoveHeader -
func (*ElasticProcessorStub) RemoveMiniblocks ¶ added in v1.1.6
func (eim *ElasticProcessorStub) RemoveMiniblocks(header data.HeaderHandler, body *block.Body) error
RemoveMiniblocks -
func (*ElasticProcessorStub) SaveAccounts ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveAccounts(acc []state.UserAccountHandler) error
SaveAccounts -
func (*ElasticProcessorStub) SaveHeader ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveHeader(header data.HeaderHandler, signersIndexes []uint64, body *block.Body, notarizedHeadersHashes []string, txsSize int) error
SaveHeader -
func (*ElasticProcessorStub) SaveMiniblocks ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveMiniblocks(header data.HeaderHandler, body *block.Body) (map[string]bool, error)
SaveMiniblocks -
func (*ElasticProcessorStub) SaveRoundsInfo ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveRoundsInfo(info []workItems.RoundInfo) error
SaveRoundsInfo -
func (*ElasticProcessorStub) SaveShardStatistics ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveShardStatistics(tpsBenchmark statistics.TPSBenchmark) error
SaveShardStatistics -
func (*ElasticProcessorStub) SaveShardValidatorsPubKeys ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveShardValidatorsPubKeys(shardID, epoch uint32, shardValidatorsPubKeys [][]byte) error
SaveShardValidatorsPubKeys -
func (*ElasticProcessorStub) SaveTransactions ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveTransactions(body *block.Body, header data.HeaderHandler, txPool map[string]data.TransactionHandler, selfShardID uint32, mbsInDb map[string]bool) error
SaveTransactions -
func (*ElasticProcessorStub) SaveValidatorsRating ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SaveValidatorsRating(index string, validatorsRatingInfo []workItems.ValidatorRatingInfo) error
SaveValidatorsRating -
func (*ElasticProcessorStub) SetTxLogsProcessor ¶ added in v1.1.6
func (eim *ElasticProcessorStub) SetTxLogsProcessor(txLogsProc process.TransactionLogProcessorDatabase)
SetTxLogsProcessor -
type EpochNotifierStub ¶ added in v1.1.18
type EpochNotifierStub struct { CheckEpochCalled func(epoch uint32) CurrentEpochCalled func() uint32 RegisterNotifyHandlerCalled func(handler core.EpochSubscriberHandler) }
EpochNotifierStub -
func (*EpochNotifierStub) CheckEpoch ¶ added in v1.1.18
func (ens *EpochNotifierStub) CheckEpoch(epoch uint32)
CheckEpoch -
func (*EpochNotifierStub) CurrentEpoch ¶ added in v1.1.18
func (ens *EpochNotifierStub) CurrentEpoch() uint32
CurrentEpoch -
func (*EpochNotifierStub) IsInterfaceNil ¶ added in v1.1.18
func (ens *EpochNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochNotifierStub) RegisterNotifyHandler ¶ added in v1.1.18
func (ens *EpochNotifierStub) RegisterNotifyHandler(handler core.EpochSubscriberHandler)
RegisterNotifyHandler -
type EpochStartNotifierStub ¶ added in v0.0.5
type EpochStartNotifierStub struct { RegisterHandlerCalled func(handler epochStart.ActionHandler) UnregisterHandlerCalled func(handler epochStart.ActionHandler) NotifyAllCalled func(hdr data.HeaderHandler) NotifyAllPrepareCalled func(hdr data.HeaderHandler) // contains filtered or unexported fields }
EpochStartNotifierStub -
func (*EpochStartNotifierStub) IsInterfaceNil ¶ added in v0.0.5
func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartNotifierStub) NotifyAll ¶ added in v0.0.5
func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
NotifyAll -
func (*EpochStartNotifierStub) NotifyAllPrepare ¶ added in v0.0.5
func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHeader data.HeaderHandler, body data.BodyHandler)
NotifyAllPrepare -
func (*EpochStartNotifierStub) RegisterHandler ¶ added in v0.0.5
func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
RegisterHandler -
func (*EpochStartNotifierStub) UnregisterHandler ¶ added in v0.0.5
func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
UnregisterHandler -
type EpochSubscriberHandlerStub ¶ added in v1.1.1
type EpochSubscriberHandlerStub struct {
EpochConfirmedCalled func(epoch uint32)
}
EpochSubscriberHandlerStub -
func (*EpochSubscriberHandlerStub) EpochConfirmed ¶ added in v1.1.1
func (eshs *EpochSubscriberHandlerStub) EpochConfirmed(epoch uint32)
EpochConfirmed -
func (*EpochSubscriberHandlerStub) IsInterfaceNil ¶ added in v1.1.1
func (eshs *EpochSubscriberHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type GasScheduleSubscribeHandlerStub ¶ added in v1.1.12
type GasScheduleSubscribeHandlerStub struct {
GasScheduleChangeCalled func(gasSchedule map[string]map[string]uint64)
}
GasScheduleSubscribeHandlerStub -
func (*GasScheduleSubscribeHandlerStub) GasScheduleChange ¶ added in v1.1.12
func (g *GasScheduleSubscribeHandlerStub) GasScheduleChange(gasSchedule map[string]map[string]uint64)
GasScheduleChange -
func (*GasScheduleSubscribeHandlerStub) IsInterfaceNil ¶ added in v1.1.12
func (g *GasScheduleSubscribeHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
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
type IntRandomizerStub ¶ added in v1.0.127
IntRandomizerStub -
func (*IntRandomizerStub) Intn ¶ added in v1.0.127
func (irs *IntRandomizerStub) Intn(n int) int
Intn -
func (*IntRandomizerStub) IsInterfaceNil ¶ added in v1.0.127
func (irs *IntRandomizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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 NodesCoordinatorMock ¶ added in v0.0.5
type NodesCoordinatorMock struct { Validators map[uint32][]sharding.Validator ShardConsensusSize uint32 MetaConsensusSize uint32 ShardId uint32 NbShards uint32 GetSelectedPublicKeysCalled func(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err 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) SetNodesPerShardsCalled func(nodes map[uint32][]sharding.Validator, epoch uint32) error ComputeValidatorsGroupCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error) GetValidatorWithPublicKeyCalled func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error) GetAllEligibleValidatorsPublicKeysCalled func(epoch uint32) (map[uint32][][]byte, error) GetAllWaitingValidatorsPublicKeysCalled func() (map[uint32][][]byte, error) ConsensusGroupSizeCalled func(uint32) int }
NodesCoordinatorMock defines the behaviour of a struct able to do validator group selection
func (*NodesCoordinatorMock) ComputeAdditionalLeaving ¶ added in v1.0.115
func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
ComputeAdditionalLeaving -
func (*NodesCoordinatorMock) ComputeConsensusGroup ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) ComputeConsensusGroup( randomess []byte, round uint64, shardId uint32, epoch uint32, ) ([]sharding.Validator, error)
ComputeConsensusGroup -
func (*NodesCoordinatorMock) ConsensusGroupSize ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error)
GetAllEligibleValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys ¶ added in v1.0.102
func (ncm *NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllLeavingValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllWaitingValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetChance ¶ added in v1.0.102
func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32
GetChance -
func (*NodesCoordinatorMock) GetConsensusValidatorsPublicKeys ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys( randomness []byte, round uint64, shardId uint32, epoch uint32, ) ([]string, error)
GetConsensusValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetConsensusWhitelistedNodes ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetConsensusWhitelistedNodes( _ uint32, ) (map[string]struct{}, error)
GetConsensusWhitelistedNodes return the whitelisted nodes allowed to send consensus messages, for each of the shards
func (*NodesCoordinatorMock) GetNumTotalEligible ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64
GetNumTotalEligible -
func (*NodesCoordinatorMock) GetOwnPublicKey ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
GetOwnPublicKey -
func (*NodesCoordinatorMock) GetSavedStateKey ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetSavedStateKey() []byte
GetSavedStateKey -
func (*NodesCoordinatorMock) GetSelectedPublicKeys ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err error)
GetSelectedPublicKeys -
func (*NodesCoordinatorMock) GetValidatorWithPublicKey ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
GetValidatorWithPublicKey -
func (*NodesCoordinatorMock) GetValidatorsIndexes ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)
GetValidatorsIndexes -
func (*NodesCoordinatorMock) IsInterfaceNil ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*NodesCoordinatorMock) LoadState ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) LoadState(_ []byte) error
LoadState -
func (*NodesCoordinatorMock) SetNodesPerShards ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) SetNodesPerShards( eligible map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, epoch uint32, ) error
SetNodesPerShards -
func (*NodesCoordinatorMock) ShardIdForEpoch ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error)
ShardIdForEpoch returns the nodesCoordinator configured ShardId for specified epoch if epoch configuration exists, otherwise error
func (*NodesCoordinatorMock) ShuffleOutForEpoch ¶ added in v1.0.111
func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)
ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler
func (*NodesCoordinatorMock) ValidatorsWeights ¶ added in v0.0.5
func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)
ValidatorsWeights -
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 -
type ReadCloserStub ¶ added in v1.1.6
type ReadCloserStub struct { CloseCalled func() error ReadCalled func(p []byte) (n int, err error) }
ReadCloserStub -
type ShardCoordinatorMock ¶
ShardCoordinatorMock -
func (*ShardCoordinatorMock) CommunicationIdentifier ¶
func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (*ShardCoordinatorMock) ComputeId ¶
func (scm *ShardCoordinatorMock) ComputeId(address []byte) uint32
ComputeId -
func (*ShardCoordinatorMock) IsInterfaceNil ¶
func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardCoordinatorMock) NumberOfShards ¶
func (scm *ShardCoordinatorMock) NumberOfShards() uint32
NumberOfShards -
func (*ShardCoordinatorMock) SameShard ¶
func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool
SameShard -
func (*ShardCoordinatorMock) SetSelfId ¶
func (scm *ShardCoordinatorMock) SetSelfId(shardID uint32)
SetSelfId -
type StableTagProviderStub ¶
StableTagProviderStub --
func (*StableTagProviderStub) FetchTagVersion ¶
func (s *StableTagProviderStub) FetchTagVersion() (string, error)
FetchTagVersion --
func (*StableTagProviderStub) IsInterfaceNil ¶
func (s *StableTagProviderStub) IsInterfaceNil() bool
IsInterfaceNil --
type StorerStub ¶ added in v1.0.147
type StorerStub struct { PutCalled func(key, data []byte) 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) PutInEpochCalled func(key, data []byte, epoch uint32) error }
StorerStub -
func (*StorerStub) DestroyUnit ¶ added in v1.0.147
func (ss *StorerStub) DestroyUnit() error
DestroyUnit -
func (*StorerStub) Get ¶ added in v1.0.147
func (ss *StorerStub) Get(key []byte) ([]byte, error)
Get -
func (*StorerStub) GetBulkFromEpoch ¶ added in v1.0.147
GetBulkFromEpoch -
func (*StorerStub) GetFromEpoch ¶ added in v1.0.147
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
GetFromEpoch -
func (*StorerStub) HasInEpoch ¶ added in v1.0.147
func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerStub) IsInterfaceNil ¶ added in v1.0.147
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) PutInEpoch ¶ added in v1.1.12
func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error
PutInEpoch -
func (*StorerStub) RangeKeys ¶ added in v1.0.147
func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
RangeKeys -
func (*StorerStub) Remove ¶ added in v1.0.147
func (ss *StorerStub) Remove(key []byte) error
Remove -
func (*StorerStub) SearchFirst ¶ added in v1.0.147
func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
Source Files ¶
- accountsAdapterStub.go
- alarmSchedulerStub.go
- appStatusHandlerStub.go
- chainStorerMock.go
- connectedAddressesHandlerMock.go
- databaseWriterMock.go
- distapatcherStub.go
- elasticProcessorStub.go
- epochNotifierStub.go
- epochStartNotifierStub.go
- epochSubscriberHandlerStub.go
- gasScheduleSubscribeHandlerStub.go
- hasherMock.go
- intRandomizerStub.go
- marshalizerMock.go
- nodesCoordinatorMock.go
- pubkeyConverterMock.go
- readCloserStub.go
- shardCoordinatorMock.go
- stableTagProviderStub.go
- storerStub.go