Documentation ¶
Index ¶
- func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
- func NewNonceHashConverterMock() *nonceHashConverterMock
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- func NewTopicMessageHandlerStub() *topicMessageHandlerStub
- type BlockChainMock
- func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
- func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
- func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
- func (bc *BlockChainMock) GetLocalHeight() int64
- func (bc *BlockChainMock) GetNetworkHeight() int64
- func (bc *BlockChainMock) HasBadBlock(blockHash []byte) bool
- func (bc *BlockChainMock) IsInterfaceNil() bool
- func (bc *BlockChainMock) PutBadBlock(blockHash []byte)
- func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error
- func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
- func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
- func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
- func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
- func (bc *BlockChainMock) SetLocalHeight(height int64)
- func (bc *BlockChainMock) SetNetworkHeight(height int64)
- type CacherMock
- func (cm *CacherMock) Clear()
- func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Has(key []byte) bool
- func (cm *CacherMock) HasOrAdd(key []byte, value interface{}) (bool, bool)
- func (cm *CacherMock) IsInterfaceNil() bool
- func (cm *CacherMock) Keys() [][]byte
- func (cm *CacherMock) Len() int
- func (cm *CacherMock) MaxSize() int
- func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Put(key []byte, value interface{}) (evicted bool)
- func (cm *CacherMock) RegisterHandler(func(key []byte))
- func (cm *CacherMock) Remove(key []byte)
- func (cm *CacherMock) RemoveOldest()
- type CacherStub
- func (cs *CacherStub) Clear()
- func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Has(key []byte) bool
- func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
- func (cs *CacherStub) IsInterfaceNil() bool
- func (cs *CacherStub) Keys() [][]byte
- func (cs *CacherStub) Len() int
- func (cs *CacherStub) MaxSize() int
- func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
- func (cs *CacherStub) RegisterHandler(handler func(key []byte))
- func (cs *CacherStub) Remove(key []byte)
- func (cs *CacherStub) RemoveOldest()
- 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
- type CoordinatorStub
- func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
- func (coordinator *CoordinatorStub) ComputeId(address state.AddressContainer) uint32
- func (coordinator *CoordinatorStub) IsInterfaceNil() bool
- func (coordinator *CoordinatorStub) NumberOfShards() uint32
- func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress state.AddressContainer) bool
- func (coordinator *CoordinatorStub) SelfId() uint32
- type DataPackerStub
- type EpochHandlerStub
- type HashSliceResolverStub
- func (hsrs *HashSliceResolverStub) IsInterfaceNil() bool
- func (hsrs *HashSliceResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hsrs *HashSliceResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (hsrs *HashSliceResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
- type HasherMock
- type HasherStub
- type HeaderResolverStub
- func (hrs *HeaderResolverStub) IsInterfaceNil() bool
- func (hrs *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hrs *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error
- func (hrs *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (hrs *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error
- func (hrs *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) 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) 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 IntRandomizerMock
- type MarshalizerMock
- type MarshalizerStub
- type MessageHandlerStub
- type MessengerStub
- func (ms *MessengerStub) Addresses() []string
- func (ms *MessengerStub) Bootstrap() error
- func (ms *MessengerStub) Broadcast(topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
- func (ms *MessengerStub) Close() error
- func (ms *MessengerStub) ConnectToPeer(address string) error
- func (ms *MessengerStub) ConnectedPeers() []p2p.PeerID
- func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
- func (ms *MessengerStub) HasTopic(name string) bool
- func (ms *MessengerStub) HasTopicValidator(name string) bool
- func (ms *MessengerStub) ID() p2p.PeerID
- func (ms *MessengerStub) IsConnected(peerID p2p.PeerID) bool
- func (ms *MessengerStub) IsInterfaceNil() bool
- func (ms *MessengerStub) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer
- func (ms *MessengerStub) Peers() []p2p.PeerID
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- func (ms *MessengerStub) SendToConnectedPeer(topic string, buff []byte, peerID p2p.PeerID) error
- func (ms *MessengerStub) TrimConnections()
- func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
- type P2PMessageMock
- func (msg *P2PMessageMock) Data() []byte
- func (msg *P2PMessageMock) From() []byte
- func (msg *P2PMessageMock) IsInterfaceNil() bool
- func (msg *P2PMessageMock) Key() []byte
- func (msg *P2PMessageMock) Peer() p2p.PeerID
- func (msg *P2PMessageMock) SeqNo() []byte
- func (msg *P2PMessageMock) Signature() []byte
- func (msg *P2PMessageMock) TopicIDs() []string
- type PeerListCreatorStub
- type PoolsHolderStub
- func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (phs *PoolsHolderStub) Headers() dataRetriever.HeadersPool
- func (phs *PoolsHolderStub) IsInterfaceNil() bool
- func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
- func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
- func (phs *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (phs *PoolsHolderStub) TrieNodes() storage.Cacher
- func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type RequestedItemsHandlerStub
- type ResolverStub
- type ResolversContainerStub
- func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
- func (rcs *ResolversContainerStub) IsInterfaceNil() bool
- func (rcs *ResolversContainerStub) Len() int
- func (rcs *ResolversContainerStub) Remove(key string)
- func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
- type ResolversFinderStub
- func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
- type ShardedDataStub
- func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
- func (sd *ShardedDataStub) Clear()
- func (sd *ShardedDataStub) ClearShardStore(cacheId string)
- func (sd *ShardedDataStub) CreateShardStore(cacheId string)
- func (sd *ShardedDataStub) IsInterfaceNil() bool
- func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)
- func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
- func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
- func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
- func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
- func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
- func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
- 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 TopicHandlerStub
- type TopicResolverSenderStub
- func (trss *TopicResolverSenderStub) IsInterfaceNil() bool
- func (trss *TopicResolverSenderStub) Send(buff []byte, peer p2p.PeerID) error
- func (trss *TopicResolverSenderStub) SendOnRequestTopic(rd *dataRetriever.RequestData) error
- func (trss *TopicResolverSenderStub) TargetShardID() uint32
- func (trss *TopicResolverSenderStub) TopicRequestSuffix() string
- 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) DeepClone() (data.Trie, error)
- func (ts *TrieStub) Delete(key []byte) error
- func (ts *TrieStub) Get(key []byte) ([]byte, error)
- func (ts *TrieStub) GetAllLeaves() (map[string][]byte, error)
- func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, error)
- func (ts *TrieStub) IsInterfaceNil() bool
- func (ts *TrieStub) IsPruningEnabled() bool
- func (ts *TrieStub) Prove(key []byte) ([][]byte, error)
- func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier) error
- func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)
- func (ts *TrieStub) ResetOldHashes() [][]byte
- func (ts *TrieStub) Root() ([]byte, error)
- func (ts *TrieStub) SetCheckpoint(_ []byte)
- func (ts *TrieStub) String() string
- func (ts *TrieStub) TakeSnapshot(_ []byte)
- func (ts *TrieStub) Update(key, value []byte) error
- func (ts *TrieStub) VerifyProof(proofs [][]byte, key []byte) (bool, error)
- type TxForCurrentBlockStub
- type Uint64ByteSliceConverterMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultipleShardsCoordinatorMock ¶
func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
func NewNonceHashConverterMock ¶
func NewNonceHashConverterMock() *nonceHashConverterMock
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
func NewTopicMessageHandlerStub ¶
func NewTopicMessageHandlerStub() *topicMessageHandlerStub
Types ¶
type BlockChainMock ¶
type BlockChainMock struct { GetGenesisHeaderCalled func() data.HeaderHandler SetGenesisHeaderCalled func(handler data.HeaderHandler) error GetGenesisHeaderHashCalled func() []byte SetGenesisHeaderHashCalled func([]byte) GetCurrentBlockHeaderCalled func() data.HeaderHandler SetCurrentBlockHeaderCalled func(data.HeaderHandler) error GetCurrentBlockHeaderHashCalled func() []byte SetCurrentBlockHeaderHashCalled func([]byte) GetCurrentBlockBodyCalled func() data.BodyHandler SetCurrentBlockBodyCalled func(data.BodyHandler) error GetLocalHeightCalled func() int64 SetLocalHeightCalled func(int64) GetNetworkHeightCalled func() int64 SetNetworkHeightCalled func(int64) HasBadBlockCalled func([]byte) bool PutBadBlockCalled func([]byte) }
BlockChainMock is a mock implementation of the blockchain interface
func (*BlockChainMock) GetCurrentBlockBody ¶
func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
GetCurrentBlockBody returns the tx block body pointer
func (*BlockChainMock) GetCurrentBlockHeader ¶
func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
GetCurrentBlockHeader returns current block header pointer
func (*BlockChainMock) GetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
GetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) GetGenesisHeader ¶
func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
GetGenesisHeader returns the genesis block header pointer
func (*BlockChainMock) GetGenesisHeaderHash ¶
func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
GetGenesisHeaderHash returns the genesis block header hash
func (*BlockChainMock) GetLocalHeight ¶ added in v1.0.3
func (bc *BlockChainMock) GetLocalHeight() int64
GetLocalHeight returns the height of the local chain
func (*BlockChainMock) GetNetworkHeight ¶ added in v1.0.3
func (bc *BlockChainMock) GetNetworkHeight() int64
GetNetworkHeight sets the perceived height of the network chain
func (*BlockChainMock) HasBadBlock ¶ added in v1.0.3
func (bc *BlockChainMock) HasBadBlock(blockHash []byte) bool
HasBadBlock returns true if the provided hash is blacklisted as a bad block, or false otherwise
func (*BlockChainMock) IsInterfaceNil ¶
func (bc *BlockChainMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockChainMock) PutBadBlock ¶ added in v1.0.3
func (bc *BlockChainMock) PutBadBlock(blockHash []byte)
PutBadBlock adds the given serialized block to the bad block cache, blacklisting it
func (*BlockChainMock) SetCurrentBlockBody ¶
func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error
SetCurrentBlockBody sets the tx block body pointer
func (*BlockChainMock) SetCurrentBlockHeader ¶
func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
SetCurrentBlockHeader sets current block header pointer
func (*BlockChainMock) SetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
SetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) SetGenesisHeader ¶
func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
SetGenesisHeader sets the genesis block header pointer
func (*BlockChainMock) SetGenesisHeaderHash ¶
func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
SetGenesisHeaderHash sets the genesis block header hash
func (*BlockChainMock) SetLocalHeight ¶ added in v1.0.3
func (bc *BlockChainMock) SetLocalHeight(height int64)
SetLocalHeight sets the height of the local chain
func (*BlockChainMock) SetNetworkHeight ¶ added in v1.0.3
func (bc *BlockChainMock) SetNetworkHeight(height int64)
SetNetworkHeight sets the perceived height of the network chain
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
func (*CacherMock) Clear ¶
func (cm *CacherMock) Clear()
func (*CacherMock) Get ¶
func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
func (*CacherMock) Has ¶
func (cm *CacherMock) Has(key []byte) bool
func (*CacherMock) HasOrAdd ¶
func (cm *CacherMock) HasOrAdd(key []byte, value interface{}) (bool, bool)
func (*CacherMock) IsInterfaceNil ¶
func (cm *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Keys ¶
func (cm *CacherMock) Keys() [][]byte
func (*CacherMock) Len ¶
func (cm *CacherMock) Len() int
func (*CacherMock) MaxSize ¶
func (cm *CacherMock) MaxSize() int
func (*CacherMock) Peek ¶
func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
func (*CacherMock) Put ¶
func (cm *CacherMock) Put(key []byte, value interface{}) (evicted bool)
func (*CacherMock) RegisterHandler ¶
func (cm *CacherMock) RegisterHandler(func(key []byte))
func (*CacherMock) Remove ¶
func (cm *CacherMock) Remove(key []byte)
func (*CacherMock) RemoveOldest ¶
func (cm *CacherMock) RemoveOldest()
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}) (ok, evicted bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte)) }
func (*CacherStub) Clear ¶
func (cs *CacherStub) Clear()
func (*CacherStub) Get ¶
func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
func (*CacherStub) Has ¶
func (cs *CacherStub) Has(key []byte) bool
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
func (*CacherStub) IsInterfaceNil ¶
func (cs *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Keys ¶
func (cs *CacherStub) Keys() [][]byte
func (*CacherStub) Len ¶
func (cs *CacherStub) Len() int
func (*CacherStub) MaxSize ¶
func (cs *CacherStub) MaxSize() int
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte))
func (*CacherStub) Remove ¶
func (cs *CacherStub) Remove(key []byte)
func (*CacherStub) RemoveOldest ¶
func (cs *CacherStub) RemoveOldest()
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 CloseAllCalled func() error }
ChainStorerMock is a mock implementation of the ChianStorer 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 ¶
func (bc *ChainStorerMock) CloseAll() error
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 ¶
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
type CoordinatorStub ¶
type CoordinatorStub struct { NumberOfShardsCalled func() uint32 ComputeIdCalled func(address state.AddressContainer) uint32 SelfIdCalled func() uint32 SameShardCalled func(firstAddress, secondAddress state.AddressContainer) bool CommunicationIdentifierCalled func(destShardID uint32) string }
func (*CoordinatorStub) CommunicationIdentifier ¶
func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
func (*CoordinatorStub) ComputeId ¶
func (coordinator *CoordinatorStub) ComputeId(address state.AddressContainer) uint32
func (*CoordinatorStub) IsInterfaceNil ¶
func (coordinator *CoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CoordinatorStub) NumberOfShards ¶
func (coordinator *CoordinatorStub) NumberOfShards() uint32
func (*CoordinatorStub) SameShard ¶
func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress state.AddressContainer) bool
func (*CoordinatorStub) SelfId ¶
func (coordinator *CoordinatorStub) SelfId() uint32
type DataPackerStub ¶
type DataPackerStub struct {
PackDataInChunksCalled func(data [][]byte, limit int) ([][]byte, error)
}
func (*DataPackerStub) IsInterfaceNil ¶
func (dps *DataPackerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*DataPackerStub) PackDataInChunks ¶
func (dps *DataPackerStub) PackDataInChunks(data [][]byte, limit int) ([][]byte, error)
type EpochHandlerStub ¶
type EpochHandlerStub struct {
EpochCalled func() uint32
}
func (*EpochHandlerStub) Epoch ¶
func (ehs *EpochHandlerStub) Epoch() uint32
func (*EpochHandlerStub) IsInterfaceNil ¶
func (ehs *EpochHandlerStub) IsInterfaceNil() bool
type HashSliceResolverStub ¶
type HashSliceResolverStub struct { RequestDataFromHashCalled func(hash []byte, epoch uint32) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error RequestDataFromHashArrayCalled func(hashes [][]byte, epoch uint32) error }
func (*HashSliceResolverStub) IsInterfaceNil ¶
func (hsrs *HashSliceResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HashSliceResolverStub) ProcessReceivedMessage ¶
func (hsrs *HashSliceResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
func (*HashSliceResolverStub) RequestDataFromHash ¶
func (hsrs *HashSliceResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
func (*HashSliceResolverStub) RequestDataFromHashArray ¶
func (hsrs *HashSliceResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
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 HasherStub ¶
func (HasherStub) Compute ¶
func (hash HasherStub) Compute(s string) []byte
func (HasherStub) EmptyHash ¶
func (hash HasherStub) EmptyHash() []byte
func (*HasherStub) IsInterfaceNil ¶
func (hash *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (HasherStub) Size ¶
func (HasherStub) Size() int
type HeaderResolverStub ¶
type HeaderResolverStub struct { RequestDataFromHashCalled func(hash []byte, epoch uint32) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error RequestDataFromNonceCalled func(nonce uint64, epoch uint32) error RequestDataFromEpochCalled func(identifier []byte) error SetEpochHandlerCalled func(epochHandler dataRetriever.EpochHandler) error }
func (*HeaderResolverStub) IsInterfaceNil ¶
func (hrs *HeaderResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderResolverStub) ProcessReceivedMessage ¶
func (hrs *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
func (*HeaderResolverStub) RequestDataFromEpoch ¶
func (hrs *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error
func (*HeaderResolverStub) RequestDataFromHash ¶
func (hrs *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
func (*HeaderResolverStub) RequestDataFromNonce ¶
func (hrs *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error
func (*HeaderResolverStub) SetEpochHandler ¶
func (hrs *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) error
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 }
func (*HeadersCacherStub) AddHeader ¶
func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
func (*HeadersCacherStub) Clear ¶
func (hcs *HeadersCacherStub) Clear()
func (*HeadersCacherStub) GetHeaderByHash ¶
func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
func (*HeadersCacherStub) GetHeadersByNonceAndShardId ¶
func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
func (*HeadersCacherStub) IsInterfaceNil ¶
func (hcs *HeadersCacherStub) IsInterfaceNil() bool
func (*HeadersCacherStub) Len ¶
func (hcs *HeadersCacherStub) Len() int
func (*HeadersCacherStub) MaxSize ¶
func (hcs *HeadersCacherStub) MaxSize() int
func (*HeadersCacherStub) Nonces ¶
func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
func (*HeadersCacherStub) RegisterHandler ¶
func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
func (*HeadersCacherStub) RemoveHeaderByHash ¶
func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId ¶
func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
type IntRandomizerMock ¶ added in v1.0.3
func (*IntRandomizerMock) Intn ¶ added in v1.0.3
func (irm *IntRandomizerMock) Intn(n int) (int, error)
func (*IntRandomizerMock) IsInterfaceNil ¶ added in v1.0.16
func (irm *IntRandomizerMock) 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 MarshalizerStub ¶
type MarshalizerStub struct { MarshalCalled func(obj interface{}) ([]byte, error) UnmarshalCalled func(obj interface{}, buff []byte) error }
func (*MarshalizerStub) IsInterfaceNil ¶
func (ms *MarshalizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerStub) Marshal ¶
func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)
func (*MarshalizerStub) Unmarshal ¶
func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error
type MessageHandlerStub ¶
type MessageHandlerStub struct { ConnectedPeersOnTopicCalled func(topic string) []p2p.PeerID SendToConnectedPeerCalled func(topic string, buff []byte, peerID p2p.PeerID) error }
func (*MessageHandlerStub) ConnectedPeersOnTopic ¶
func (mhs *MessageHandlerStub) ConnectedPeersOnTopic(topic string) []p2p.PeerID
func (*MessageHandlerStub) IsInterfaceNil ¶
func (mhs *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessageHandlerStub) SendToConnectedPeer ¶
type MessengerStub ¶
type MessengerStub struct { CloseCalled func() error IDCalled func() p2p.PeerID PeersCalled func() []p2p.PeerID AddressesCalled func() []string ConnectToPeerCalled func(address string) error TrimConnectionsCalled func() IsConnectedCalled func(peerID p2p.PeerID) bool ConnectedPeersCalled func() []p2p.PeerID CreateTopicCalled func(name string, createChannelForTopic bool) error HasTopicCalled func(name string) bool HasTopicValidatorCalled func(name string) bool BroadcastOnChannelCalled func(channel string, topic string, buff []byte) BroadcastCalled func(topic string, buff []byte) RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error UnregisterMessageProcessorCalled func(topic string) error SendToConnectedPeerCalled func(topic string, buff []byte, peerID p2p.PeerID) error OutgoingChannelLoadBalancerCalled func() p2p.ChannelLoadBalancer BootstrapCalled func() error }
func (*MessengerStub) Addresses ¶
func (ms *MessengerStub) Addresses() []string
func (*MessengerStub) Bootstrap ¶
func (ms *MessengerStub) Bootstrap() error
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
func (*MessengerStub) BroadcastOnChannel ¶
func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
func (*MessengerStub) Close ¶
func (ms *MessengerStub) Close() error
func (*MessengerStub) ConnectToPeer ¶
func (ms *MessengerStub) ConnectToPeer(address string) error
func (*MessengerStub) ConnectedPeers ¶
func (ms *MessengerStub) ConnectedPeers() []p2p.PeerID
func (*MessengerStub) CreateTopic ¶
func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
func (*MessengerStub) HasTopic ¶
func (ms *MessengerStub) HasTopic(name string) bool
func (*MessengerStub) HasTopicValidator ¶
func (ms *MessengerStub) HasTopicValidator(name string) bool
func (*MessengerStub) ID ¶
func (ms *MessengerStub) ID() p2p.PeerID
func (*MessengerStub) IsConnected ¶
func (ms *MessengerStub) IsConnected(peerID p2p.PeerID) bool
func (*MessengerStub) IsInterfaceNil ¶
func (ms *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessengerStub) OutgoingChannelLoadBalancer ¶
func (ms *MessengerStub) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer
func (*MessengerStub) Peers ¶
func (ms *MessengerStub) Peers() []p2p.PeerID
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
func (*MessengerStub) SendToConnectedPeer ¶
func (*MessengerStub) TrimConnections ¶
func (ms *MessengerStub) TrimConnections()
func (*MessengerStub) UnregisterMessageProcessor ¶
func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
type P2PMessageMock ¶
type P2PMessageMock struct { FromField []byte DataField []byte SeqNoField []byte TopicIDsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
func (*P2PMessageMock) Data ¶
func (msg *P2PMessageMock) Data() []byte
func (*P2PMessageMock) From ¶
func (msg *P2PMessageMock) From() []byte
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageMock) Key ¶
func (msg *P2PMessageMock) Key() []byte
func (*P2PMessageMock) Peer ¶
func (msg *P2PMessageMock) Peer() p2p.PeerID
func (*P2PMessageMock) SeqNo ¶
func (msg *P2PMessageMock) SeqNo() []byte
func (*P2PMessageMock) Signature ¶
func (msg *P2PMessageMock) Signature() []byte
func (*P2PMessageMock) TopicIDs ¶ added in v1.0.3
func (msg *P2PMessageMock) TopicIDs() []string
type PeerListCreatorStub ¶
func (*PeerListCreatorStub) IsInterfaceNil ¶
func (p *PeerListCreatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (PeerListCreatorStub) PeerList ¶
func (p PeerListCreatorStub) PeerList() []p2p.PeerID
type PoolsHolderStub ¶
type PoolsHolderStub struct { HeadersCalled func() dataRetriever.HeadersPool PeerChangesBlocksCalled func() storage.Cacher TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier RewardTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier MiniBlocksCalled func() storage.Cacher TrieNodesCalled func() storage.Cacher CurrBlockTxsCalled func() dataRetriever.TransactionCacher }
func (*PoolsHolderStub) CurrentBlockTxs ¶
func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
func (*PoolsHolderStub) Headers ¶
func (phs *PoolsHolderStub) Headers() dataRetriever.HeadersPool
func (*PoolsHolderStub) IsInterfaceNil ¶
func (phs *PoolsHolderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderStub) MiniBlocks ¶
func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
func (*PoolsHolderStub) RewardTransactions ¶
func (phs *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) Transactions ¶
func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) TrieNodes ¶
func (phs *PoolsHolderStub) TrieNodes() storage.Cacher
func (*PoolsHolderStub) UnsignedTransactions ¶
func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type RequestedItemsHandlerStub ¶
type RequestedItemsHandlerStub struct { AddCalled func(key string) error HasCalled func(key string) bool SweepCalled func() }
func (*RequestedItemsHandlerStub) Add ¶
func (rihs *RequestedItemsHandlerStub) Add(key string) error
func (*RequestedItemsHandlerStub) Has ¶
func (rihs *RequestedItemsHandlerStub) Has(key string) bool
func (*RequestedItemsHandlerStub) IsInterfaceNil ¶
func (rihs *RequestedItemsHandlerStub) IsInterfaceNil() bool
func (*RequestedItemsHandlerStub) Sweep ¶
func (rihs *RequestedItemsHandlerStub) Sweep()
type ResolverStub ¶
type ResolverStub struct { RequestDataFromHashCalled func(hash []byte, epoch uint32) error ProcessReceivedMessageCalled func(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error }
func (*ResolverStub) IsInterfaceNil ¶
func (rs *ResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolverStub) ProcessReceivedMessage ¶
func (rs *ResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error
func (*ResolverStub) RequestDataFromHash ¶
func (rs *ResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
type ResolversContainerStub ¶
type ResolversContainerStub struct { GetCalled func(key string) (dataRetriever.Resolver, error) AddCalled func(key string, val dataRetriever.Resolver) error ReplaceCalled func(key string, val dataRetriever.Resolver) error RemoveCalled func(key string) LenCalled func() int }
func (*ResolversContainerStub) Add ¶
func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
func (*ResolversContainerStub) AddMultiple ¶
func (rcs *ResolversContainerStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
func (*ResolversContainerStub) Get ¶
func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
func (*ResolversContainerStub) IsInterfaceNil ¶
func (rcs *ResolversContainerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolversContainerStub) Len ¶
func (rcs *ResolversContainerStub) Len() int
func (*ResolversContainerStub) Remove ¶
func (rcs *ResolversContainerStub) Remove(key string)
func (*ResolversContainerStub) Replace ¶
func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
type ResolversFinderStub ¶
type ResolversFinderStub struct { ResolversContainerStub IntraShardResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) MetaChainResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) CrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error) }
func (*ResolversFinderStub) CrossShardResolver ¶
func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) IntraShardResolver ¶
func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) MetaChainResolver ¶
func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
type ShardedDataStub ¶
type ShardedDataStub struct { RegisterHandlerCalled func(func(key []byte)) ShardDataStoreCalled func(cacheId string) (c storage.Cacher) AddDataCalled func(key []byte, data interface{}, cacheId string) SearchFirstDataCalled func(key []byte) (value interface{}, ok bool) RemoveDataCalled func(key []byte, cacheId string) RemoveDataFromAllShardsCalled func(key []byte) MergeShardStoresCalled func(sourceCacheId, destCacheId string) MoveDataCalled func(sourceCacheId, destCacheId string, key [][]byte) ClearCalled func() ClearShardStoreCalled func(cacheId string) RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheId string) CreateShardStoreCalled func(destCacheId string) }
func (*ShardedDataStub) AddData ¶
func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
func (*ShardedDataStub) Clear ¶
func (sd *ShardedDataStub) Clear()
func (*ShardedDataStub) ClearShardStore ¶
func (sd *ShardedDataStub) ClearShardStore(cacheId string)
func (*ShardedDataStub) CreateShardStore ¶
func (sd *ShardedDataStub) CreateShardStore(cacheId string)
func (*ShardedDataStub) IsInterfaceNil ¶
func (sd *ShardedDataStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardedDataStub) MergeShardStores ¶
func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)
func (*ShardedDataStub) RegisterHandler ¶
func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
func (*ShardedDataStub) RemoveData ¶
func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
func (*ShardedDataStub) SearchFirstData ¶
func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
func (*ShardedDataStub) ShardDataStore ¶
func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
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 }
func (*StorerStub) ClearCache ¶
func (ss *StorerStub) ClearCache()
func (*StorerStub) Close ¶
func (ss *StorerStub) Close() error
func (*StorerStub) DestroyUnit ¶
func (ss *StorerStub) DestroyUnit() error
func (*StorerStub) GetFromEpoch ¶
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
func (*StorerStub) Has ¶
func (ss *StorerStub) Has(key []byte) error
func (*StorerStub) HasInEpoch ¶
func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
func (*StorerStub) IsInterfaceNil ¶
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) Put ¶
func (ss *StorerStub) Put(key, data []byte) error
func (*StorerStub) Remove ¶
func (ss *StorerStub) Remove(key []byte) error
func (*StorerStub) SearchFirst ¶
func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
type TopicHandlerStub ¶
type TopicHandlerStub struct { HasTopicCalled func(name string) bool CreateTopicCalled func(name string, createChannelForTopic bool) error RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error }
func (*TopicHandlerStub) CreateTopic ¶
func (ths *TopicHandlerStub) CreateTopic(name string, createChannelForTopic bool) error
func (*TopicHandlerStub) HasTopic ¶
func (ths *TopicHandlerStub) HasTopic(name string) bool
func (*TopicHandlerStub) IsInterfaceNil ¶
func (ths *TopicHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TopicHandlerStub) RegisterMessageProcessor ¶
func (ths *TopicHandlerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
type TopicResolverSenderStub ¶
type TopicResolverSenderStub struct { SendOnRequestTopicCalled func(rd *dataRetriever.RequestData) error SendCalled func(buff []byte, peer p2p.PeerID) error TargetShardIDCalled func() uint32 }
func (*TopicResolverSenderStub) IsInterfaceNil ¶
func (trss *TopicResolverSenderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TopicResolverSenderStub) Send ¶
func (trss *TopicResolverSenderStub) Send(buff []byte, peer p2p.PeerID) error
func (*TopicResolverSenderStub) SendOnRequestTopic ¶
func (trss *TopicResolverSenderStub) SendOnRequestTopic(rd *dataRetriever.RequestData) error
func (*TopicResolverSenderStub) TargetShardID ¶
func (trss *TopicResolverSenderStub) TargetShardID() uint32
func (*TopicResolverSenderStub) TopicRequestSuffix ¶ added in v1.0.3
func (trss *TopicResolverSenderStub) TopicRequestSuffix() string
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) ProveCalled func(key []byte) ([][]byte, error) VerifyProofCalled func(proofs [][]byte, key []byte) (bool, error) CommitCalled func() error RecreateCalled func(root []byte) (data.Trie, error) DeepCloneCalled func() (data.Trie, error) CancelPruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) PruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) error ResetOldHashesCalled func() [][]byte AppendToOldHashesCalled func([][]byte) GetSerializedNodesCalled func([]byte, uint64) ([][]byte, error) DatabaseCalled func() data.DBWriteCacher }
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) ClosePersister ¶
func (*TrieStub) Database ¶
func (ts *TrieStub) Database() data.DBWriteCacher
func (*TrieStub) GetSerializedNodes ¶
func (*TrieStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*TrieStub) IsPruningEnabled ¶
func (*TrieStub) Prune ¶
func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier) error
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) SetCheckpoint ¶
func (*TrieStub) TakeSnapshot ¶
type TxForCurrentBlockStub ¶
type TxForCurrentBlockStub struct { CleanCalled func() GetTxCalled func(txHash []byte) (data.TransactionHandler, error) AddTxCalled func(txHash []byte, tx data.TransactionHandler) }
func (*TxForCurrentBlockStub) AddTx ¶
func (t *TxForCurrentBlockStub) AddTx(txHash []byte, tx data.TransactionHandler)
func (*TxForCurrentBlockStub) Clean ¶
func (t *TxForCurrentBlockStub) Clean()
func (*TxForCurrentBlockStub) GetTx ¶
func (t *TxForCurrentBlockStub) GetTx(txHash []byte) (data.TransactionHandler, error)
func (*TxForCurrentBlockStub) IsInterfaceNil ¶
func (t *TxForCurrentBlockStub) IsInterfaceNil() bool
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
Source Files ¶
- blockChainMock.go
- cacherMock.go
- cacherStub.go
- chainStorerMock.go
- coordinatorStub.go
- dataPackerStub.go
- epochHandlerStub.go
- hashSliceResolverStub.go
- hasherMock.go
- hasherStub.go
- headerResolverStub.go
- headersCacherStub.go
- intRandomizerMock.go
- marshalizerMock.go
- marshalizerStub.go
- messageHandlerStub.go
- messengerStub.go
- multipleShardsCoordinatorMock.go
- nonceHashConverterMock.go
- oneShardCoordinatorMock.go
- p2pMessageMock.go
- peerListCreatorStub.go
- poolsHolderStub.go
- requestedItemsHandlerStub.go
- resolverStub.go
- resolversContainerStub.go
- resolversFinderStub.go
- shardedDataStub.go
- storerStub.go
- topicHandlerStub.go
- topicMessageHandlerStub.go
- topicResolverSenderStub.go
- trieStub.go
- txForCurrentBlockMock.go
- uint64ByteSliceConverterMock.go