Documentation ¶
Index ¶
- func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
- func NewNonceHashConverterMock() *nonceHashConverterMock
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- func NewTopicMessageHandlerStub() *topicMessageHandlerStub
- type BlockChainMock
- func (bc *BlockChainMock) CreateNewHeader() data.HeaderHandler
- 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) IsInterfaceNil() bool
- 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)
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) CloseAll() error
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) IsInterfaceNil() bool
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
- type CoordinatorStub
- func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
- func (coordinator *CoordinatorStub) ComputeId(address []byte) uint32
- func (coordinator *CoordinatorStub) IsInterfaceNil() bool
- func (coordinator *CoordinatorStub) NumberOfShards() uint32
- func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
- func (coordinator *CoordinatorStub) SelfId() uint32
- type DataPackerStub
- type EpochHandlerStub
- type HashSliceResolverStub
- func (hsrs *HashSliceResolverStub) IsInterfaceNil() bool
- func (hsrs *HashSliceResolverStub) NumPeersToQuery() (int, int)
- func (hsrs *HashSliceResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
- func (hsrs *HashSliceResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (hsrs *HashSliceResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
- func (hsrs *HashSliceResolverStub) SetNumPeersToQuery(intra int, cross int)
- func (hsrs *HashSliceResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
- type HasherMock
- type HasherStub
- type HeaderResolverStub
- func (hrs *HeaderResolverStub) IsInterfaceNil() bool
- func (hrs *HeaderResolverStub) NumPeersToQuery() (int, int)
- func (hrs *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) 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
- func (hrs *HeaderResolverStub) SetNumPeersToQuery(intra int, cross int)
- func (hrs *HeaderResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) 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 IntRandomizerStub
- type ManualEpochStartNotifierStub
- 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() []core.PeerID
- func (ms *MessengerStub) ConnectedPeersOnTopic(topic string) []core.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() core.PeerID
- func (ms *MessengerStub) IsConnected(peerID core.PeerID) bool
- func (ms *MessengerStub) IsInterfaceNil() bool
- func (ms *MessengerStub) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer
- func (ms *MessengerStub) Peers() []core.PeerID
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- func (ms *MessengerStub) SendToConnectedPeer(topic string, buff []byte, peerID core.PeerID) error
- func (ms *MessengerStub) TrimConnections()
- func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
- type P2PAntifloodHandlerStub
- func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, ...) error
- func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool
- 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) Payload() []byte
- func (msg *P2PMessageMock) Peer() core.PeerID
- func (msg *P2PMessageMock) SeqNo() []byte
- func (msg *P2PMessageMock) Signature() []byte
- func (msg *P2PMessageMock) Timestamp() int64
- func (msg *P2PMessageMock) Topic() string
- type PeerListCreatorStub
- type RequestedItemsHandlerStub
- type ResolverDebugHandler
- func (rdh *ResolverDebugHandler) IsInterfaceNil() bool
- func (rdh *ResolverDebugHandler) LogFailedToResolveData(topic string, hash []byte, err error)
- func (rdh *ResolverDebugHandler) LogRequestedData(topic string, hashes [][]byte, numReqIntra int, numReqCross int)
- func (rdh *ResolverDebugHandler) LogSucceededToResolveData(topic string, hash []byte)
- type ResolverStub
- func (rs *ResolverStub) IsInterfaceNil() bool
- func (rs *ResolverStub) NumPeersToQuery() (int, int)
- func (rs *ResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
- func (rs *ResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (rs *ResolverStub) SetNumPeersToQuery(intra int, cross int)
- func (rs *ResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
- type ResolversContainerStub
- func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) AddMultiple(_ []string, _ []dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
- func (rcs *ResolversContainerStub) IsInterfaceNil() bool
- func (rcs *ResolversContainerStub) Iterate(handler func(key string, resolver dataRetriever.Resolver) bool)
- func (rcs *ResolversContainerStub) Len() int
- func (rcs *ResolversContainerStub) Remove(key string)
- func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) ResolverKeys() string
- 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)
- func (rfs *ResolversFinderStub) MetaCrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, 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) GetBulkFromEpoch(keys [][]byte, epoch uint32) (map[string][]byte, error)
- func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error
- func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
- func (ss *StorerStub) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
- type ThrottlerStub
- type TopicHandlerStub
- type TopicResolverSenderStub
- func (trss *TopicResolverSenderStub) IsInterfaceNil() bool
- func (trss *TopicResolverSenderStub) NumPeersToQuery() (int, int)
- func (trss *TopicResolverSenderStub) RequestTopic() string
- func (trss *TopicResolverSenderStub) ResolverDebugHandler() dataRetriever.ResolverDebugHandler
- func (trss *TopicResolverSenderStub) Send(buff []byte, peer core.PeerID) error
- func (trss *TopicResolverSenderStub) SendOnRequestTopic(rd *dataRetriever.RequestData, originalHashes [][]byte) error
- func (trss *TopicResolverSenderStub) SetNumPeersToQuery(intra int, cross int)
- func (trss *TopicResolverSenderStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
- func (trss *TopicResolverSenderStub) TargetShardID() uint32
- type TrieStub
- func (ts *TrieStub) AppendToOldHashes(hashes [][]byte)
- func (ts *TrieStub) ClosePersister() error
- func (ts *TrieStub) Commit() error
- func (ts *TrieStub) Delete(key []byte) error
- func (ts *TrieStub) Get(key []byte) ([]byte, error)
- func (ts *TrieStub) GetAllHashes() ([][]byte, error)
- func (ts *TrieStub) GetAllLeavesOnChannel(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
- func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
- func (ts *TrieStub) GetNumNodes() data.NumNodesDTO
- func (ts *TrieStub) GetProof(key []byte) ([][]byte, error)
- func (ts *TrieStub) GetSerializedNode(bytes []byte) ([]byte, error)
- func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, uint64, error)
- func (ts *TrieStub) GetStorageManager() data.StorageManager
- func (ts *TrieStub) IsInterfaceNil() bool
- func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)
- func (ts *TrieStub) ResetOldHashes() [][]byte
- func (ts *TrieStub) RootHash() ([]byte, error)
- func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)
- func (ts *TrieStub) String() string
- func (ts *TrieStub) Update(key, value []byte) error
- func (ts *TrieStub) VerifyProof(key []byte, proof [][]byte) (bool, error)
- type TxForCurrentBlockStub
- type Uint64ByteSliceConverterMock
- type WhiteListHandlerStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultipleShardsCoordinatorMock ¶
func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
NewMultipleShardsCoordinatorMock -
func NewNonceHashConverterMock ¶
func NewNonceHashConverterMock() *nonceHashConverterMock
NewNonceHashConverterMock -
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
NewOneShardCoordinatorMock -
func NewTopicMessageHandlerStub ¶
func NewTopicMessageHandlerStub() *topicMessageHandlerStub
NewTopicMessageHandlerStub -
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) GetLocalHeightCalled func() int64 SetLocalHeightCalled func(int64) GetNetworkHeightCalled func() int64 SetNetworkHeightCalled func(int64) HasBadBlockCalled func([]byte) bool PutBadBlockCalled func([]byte) CreateNewHeaderCalled func() data.HeaderHandler }
BlockChainMock is a mock implementation of the blockchain interface
func (*BlockChainMock) CreateNewHeader ¶
func (bc *BlockChainMock) CreateNewHeader() data.HeaderHandler
CreateNewHeader -
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) IsInterfaceNil ¶
func (bc *BlockChainMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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
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 ChainStorer interface
func (*ChainStorerMock) AddStorer ¶
func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
AddStorer will add a new storer to the chain map
func (*ChainStorerMock) 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
func (*ChainStorerMock) SetEpochForPutOperation ¶
func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
SetEpochForPutOperation won't do anything
type CoordinatorStub ¶
type CoordinatorStub struct { NumberOfShardsCalled func() uint32 ComputeIdCalled func(address []byte) uint32 SelfIdCalled func() uint32 SameShardCalled func(firstAddress, secondAddress []byte) bool CommunicationIdentifierCalled func(destShardID uint32) string }
CoordinatorStub -
func (*CoordinatorStub) CommunicationIdentifier ¶
func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (*CoordinatorStub) ComputeId ¶
func (coordinator *CoordinatorStub) ComputeId(address []byte) uint32
ComputeId -
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
NumberOfShards -
func (*CoordinatorStub) SameShard ¶
func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
SameShard -
type DataPackerStub ¶
type DataPackerStub struct {
PackDataInChunksCalled func(data [][]byte, limit int) ([][]byte, error)
}
DataPackerStub -
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)
PackDataInChunks -
type EpochHandlerStub ¶
type EpochHandlerStub struct {
MetaEpochCalled func() uint32
}
EpochHandlerStub -
func (*EpochHandlerStub) IsInterfaceNil ¶
func (ehs *EpochHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
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 SetNumPeersToQueryCalled func(intra int, cross int) NumPeersToQueryCalled func() (int, int) SetResolverDebugHandlerCalled func(handler dataRetriever.ResolverDebugHandler) error }
HashSliceResolverStub -
func (*HashSliceResolverStub) IsInterfaceNil ¶
func (hsrs *HashSliceResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HashSliceResolverStub) NumPeersToQuery ¶
func (hsrs *HashSliceResolverStub) NumPeersToQuery() (int, int)
NumPeersToQuery -
func (*HashSliceResolverStub) ProcessReceivedMessage ¶
func (hsrs *HashSliceResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
ProcessReceivedMessage -
func (*HashSliceResolverStub) RequestDataFromHash ¶
func (hsrs *HashSliceResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
RequestDataFromHash -
func (*HashSliceResolverStub) RequestDataFromHashArray ¶
func (hsrs *HashSliceResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
RequestDataFromHashArray -
func (*HashSliceResolverStub) SetNumPeersToQuery ¶
func (hsrs *HashSliceResolverStub) SetNumPeersToQuery(intra int, cross int)
SetNumPeersToQuery -
func (*HashSliceResolverStub) SetResolverDebugHandler ¶
func (hsrs *HashSliceResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
SetResolverDebugHandler -
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 ¶
HasherStub -
func (*HasherStub) IsInterfaceNil ¶
func (hash *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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 SetNumPeersToQueryCalled func(intra int, cross int) NumPeersToQueryCalled func() (int, int) SetResolverDebugHandlerCalled func(handler dataRetriever.ResolverDebugHandler) error }
HeaderResolverStub -
func (*HeaderResolverStub) IsInterfaceNil ¶
func (hrs *HeaderResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderResolverStub) NumPeersToQuery ¶
func (hrs *HeaderResolverStub) NumPeersToQuery() (int, int)
NumPeersToQuery -
func (*HeaderResolverStub) ProcessReceivedMessage ¶
func (hrs *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
ProcessReceivedMessage -
func (*HeaderResolverStub) RequestDataFromEpoch ¶
func (hrs *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error
RequestDataFromEpoch -
func (*HeaderResolverStub) RequestDataFromHash ¶
func (hrs *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
RequestDataFromHash -
func (*HeaderResolverStub) RequestDataFromNonce ¶
func (hrs *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error
RequestDataFromNonce -
func (*HeaderResolverStub) SetEpochHandler ¶
func (hrs *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) error
SetEpochHandler -
func (*HeaderResolverStub) SetNumPeersToQuery ¶
func (hrs *HeaderResolverStub) SetNumPeersToQuery(intra int, cross int)
SetNumPeersToQuery -
func (*HeaderResolverStub) SetResolverDebugHandler ¶
func (hrs *HeaderResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
SetResolverDebugHandler -
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 IntRandomizerStub ¶
IntRandomizerStub -
func (*IntRandomizerStub) IsInterfaceNil ¶
func (irs *IntRandomizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type ManualEpochStartNotifierStub ¶
type ManualEpochStartNotifierStub struct { NewEpochCalled func(epoch uint32) CurrentEpochCalled func() uint32 }
ManualEpochStartNotifierStub -
func (*ManualEpochStartNotifierStub) CurrentEpoch ¶
func (mesns *ManualEpochStartNotifierStub) CurrentEpoch() uint32
CurrentEpoch -
func (*ManualEpochStartNotifierStub) IsInterfaceNil ¶
func (mesns *ManualEpochStartNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ManualEpochStartNotifierStub) NewEpoch ¶
func (mesns *ManualEpochStartNotifierStub) NewEpoch(epoch uint32)
NewEpoch -
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 }
MarshalizerStub -
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)
Marshal -
func (*MarshalizerStub) Unmarshal ¶
func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error
Unmarshal -
type MessageHandlerStub ¶
type MessageHandlerStub struct { ConnectedPeersOnTopicCalled func(topic string) []core.PeerID SendToConnectedPeerCalled func(topic string, buff []byte, peerID core.PeerID) error IDCalled func() core.PeerID }
MessageHandlerStub -
func (*MessageHandlerStub) ConnectedPeersOnTopic ¶
func (mhs *MessageHandlerStub) ConnectedPeersOnTopic(topic string) []core.PeerID
ConnectedPeersOnTopic -
func (*MessageHandlerStub) IsInterfaceNil ¶
func (mhs *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessageHandlerStub) SendToConnectedPeer ¶
func (mhs *MessageHandlerStub) SendToConnectedPeer(topic string, buff []byte, peerID core.PeerID) error
SendToConnectedPeer -
type MessengerStub ¶
type MessengerStub struct { ConnectedPeersOnTopicCalled func(topic string) []core.PeerID CloseCalled func() error IDCalled func() core.PeerID PeersCalled func() []core.PeerID AddressesCalled func() []string ConnectToPeerCalled func(address string) error TrimConnectionsCalled func() IsConnectedCalled func(peerID core.PeerID) bool ConnectedPeersCalled func() []core.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 core.PeerID) error OutgoingChannelLoadBalancerCalled func() p2p.ChannelLoadBalancer BootstrapCalled func() error }
MessengerStub -
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
Broadcast -
func (*MessengerStub) BroadcastOnChannel ¶
func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
BroadcastOnChannel -
func (*MessengerStub) ConnectToPeer ¶
func (ms *MessengerStub) ConnectToPeer(address string) error
ConnectToPeer -
func (*MessengerStub) ConnectedPeers ¶
func (ms *MessengerStub) ConnectedPeers() []core.PeerID
ConnectedPeers -
func (*MessengerStub) ConnectedPeersOnTopic ¶
func (ms *MessengerStub) ConnectedPeersOnTopic(topic string) []core.PeerID
ConnectedPeersOnTopic -
func (*MessengerStub) CreateTopic ¶
func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
CreateTopic -
func (*MessengerStub) HasTopicValidator ¶
func (ms *MessengerStub) HasTopicValidator(name string) bool
HasTopicValidator -
func (*MessengerStub) IsConnected ¶
func (ms *MessengerStub) IsConnected(peerID core.PeerID) bool
IsConnected -
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
OutgoingChannelLoadBalancer -
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
RegisterMessageProcessor -
func (*MessengerStub) SendToConnectedPeer ¶
SendToConnectedPeer -
func (*MessengerStub) TrimConnections ¶
func (ms *MessengerStub) TrimConnections()
TrimConnections -
func (*MessengerStub) UnregisterMessageProcessor ¶
func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
UnregisterMessageProcessor -
type P2PAntifloodHandlerStub ¶
type P2PAntifloodHandlerStub struct { CanProcessMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error CanProcessMessagesOnTopicCalled func(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error BlacklistPeerCalled func(peer core.PeerID, reason string, duration time.Duration) }
P2PAntifloodHandlerStub -
func (*P2PAntifloodHandlerStub) BlacklistPeer ¶
func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)
BlacklistPeer -
func (*P2PAntifloodHandlerStub) CanProcessMessage ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
CanProcessMessage -
func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error
CanProcessMessagesOnTopic -
func (*P2PAntifloodHandlerStub) IsInterfaceNil ¶
func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type P2PMessageMock ¶
type P2PMessageMock struct { FromField []byte DataField []byte SeqNoField []byte TopicField string SignatureField []byte KeyField []byte PeerField core.PeerID PayloadField []byte TimestampField int64 }
P2PMessageMock -
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type PeerListCreatorStub ¶
type PeerListCreatorStub struct { PeerListCalled func() []core.PeerID IntraShardPeerListCalled func() []core.PeerID }
PeerListCreatorStub -
func (*PeerListCreatorStub) IntraShardPeerList ¶
func (p *PeerListCreatorStub) IntraShardPeerList() []core.PeerID
IntraShardPeerList -
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() []core.PeerID
PeerList -
type RequestedItemsHandlerStub ¶
type RequestedItemsHandlerStub struct { AddCalled func(key string) error HasCalled func(key string) bool SweepCalled func() }
RequestedItemsHandlerStub -
func (*RequestedItemsHandlerStub) Add ¶
func (rihs *RequestedItemsHandlerStub) Add(key string) error
Add -
func (*RequestedItemsHandlerStub) Has ¶
func (rihs *RequestedItemsHandlerStub) Has(key string) bool
Has -
func (*RequestedItemsHandlerStub) IsInterfaceNil ¶
func (rihs *RequestedItemsHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type ResolverDebugHandler ¶
type ResolverDebugHandler struct { LogRequestedDataCalled func(topic string, hash [][]byte, numReqIntra int, numReqCross int) LogFailedToResolveDataCalled func(topic string, hash []byte, err error) LogSucceededToResolveDataCalled func(topic string, hash []byte) EnabledCalled func() bool }
ResolverDebugHandler -
func (*ResolverDebugHandler) IsInterfaceNil ¶
func (rdh *ResolverDebugHandler) IsInterfaceNil() bool
IsInterfaceNil -
func (*ResolverDebugHandler) LogFailedToResolveData ¶
func (rdh *ResolverDebugHandler) LogFailedToResolveData(topic string, hash []byte, err error)
LogFailedToResolveData -
func (*ResolverDebugHandler) LogRequestedData ¶
func (rdh *ResolverDebugHandler) LogRequestedData(topic string, hashes [][]byte, numReqIntra int, numReqCross int)
LogRequestedData -
func (*ResolverDebugHandler) LogSucceededToResolveData ¶
func (rdh *ResolverDebugHandler) LogSucceededToResolveData(topic string, hash []byte)
LogSucceededToResolveData -
type ResolverStub ¶
type ResolverStub struct { RequestDataFromHashCalled func(hash []byte, epoch uint32) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error SetNumPeersToQueryCalled func(intra int, cross int) NumPeersToQueryCalled func() (int, int) SetResolverDebugHandlerCalled func(handler dataRetriever.ResolverDebugHandler) error }
ResolverStub -
func (*ResolverStub) IsInterfaceNil ¶
func (rs *ResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolverStub) NumPeersToQuery ¶
func (rs *ResolverStub) NumPeersToQuery() (int, int)
NumPeersToQuery -
func (*ResolverStub) ProcessReceivedMessage ¶
func (rs *ResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
ProcessReceivedMessage -
func (*ResolverStub) RequestDataFromHash ¶
func (rs *ResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
RequestDataFromHash -
func (*ResolverStub) SetNumPeersToQuery ¶
func (rs *ResolverStub) SetNumPeersToQuery(intra int, cross int)
SetNumPeersToQuery -
func (*ResolverStub) SetResolverDebugHandler ¶
func (rs *ResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
SetResolverDebugHandler -
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 ResolverKeysCalled func() string IterateCalled func(handler func(key string, resolver dataRetriever.Resolver) bool) }
ResolversContainerStub -
func (*ResolversContainerStub) Add ¶
func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
Add -
func (*ResolversContainerStub) AddMultiple ¶
func (rcs *ResolversContainerStub) AddMultiple(_ []string, _ []dataRetriever.Resolver) error
AddMultiple -
func (*ResolversContainerStub) Get ¶
func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
Get -
func (*ResolversContainerStub) IsInterfaceNil ¶
func (rcs *ResolversContainerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolversContainerStub) Iterate ¶
func (rcs *ResolversContainerStub) Iterate(handler func(key string, resolver dataRetriever.Resolver) bool)
Iterate -
func (*ResolversContainerStub) Remove ¶
func (rcs *ResolversContainerStub) Remove(key string)
Remove -
func (*ResolversContainerStub) Replace ¶
func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
Replace -
func (*ResolversContainerStub) ResolverKeys ¶
func (rcs *ResolversContainerStub) ResolverKeys() string
ResolverKeys -
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) MetaCrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error) }
ResolversFinderStub -
func (*ResolversFinderStub) CrossShardResolver ¶
func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
CrossShardResolver -
func (*ResolversFinderStub) IntraShardResolver ¶
func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
IntraShardResolver -
func (*ResolversFinderStub) MetaChainResolver ¶
func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
MetaChainResolver -
func (*ResolversFinderStub) MetaCrossShardResolver ¶
func (rfs *ResolversFinderStub) MetaCrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
MetaCrossShardResolver -
type StorerStub ¶
type StorerStub struct { PutCalled func(key, data []byte) error PutInEpochCalled func(key, data []byte, epoch uint32) error GetCalled func(key []byte) ([]byte, error) GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error) HasCalled func(key []byte) error HasInEpochCalled func(key []byte, epoch uint32) error SearchFirstCalled func(key []byte) ([]byte, error) RemoveCalled func(key []byte) error ClearCacheCalled func() DestroyUnitCalled func() error RangeKeysCalled func(handler func(key []byte, val []byte) bool) GetBulkFromEpochCalled func(keys [][]byte, epoch uint32) (map[string][]byte, error) }
StorerStub -
func (*StorerStub) GetBulkFromEpoch ¶
GetBulkFromEpoch -
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) PutInEpoch ¶
func (ss *StorerStub) PutInEpoch(key, data []byte, epoch uint32) error
PutInEpoch -
func (*StorerStub) RangeKeys ¶
func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool)
RangeKeys -
func (*StorerStub) SearchFirst ¶
func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type ThrottlerStub ¶
type ThrottlerStub struct { CanProcessCalled func() bool StartProcessingCalled func() EndProcessingCalled func() StartWasCalled bool EndWasCalled bool }
ThrottlerStub -
func (*ThrottlerStub) IsInterfaceNil ¶
func (ts *ThrottlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ThrottlerStub) StartProcessing ¶
func (ts *ThrottlerStub) StartProcessing()
StartProcessing -
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 }
TopicHandlerStub -
func (*TopicHandlerStub) CreateTopic ¶
func (ths *TopicHandlerStub) CreateTopic(name string, createChannelForTopic bool) error
CreateTopic -
func (*TopicHandlerStub) HasTopic ¶
func (ths *TopicHandlerStub) HasTopic(name string) bool
HasTopic -
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
RegisterMessageProcessor -
type TopicResolverSenderStub ¶
type TopicResolverSenderStub struct { SendOnRequestTopicCalled func(rd *dataRetriever.RequestData, originalHashes [][]byte) error SendCalled func(buff []byte, peer core.PeerID) error TargetShardIDCalled func() uint32 SetNumPeersToQueryCalled func(intra int, cross int) GetNumPeersToQueryCalled func() (int, int) // contains filtered or unexported fields }
TopicResolverSenderStub -
func (*TopicResolverSenderStub) IsInterfaceNil ¶
func (trss *TopicResolverSenderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TopicResolverSenderStub) NumPeersToQuery ¶
func (trss *TopicResolverSenderStub) NumPeersToQuery() (int, int)
NumPeersToQuery -
func (*TopicResolverSenderStub) RequestTopic ¶
func (trss *TopicResolverSenderStub) RequestTopic() string
RequestTopic -
func (*TopicResolverSenderStub) ResolverDebugHandler ¶
func (trss *TopicResolverSenderStub) ResolverDebugHandler() dataRetriever.ResolverDebugHandler
ResolverDebugHandler -
func (*TopicResolverSenderStub) Send ¶
func (trss *TopicResolverSenderStub) Send(buff []byte, peer core.PeerID) error
Send -
func (*TopicResolverSenderStub) SendOnRequestTopic ¶
func (trss *TopicResolverSenderStub) SendOnRequestTopic(rd *dataRetriever.RequestData, originalHashes [][]byte) error
SendOnRequestTopic -
func (*TopicResolverSenderStub) SetNumPeersToQuery ¶
func (trss *TopicResolverSenderStub) SetNumPeersToQuery(intra int, cross int)
SetNumPeersToQuery -
func (*TopicResolverSenderStub) SetResolverDebugHandler ¶
func (trss *TopicResolverSenderStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error
SetResolverDebugHandler -
func (*TopicResolverSenderStub) TargetShardID ¶
func (trss *TopicResolverSenderStub) TargetShardID() uint32
TargetShardID -
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) ResetOldHashesCalled func() [][]byte AppendToOldHashesCalled func([][]byte) GetSerializedNodesCalled func([]byte, uint64) ([][]byte, uint64, error) GetSerializedNodeCalled func(bytes []byte) ([]byte, error) GetNumNodesCalled func() data.NumNodesDTO GetAllHashesCalled func() ([][]byte, error) GetAllLeavesOnChannelCalled func(rootHash []byte) (chan core.KeyValueHolder, error) GetProofCalled func(key []byte) ([][]byte, error) VerifyProofCalled func(key []byte, proof [][]byte) (bool, error) GetStorageManagerCalled func() data.StorageManager }
TrieStub -
func (*TrieStub) AppendToOldHashes ¶
AppendToOldHashes appends the given hashes to the trie's oldHashes variable
func (*TrieStub) GetAllLeavesOnChannel ¶
func (ts *TrieStub) GetAllLeavesOnChannel(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
GetAllLeavesOnChannel -
func (*TrieStub) GetDirtyHashes ¶
func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
GetDirtyHashes -
func (*TrieStub) GetSerializedNode ¶
GetSerializedNode -
func (*TrieStub) GetSerializedNodes ¶
GetSerializedNodes -
func (*TrieStub) GetStorageManager ¶
func (ts *TrieStub) GetStorageManager() data.StorageManager
GetStorageManager -
func (*TrieStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
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 TxForCurrentBlockStub ¶
type TxForCurrentBlockStub struct { CleanCalled func() GetTxCalled func(txHash []byte) (data.TransactionHandler, error) AddTxCalled func(txHash []byte, tx data.TransactionHandler) }
TxForCurrentBlockStub -
func (*TxForCurrentBlockStub) AddTx ¶
func (t *TxForCurrentBlockStub) AddTx(txHash []byte, tx data.TransactionHandler)
AddTx -
func (*TxForCurrentBlockStub) GetTx ¶
func (t *TxForCurrentBlockStub) GetTx(txHash []byte) (data.TransactionHandler, error)
GetTx -
func (*TxForCurrentBlockStub) IsInterfaceNil ¶
func (t *TxForCurrentBlockStub) IsInterfaceNil() bool
IsInterfaceNil -
type Uint64ByteSliceConverterMock ¶
type Uint64ByteSliceConverterMock struct { ToByteSliceCalled func(uint64) []byte ToUint64Called func([]byte) (uint64, error) }
Uint64ByteSliceConverterMock converts byte slice to/from uint64
func (*Uint64ByteSliceConverterMock) IsInterfaceNil ¶
func (u *Uint64ByteSliceConverterMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*Uint64ByteSliceConverterMock) ToByteSlice ¶
func (u *Uint64ByteSliceConverterMock) ToByteSlice(p uint64) []byte
ToByteSlice is a mock implementation for Uint64ByteSliceConverter
type WhiteListHandlerStub ¶
WhiteListHandlerStub -
func (*WhiteListHandlerStub) IsInterfaceNil ¶
func (w *WhiteListHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
Source Files ¶
- blockChainMock.go
- chainStorerMock.go
- coordinatorStub.go
- dataPackerStub.go
- epochHandlerStub.go
- hashSliceResolverStub.go
- hasherMock.go
- hasherStub.go
- headerResolverStub.go
- headersCacherStub.go
- intRandomizerStub.go
- manualEpochStartNotifierStub.go
- marshalizerMock.go
- marshalizerStub.go
- messageHandlerStub.go
- messengerStub.go
- multipleShardsCoordinatorMock.go
- nonceHashConverterMock.go
- oneShardCoordinatorMock.go
- p2pAntifloodHandlerStub.go
- p2pMessageMock.go
- peerListCreatorStub.go
- requestedItemsHandlerStub.go
- resolverDebugHandlerStub.go
- resolverStub.go
- resolversContainerStub.go
- resolversFinderStub.go
- storerStub.go
- throttlerStub.go
- topicHandlerStub.go
- topicMessageHandlerStub.go
- topicResolverSenderStub.go
- trieStub.go
- txForCurrentBlockMock.go
- uint64ByteSliceConverterMock.go
- whiteListHandlerStub.go