Documentation ¶
Index ¶
- func NewInterceptedMetaBlockMock(hdr data.HeaderHandler, hash []byte) *interceptedMetaBlockMock
- func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
- func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
- type AddressMock
- 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 ArgumentParserMock
- func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string
- func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)
- func (ap *ArgumentParserMock) IsInterfaceNil() bool
- func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error)
- func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error)
- type ChainStorerStub
- func (bc *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerStub) CloseAll() error
- func (bc *ChainStorerStub) Destroy() error
- func (bc *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerStub) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerStub) IsInterfaceNil() bool
- func (bc *ChainStorerStub) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (bc *ChainStorerStub) SetEpochForPutOperation(epoch uint32)
- type EpochStartNotifierStub
- func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
- func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
- func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)
- type HasherMock
- type HeaderValidatorStub
- type HeadersByHashSyncerStub
- func (hhss *HeadersByHashSyncerStub) ClearFields()
- func (hhss *HeadersByHashSyncerStub) GetHeaders() (map[string]data.HeaderHandler, error)
- func (hhss *HeadersByHashSyncerStub) IsInterfaceNil() bool
- func (hhss *HeadersByHashSyncerStub) SyncMissingHeadersByHash(shardIDs []uint32, headersHashes [][]byte, ctx context.Context) error
- type HeadersCacherStub
- func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
- func (hcs *HeadersCacherStub) Clear()
- func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
- func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
- func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int
- func (hcs *HeadersCacherStub) IsInterfaceNil() bool
- func (hcs *HeadersCacherStub) Len() int
- func (hcs *HeadersCacherStub) MaxSize() int
- func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
- func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
- func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
- func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
- type ImportStartHandlerStub
- func (ish *ImportStartHandlerStub) IsAfterExportBeforeImport() bool
- func (ish *ImportStartHandlerStub) IsInterfaceNil() bool
- func (ish *ImportStartHandlerStub) ResetStartImport() error
- func (ish *ImportStartHandlerStub) SetStartImport() error
- func (ish *ImportStartHandlerStub) ShouldStartImport() bool
- type KeyGenMock
- func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error
- func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
- func (keyGen *KeyGenMock) IsInterfaceNil() bool
- func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error)
- func (keyGen *KeyGenMock) PublicKeyFromByteArray(_ []byte) (crypto.PublicKey, error)
- func (keyGen *KeyGenMock) Suite() crypto.Suite
- type LatestStorageDataProviderStub
- func (lsdps *LatestStorageDataProviderStub) Get() (storage.LatestDataFromStorage, error)
- func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)
- func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)
- func (lsdps *LatestStorageDataProviderStub) IsInterfaceNil() bool
- type MarshalizerMock
- type MessengerStub
- func (m *MessengerStub) ConnectedPeers() []core.PeerID
- func (m *MessengerStub) ConnectedPeersOnTopic(_ string) []core.PeerID
- func (m *MessengerStub) CreateTopic(_ string, _ bool) error
- func (m *MessengerStub) HasTopic(_ string) bool
- func (m *MessengerStub) IsInterfaceNil() bool
- func (m *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- func (m *MessengerStub) SendToConnectedPeer(_ string, _ []byte, _ core.PeerID) error
- func (m *MessengerStub) UnjoinAllTopics() error
- func (m *MessengerStub) UnregisterAllMessageProcessors() error
- func (m *MessengerStub) UnregisterMessageProcessor(_ string) error
- type MetaBlockInterceptorProcessorStub
- func (m *MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock(_ context.Context) (*block.MetaBlock, error)
- func (m *MetaBlockInterceptorProcessorStub) IsInterfaceNil() bool
- func (m *MetaBlockInterceptorProcessorStub) RegisterHandler(_ func(topic string, hash []byte, data interface{}))
- func (m *MetaBlockInterceptorProcessorStub) Save(_ process.InterceptedData, _ core.PeerID, _ string) error
- func (m *MetaBlockInterceptorProcessorStub) SignalEndOfProcessing(_ []process.InterceptedData)
- func (m *MetaBlockInterceptorProcessorStub) Validate(_ process.InterceptedData, _ core.PeerID) error
- type NodeInfoMock
- type NodeShufflerMock
- type NodesCoordinatorStub
- func (ncm *NodesCoordinatorStub) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
- func (ncm *NodesCoordinatorStub) ComputeConsensusGroup(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int
- func (ncm *NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32
- func (ncm *NodesCoordinatorStub) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
- func (ncm *NodesCoordinatorStub) GetConsensusWhitelistedNodes(_ uint32) (map[string]struct{}, error)
- func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64
- func (ncm *NodesCoordinatorStub) GetOwnPublicKey() []byte
- func (ncm *NodesCoordinatorStub) GetSavedStateKey() []byte
- func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)
- func (ncm *NodesCoordinatorStub) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
- func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)
- func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool
- func (ncm *NodesCoordinatorStub) LoadState(_ []byte) error
- func (ncm *NodesCoordinatorStub) SetConfig(_ *sharding.NodesCoordinatorRegistry) error
- func (ncm *NodesCoordinatorStub) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, ...) error
- func (ncm *NodesCoordinatorStub) ShardIdForEpoch(_ uint32) (uint32, error)
- func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)
- func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)
- type NodesSetupStub
- func (n *NodesSetupStub) GetChainId() string
- func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32
- func (n *NodesSetupStub) GetMinTransactionVersion() uint32
- func (n *NodesSetupStub) GetRoundDuration() uint64
- func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32
- func (n *NodesSetupStub) GetStartTime() int64
- func (n *NodesSetupStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, ...)
- func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
- func (n *NodesSetupStub) IsInterfaceNil() bool
- func (n *NodesSetupStub) MinNumberOfNodes() uint32
- func (n *NodesSetupStub) NumberOfShards() uint32
- type PathManagerStub
- type PendingMiniBlockSyncHandlerStub
- func (pm *PendingMiniBlockSyncHandlerStub) ClearFields()
- func (pm *PendingMiniBlockSyncHandlerStub) GetMiniBlocks() (map[string]*block.MiniBlock, error)
- func (pm *PendingMiniBlockSyncHandlerStub) IsInterfaceNil() bool
- func (pm *PendingMiniBlockSyncHandlerStub) SyncPendingMiniBlocks(miniBlockHeaders []block.MiniBlockHeader, ctx context.Context) error
- type PrivateKeyMock
- type PrivateKeyStub
- type PubkeyConverterMock
- type PublicKeyMock
- type PublicKeyStub
- type RaterStub
- func (rm *RaterStub) ComputeDecreaseProposer(shardId uint32, currentRating uint32, consecutiveMisses uint32) uint32
- func (rm *RaterStub) ComputeDecreaseValidator(shardId uint32, currentRating uint32) uint32
- func (rm *RaterStub) ComputeIncreaseProposer(shardId uint32, currentRating uint32) uint32
- func (rm *RaterStub) ComputeIncreaseValidator(shardId uint32, currentRating uint32) uint32
- func (rm *RaterStub) GetChance(rating uint32) uint32
- func (rm *RaterStub) GetRating(pk string) uint32
- func (rm *RaterStub) GetSignedBlocksThreshold() float32
- func (rm *RaterStub) GetStartRating() uint32
- func (rm *RaterStub) IsInterfaceNil() bool
- func (rm *RaterStub) RevertIncreaseValidator(shardId uint32, currentRating uint32, nrReverts uint32) uint32
- type RequestHandlerStub
- func (rhs *RequestHandlerStub) GetNumPeersToQuery(key string) (int, int, error)
- func (rhs *RequestHandlerStub) IsInterfaceNil() bool
- func (rhs *RequestHandlerStub) RequestInterval() time.Duration
- func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)
- func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)
- func (rhs *RequestHandlerStub) RequestMiniBlock(_ uint32, _ []byte)
- func (rhs *RequestHandlerStub) RequestMiniBlocks(shardId uint32, miniblockHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestShardHeader(shardId uint32, hash []byte)
- func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardId uint32, nonce uint64)
- func (rhs *RequestHandlerStub) RequestStartOfEpochMetaBlock(epoch uint32)
- func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestTrieNodes(_ uint32, _ [][]byte, _ string)
- func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) SetEpoch(_ uint32)
- func (rhs *RequestHandlerStub) SetNumPeersToQuery(key string, intra int, cross int) error
- type RewardsHandlerStub
- func (r *RewardsHandlerStub) CommunityAddress() string
- func (r *RewardsHandlerStub) CommunityPercentage() float64
- func (r *RewardsHandlerStub) IsInterfaceNil() bool
- func (r *RewardsHandlerStub) LeaderPercentage() float64
- func (r *RewardsHandlerStub) MaxInflationRate(year uint32) float64
- func (r *RewardsHandlerStub) MinInflationRate() float64
- type RoundTimeDurationHandler
- type RounderStub
- func (rndm *RounderStub) Index() int64
- func (rndm *RounderStub) IsInterfaceNil() bool
- func (rndm *RounderStub) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rndm *RounderStub) TimeDuration() time.Duration
- func (rndm *RounderStub) TimeStamp() time.Time
- func (rndm *RounderStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- type ShardCoordinatorStub
- func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string
- func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32
- func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool
- func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32
- func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
- func (coordinator *ShardCoordinatorStub) SelfId() uint32
- type ShardIdHasMapStub
- func (sihsm *ShardIdHasMapStub) Delete(shardId uint32)
- func (sihsm *ShardIdHasMapStub) IsInterfaceNil() bool
- func (sihsm *ShardIdHasMapStub) Load(shardId uint32) ([]byte, bool)
- func (sihsm *ShardIdHasMapStub) Range(f func(shardId uint32, hash []byte) bool)
- func (sihsm *ShardIdHasMapStub) Store(shardId uint32, hash []byte)
- type SignerStub
- type StorageManagerStub
- func (sms *StorageManagerStub) CancelPrune([]byte, data.TriePruningIdentifier)
- func (sms *StorageManagerStub) Database() data.DBWriteCacher
- func (sms *StorageManagerStub) EnterSnapshotMode()
- func (sms *StorageManagerStub) ExitSnapshotMode()
- func (sms *StorageManagerStub) GetSnapshotThatContainsHash(d []byte) data.SnapshotDbHandler
- func (sms *StorageManagerStub) IsInterfaceNil() bool
- func (sms *StorageManagerStub) IsPruningEnabled() bool
- func (sms *StorageManagerStub) MarkForEviction(d []byte, m data.ModifiedHashes) error
- func (sms *StorageManagerStub) Prune([]byte, data.TriePruningIdentifier)
- func (sms *StorageManagerStub) SetCheckpoint([]byte)
- func (sms *StorageManagerStub) TakeSnapshot([]byte)
- type StorerMock
- func (sm *StorerMock) ClearCache()
- func (sm *StorerMock) Close() error
- func (sm *StorerMock) DestroyUnit() error
- func (sm *StorerMock) Get(key []byte) ([]byte, error)
- func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (sm *StorerMock) Has(key []byte) error
- func (sm *StorerMock) HasInEpoch(key []byte, epoch uint32) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, data []byte) error
- func (sm *StorerMock) Remove(key []byte) error
- func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
- 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) 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) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
- type SyncTimerStub
- type TrieStub
- func (ts *TrieStub) AppendToOldHashes(hashes [][]byte)
- func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (ts *TrieStub) ClosePersister() error
- func (ts *TrieStub) Commit() error
- func (ts *TrieStub) Database() data.DBWriteCacher
- func (ts *TrieStub) Delete(key []byte) error
- func (ts *TrieStub) EnterSnapshotMode()
- func (ts *TrieStub) ExitSnapshotMode()
- func (ts *TrieStub) Get(key []byte) ([]byte, error)
- func (ts *TrieStub) GetAllHashes() ([][]byte, error)
- func (ts *TrieStub) GetAllLeaves() (map[string][]byte, error)
- func (ts *TrieStub) GetAllLeavesOnChannel() chan core.KeyValueHolder
- func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
- func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, uint64, error)
- func (ts *TrieStub) IsInterfaceNil() bool
- func (ts *TrieStub) IsPruningEnabled() bool
- func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)
- func (ts *TrieStub) ResetOldHashes() [][]byte
- func (ts *TrieStub) Root() ([]byte, error)
- func (ts *TrieStub) SetCheckpoint(rootHash []byte)
- func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)
- func (ts *TrieStub) String() string
- func (ts *TrieStub) TakeSnapshot(rootHash []byte)
- func (ts *TrieStub) Update(key, value []byte) error
- type TriesHolderMock
- func (thm *TriesHolderMock) Get(key []byte) data.Trie
- func (thm *TriesHolderMock) GetAll() []data.Trie
- func (thm *TriesHolderMock) IsInterfaceNil() bool
- func (thm *TriesHolderMock) Put(key []byte, trie data.Trie)
- func (thm *TriesHolderMock) Replace(key []byte, trie data.Trie)
- func (thm *TriesHolderMock) Reset()
- type Uint64ByteSliceConverterMock
- type Uint64SyncMapCacherStub
- func (usmcs *Uint64SyncMapCacherStub) Clear()
- func (usmcs *Uint64SyncMapCacherStub) Get(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
- func (usmcs *Uint64SyncMapCacherStub) Has(nonce uint64, shardId uint32) bool
- func (usmcs *Uint64SyncMapCacherStub) IsInterfaceNil() bool
- func (usmcs *Uint64SyncMapCacherStub) Merge(nonce uint64, src dataRetriever.ShardIdHashMap)
- func (usmcs *Uint64SyncMapCacherStub) RegisterHandler(handler func(nonce uint64, shardId uint32, value []byte))
- func (usmcs *Uint64SyncMapCacherStub) Remove(nonce uint64, shardId uint32)
- type UnitOpenerStub
- type ValidatorInfoSyncerStub
- type ValidatorStatisticsProcessorStub
- type WhiteListHandlerStub
- func (w *WhiteListHandlerStub) Add(keys [][]byte)
- func (w *WhiteListHandlerStub) IsForCurrentShard(interceptedData process.InterceptedData) bool
- func (w *WhiteListHandlerStub) IsInterfaceNil() bool
- func (w *WhiteListHandlerStub) IsWhiteListed(interceptedData process.InterceptedData) bool
- func (w *WhiteListHandlerStub) Remove(keys [][]byte)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewInterceptedMetaBlockMock ¶
func NewInterceptedMetaBlockMock(hdr data.HeaderHandler, hash []byte) *interceptedMetaBlockMock
NewInterceptedMetaBlockMock -
func NewMultiShardsCoordinatorMock ¶
func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
NewMultiShardsCoordinatorMock -
func NewMultipleShardsCoordinatorMock ¶
func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
NewMultipleShardsCoordinatorMock -
Types ¶
type AddressMock ¶
type AddressMock struct {
// contains filtered or unexported fields
}
AddressMock is the struct holding a mock address
func NewAddressMock ¶
func NewAddressMock(adr []byte) *AddressMock
NewAddressMock creates a new Address with the same byte slice as the parameter received
func (*AddressMock) Bytes ¶
func (adr *AddressMock) Bytes() []byte
Bytes returns the data corresponding to this address
func (*AddressMock) IsInterfaceNil ¶
func (adr *AddressMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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 ArgumentParserMock ¶
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 ¶
func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string
CreateDataFromStorageUpdate -
func (*ArgumentParserMock) GetStorageUpdates ¶
func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)
GetStorageUpdates -
func (*ArgumentParserMock) IsInterfaceNil ¶
func (ap *ArgumentParserMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ArgumentParserMock) ParseCallData ¶
func (ap *ArgumentParserMock) ParseCallData(data string) (string, [][]byte, error)
ParseData -
func (*ArgumentParserMock) ParseDeployData ¶
func (ap *ArgumentParserMock) ParseDeployData(data string) (*parsers.DeployArgs, error)
ParseData -
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) 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 ¶
func (bc *ChainStorerStub) SetEpochForPutOperation(epoch uint32)
SetEpochForPutOperation won't do anything
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 ¶
func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)
NotifyEpochChangeConfirmed -
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 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 ¶
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 ¶
func (hhss *HeadersByHashSyncerStub) ClearFields()
ClearFields --
func (*HeadersByHashSyncerStub) GetHeaders ¶
func (hhss *HeadersByHashSyncerStub) GetHeaders() (map[string]data.HeaderHandler, error)
GetHeaders --
func (*HeadersByHashSyncerStub) IsInterfaceNil ¶
func (hhss *HeadersByHashSyncerStub) IsInterfaceNil() bool
IsInterfaceNil --
func (*HeadersByHashSyncerStub) SyncMissingHeadersByHash ¶
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) 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) 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 ¶
type ImportStartHandlerStub struct { SetStartImportCalled func() error ResetStartImportCalled func() error ShouldStartImportCalled func() bool IsAfterExportBeforeImportCalled func() bool }
ImportStartHandlerStub -
func (*ImportStartHandlerStub) IsAfterExportBeforeImport ¶
func (ish *ImportStartHandlerStub) IsAfterExportBeforeImport() bool
IsAfterExportBeforeImport -
func (*ImportStartHandlerStub) IsInterfaceNil ¶
func (ish *ImportStartHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ImportStartHandlerStub) ResetStartImport ¶
func (ish *ImportStartHandlerStub) ResetStartImport() error
ResetStartImport -
func (*ImportStartHandlerStub) SetStartImport ¶
func (ish *ImportStartHandlerStub) SetStartImport() error
SetStartImport -
func (*ImportStartHandlerStub) ShouldStartImport ¶
func (ish *ImportStartHandlerStub) ShouldStartImport() bool
ShouldStartImport -
type KeyGenMock ¶
type KeyGenMock struct { }
KeyGenMock -
func (*KeyGenMock) CheckPublicKeyValid ¶
func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error
CheckPublicKeyValid -
func (*KeyGenMock) GeneratePair ¶
func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
GeneratePair -
func (*KeyGenMock) IsInterfaceNil ¶
func (keyGen *KeyGenMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*KeyGenMock) PrivateKeyFromByteArray ¶
func (keyGen *KeyGenMock) PrivateKeyFromByteArray(_ []byte) (crypto.PrivateKey, error)
PrivateKeyFromByteArray -
func (*KeyGenMock) PublicKeyFromByteArray ¶
func (keyGen *KeyGenMock) PublicKeyFromByteArray(_ []byte) (crypto.PublicKey, error)
PublicKeyFromByteArray -
type LatestStorageDataProviderStub ¶
type LatestStorageDataProviderStub struct { GetParentDirAndLastEpochCalled func() (string, uint32, error) GetCalled func() (storage.LatestDataFromStorage, error) GetShardsFromDirectoryCalled func(path string) ([]string, error) }
LatestStorageDataProviderStub -
func (*LatestStorageDataProviderStub) Get ¶
func (lsdps *LatestStorageDataProviderStub) Get() (storage.LatestDataFromStorage, error)
Get -
func (*LatestStorageDataProviderStub) GetParentDirAndLastEpoch ¶
func (lsdps *LatestStorageDataProviderStub) GetParentDirAndLastEpoch() (string, uint32, error)
GetParentDirAndLastEpoch -
func (*LatestStorageDataProviderStub) GetShardsFromDirectory ¶
func (lsdps *LatestStorageDataProviderStub) GetShardsFromDirectory(path string) ([]string, error)
GetShardsFromDirectory -
func (*LatestStorageDataProviderStub) IsInterfaceNil ¶
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 ¶
type MessengerStub struct { ConnectedPeersCalled func() []core.PeerID RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error UnjoinAllTopicsCalled func() error }
MessengerStub -
func (*MessengerStub) ConnectedPeers ¶
func (m *MessengerStub) ConnectedPeers() []core.PeerID
ConnectedPeers -
func (*MessengerStub) ConnectedPeersOnTopic ¶
func (m *MessengerStub) ConnectedPeersOnTopic(_ string) []core.PeerID
ConnectedPeersOnTopic -
func (*MessengerStub) CreateTopic ¶
func (m *MessengerStub) CreateTopic(_ string, _ bool) error
CreateTopic -
func (*MessengerStub) IsInterfaceNil ¶
func (m *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MessengerStub) RegisterMessageProcessor ¶
func (m *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
RegisterMessageProcessor -
func (*MessengerStub) SendToConnectedPeer ¶
SendToConnectedPeer -
func (*MessengerStub) UnjoinAllTopics ¶
func (m *MessengerStub) UnjoinAllTopics() error
UnjoinAllTopics -
func (*MessengerStub) UnregisterAllMessageProcessors ¶
func (m *MessengerStub) UnregisterAllMessageProcessors() error
UnregisterAllMessageProcessors -
func (*MessengerStub) UnregisterMessageProcessor ¶
func (m *MessengerStub) UnregisterMessageProcessor(_ string) error
UnregisterMessageProcessor -
type MetaBlockInterceptorProcessorStub ¶
type MetaBlockInterceptorProcessorStub struct {
GetEpochStartMetaBlockCalled func() (*block.MetaBlock, error)
}
MetaBlockInterceptorProcessorStub -
func (*MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock ¶
func (m *MetaBlockInterceptorProcessorStub) GetEpochStartMetaBlock(_ context.Context) (*block.MetaBlock, error)
GetEpochStartMetaBlock -
func (*MetaBlockInterceptorProcessorStub) IsInterfaceNil ¶
func (m *MetaBlockInterceptorProcessorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MetaBlockInterceptorProcessorStub) RegisterHandler ¶
func (m *MetaBlockInterceptorProcessorStub) RegisterHandler(_ func(topic string, hash []byte, data interface{}))
RegisterHandler -
func (*MetaBlockInterceptorProcessorStub) Save ¶
func (m *MetaBlockInterceptorProcessorStub) Save(_ process.InterceptedData, _ core.PeerID, _ string) error
Save -
func (*MetaBlockInterceptorProcessorStub) SignalEndOfProcessing ¶
func (m *MetaBlockInterceptorProcessorStub) SignalEndOfProcessing(_ []process.InterceptedData)
SignalEndOfProcessing -
func (*MetaBlockInterceptorProcessorStub) Validate ¶
func (m *MetaBlockInterceptorProcessorStub) Validate(_ process.InterceptedData, _ core.PeerID) error
Validate -
type NodeInfoMock ¶
type NodeInfoMock struct {
// contains filtered or unexported fields
}
NodeInfoMock -
func NewNodeInfo ¶
func NewNodeInfo(address []byte, pubKey []byte, shardId uint32) *NodeInfoMock
NewNodeInfo -
type NodeShufflerMock ¶
type NodeShufflerMock struct { }
NodeShufflerMock -
func (*NodeShufflerMock) IsInterfaceNil ¶
func (nsm *NodeShufflerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*NodeShufflerMock) UpdateNodeLists ¶
func (nsm *NodeShufflerMock) UpdateNodeLists(args sharding.ArgsUpdateNodes) (*sharding.ResUpdateNodes, error)
UpdateNodeLists -
func (*NodeShufflerMock) UpdateParams ¶
func (nsm *NodeShufflerMock) UpdateParams( _ uint32, _ uint32, _ float32, _ bool, )
UpdateParams -
type NodesCoordinatorStub ¶
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 ¶
func (ncm *NodesCoordinatorStub) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
ComputeAdditionalLeaving -
func (*NodesCoordinatorStub) ComputeConsensusGroup ¶
func (ncm *NodesCoordinatorStub) ComputeConsensusGroup( randomness []byte, round uint64, shardId uint32, epoch uint32, ) (validatorsGroup []sharding.Validator, err error)
ComputeConsensusGroup -
func (*NodesCoordinatorStub) ConsensusGroupSize ¶
func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllEligibleValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllLeavingValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllWaitingValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetChance ¶
func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32
GetChance -
func (*NodesCoordinatorStub) GetConsensusValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetConsensusValidatorsPublicKeys( randomness []byte, round uint64, shardId uint32, epoch uint32, ) ([]string, error)
GetConsensusValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetConsensusWhitelistedNodes ¶
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 ¶
func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64
GetNumTotalEligible -
func (*NodesCoordinatorStub) GetOwnPublicKey ¶
func (ncm *NodesCoordinatorStub) GetOwnPublicKey() []byte
GetOwnPublicKey -
func (*NodesCoordinatorStub) GetSavedStateKey ¶
func (ncm *NodesCoordinatorStub) GetSavedStateKey() []byte
GetSavedStateKey -
func (*NodesCoordinatorStub) GetSelectedPublicKeys ¶
func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)
GetSelectedPublicKeys -
func (*NodesCoordinatorStub) GetValidatorWithPublicKey ¶
func (ncm *NodesCoordinatorStub) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
GetValidatorWithPublicKey -
func (*NodesCoordinatorStub) GetValidatorsIndexes ¶
func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)
GetValidatorsIndexes -
func (*NodesCoordinatorStub) IsInterfaceNil ¶
func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NodesCoordinatorStub) LoadState ¶
func (ncm *NodesCoordinatorStub) LoadState(_ []byte) error
LoadState -
func (*NodesCoordinatorStub) SetConfig ¶
func (ncm *NodesCoordinatorStub) SetConfig(_ *sharding.NodesCoordinatorRegistry) error
SetConfig -
func (*NodesCoordinatorStub) SetNodesPerShards ¶
func (ncm *NodesCoordinatorStub) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, _ []sharding.Validator, _ uint32) error
SetNodesPerShards -
func (*NodesCoordinatorStub) ShardIdForEpoch ¶
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 ¶
func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)
ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler
func (*NodesCoordinatorStub) ValidatorsWeights ¶
func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)
ValidatorsWeights -
type NodesSetupStub ¶
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 }
NodesSetupStub -
func (*NodesSetupStub) GetMetaConsensusGroupSize ¶
func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32
GetMetaConsensusGroupSize -
func (*NodesSetupStub) GetMinTransactionVersion ¶
func (n *NodesSetupStub) GetMinTransactionVersion() uint32
GetMinTransactionVersion -
func (*NodesSetupStub) GetRoundDuration ¶
func (n *NodesSetupStub) GetRoundDuration() uint64
GetRoundDuration -
func (*NodesSetupStub) GetShardConsensusGroupSize ¶
func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32
GetShardConsensusGroupSize -
func (*NodesSetupStub) InitialNodesInfo ¶
func (n *NodesSetupStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
InitialNodesInfo -
func (*NodesSetupStub) InitialNodesInfoForShard ¶
func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
InitialNodesInfoForShard -
func (*NodesSetupStub) IsInterfaceNil ¶
func (n *NodesSetupStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*NodesSetupStub) MinNumberOfNodes ¶
func (n *NodesSetupStub) MinNumberOfNodes() uint32
MinNumberOfNodes -
func (*NodesSetupStub) NumberOfShards ¶
func (n *NodesSetupStub) NumberOfShards() uint32
NumberOfShards -
type PathManagerStub ¶
type PathManagerStub struct { PathForEpochCalled func(shardId string, epoch uint32, identifier string) string PathForStaticCalled func(shardId string, identifier string) string }
PathManagerStub -
func (*PathManagerStub) IsInterfaceNil ¶
func (p *PathManagerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PathManagerStub) PathForEpoch ¶
func (p *PathManagerStub) PathForEpoch(shardId string, epoch uint32, identifier string) string
PathForEpoch -
func (*PathManagerStub) PathForStatic ¶
func (p *PathManagerStub) PathForStatic(shardId string, identifier string) string
PathForStatic -
type PendingMiniBlockSyncHandlerStub ¶
type PendingMiniBlockSyncHandlerStub struct { SyncPendingMiniBlocksCalled func(miniBlockHeaders []block.MiniBlockHeader, ctx context.Context) error GetMiniBlocksCalled func() (map[string]*block.MiniBlock, error) }
PendingMiniBlockSyncHandlerStub -
func (*PendingMiniBlockSyncHandlerStub) ClearFields ¶
func (pm *PendingMiniBlockSyncHandlerStub) ClearFields()
ClearFields --
func (*PendingMiniBlockSyncHandlerStub) GetMiniBlocks ¶
func (pm *PendingMiniBlockSyncHandlerStub) GetMiniBlocks() (map[string]*block.MiniBlock, error)
GetMiniBlocks -
func (*PendingMiniBlockSyncHandlerStub) IsInterfaceNil ¶
func (pm *PendingMiniBlockSyncHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PendingMiniBlockSyncHandlerStub) SyncPendingMiniBlocks ¶
func (pm *PendingMiniBlockSyncHandlerStub) SyncPendingMiniBlocks(miniBlockHeaders []block.MiniBlockHeader, ctx context.Context) error
SyncPendingMiniBlocks -
type PrivateKeyMock ¶
type PrivateKeyMock struct { }
PrivateKeyMock -
func (*PrivateKeyMock) GeneratePublic ¶
func (sk *PrivateKeyMock) GeneratePublic() crypto.PublicKey
GeneratePublic -
func (*PrivateKeyMock) IsInterfaceNil ¶
func (sk *PrivateKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyMock) ToByteArray ¶
func (sk *PrivateKeyMock) ToByteArray() ([]byte, error)
ToByteArray -
type PrivateKeyStub ¶
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 ¶
func (privKey *PrivateKeyStub) GeneratePublic() crypto.PublicKey
GeneratePublic builds a public key for the current private key
func (*PrivateKeyStub) IsInterfaceNil ¶
func (privKey *PrivateKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyStub) Scalar ¶
func (privKey *PrivateKeyStub) Scalar() crypto.Scalar
Scalar returns the Scalar corresponding to this Private Key
func (*PrivateKeyStub) Suite ¶
func (privKey *PrivateKeyStub) Suite() crypto.Suite
Suite returns the Suite (curve data) used for this private key
func (*PrivateKeyStub) ToByteArray ¶
func (privKey *PrivateKeyStub) ToByteArray() ([]byte, error)
ToByteArray returns the byte array representation of the private key
type PubkeyConverterMock ¶
type PubkeyConverterMock struct {
// contains filtered or unexported fields
}
PubkeyConverterMock -
func NewPubkeyConverterMock ¶
func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock
NewPubkeyConverterMock -
func (*PubkeyConverterMock) Decode ¶
func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)
Decode -
func (*PubkeyConverterMock) Encode ¶
func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string
Encode -
func (*PubkeyConverterMock) IsInterfaceNil ¶
func (pcm *PubkeyConverterMock) IsInterfaceNil() bool
IsInterfaceNil -
type PublicKeyMock ¶
type PublicKeyMock struct { }
PublicKeyMock -
func (*PublicKeyMock) IsInterfaceNil ¶
func (sspk *PublicKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyMock) ToByteArray ¶
func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)
ToByteArray -
type PublicKeyStub ¶
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 ¶
func (pubKey *PublicKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyStub) Point ¶
func (pubKey *PublicKeyStub) Point() crypto.Point
Point returns the Point corresponding to this Public Key
func (*PublicKeyStub) Suite ¶
func (pubKey *PublicKeyStub) Suite() crypto.Suite
Suite returns the Suite (curve data) used for this private key
func (*PublicKeyStub) ToByteArray ¶
func (pubKey *PublicKeyStub) ToByteArray() ([]byte, error)
ToByteArray returns the byte array representation of the public key
type RaterStub ¶
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 ¶
func (rm *RaterStub) ComputeDecreaseProposer(shardId uint32, currentRating uint32, consecutiveMisses uint32) uint32
ComputeDecreaseProposer -
func (*RaterStub) ComputeDecreaseValidator ¶
ComputeDecreaseValidator -
func (*RaterStub) ComputeIncreaseProposer ¶
ComputeIncreaseProposer -
func (*RaterStub) ComputeIncreaseValidator ¶
ComputeIncreaseValidator -
func (*RaterStub) GetSignedBlocksThreshold ¶
GetSignedBlocksThreshold -
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 ¶
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 ¶
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 ¶
func (rhs *RequestHandlerStub) RequestMiniBlock(_ uint32, _ []byte)
RequestMiniBlock -
func (*RequestHandlerStub) RequestMiniBlocks ¶
func (rhs *RequestHandlerStub) RequestMiniBlocks(shardId uint32, miniblockHashes [][]byte)
RequestMiniBlock -
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 ¶
func (rhs *RequestHandlerStub) RequestTrieNodes(_ uint32, _ [][]byte, _ string)
RequestTrieNodes -
func (*RequestHandlerStub) RequestUnsignedTransactions ¶
func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
RequestUnsignedTransactions -
func (*RequestHandlerStub) SetNumPeersToQuery ¶
func (rhs *RequestHandlerStub) SetNumPeersToQuery(key string, intra int, cross int) error
SetNumPeersToQuery -
type RewardsHandlerStub ¶
type RewardsHandlerStub struct { LeaderPercentageCalled func() float64 CommunityPercentageCalled func() float64 CommunityAddressCalled func() string MinInflationRateCalled func() float64 MaxInflationRateCalled func(year uint32) float64 }
RewardsHandlerStub -
func (*RewardsHandlerStub) CommunityAddress ¶
func (r *RewardsHandlerStub) CommunityAddress() string
CommunityAddress will return the community address
func (*RewardsHandlerStub) CommunityPercentage ¶
func (r *RewardsHandlerStub) CommunityPercentage() float64
CommunityPercentage will return the community percentage value
func (*RewardsHandlerStub) IsInterfaceNil ¶
func (r *RewardsHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*RewardsHandlerStub) LeaderPercentage ¶
func (r *RewardsHandlerStub) LeaderPercentage() float64
LeaderPercentage -
func (*RewardsHandlerStub) MaxInflationRate ¶
func (r *RewardsHandlerStub) MaxInflationRate(year uint32) float64
MaxInflationRate -
func (*RewardsHandlerStub) MinInflationRate ¶
func (r *RewardsHandlerStub) MinInflationRate() float64
MinInflationRate -
type RoundTimeDurationHandler ¶
RoundTimeDurationHandler -
func (*RoundTimeDurationHandler) IsInterfaceNil ¶
func (r *RoundTimeDurationHandler) IsInterfaceNil() bool
IsInterfaceNil -
func (*RoundTimeDurationHandler) TimeDuration ¶
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) IsInterfaceNil ¶
func (rndm *RounderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RounderStub) RemainingTime ¶
RemainingTime -
func (*RounderStub) TimeDuration ¶
func (rndm *RounderStub) TimeDuration() time.Duration
TimeDuration -
func (*RounderStub) UpdateRound ¶
func (rndm *RounderStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
UpdateRound -
type ShardCoordinatorStub ¶
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 ¶
func (coordinator *ShardCoordinatorStub) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (*ShardCoordinatorStub) ComputeId ¶
func (coordinator *ShardCoordinatorStub) ComputeId(address []byte) uint32
ComputeId -
func (*ShardCoordinatorStub) IsInterfaceNil ¶
func (coordinator *ShardCoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardCoordinatorStub) NumberOfShards ¶
func (coordinator *ShardCoordinatorStub) NumberOfShards() uint32
NumberOfShards -
func (*ShardCoordinatorStub) SameShard ¶
func (coordinator *ShardCoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
SameShard -
func (*ShardCoordinatorStub) SelfId ¶
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) 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 ¶
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 ¶
func (s *SignerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SignerStub) Sign ¶
func (s *SignerStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign -
type StorageManagerStub ¶
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 ¶
func (sms *StorageManagerStub) CancelPrune([]byte, data.TriePruningIdentifier)
CancelPrune --
func (*StorageManagerStub) Database ¶
func (sms *StorageManagerStub) Database() data.DBWriteCacher
Database --
func (*StorageManagerStub) EnterSnapshotMode ¶
func (sms *StorageManagerStub) EnterSnapshotMode()
EnterSnapshotMode --
func (*StorageManagerStub) ExitSnapshotMode ¶
func (sms *StorageManagerStub) ExitSnapshotMode()
ExitSnapshotMode --
func (*StorageManagerStub) GetSnapshotThatContainsHash ¶
func (sms *StorageManagerStub) GetSnapshotThatContainsHash(d []byte) data.SnapshotDbHandler
GetSnapshotThatContainsHash --
func (*StorageManagerStub) IsInterfaceNil ¶
func (sms *StorageManagerStub) IsInterfaceNil() bool
IsInterfaceNil --
func (*StorageManagerStub) IsPruningEnabled ¶
func (sms *StorageManagerStub) IsPruningEnabled() bool
IsPruningEnabled --
func (*StorageManagerStub) MarkForEviction ¶
func (sms *StorageManagerStub) MarkForEviction(d []byte, m data.ModifiedHashes) error
MarkForEviction --
func (*StorageManagerStub) Prune ¶
func (sms *StorageManagerStub) Prune([]byte, data.TriePruningIdentifier)
Prune --
func (*StorageManagerStub) SetCheckpoint ¶
func (sms *StorageManagerStub) SetCheckpoint([]byte)
SetCheckpoint --
func (*StorageManagerStub) TakeSnapshot ¶
func (sms *StorageManagerStub) TakeSnapshot([]byte)
TakeSnapshot --
type StorerMock ¶
type StorerMock struct {
// contains filtered or unexported fields
}
StorerMock -
func (*StorerMock) GetFromEpoch ¶
func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
GetFromEpoch -
func (*StorerMock) HasInEpoch ¶
func (sm *StorerMock) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerMock) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerMock) SearchFirst ¶
func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type StorerStub ¶
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 }
StorerStub -
func (*StorerStub) GetFromEpoch ¶
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
GetFromEpoch -
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) 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) 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 ¶
func (sts *SyncTimerStub) StartSyncingTime()
StartSyncingTime is a mock implementation for StartSyncingTime
type TrieStub ¶
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 GetAllLeavesCalled func() (map[string][]byte, error) GetAllHashesCalled func() ([][]byte, error) IsPruningEnabledCalled func() bool ClosePersisterCalled func() error GetAllLeavesOnChannelCalled func() chan core.KeyValueHolder }
TrieStub -
func (*TrieStub) AppendToOldHashes ¶
AppendToOldHashes appends the given hashes to the trie's oldHashes variable
func (*TrieStub) CancelPrune ¶
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) GetAllLeaves ¶
GetAllLeaves -
func (*TrieStub) GetAllLeavesOnChannel ¶
func (ts *TrieStub) GetAllLeavesOnChannel() chan core.KeyValueHolder
GetAllLeavesOnChannel -
func (*TrieStub) GetDirtyHashes ¶
func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
GetDirtyHashes -
func (*TrieStub) GetSerializedNodes ¶
GetSerializedNodes -
func (*TrieStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*TrieStub) Prune ¶
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) ResetOldHashes ¶
ResetOldHashes resets the oldHashes and oldRoot variables and returns the old hashes
func (*TrieStub) SetNewHashes ¶
func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)
SetNewHashes -
type TriesHolderMock ¶
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) IsInterfaceNil ¶
func (thm *TriesHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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
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) Get ¶
func (usmcs *Uint64SyncMapCacherStub) Get(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
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 ¶
func (usmcs *Uint64SyncMapCacherStub) Merge(nonce uint64, src dataRetriever.ShardIdHashMap)
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 ¶
type UnitOpenerStub struct { }
UnitOpenerStub -
func (*UnitOpenerStub) GetMostRecentBootstrapStorageUnit ¶
func (u *UnitOpenerStub) GetMostRecentBootstrapStorageUnit() (storage.Storer, error)
GetMostRecentBootstrapStorageUnit -
func (*UnitOpenerStub) IsInterfaceNil ¶
func (u *UnitOpenerStub) IsInterfaceNil() bool
IsInterfaceNil -
type ValidatorInfoSyncerStub ¶
type ValidatorInfoSyncerStub struct { }
ValidatorInfoSyncerStub -
func (*ValidatorInfoSyncerStub) IsInterfaceNil ¶
func (vip *ValidatorInfoSyncerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorInfoSyncerStub) SyncMiniBlocks ¶
func (vip *ValidatorInfoSyncerStub) SyncMiniBlocks(*block.MetaBlock) ([][]byte, data.BodyHandler, error)
SyncMiniBlocks -
type ValidatorStatisticsProcessorStub ¶
type ValidatorStatisticsProcessorStub struct { ProcessCalled func(validatorInfo data.ShardValidatorInfoHandler) error CommitCalled func() ([]byte, error) IsInterfaceNilCalled func() bool }
ValidatorStatisticsProcessorStub -
func (*ValidatorStatisticsProcessorStub) Commit ¶
func (pm *ValidatorStatisticsProcessorStub) Commit() ([]byte, error)
Commit -
func (*ValidatorStatisticsProcessorStub) IsInterfaceNil ¶
func (pm *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorStatisticsProcessorStub) Process ¶
func (pm *ValidatorStatisticsProcessorStub) Process(validatorInfo data.ShardValidatorInfoHandler) error
Process -
type WhiteListHandlerStub ¶
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) IsForCurrentShard ¶
func (w *WhiteListHandlerStub) IsForCurrentShard(interceptedData process.InterceptedData) bool
IsForCurrentShard -
func (*WhiteListHandlerStub) IsInterfaceNil ¶
func (w *WhiteListHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*WhiteListHandlerStub) IsWhiteListed ¶
func (w *WhiteListHandlerStub) IsWhiteListed(interceptedData process.InterceptedData) bool
IsWhiteListed -
Source Files ¶
- addressMock.go
- appStatusHandlerStub.go
- argumentsParserMock.go
- chainStorerStub.go
- epochStartNotifierStub.go
- hasherMock.go
- headerValidatorStub.go
- headersByHashSyncerStub.go
- headersCacherStub.go
- importStartHandlerStub.go
- interceptedMetaBlockMock.go
- keyGenMock.go
- keyStub.go
- latestStorageDataProviderStub.go
- marshalizerMock.go
- messengerStub.go
- metaBlockInterceptorProcessorStub.go
- multiShardsCoordinatorMock.go
- nodeInfoMock.go
- nodesCoordinatorStub.go
- nodesSetupStub.go
- pathManagerStub.go
- pendingMiniBlockSyncHandlerStub.go
- pubkeyConverterMock.go
- raterStub.go
- requestHandlerStub.go
- rewardsHandlerStub.go
- roundTimeDurationStub.go
- rounderStub.go
- shardCoordinatorStub.go
- shardIdHashMapStub.go
- shufflerMock.go
- signerStub.go
- storageManagerStub.go
- storerMock.go
- storerStub.go
- syncTimerStub.go
- trieStub.go
- triesHolderMock.go
- uint64ByteSliceConverterMock.go
- uint64SyncMapCacherStub.go
- unitOpenerStub.go
- validatorInfoSyncerStub.go
- validatorStatisticsProcessorStub.go
- whiteListHandlerStub.go