Documentation ¶
Index ¶
- func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
- func NewNonceHashConverterMock() *nonceHashConverterMock
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- type AccountTrackerStub
- type AccountsFactoryStub
- type AccountsStub
- func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
- func (as *AccountsStub) CancelPrune(rootHash []byte)
- func (as *AccountsStub) ClosePersister() error
- func (as *AccountsStub) Commit() ([]byte, error)
- func (as *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (as *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (as *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
- func (as *AccountsStub) IsInterfaceNil() bool
- func (as *AccountsStub) IsPruningEnabled() bool
- func (as *AccountsStub) JournalLen() int
- func (as *AccountsStub) PruneTrie(rootHash []byte) error
- func (as *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
- func (as *AccountsStub) RecreateTrie(rootHash []byte) error
- func (as *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
- func (as *AccountsStub) RemoveCode(codeHash []byte) error
- func (as *AccountsStub) RevertToSnapshot(snapshot int) error
- func (as *AccountsStub) RootHash() ([]byte, error)
- func (as *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
- func (as *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
- func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
- func (as *AccountsStub) SnapshotState(rootHash []byte)
- type AddressConverterFake
- func (acf *AddressConverterFake) AddressLen() int
- func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (acf *AddressConverterFake) IsInterfaceNil() bool
- func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AddressConverterStub
- func (ac AddressConverterStub) AddressLen() int
- func (ac AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (ac AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (ac AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (ac *AddressConverterStub) IsInterfaceNil() bool
- func (ac AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AddressMock
- type AppStatusHandlerStub
- func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
- func (ashs *AppStatusHandlerStub) Close()
- func (ashs *AppStatusHandlerStub) Decrement(key string)
- func (ashs *AppStatusHandlerStub) Increment(key string)
- func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
- func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
- func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
- func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
- type 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 BlockProcessorStub
- func (bps *BlockProcessorStub) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
- func (bps *BlockProcessorStub) ApplyBodyToHeader(header data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error)
- func (bps *BlockProcessorStub) ApplyProcessedMiniBlocks(miniBlocks *processedMb.ProcessedMiniBlockTracker)
- func (bps *BlockProcessorStub) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
- func (bps *BlockProcessorStub) CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)
- func (bps *BlockProcessorStub) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
- func (bps *BlockProcessorStub) CreateNewHeader() data.HeaderHandler
- func (bps *BlockProcessorStub) DecodeBlockBody(dta []byte) data.BodyHandler
- func (bps *BlockProcessorStub) DecodeBlockBodyAndHeader(dta []byte) (data.BodyHandler, data.HeaderHandler)
- func (bps *BlockProcessorStub) DecodeBlockHeader(dta []byte) data.HeaderHandler
- func (bps *BlockProcessorStub) IsInterfaceNil() bool
- func (bps *BlockProcessorStub) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
- func (bps *BlockProcessorStub) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, ...) error
- func (bps *BlockProcessorStub) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
- func (bps *BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis()
- func (bps *BlockProcessorStub) RevertAccountState()
- func (bps *BlockProcessorStub) RevertStateToBlock(header data.HeaderHandler) error
- func (bps *BlockProcessorStub) SetConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32)
- func (bps *BlockProcessorStub) SetNumProcessedObj(numObj uint64)
- type BlockTrackerStub
- func (bts *BlockTrackerStub) AddCrossNotarizedHeader(shardID uint32, crossNotarizedHeader data.HeaderHandler, ...)
- func (bts *BlockTrackerStub) AddSelfNotarizedHeader(shardID uint32, selfNotarizedHeader data.HeaderHandler, ...)
- func (bts *BlockTrackerStub) AddTrackedHeader(header data.HeaderHandler, hash []byte)
- func (bts *BlockTrackerStub) CheckBlockAgainstFinal(headerHandler data.HeaderHandler) error
- func (bts *BlockTrackerStub) CheckBlockAgainstRounder(headerHandler data.HeaderHandler) error
- func (bts *BlockTrackerStub) CleanupHeadersBehindNonce(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)
- func (bts *BlockTrackerStub) ComputeLongestChain(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte)
- func (bts *BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized() ([]data.HeaderHandler, [][]byte, error)
- func (bts *BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error)
- func (bts *BlockTrackerStub) DisplayTrackedHeaders()
- func (bts *BlockTrackerStub) GetCrossNotarizedHeader(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
- func (bts *BlockTrackerStub) GetFinalHeader(shardID uint32) (data.HeaderHandler, []byte, error)
- func (bts *BlockTrackerStub) GetLastCrossNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)
- func (bts *BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards() (map[uint32]data.HeaderHandler, error)
- func (bts *BlockTrackerStub) GetTrackedHeaders(shardID uint32) ([]data.HeaderHandler, [][]byte)
- func (bts *BlockTrackerStub) GetTrackedHeadersForAllShards() map[uint32][]data.HeaderHandler
- func (bts *BlockTrackerStub) GetTrackedHeadersWithNonce(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)
- func (bts *BlockTrackerStub) IsInterfaceNil() bool
- func (bts *BlockTrackerStub) IsShardStuck(shardId uint32) bool
- func (bts *BlockTrackerStub) RegisterCrossNotarizedHeadersHandler(...)
- func (bts *BlockTrackerStub) RegisterSelfNotarizedHeadersHandler(...)
- func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()
- func (bts *BlockTrackerStub) RestoreToGenesis()
- type BoostrapStorerMock
- func (bsm *BoostrapStorerMock) Get(round int64) (bootstrapStorage.BootstrapData, error)
- func (bsm *BoostrapStorerMock) GetHighestRound() int64
- func (bsm *BoostrapStorerMock) IsInterfaceNil() bool
- func (bsm *BoostrapStorerMock) Put(round int64, bootData bootstrapStorage.BootstrapData) error
- func (bsm *BoostrapStorerMock) SaveLastRound(round int64) error
- 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 ChainHandlerStub
- func (chs *ChainHandlerStub) GetCurrentBlockBody() data.BodyHandler
- func (chs *ChainHandlerStub) GetCurrentBlockHeader() data.HeaderHandler
- func (chs *ChainHandlerStub) GetCurrentBlockHeaderHash() []byte
- func (chs *ChainHandlerStub) GetGenesisHeader() data.HeaderHandler
- func (chs *ChainHandlerStub) GetGenesisHeaderHash() []byte
- func (chs *ChainHandlerStub) GetLocalHeight() int64
- func (chs *ChainHandlerStub) GetNetworkHeight() int64
- func (chs *ChainHandlerStub) HasBadBlock(blockHash []byte) bool
- func (chs *ChainHandlerStub) IsInterfaceNil() bool
- func (chs *ChainHandlerStub) PutBadBlock(blockHash []byte)
- func (chs *ChainHandlerStub) SetCurrentBlockBody(body data.BodyHandler) error
- func (chs *ChainHandlerStub) SetCurrentBlockHeader(bh data.HeaderHandler) error
- func (chs *ChainHandlerStub) SetCurrentBlockHeaderHash(hash []byte)
- func (chs *ChainHandlerStub) SetGenesisHeader(gb data.HeaderHandler) error
- func (chs *ChainHandlerStub) SetGenesisHeaderHash(hash []byte)
- func (chs *ChainHandlerStub) SetLocalHeight(height int64)
- func (chs *ChainHandlerStub) SetNetworkHeight(height int64)
- 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 EpochStartTriggerStub
- func (e *EpochStartTriggerStub) Epoch() uint32
- func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64
- func (e *EpochStartTriggerStub) EpochStartMetaHdrHash() []byte
- func (e *EpochStartTriggerStub) EpochStartRound() uint64
- func (e *EpochStartTriggerStub) ForceEpochStart(round uint64) error
- func (e *EpochStartTriggerStub) IsEpochStart() bool
- func (e *EpochStartTriggerStub) IsInterfaceNil() bool
- func (e *EpochStartTriggerStub) NotifyAll(_ data.HeaderHandler)
- func (e *EpochStartTriggerStub) ReceivedHeader(header data.HeaderHandler)
- func (e *EpochStartTriggerStub) Revert(_ uint64)
- func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)
- func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)
- func (e *EpochStartTriggerStub) SetProcessed(header data.HeaderHandler)
- func (e *EpochStartTriggerStub) Update(round uint64)
- type FeeHandlerStub
- func (fhs *FeeHandlerStub) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
- func (fhs *FeeHandlerStub) ComputeFee(tx process.TransactionWithFeeHandler) *big.Int
- func (fhs *FeeHandlerStub) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
- func (fhs *FeeHandlerStub) IsInterfaceNil() bool
- func (fhs *FeeHandlerStub) MaxGasLimitPerBlock() uint64
- type ForkDetectorMock
- func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, ...) error
- func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
- func (fdm *ForkDetectorMock) GetHighestFinalBlockHash() []byte
- func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
- func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte
- func (fdm *ForkDetectorMock) IsInterfaceNil() bool
- func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64
- func (fdm *ForkDetectorMock) RemoveHeader(nonce uint64, hash []byte)
- func (fdm *ForkDetectorMock) ResetFork()
- func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
- func (fdm *ForkDetectorMock) RestoreToGenesis()
- func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)
- type GeneratorSuite
- type HasherFake
- type HasherMock
- type HeaderResolverStub
- func (hrm *HeaderResolverStub) IsInterfaceNil() bool
- func (hrm *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hrm *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error
- func (hrm *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (hrm *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error
- func (hrm *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) error
- type HeaderSigVerifierStub
- 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 HeartbeatStorerStub
- func (hss *HeartbeatStorerStub) IsInterfaceNil() bool
- func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)
- func (hss *HeartbeatStorerStub) LoadHbmiDTO(pubKey string) (*heartbeat.HeartbeatDTO, error)
- func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)
- func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error
- func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *heartbeat.HeartbeatDTO) error
- func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error
- type IndexerMock
- func (im *IndexerMock) IsInterfaceNil() bool
- func (im *IndexerMock) IsNilIndexer() bool
- func (im *IndexerMock) SaveBlock(body data.BodyHandler, header data.HeaderHandler, ...)
- func (im *IndexerMock) SaveMetaBlock(header data.HeaderHandler, signersIndexes []uint64)
- func (im *IndexerMock) SaveRoundInfo(roundInfo indexer.RoundInfo)
- func (im *IndexerMock) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte)
- func (im *IndexerMock) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)
- type InterceptorsContainerStub
- func (ics *InterceptorsContainerStub) Add(_ string, _ process.Interceptor) error
- func (ics *InterceptorsContainerStub) AddMultiple(_ []string, _ []process.Interceptor) error
- func (ics *InterceptorsContainerStub) Get(_ string) (process.Interceptor, error)
- func (ics *InterceptorsContainerStub) IsInterfaceNil() bool
- func (ics *InterceptorsContainerStub) Len() int
- func (ics *InterceptorsContainerStub) Remove(_ string)
- func (ics *InterceptorsContainerStub) Replace(_ string, _ process.Interceptor) error
- type KeyGenMock
- func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
- func (keyGen *KeyGenMock) IsInterfaceNil() bool
- func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
- func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
- func (keyGen *KeyGenMock) Suite() crypto.Suite
- type MarshalizerFake
- type MarshalizerMock
- type MessageHandlerStub
- type MessengerStub
- 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) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error
- func (ms *MessengerStub) Close() error
- 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) IsConnectedToTheNetwork() bool
- func (ms *MessengerStub) IsInterfaceNil() bool
- func (ms *MessengerStub) PeerAddress(pid p2p.PeerID) string
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- type MiniBlocksResolverStub
- func (hrm *MiniBlocksResolverStub) GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
- func (hrm *MiniBlocksResolverStub) GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
- func (hrm *MiniBlocksResolverStub) IsInterfaceNil() bool
- func (hrm *MiniBlocksResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hrm *MiniBlocksResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
- func (hrm *MiniBlocksResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
- type MockTimer
- type MultisignMock
- func (mm *MultisignMock) AggregateCommitments(bitmap []byte) error
- func (mm *MultisignMock) AggregateSigs(bitmap []byte) ([]byte, error)
- func (mm *MultisignMock) Commitment(index uint16) ([]byte, error)
- func (mm *MultisignMock) CommitmentHash(index uint16) ([]byte, error)
- func (mm *MultisignMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
- func (mm *MultisignMock) CreateCommitment() (commSecret []byte, commitment []byte)
- func (mm *MultisignMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
- func (mm *MultisignMock) IsInterfaceNil() bool
- func (mm *MultisignMock) Reset(pubKeys []string, index uint16) error
- func (mm *MultisignMock) SetAggregatedSig([]byte) error
- func (mm *MultisignMock) SignatureShare(index uint16) ([]byte, error)
- func (mm *MultisignMock) StoreCommitment(index uint16, value []byte) error
- func (mm *MultisignMock) StoreCommitmentHash(index uint16, commHash []byte) error
- func (mm *MultisignMock) StoreSignatureShare(index uint16, sig []byte) error
- func (mm *MultisignMock) Verify(msg []byte, bitmap []byte) error
- func (mm *MultisignMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeValidatorsGroup(randomness []byte, round uint64, shardId uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int
- func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte
- func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
- func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32) (publicKeys []string, err error)
- func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
- func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64
- func (ncm *NodesCoordinatorMock) GetValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) GetValidatorsRewardsAddresses(randomness []byte, round uint64, shardId uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
- func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(int) error
- func (ncm *NodesCoordinatorMock) SetNodesPerShards(map[uint32][]sharding.Validator) 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 P2PMessageStub
- func (msg *P2PMessageStub) Data() []byte
- func (msg *P2PMessageStub) From() []byte
- func (msg *P2PMessageStub) IsInterfaceNil() bool
- func (msg *P2PMessageStub) Key() []byte
- func (msg *P2PMessageStub) Peer() p2p.PeerID
- func (msg *P2PMessageStub) SeqNo() []byte
- func (msg *P2PMessageStub) Signature() []byte
- func (msg *P2PMessageStub) TopicIDs() []string
- type PeerAccountHandlerMock
- func (pahm *PeerAccountHandlerMock) AddressContainer() state.AddressContainer
- func (pahm *PeerAccountHandlerMock) DataTrie() data.Trie
- func (pahm *PeerAccountHandlerMock) DataTrieTracker() state.DataTrieTracker
- func (pahm *PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal() error
- func (pahm *PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal() error
- func (pahm *PeerAccountHandlerMock) GetCode() []byte
- func (pahm *PeerAccountHandlerMock) GetCodeHash() []byte
- func (pahm *PeerAccountHandlerMock) GetNonce() uint64
- func (pahm *PeerAccountHandlerMock) GetRating() uint32
- func (pahm *PeerAccountHandlerMock) GetRootHash() []byte
- func (pahm *PeerAccountHandlerMock) GetTempRating() uint32
- func (pahm *PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal() error
- func (pahm *PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal() error
- func (pahm *PeerAccountHandlerMock) IsInterfaceNil() bool
- func (pahm *PeerAccountHandlerMock) SetCode(code []byte)
- func (pahm *PeerAccountHandlerMock) SetCodeHash(codeHash []byte)
- func (pahm *PeerAccountHandlerMock) SetCodeHashWithJournal(codeHash []byte) error
- func (pahm *PeerAccountHandlerMock) SetDataTrie(trie data.Trie)
- func (pahm *PeerAccountHandlerMock) SetDataTrieTracker(tracker state.DataTrieTracker)
- func (pahm *PeerAccountHandlerMock) SetNonce(nonce uint64)
- func (pahm *PeerAccountHandlerMock) SetNonceWithJournal(nonce uint64) error
- func (pahm *PeerAccountHandlerMock) SetRatingWithJournal(rating uint32) error
- func (pahm *PeerAccountHandlerMock) SetRootHash(rootHash []byte)
- func (pahm *PeerAccountHandlerMock) SetTempRatingWithJournal(rating uint32) error
- type PendingMiniBlocksHandlerStub
- func (p *PendingMiniBlocksHandlerStub) AddProcessedHeader(handler data.HeaderHandler) error
- func (p *PendingMiniBlocksHandlerStub) GetNumPendingMiniBlocks(shardID uint32) uint32
- func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool
- func (p *PendingMiniBlocksHandlerStub) PendingMiniBlockHeaders(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error)
- func (p *PendingMiniBlocksHandlerStub) RevertHeader(handler data.HeaderHandler) error
- func (p *PendingMiniBlocksHandlerStub) SetNumPendingMiniBlocks(shardID uint32, numPendingMiniBlocks uint32)
- 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 PrivateKeyStub
- type PublicKeyMock
- type RequestHandlerStub
- func (rhs *RequestHandlerStub) IsInterfaceNil() bool
- func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)
- func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)
- func (rhs *RequestHandlerStub) RequestMiniBlock(destShardID uint32, miniblockHash []byte)
- func (rhs *RequestHandlerStub) RequestMiniBlocks(destShardID uint32, miniblocksHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestShardHeader(shardID uint32, hash []byte)
- func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardID uint32, nonce uint64)
- func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestTrieNodes(destShardID uint32, miniblockHash []byte, topic string)
- func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) SetEpoch(epoch uint32)
- type RequestedItemsHandlerStub
- type ResolversFinderStub
- func (rfs *ResolversFinderStub) Add(key string, val dataRetriever.Resolver) error
- func (rfs *ResolversFinderStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
- func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) Get(key string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) IsInterfaceNil() bool
- func (rfs *ResolversFinderStub) Len() int
- func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) Remove(key string)
- func (rfs *ResolversFinderStub) Replace(key string, val dataRetriever.Resolver) error
- type RounderMock
- func (rndm *RounderMock) Index() int64
- func (rndm *RounderMock) IsInterfaceNil() bool
- func (rndm *RounderMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rndm *RounderMock) TimeDuration() time.Duration
- func (rndm *RounderMock) TimeStamp() time.Time
- func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- type SCQueryServiceStub
- type ShardCoordinatorMock
- func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm ShardCoordinatorMock) ComputeId(address state.AddressContainer) uint32
- func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
- func (scm ShardCoordinatorMock) NumberOfShards() uint32
- func (scm ShardCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool
- func (scm ShardCoordinatorMock) SelfId() uint32
- func (scm ShardCoordinatorMock) SetSelfShardId(shardId uint32) 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 SingleSignerMock
- type SinglesignFailMock
- type SinglesignMock
- type SinglesignStub
- type StatusMetricsStub
- type StorerMock
- func (sm *StorerMock) ClearCache()
- func (sm *StorerMock) Close() error
- func (sm *StorerMock) DestroyUnit() error
- func (sm *StorerMock) Get(key []byte) ([]byte, error)
- func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (sm *StorerMock) Has(key []byte) error
- func (sm *StorerMock) HasInEpoch(key []byte, epoch uint32) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, data []byte) error
- func (sm *StorerMock) Remove(key []byte) error
- func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) Close() error
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
- type Streamer
- type SuiteMock
- func (s *SuiteMock) CreatePoint() crypto.Point
- func (s *SuiteMock) CreateScalar() crypto.Scalar
- func (s *SuiteMock) GetUnderlyingSuite() interface{}
- func (s *SuiteMock) IsInterfaceNil() bool
- func (s *SuiteMock) PointLen() int
- func (s *SuiteMock) RandomStream() cipher.Stream
- func (s *SuiteMock) ScalarLen() int
- func (s *SuiteMock) String() string
- type SyncStub
- 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 Uint64CacherStub
- func (ucs *Uint64CacherStub) Clear()
- func (ucs *Uint64CacherStub) Get(nonce uint64) ([]byte, bool)
- func (ucs *Uint64CacherStub) Has(nonce uint64) bool
- func (ucs *Uint64CacherStub) HasOrAdd(nonce uint64, value []byte) (bool, bool)
- func (ucs *Uint64CacherStub) Keys() []uint64
- func (ucs *Uint64CacherStub) Len() int
- func (ucs *Uint64CacherStub) Peek(nonce uint64) ([]byte, bool)
- func (ucs *Uint64CacherStub) Put(nonce uint64, value []byte) bool
- func (ucs *Uint64CacherStub) RegisterHandler(handler func(nonce uint64))
- func (ucs *Uint64CacherStub) Remove(nonce uint64)
- func (ucs *Uint64CacherStub) RemoveOldest()
- type ValidatorMock
- type ValidatorStatisticsProcessorMock
- func (vsp *ValidatorStatisticsProcessorMock) Commit() ([]byte, error)
- func (vsp *ValidatorStatisticsProcessorMock) GetPeerAccount(address []byte) (state.PeerAccountHandler, error)
- func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool
- func (vsp *ValidatorStatisticsProcessorMock) RevertPeerState(header data.HeaderHandler) error
- func (vsp *ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot(snapshot int) error
- func (vsp *ValidatorStatisticsProcessorMock) RootHash() ([]byte, error)
- func (vsp *ValidatorStatisticsProcessorMock) UpdatePeerState(header data.HeaderHandler) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultiShardsCoordinatorMock ¶
func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
NewMultiShardsCoordinatorMock -
func NewNonceHashConverterMock ¶
func NewNonceHashConverterMock() *nonceHashConverterMock
NewNonceHashConverterMock -
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
NewOneShardCoordinatorMock -
Types ¶
type AccountTrackerStub ¶ added in v1.0.84
type AccountTrackerStub struct { SaveAccountCalled func(accountHandler state.AccountHandler) error JournalizeCalled func(entry state.JournalEntry) }
AccountTrackerStub -
func (*AccountTrackerStub) IsInterfaceNil ¶ added in v1.0.84
func (ats *AccountTrackerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountTrackerStub) Journalize ¶ added in v1.0.84
func (ats *AccountTrackerStub) Journalize(entry state.JournalEntry)
Journalize -
func (*AccountTrackerStub) SaveAccount ¶ added in v1.0.84
func (ats *AccountTrackerStub) SaveAccount(accountHandler state.AccountHandler) error
SaveAccount -
type AccountsFactoryStub ¶
type AccountsFactoryStub struct {
CreateAccountCalled func(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, error)
}
AccountsFactoryStub -
func (*AccountsFactoryStub) CreateAccount ¶
func (afs *AccountsFactoryStub) CreateAccount(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, error)
CreateAccount -
func (*AccountsFactoryStub) IsInterfaceNil ¶
func (afs *AccountsFactoryStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type AccountsStub ¶
type AccountsStub struct { AddJournalEntryCalled func(je state.JournalEntry) CommitCalled func() ([]byte, error) GetAccountWithJournalCalled func(addressContainer state.AddressContainer) (state.AccountHandler, error) GetExistingAccountCalled func(addressContainer state.AddressContainer) (state.AccountHandler, error) HasAccountStateCalled func(addressContainer state.AddressContainer) (bool, error) JournalLenCalled func() int PutCodeCalled func(accountHandler state.AccountHandler, code []byte) error RemoveAccountCalled func(addressContainer state.AddressContainer) error RemoveCodeCalled func(codeHash []byte) error RevertToSnapshotCalled func(snapshot int) error SaveAccountStateCalled func(acountWrapper state.AccountHandler) error SaveDataTrieCalled func(acountWrapper state.AccountHandler) error RootHashCalled func() ([]byte, error) RecreateTrieCalled func(rootHash []byte) error PruneTrieCalled func(rootHash []byte) error SnapshotStateCalled func(rootHash []byte) SetStateCheckpointCalled func(rootHash []byte) CancelPruneCalled func(rootHash []byte) IsPruningEnabledCalled func() bool }
AccountsStub -
func (*AccountsStub) AddJournalEntry ¶ added in v1.0.3
func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
AddJournalEntry -
func (*AccountsStub) CancelPrune ¶
func (as *AccountsStub) CancelPrune(rootHash []byte)
CancelPrune -
func (*AccountsStub) ClosePersister ¶ added in v1.0.78
func (as *AccountsStub) ClosePersister() error
ClosePersister -
func (*AccountsStub) GetAccountWithJournal ¶ added in v1.0.3
func (as *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
GetAccountWithJournal -
func (*AccountsStub) GetExistingAccount ¶
func (as *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
GetExistingAccount -
func (*AccountsStub) HasAccount ¶ added in v1.0.3
func (as *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
HasAccount -
func (*AccountsStub) IsInterfaceNil ¶
func (as *AccountsStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsStub) IsPruningEnabled ¶
func (as *AccountsStub) IsPruningEnabled() bool
IsPruningEnabled -
func (*AccountsStub) PruneTrie ¶
func (as *AccountsStub) PruneTrie(rootHash []byte) error
PruneTrie -
func (*AccountsStub) PutCode ¶ added in v1.0.3
func (as *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
PutCode -
func (*AccountsStub) RecreateTrie ¶
func (as *AccountsStub) RecreateTrie(rootHash []byte) error
RecreateTrie -
func (*AccountsStub) RemoveAccount ¶
func (as *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
RemoveAccount -
func (*AccountsStub) RemoveCode ¶ added in v1.0.3
func (as *AccountsStub) RemoveCode(codeHash []byte) error
RemoveCode -
func (*AccountsStub) RevertToSnapshot ¶
func (as *AccountsStub) RevertToSnapshot(snapshot int) error
RevertToSnapshot -
func (*AccountsStub) SaveDataTrie ¶ added in v1.0.3
func (as *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
SaveDataTrie -
func (*AccountsStub) SaveJournalizedAccount ¶ added in v1.0.3
func (as *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
SaveJournalizedAccount -
func (*AccountsStub) SetStateCheckpoint ¶
func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
SetStateCheckpoint -
func (*AccountsStub) SnapshotState ¶
func (as *AccountsStub) SnapshotState(rootHash []byte)
SnapshotState -
type AddressConverterFake ¶
type AddressConverterFake struct {
// contains filtered or unexported fields
}
AddressConverterFake -
func NewAddressConverterFake ¶
func NewAddressConverterFake(addressLen int, prefix string) *AddressConverterFake
NewAddressConverterFake -
func (*AddressConverterFake) AddressLen ¶
func (acf *AddressConverterFake) AddressLen() int
AddressLen -
func (*AddressConverterFake) ConvertToHex ¶
func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
ConvertToHex -
func (*AddressConverterFake) CreateAddressFromHex ¶
func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
CreateAddressFromHex -
func (*AddressConverterFake) CreateAddressFromPublicKeyBytes ¶
func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
CreateAddressFromPublicKeyBytes -
func (*AddressConverterFake) IsInterfaceNil ¶
func (acf *AddressConverterFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AddressConverterFake) PrepareAddressBytes ¶
func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
PrepareAddressBytes -
type AddressConverterStub ¶
type AddressConverterStub struct { CreateAddressFromPublicKeyBytesHandler func(pubKey []byte) (state.AddressContainer, error) ConvertToHexHandler func(addressContainer state.AddressContainer) (string, error) CreateAddressFromHexHandler func(hexAddress string) (state.AddressContainer, error) PrepareAddressBytesHandler func(addressBytes []byte) ([]byte, error) AddressLenHandler func() int }
AddressConverterStub -
func (AddressConverterStub) AddressLen ¶
func (ac AddressConverterStub) AddressLen() int
AddressLen -
func (AddressConverterStub) ConvertToHex ¶
func (ac AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
ConvertToHex -
func (AddressConverterStub) CreateAddressFromHex ¶
func (ac AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
CreateAddressFromHex -
func (AddressConverterStub) CreateAddressFromPublicKeyBytes ¶
func (ac AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
CreateAddressFromPublicKeyBytes -
func (*AddressConverterStub) IsInterfaceNil ¶
func (ac *AddressConverterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (AddressConverterStub) PrepareAddressBytes ¶
func (ac AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
PrepareAddressBytes -
type AddressMock ¶
type AddressMock struct {
// contains filtered or unexported fields
}
AddressMock implements a mock address generator used in testing
func (*AddressMock) Bytes ¶
func (address *AddressMock) Bytes() []byte
Bytes returns the address' bytes
func (*AddressMock) IsInterfaceNil ¶
func (address *AddressMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type AppStatusHandlerStub ¶
type AppStatusHandlerStub struct { AddUint64Handler func(key string, value uint64) IncrementHandler func(key string) DecrementHandler func(key string) SetUInt64ValueHandler func(key string, value uint64) SetInt64ValueHandler func(key string, value int64) SetStringValueHandler func(key string, value string) CloseHandler func() }
AppStatusHandlerStub is a stub implementation of AppStatusHandler
func (*AppStatusHandlerStub) AddUint64 ¶
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
AddUint64 will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an string value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
type 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 BlockProcessorStub ¶
type BlockProcessorStub struct { ProcessBlockCalled func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error CommitBlockCalled func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error RevertAccountStateCalled func() CreateGenesisBlockCalled func(balances map[string]*big.Int) (data.HeaderHandler, error) CreateBlockBodyCalled func(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error) RestoreBlockIntoPoolsCalled func(header data.HeaderHandler, body data.BodyHandler) error SetOnRequestTransactionCalled func(f func(destShardID uint32, txHash []byte)) ApplyBodyToHeaderCalled func(header data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error) MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error) DecodeBlockBodyAndHeaderCalled func(dta []byte) (data.BodyHandler, data.HeaderHandler) DecodeBlockBodyCalled func(dta []byte) data.BodyHandler DecodeBlockHeaderCalled func(dta []byte) data.HeaderHandler AddLastNotarizedHdrCalled func(shardId uint32, processedHdr data.HeaderHandler) CreateNewHeaderCalled func() data.HeaderHandler RevertStateToBlockCalled func(header data.HeaderHandler) error }
BlockProcessorStub mocks the implementation for a blockProcessor
func (*BlockProcessorStub) AddLastNotarizedHdr ¶
func (bps *BlockProcessorStub) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
AddLastNotarizedHdr -
func (*BlockProcessorStub) ApplyBodyToHeader ¶ added in v1.0.39
func (bps *BlockProcessorStub) ApplyBodyToHeader(header data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error)
ApplyBodyToHeader -
func (*BlockProcessorStub) ApplyProcessedMiniBlocks ¶
func (bps *BlockProcessorStub) ApplyProcessedMiniBlocks(miniBlocks *processedMb.ProcessedMiniBlockTracker)
ApplyProcessedMiniBlocks -
func (*BlockProcessorStub) CommitBlock ¶
func (bps *BlockProcessorStub) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
CommitBlock mocks the commit of a block
func (*BlockProcessorStub) CreateBlockBody ¶ added in v1.0.3
func (bps *BlockProcessorStub) CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)
CreateBlockBody mocks the creation of a transaction block body
func (*BlockProcessorStub) CreateGenesisBlock ¶
func (bps *BlockProcessorStub) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
CreateGenesisBlock mocks the creation of a genesis block body
func (*BlockProcessorStub) CreateNewHeader ¶
func (bps *BlockProcessorStub) CreateNewHeader() data.HeaderHandler
CreateNewHeader creates a new header
func (*BlockProcessorStub) DecodeBlockBody ¶
func (bps *BlockProcessorStub) DecodeBlockBody(dta []byte) data.BodyHandler
DecodeBlockBody -
func (*BlockProcessorStub) DecodeBlockBodyAndHeader ¶ added in v1.0.86
func (bps *BlockProcessorStub) DecodeBlockBodyAndHeader(dta []byte) (data.BodyHandler, data.HeaderHandler)
DecodeBlockBodyAndHeader -
func (*BlockProcessorStub) DecodeBlockHeader ¶
func (bps *BlockProcessorStub) DecodeBlockHeader(dta []byte) data.HeaderHandler
DecodeBlockHeader -
func (*BlockProcessorStub) IsInterfaceNil ¶
func (bps *BlockProcessorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockProcessorStub) MarshalizedDataToBroadcast ¶
func (bps *BlockProcessorStub) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
MarshalizedDataToBroadcast -
func (*BlockProcessorStub) ProcessBlock ¶
func (bps *BlockProcessorStub) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
ProcessBlock mocks pocessing a block
func (*BlockProcessorStub) RestoreBlockIntoPools ¶
func (bps *BlockProcessorStub) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
RestoreBlockIntoPools -
func (*BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis ¶
func (bps *BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis()
RestoreLastNotarizedHrdsToGenesis -
func (*BlockProcessorStub) RevertAccountState ¶
func (bps *BlockProcessorStub) RevertAccountState()
RevertAccountState mocks revert of the accounts state
func (*BlockProcessorStub) RevertStateToBlock ¶
func (bps *BlockProcessorStub) RevertStateToBlock(header data.HeaderHandler) error
RevertStateToBlock recreates thee state tries to the root hashes indicated by the provided header
func (*BlockProcessorStub) SetConsensusData ¶ added in v1.0.20
func (bps *BlockProcessorStub) SetConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32)
SetConsensusData -
func (*BlockProcessorStub) SetNumProcessedObj ¶
func (bps *BlockProcessorStub) SetNumProcessedObj(numObj uint64)
SetNumProcessedObj -
type BlockTrackerStub ¶
type BlockTrackerStub struct { AddTrackedHeaderCalled func(header data.HeaderHandler, hash []byte) AddCrossNotarizedHeaderCalled func(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte) AddSelfNotarizedHeaderCalled func(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte) CheckBlockAgainstRounderCalled func(headerHandler data.HeaderHandler) error CheckBlockAgainstFinalCalled func(headerHandler data.HeaderHandler) error CleanupHeadersBehindNonceCalled func(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64) ComputeLongestChainCalled func(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte) ComputeLongestMetaChainFromLastNotarizedCalled func() ([]data.HeaderHandler, [][]byte, error) ComputeLongestShardsChainsFromLastNotarizedCalled func() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error) DisplayTrackedHeadersCalled func() GetCrossNotarizedHeaderCalled func(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error) GetFinalHeaderCalled func(shardID uint32) (data.HeaderHandler, []byte, error) GetLastCrossNotarizedHeaderCalled func(shardID uint32) (data.HeaderHandler, []byte, error) GetLastCrossNotarizedHeadersForAllShardsCalled func() (map[uint32]data.HeaderHandler, error) GetTrackedHeadersCalled func(shardID uint32) ([]data.HeaderHandler, [][]byte) GetTrackedHeadersForAllShardsCalled func() map[uint32][]data.HeaderHandler GetTrackedHeadersWithNonceCalled func(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte) IsShardStuckCalled func(shardId uint32) bool RegisterCrossNotarizedHeadersHandlerCalled func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)) RegisterSelfNotarizedHeadersHandlerCalled func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte)) RemoveLastNotarizedHeadersCalled func() RestoreToGenesisCalled func() }
BlockTrackerStub -
func (*BlockTrackerStub) AddCrossNotarizedHeader ¶
func (bts *BlockTrackerStub) AddCrossNotarizedHeader(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte)
AddCrossNotarizedHeader -
func (*BlockTrackerStub) AddSelfNotarizedHeader ¶
func (bts *BlockTrackerStub) AddSelfNotarizedHeader(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte)
AddSelfNotarizedHeader -
func (*BlockTrackerStub) AddTrackedHeader ¶
func (bts *BlockTrackerStub) AddTrackedHeader(header data.HeaderHandler, hash []byte)
AddTrackedHeader -
func (*BlockTrackerStub) CheckBlockAgainstFinal ¶
func (bts *BlockTrackerStub) CheckBlockAgainstFinal(headerHandler data.HeaderHandler) error
CheckBlockAgainstFinal -
func (*BlockTrackerStub) CheckBlockAgainstRounder ¶
func (bts *BlockTrackerStub) CheckBlockAgainstRounder(headerHandler data.HeaderHandler) error
CheckBlockAgainstRounder -
func (*BlockTrackerStub) CleanupHeadersBehindNonce ¶
func (bts *BlockTrackerStub) CleanupHeadersBehindNonce(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)
CleanupHeadersBehindNonce -
func (*BlockTrackerStub) ComputeLongestChain ¶
func (bts *BlockTrackerStub) ComputeLongestChain(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte)
ComputeLongestChain -
func (*BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized ¶
func (bts *BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized() ([]data.HeaderHandler, [][]byte, error)
ComputeLongestMetaChainFromLastNotarized -
func (*BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized ¶
func (bts *BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error)
ComputeLongestShardsChainsFromLastNotarized -
func (*BlockTrackerStub) DisplayTrackedHeaders ¶
func (bts *BlockTrackerStub) DisplayTrackedHeaders()
DisplayTrackedHeaders -
func (*BlockTrackerStub) GetCrossNotarizedHeader ¶
func (bts *BlockTrackerStub) GetCrossNotarizedHeader(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
GetCrossNotarizedHeader -
func (*BlockTrackerStub) GetFinalHeader ¶
func (bts *BlockTrackerStub) GetFinalHeader(shardID uint32) (data.HeaderHandler, []byte, error)
GetFinalHeader -
func (*BlockTrackerStub) GetLastCrossNotarizedHeader ¶
func (bts *BlockTrackerStub) GetLastCrossNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)
GetLastCrossNotarizedHeader -
func (*BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards ¶
func (bts *BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards() (map[uint32]data.HeaderHandler, error)
GetLastCrossNotarizedHeadersForAllShards -
func (*BlockTrackerStub) GetTrackedHeaders ¶
func (bts *BlockTrackerStub) GetTrackedHeaders(shardID uint32) ([]data.HeaderHandler, [][]byte)
GetTrackedHeaders -
func (*BlockTrackerStub) GetTrackedHeadersForAllShards ¶
func (bts *BlockTrackerStub) GetTrackedHeadersForAllShards() map[uint32][]data.HeaderHandler
GetTrackedHeadersForAllShards -
func (*BlockTrackerStub) GetTrackedHeadersWithNonce ¶
func (bts *BlockTrackerStub) GetTrackedHeadersWithNonce(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)
GetTrackedHeadersWithNonce -
func (*BlockTrackerStub) IsInterfaceNil ¶
func (bts *BlockTrackerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*BlockTrackerStub) IsShardStuck ¶
func (bts *BlockTrackerStub) IsShardStuck(shardId uint32) bool
IsShardStuck -
func (*BlockTrackerStub) RegisterCrossNotarizedHeadersHandler ¶
func (bts *BlockTrackerStub) RegisterCrossNotarizedHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
RegisterCrossNotarizedHeadersHandler -
func (*BlockTrackerStub) RegisterSelfNotarizedHeadersHandler ¶
func (bts *BlockTrackerStub) RegisterSelfNotarizedHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
RegisterSelfNotarizedHeadersHandler -
func (*BlockTrackerStub) RemoveLastNotarizedHeaders ¶
func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()
RemoveLastNotarizedHeaders -
func (*BlockTrackerStub) RestoreToGenesis ¶
func (bts *BlockTrackerStub) RestoreToGenesis()
RestoreToGenesis -
type BoostrapStorerMock ¶
type BoostrapStorerMock struct { PutCalled func(round int64, bootData bootstrapStorage.BootstrapData) error GetCalled func(round int64) (bootstrapStorage.BootstrapData, error) GetHighestRoundCalled func() int64 }
BoostrapStorerMock -
func (*BoostrapStorerMock) Get ¶
func (bsm *BoostrapStorerMock) Get(round int64) (bootstrapStorage.BootstrapData, error)
Get -
func (*BoostrapStorerMock) GetHighestRound ¶
func (bsm *BoostrapStorerMock) GetHighestRound() int64
GetHighestRound -
func (*BoostrapStorerMock) IsInterfaceNil ¶
func (bsm *BoostrapStorerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*BoostrapStorerMock) Put ¶
func (bsm *BoostrapStorerMock) Put(round int64, bootData bootstrapStorage.BootstrapData) error
Put -
func (*BoostrapStorerMock) SaveLastRound ¶
func (bsm *BoostrapStorerMock) SaveLastRound(round int64) error
SaveLastRound -
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)) }
CacherStub -
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cs *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte))
RegisterHandler -
type ChainHandlerStub ¶
type ChainHandlerStub struct { GetGenesisHeaderCalled func() data.HeaderHandler GetGenesisHeaderHashCalled func() []byte SetGenesisHeaderCalled func(gb data.HeaderHandler) error SetGenesisHeaderHashCalled func(hash []byte) SetCurrentBlockHeaderCalled func(bh data.HeaderHandler) error SetCurrentBlockBodyCalled func(body data.BodyHandler) error }
ChainHandlerStub -
func (*ChainHandlerStub) GetCurrentBlockBody ¶
func (chs *ChainHandlerStub) GetCurrentBlockBody() data.BodyHandler
GetCurrentBlockBody -
func (*ChainHandlerStub) GetCurrentBlockHeader ¶
func (chs *ChainHandlerStub) GetCurrentBlockHeader() data.HeaderHandler
GetCurrentBlockHeader -
func (*ChainHandlerStub) GetCurrentBlockHeaderHash ¶
func (chs *ChainHandlerStub) GetCurrentBlockHeaderHash() []byte
GetCurrentBlockHeaderHash -
func (*ChainHandlerStub) GetGenesisHeader ¶
func (chs *ChainHandlerStub) GetGenesisHeader() data.HeaderHandler
GetGenesisHeader -
func (*ChainHandlerStub) GetGenesisHeaderHash ¶
func (chs *ChainHandlerStub) GetGenesisHeaderHash() []byte
GetGenesisHeaderHash -
func (*ChainHandlerStub) GetLocalHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) GetLocalHeight() int64
GetLocalHeight -
func (*ChainHandlerStub) GetNetworkHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) GetNetworkHeight() int64
GetNetworkHeight -
func (*ChainHandlerStub) HasBadBlock ¶ added in v1.0.3
func (chs *ChainHandlerStub) HasBadBlock(blockHash []byte) bool
HasBadBlock -
func (*ChainHandlerStub) IsInterfaceNil ¶
func (chs *ChainHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChainHandlerStub) PutBadBlock ¶ added in v1.0.3
func (chs *ChainHandlerStub) PutBadBlock(blockHash []byte)
PutBadBlock -
func (*ChainHandlerStub) SetCurrentBlockBody ¶
func (chs *ChainHandlerStub) SetCurrentBlockBody(body data.BodyHandler) error
SetCurrentBlockBody -
func (*ChainHandlerStub) SetCurrentBlockHeader ¶
func (chs *ChainHandlerStub) SetCurrentBlockHeader(bh data.HeaderHandler) error
SetCurrentBlockHeader -
func (*ChainHandlerStub) SetCurrentBlockHeaderHash ¶
func (chs *ChainHandlerStub) SetCurrentBlockHeaderHash(hash []byte)
SetCurrentBlockHeaderHash -
func (*ChainHandlerStub) SetGenesisHeader ¶
func (chs *ChainHandlerStub) SetGenesisHeader(gb data.HeaderHandler) error
SetGenesisHeader -
func (*ChainHandlerStub) SetGenesisHeaderHash ¶
func (chs *ChainHandlerStub) SetGenesisHeaderHash(hash []byte)
SetGenesisHeaderHash -
func (*ChainHandlerStub) SetLocalHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) SetLocalHeight(height int64)
SetLocalHeight -
func (*ChainHandlerStub) SetNetworkHeight ¶ added in v1.0.3
func (chs *ChainHandlerStub) SetNetworkHeight(height int64)
SetNetworkHeight -
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) 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 EpochStartTriggerStub ¶
type EpochStartTriggerStub struct { ForceEpochStartCalled func(round uint64) error IsEpochStartCalled func() bool EpochCalled func() uint32 ReceivedHeaderCalled func(handler data.HeaderHandler) UpdateCalled func(round uint64) ProcessedCalled func(header data.HeaderHandler) EpochStartRoundCalled func() uint64 }
EpochStartTriggerStub -
func (*EpochStartTriggerStub) EpochFinalityAttestingRound ¶
func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64
EpochFinalityAttestingRound -
func (*EpochStartTriggerStub) EpochStartMetaHdrHash ¶
func (e *EpochStartTriggerStub) EpochStartMetaHdrHash() []byte
EpochStartMetaHdrHash -
func (*EpochStartTriggerStub) EpochStartRound ¶
func (e *EpochStartTriggerStub) EpochStartRound() uint64
EpochStartRound -
func (*EpochStartTriggerStub) ForceEpochStart ¶
func (e *EpochStartTriggerStub) ForceEpochStart(round uint64) error
ForceEpochStart -
func (*EpochStartTriggerStub) IsEpochStart ¶
func (e *EpochStartTriggerStub) IsEpochStart() bool
IsEpochStart -
func (*EpochStartTriggerStub) IsInterfaceNil ¶
func (e *EpochStartTriggerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartTriggerStub) NotifyAll ¶
func (e *EpochStartTriggerStub) NotifyAll(_ data.HeaderHandler)
NotifyAll -
func (*EpochStartTriggerStub) ReceivedHeader ¶
func (e *EpochStartTriggerStub) ReceivedHeader(header data.HeaderHandler)
ReceivedHeader -
func (*EpochStartTriggerStub) SetCurrentEpochStartRound ¶
func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)
SetCurrentEpochStartRound -
func (*EpochStartTriggerStub) SetFinalityAttestingRound ¶
func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)
SetFinalityAttestingRound -
func (*EpochStartTriggerStub) SetProcessed ¶
func (e *EpochStartTriggerStub) SetProcessed(header data.HeaderHandler)
SetProcessed -
func (*EpochStartTriggerStub) Update ¶
func (e *EpochStartTriggerStub) Update(round uint64)
Update -
type FeeHandlerStub ¶
type FeeHandlerStub struct { MaxGasLimitPerBlockCalled func() uint64 SetMinGasPriceCalled func(minasPrice uint64) SetMinGasLimitCalled func(minGasLimit uint64) ComputeGasLimitCalled func(tx process.TransactionWithFeeHandler) uint64 ComputeFeeCalled func(tx process.TransactionWithFeeHandler) *big.Int CheckValidityTxValuesCalled func(tx process.TransactionWithFeeHandler) error }
FeeHandlerStub -
func (*FeeHandlerStub) CheckValidityTxValues ¶
func (fhs *FeeHandlerStub) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
CheckValidityTxValues -
func (*FeeHandlerStub) ComputeFee ¶
func (fhs *FeeHandlerStub) ComputeFee(tx process.TransactionWithFeeHandler) *big.Int
ComputeFee -
func (*FeeHandlerStub) ComputeGasLimit ¶
func (fhs *FeeHandlerStub) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
ComputeGasLimit -
func (*FeeHandlerStub) IsInterfaceNil ¶
func (fhs *FeeHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*FeeHandlerStub) MaxGasLimitPerBlock ¶
func (fhs *FeeHandlerStub) MaxGasLimitPerBlock() uint64
MaxGasLimitPerBlock -
type ForkDetectorMock ¶
type ForkDetectorMock struct { AddHeaderCalled func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error RemoveHeaderCalled func(nonce uint64, hash []byte) CheckForkCalled func() *process.ForkInfo GetHighestFinalBlockNonceCalled func() uint64 GetHighestFinalBlockHashCalled func() []byte ProbableHighestNonceCalled func() uint64 ResetForkCalled func() GetNotarizedHeaderHashCalled func(nonce uint64) []byte SetRollBackNonceCalled func(nonce uint64) RestoreToGenesisCalled func() ResetProbableHighestNonceCalled func() }
ForkDetectorMock is a mock implementation for the ForkDetector interface
func (*ForkDetectorMock) AddHeader ¶
func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error
AddHeader is a mock implementation for AddHeader
func (*ForkDetectorMock) CheckFork ¶
func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
CheckFork is a mock implementation for CheckFork
func (*ForkDetectorMock) GetHighestFinalBlockHash ¶
func (fdm *ForkDetectorMock) GetHighestFinalBlockHash() []byte
GetHighestFinalBlockHash -
func (*ForkDetectorMock) GetHighestFinalBlockNonce ¶
func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce
func (*ForkDetectorMock) GetNotarizedHeaderHash ¶
func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte
GetNotarizedHeaderHash -
func (*ForkDetectorMock) IsInterfaceNil ¶
func (fdm *ForkDetectorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ForkDetectorMock) ProbableHighestNonce ¶
func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64
ProbableHighestNonce is a mock implementation for GetProbableHighestNonce
func (*ForkDetectorMock) RemoveHeader ¶
func (fdm *ForkDetectorMock) RemoveHeader(nonce uint64, hash []byte)
RemoveHeader is a mock implementation for RemoveHeader
func (*ForkDetectorMock) ResetProbableHighestNonce ¶
func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
ResetProbableHighestNonce -
func (*ForkDetectorMock) RestoreToGenesis ¶
func (fdm *ForkDetectorMock) RestoreToGenesis()
RestoreToGenesis -
func (*ForkDetectorMock) SetRollBackNonce ¶
func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)
SetRollBackNonce -
type GeneratorSuite ¶
GeneratorSuite -
type HasherFake ¶
type HasherFake struct { }
HasherFake that will be used for testing
func (HasherFake) Compute ¶
func (sha HasherFake) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherFake) EmptyHash ¶
func (sha HasherFake) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (*HasherFake) IsInterfaceNil ¶
func (sha *HasherFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HasherMock ¶
HasherMock -
func (HasherMock) IsInterfaceNil ¶
func (hash HasherMock) 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 }
HeaderResolverStub -
func (*HeaderResolverStub) IsInterfaceNil ¶
func (hrm *HeaderResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderResolverStub) ProcessReceivedMessage ¶
func (hrm *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
ProcessReceivedMessage -
func (*HeaderResolverStub) RequestDataFromEpoch ¶
func (hrm *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error
RequestDataFromEpoch -
func (*HeaderResolverStub) RequestDataFromHash ¶
func (hrm *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
RequestDataFromHash -
func (*HeaderResolverStub) RequestDataFromNonce ¶
func (hrm *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error
RequestDataFromNonce -
func (*HeaderResolverStub) SetEpochHandler ¶
func (hrm *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) error
SetEpochHandler -
type HeaderSigVerifierStub ¶
type HeaderSigVerifierStub struct {
VerifyRandSeedCaller func(header data.HeaderHandler) error
}
HeaderSigVerifierStub -
func (*HeaderSigVerifierStub) IsInterfaceNil ¶
func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeaderSigVerifierStub) VerifyRandSeed ¶
func (hsvm *HeaderSigVerifierStub) VerifyRandSeed(header data.HeaderHandler) error
VerifyRandSeed -
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 }
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) 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 HeartbeatStorerStub ¶
type HeartbeatStorerStub struct { LoadGenesisTimeCalled func() (time.Time, error) UpdateGenesisTimeCalled func(genesisTime time.Time) error LoadHbmiDTOCalled func(pubKey string) (*heartbeat.HeartbeatDTO, error) SavePubkeyDataCalled func(pubkey []byte, heartbeat *heartbeat.HeartbeatDTO) error LoadKeysCalled func() ([][]byte, error) SaveKeysCalled func(peersSlice [][]byte) error }
HeartbeatStorerStub -
func (*HeartbeatStorerStub) IsInterfaceNil ¶
func (hss *HeartbeatStorerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeartbeatStorerStub) LoadGenesisTime ¶
func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)
LoadGenesisTime -
func (*HeartbeatStorerStub) LoadHbmiDTO ¶
func (hss *HeartbeatStorerStub) LoadHbmiDTO(pubKey string) (*heartbeat.HeartbeatDTO, error)
LoadHbmiDTO -
func (*HeartbeatStorerStub) LoadKeys ¶
func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)
LoadKeys -
func (*HeartbeatStorerStub) SaveKeys ¶
func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error
SaveKeys -
func (*HeartbeatStorerStub) SavePubkeyData ¶
func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *heartbeat.HeartbeatDTO) error
SavePubkeyData -
func (*HeartbeatStorerStub) UpdateGenesisTime ¶
func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error
UpdateGenesisTime -
type IndexerMock ¶
IndexerMock is a mock implementation fot the Indexer interface
func (*IndexerMock) IsInterfaceNil ¶
func (im *IndexerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*IndexerMock) SaveBlock ¶
func (im *IndexerMock) SaveBlock(body data.BodyHandler, header data.HeaderHandler, txPool map[string]data.TransactionHandler, signersIndexes []uint64)
SaveBlock -
func (*IndexerMock) SaveMetaBlock ¶
func (im *IndexerMock) SaveMetaBlock(header data.HeaderHandler, signersIndexes []uint64)
SaveMetaBlock -
func (*IndexerMock) SaveRoundInfo ¶
func (im *IndexerMock) SaveRoundInfo(roundInfo indexer.RoundInfo)
SaveRoundInfo -
func (*IndexerMock) SaveValidatorsPubKeys ¶
func (im *IndexerMock) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte)
SaveValidatorsPubKeys -
func (*IndexerMock) UpdateTPS ¶
func (im *IndexerMock) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)
UpdateTPS -
type InterceptorsContainerStub ¶
type InterceptorsContainerStub struct { }
InterceptorsContainerStub -
func (*InterceptorsContainerStub) Add ¶
func (ics *InterceptorsContainerStub) Add(_ string, _ process.Interceptor) error
Add -
func (*InterceptorsContainerStub) AddMultiple ¶
func (ics *InterceptorsContainerStub) AddMultiple(_ []string, _ []process.Interceptor) error
AddMultiple -
func (*InterceptorsContainerStub) Get ¶
func (ics *InterceptorsContainerStub) Get(_ string) (process.Interceptor, error)
Get -
func (*InterceptorsContainerStub) IsInterfaceNil ¶
func (ics *InterceptorsContainerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*InterceptorsContainerStub) Remove ¶
func (ics *InterceptorsContainerStub) Remove(_ string)
Remove -
func (*InterceptorsContainerStub) Replace ¶
func (ics *InterceptorsContainerStub) Replace(_ string, _ process.Interceptor) error
Replace -
type KeyGenMock ¶
type KeyGenMock struct { GeneratePairMock func() (crypto.PrivateKey, crypto.PublicKey) PrivateKeyFromByteArrayMock func(b []byte) (crypto.PrivateKey, error) PublicKeyFromByteArrayMock func(b []byte) (crypto.PublicKey, error) SuiteMock func() crypto.Suite }
KeyGenMock -
func (*KeyGenMock) GeneratePair ¶
func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
GeneratePair -
func (*KeyGenMock) IsInterfaceNil ¶
func (keyGen *KeyGenMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*KeyGenMock) PrivateKeyFromByteArray ¶
func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
PrivateKeyFromByteArray -
func (*KeyGenMock) PublicKeyFromByteArray ¶
func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
PublicKeyFromByteArray -
type MarshalizerFake ¶
type MarshalizerFake struct {
Fail bool
}
MarshalizerFake that will be used for testing
func (*MarshalizerFake) IsInterfaceNil ¶
func (mm *MarshalizerFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerFake) Marshal ¶
func (mm *MarshalizerFake) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerFake) Unmarshal ¶
func (mm *MarshalizerFake) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type MarshalizerMock ¶
type MarshalizerMock struct { MarshalHandler func(obj interface{}) ([]byte, error) UnmarshalHandler func(obj interface{}, buff []byte) error }
MarshalizerMock -
func (*MarshalizerMock) IsInterfaceNil ¶
func (j *MarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (MarshalizerMock) Marshal ¶
func (j MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal -
func (MarshalizerMock) Unmarshal ¶
func (j MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal -
type MessageHandlerStub ¶
type MessageHandlerStub struct {
CreateHeartbeatFromP2pMessageCalled func(message p2p.MessageP2P) (*heartbeat.Heartbeat, error)
}
MessageHandlerStub -
func (*MessageHandlerStub) CreateHeartbeatFromP2pMessage ¶ added in v1.0.23
func (mhs *MessageHandlerStub) CreateHeartbeatFromP2pMessage(message p2p.MessageP2P) (*heartbeat.Heartbeat, error)
CreateHeartbeatFromP2pMessage -
func (*MessageHandlerStub) IsInterfaceNil ¶
func (mhs *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type MessengerStub ¶
type MessengerStub struct { CloseCalled func() error 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 BootstrapCalled func() error PeerAddressCalled func(pid p2p.PeerID) string BroadcastOnChannelBlockingCalled func(channel string, topic string, buff []byte) error IsConnectedToTheNetworkCalled func() bool }
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) BroadcastOnChannelBlocking ¶
func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error
BroadcastOnChannelBlocking -
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) IsConnectedToTheNetwork ¶
func (ms *MessengerStub) IsConnectedToTheNetwork() bool
IsConnectedToTheNetwork -
func (*MessengerStub) IsInterfaceNil ¶
func (ms *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessengerStub) PeerAddress ¶
func (ms *MessengerStub) PeerAddress(pid p2p.PeerID) string
PeerAddress -
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
RegisterMessageProcessor -
type MiniBlocksResolverStub ¶
type MiniBlocksResolverStub struct { RequestDataFromHashCalled func(hash []byte, epoch uint32) error RequestDataFromHashArrayCalled func(hashes [][]byte, epoch uint32) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error GetMiniBlocksCalled func(hashes [][]byte) (block.MiniBlockSlice, [][]byte) GetMiniBlocksFromPoolCalled func(hashes [][]byte) (block.MiniBlockSlice, [][]byte) }
MiniBlocksResolverStub -
func (*MiniBlocksResolverStub) GetMiniBlocks ¶
func (hrm *MiniBlocksResolverStub) GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
GetMiniBlocks -
func (*MiniBlocksResolverStub) GetMiniBlocksFromPool ¶
func (hrm *MiniBlocksResolverStub) GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
GetMiniBlocksFromPool -
func (*MiniBlocksResolverStub) IsInterfaceNil ¶
func (hrm *MiniBlocksResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MiniBlocksResolverStub) ProcessReceivedMessage ¶
func (hrm *MiniBlocksResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
ProcessReceivedMessage -
func (*MiniBlocksResolverStub) RequestDataFromHash ¶
func (hrm *MiniBlocksResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error
RequestDataFromHash -
func (*MiniBlocksResolverStub) RequestDataFromHashArray ¶
func (hrm *MiniBlocksResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error
RequestDataFromHashArray -
type MockTimer ¶
type MockTimer struct {
// contains filtered or unexported fields
}
MockTimer -
func (*MockTimer) IncrementSeconds ¶
IncrementSeconds -
type MultisignMock ¶
type MultisignMock struct { }
MultisignMock -
func (*MultisignMock) AggregateCommitments ¶
func (mm *MultisignMock) AggregateCommitments(bitmap []byte) error
AggregateCommitments -
func (*MultisignMock) AggregateSigs ¶
func (mm *MultisignMock) AggregateSigs(bitmap []byte) ([]byte, error)
AggregateSigs -
func (*MultisignMock) Commitment ¶
func (mm *MultisignMock) Commitment(index uint16) ([]byte, error)
Commitment -
func (*MultisignMock) CommitmentHash ¶
func (mm *MultisignMock) CommitmentHash(index uint16) ([]byte, error)
CommitmentHash -
func (*MultisignMock) Create ¶
func (mm *MultisignMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
Create -
func (*MultisignMock) CreateCommitment ¶
func (mm *MultisignMock) CreateCommitment() (commSecret []byte, commitment []byte)
CreateCommitment -
func (*MultisignMock) CreateSignatureShare ¶
func (mm *MultisignMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
CreateSignatureShare -
func (*MultisignMock) IsInterfaceNil ¶
func (mm *MultisignMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MultisignMock) Reset ¶
func (mm *MultisignMock) Reset(pubKeys []string, index uint16) error
Reset -
func (*MultisignMock) SetAggregatedSig ¶
func (mm *MultisignMock) SetAggregatedSig([]byte) error
SetAggregatedSig -
func (*MultisignMock) SignatureShare ¶
func (mm *MultisignMock) SignatureShare(index uint16) ([]byte, error)
SignatureShare -
func (*MultisignMock) StoreCommitment ¶
func (mm *MultisignMock) StoreCommitment(index uint16, value []byte) error
StoreCommitment -
func (*MultisignMock) StoreCommitmentHash ¶
func (mm *MultisignMock) StoreCommitmentHash(index uint16, commHash []byte) error
StoreCommitmentHash -
func (*MultisignMock) StoreSignatureShare ¶
func (mm *MultisignMock) StoreSignatureShare(index uint16, sig []byte) error
StoreSignatureShare -
func (*MultisignMock) Verify ¶
func (mm *MultisignMock) Verify(msg []byte, bitmap []byte) error
Verify -
func (*MultisignMock) VerifySignatureShare ¶
func (mm *MultisignMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
VerifySignatureShare -
type NodesCoordinatorMock ¶
type NodesCoordinatorMock struct { ComputeValidatorsGroupCalled func(randomness []byte, round uint64, shardId uint32) ([]sharding.Validator, error) GetValidatorsPublicKeysCalled func(randomness []byte, round uint64, shardId uint32) ([]string, error) GetValidatorsRewardsAddressesCalled func(randomness []byte, round uint64, shardId uint32) ([]string, error) }
NodesCoordinatorMock -
func (*NodesCoordinatorMock) ComputeValidatorsGroup ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) ComputeValidatorsGroup( randomness []byte, round uint64, shardId uint32, ) (validatorsGroup []sharding.Validator, err error)
ComputeValidatorsGroup -
func (*NodesCoordinatorMock) ConsensusGroupSize ¶
func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorMock) GetAllValidatorsPublicKeys ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte
GetAllValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetOwnPublicKey ¶
func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
GetOwnPublicKey -
func (*NodesCoordinatorMock) GetSelectedPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32) (publicKeys []string, err error)
GetSelectedPublicKeys -
func (*NodesCoordinatorMock) GetValidatorWithPublicKey ¶
func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
GetValidatorWithPublicKey -
func (*NodesCoordinatorMock) GetValidatorsIndexes ¶
func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64
GetValidatorsIndexes -
func (*NodesCoordinatorMock) GetValidatorsPublicKeys ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) GetValidatorsPublicKeys( randomness []byte, round uint64, shardId uint32, ) ([]string, error)
GetValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetValidatorsRewardsAddresses ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) GetValidatorsRewardsAddresses( randomness []byte, round uint64, shardId uint32, ) ([]string, error)
GetValidatorsRewardsAddresses -
func (*NodesCoordinatorMock) IsInterfaceNil ¶
func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NodesCoordinatorMock) SetConsensusGroupSize ¶
func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(int) error
SetConsensusGroupSize -
func (*NodesCoordinatorMock) SetNodesPerShards ¶
func (ncm *NodesCoordinatorMock) SetNodesPerShards(map[uint32][]sharding.Validator) error
SetNodesPerShards -
type P2PMessageMock ¶
type P2PMessageMock struct { FromField []byte DataField []byte SeqNoField []byte TopicIDsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
P2PMessageMock -
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageMock) TopicIDs ¶ added in v1.0.38
func (msg *P2PMessageMock) TopicIDs() []string
TopicIDs -
type P2PMessageStub ¶
type P2PMessageStub struct { FromField []byte DataField []byte SeqNoField []byte TopicIDsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
P2PMessageStub -
func (*P2PMessageStub) IsInterfaceNil ¶
func (msg *P2PMessageStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageStub) TopicIDs ¶ added in v1.0.3
func (msg *P2PMessageStub) TopicIDs() []string
TopicIDs -
type PeerAccountHandlerMock ¶ added in v1.0.84
type PeerAccountHandlerMock struct { MockValue int SetNonceWithJournalCalled func(nonce uint64) error SetCodeHashWithJournalCalled func(codeHash []byte) error SetRootHashWithJournalCalled func([]byte) error RatingCalled func() uint32 SetCodeWithJournalCalled func(codeHash []byte) error SetRatingWithJournalCalled func(rating uint32) error TempRatingCalled func() uint32 SetTempRatingWithJournalCalled func(rating uint32) error IncreaseLeaderSuccessRateWithJournalCalled func() error DecreaseLeaderSuccessRateWithJournalCalled func() error IncreaseValidatorSuccessRateWithJournalCalled func() error DecreaseValidatorSuccessRateWithJournalCalled func() error // contains filtered or unexported fields }
PeerAccountHandlerMock -
func (*PeerAccountHandlerMock) AddressContainer ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) AddressContainer() state.AddressContainer
AddressContainer -
func (*PeerAccountHandlerMock) DataTrie ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) DataTrie() data.Trie
DataTrie -
func (*PeerAccountHandlerMock) DataTrieTracker ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) DataTrieTracker() state.DataTrieTracker
DataTrieTracker -
func (*PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal() error
DecreaseLeaderSuccessRateWithJournal -
func (*PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal() error
DecreaseValidatorSuccessRateWithJournal -
func (*PeerAccountHandlerMock) GetCode ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetCode() []byte
GetCode -
func (*PeerAccountHandlerMock) GetCodeHash ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetCodeHash() []byte
GetCodeHash -
func (*PeerAccountHandlerMock) GetNonce ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetNonce() uint64
GetNonce -
func (*PeerAccountHandlerMock) GetRating ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetRating() uint32
GetRating -
func (*PeerAccountHandlerMock) GetRootHash ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetRootHash() []byte
GetRootHash -
func (*PeerAccountHandlerMock) GetTempRating ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) GetTempRating() uint32
GetTempRating -
func (*PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal() error
IncreaseLeaderSuccessRateWithJournal -
func (*PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal() error
IncreaseValidatorSuccessRateWithJournal -
func (*PeerAccountHandlerMock) IsInterfaceNil ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeerAccountHandlerMock) SetCode ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetCode(code []byte)
SetCode -
func (*PeerAccountHandlerMock) SetCodeHash ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetCodeHash(codeHash []byte)
SetCodeHash -
func (*PeerAccountHandlerMock) SetCodeHashWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetCodeHashWithJournal(codeHash []byte) error
SetCodeHashWithJournal -
func (*PeerAccountHandlerMock) SetDataTrie ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetDataTrie(trie data.Trie)
SetDataTrie -
func (*PeerAccountHandlerMock) SetDataTrieTracker ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetDataTrieTracker(tracker state.DataTrieTracker)
SetDataTrieTracker -
func (*PeerAccountHandlerMock) SetNonce ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetNonce(nonce uint64)
SetNonce -
func (*PeerAccountHandlerMock) SetNonceWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetNonceWithJournal(nonce uint64) error
SetNonceWithJournal -
func (*PeerAccountHandlerMock) SetRatingWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetRatingWithJournal(rating uint32) error
SetRatingWithJournal -
func (*PeerAccountHandlerMock) SetRootHash ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetRootHash(rootHash []byte)
SetRootHash -
func (*PeerAccountHandlerMock) SetTempRatingWithJournal ¶ added in v1.0.84
func (pahm *PeerAccountHandlerMock) SetTempRatingWithJournal(rating uint32) error
SetTempRatingWithJournal -
type PendingMiniBlocksHandlerStub ¶
type PendingMiniBlocksHandlerStub struct { PendingMiniBlockHeadersCalled func(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error) AddProcessedHeaderCalled func(handler data.HeaderHandler) error RevertHeaderCalled func(handler data.HeaderHandler) error GetNumPendingMiniBlocksCalled func(shardID uint32) uint32 SetNumPendingMiniBlocksCalled func(shardID uint32, numPendingMiniBlocks uint32) }
PendingMiniBlocksHandlerStub -
func (*PendingMiniBlocksHandlerStub) AddProcessedHeader ¶
func (p *PendingMiniBlocksHandlerStub) AddProcessedHeader(handler data.HeaderHandler) error
AddProcessedHeader -
func (*PendingMiniBlocksHandlerStub) GetNumPendingMiniBlocks ¶ added in v1.0.82
func (p *PendingMiniBlocksHandlerStub) GetNumPendingMiniBlocks(shardID uint32) uint32
GetNumPendingMiniBlocks -
func (*PendingMiniBlocksHandlerStub) IsInterfaceNil ¶
func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PendingMiniBlocksHandlerStub) PendingMiniBlockHeaders ¶ added in v1.0.82
func (p *PendingMiniBlocksHandlerStub) PendingMiniBlockHeaders(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error)
PendingMiniBlockHeaders -
func (*PendingMiniBlocksHandlerStub) RevertHeader ¶
func (p *PendingMiniBlocksHandlerStub) RevertHeader(handler data.HeaderHandler) error
RevertHeader -
func (*PendingMiniBlocksHandlerStub) SetNumPendingMiniBlocks ¶ added in v1.0.82
func (p *PendingMiniBlocksHandlerStub) SetNumPendingMiniBlocks(shardID uint32, numPendingMiniBlocks uint32)
SetNumPendingMiniBlocks -
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 CurrBlockTxsCalled func() dataRetriever.TransactionCacher TrieNodesCalled func() storage.Cacher }
PoolsHolderStub -
func (*PoolsHolderStub) CurrentBlockTxs ¶
func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderStub) Headers ¶
func (phs *PoolsHolderStub) Headers() dataRetriever.HeadersPool
Headers -
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
MiniBlocks -
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderStub) RewardTransactions ¶
func (phs *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderStub) Transactions ¶
func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderStub) TrieNodes ¶
func (phs *PoolsHolderStub) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderStub) UnsignedTransactions ¶
func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type PrivateKeyStub ¶
type PrivateKeyStub struct { ToByteArrayHandler func() ([]byte, error) GeneratePublicHandler func() crypto.PublicKey SuiteHandler func() crypto.Suite ScalarHandler func() crypto.Scalar }
PrivateKeyStub -
func (*PrivateKeyStub) GeneratePublic ¶
func (sk *PrivateKeyStub) GeneratePublic() crypto.PublicKey
GeneratePublic -
func (*PrivateKeyStub) IsInterfaceNil ¶
func (sk *PrivateKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyStub) ToByteArray ¶
func (sk *PrivateKeyStub) ToByteArray() ([]byte, error)
ToByteArray -
type PublicKeyMock ¶
type PublicKeyMock struct { ToByteArrayHandler func() ([]byte, error) SuiteCalled func() crypto.Suite PointCalled func() crypto.Point }
PublicKeyMock -
func (*PublicKeyMock) IsInterfaceNil ¶
func (sspk *PublicKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyMock) ToByteArray ¶
func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)
ToByteArray -
type RequestHandlerStub ¶
type RequestHandlerStub struct { RequestShardHeaderCalled func(shardID uint32, hash []byte) RequestMetaHeaderCalled func(hash []byte) RequestMetaHeaderByNonceCalled func(nonce uint64) RequestShardHeaderByNonceCalled func(shardID uint32, nonce uint64) RequestTransactionHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestScrHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestRewardTxHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestMiniBlockHandlerCalled func(destShardID uint32, miniblockHash []byte) RequestMiniBlocksHandlerCalled func(destShardID uint32, miniblocksHashes [][]byte) RequestTrieNodesCalled func(destShardID uint32, hash []byte, topic string) }
RequestHandlerStub -
func (*RequestHandlerStub) IsInterfaceNil ¶
func (rhs *RequestHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RequestHandlerStub) RequestMetaHeader ¶
func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)
RequestMetaHeader -
func (*RequestHandlerStub) RequestMetaHeaderByNonce ¶
func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)
RequestMetaHeaderByNonce -
func (*RequestHandlerStub) RequestMiniBlock ¶
func (rhs *RequestHandlerStub) RequestMiniBlock(destShardID uint32, miniblockHash []byte)
RequestMiniBlock -
func (*RequestHandlerStub) RequestMiniBlocks ¶
func (rhs *RequestHandlerStub) RequestMiniBlocks(destShardID uint32, miniblocksHashes [][]byte)
RequestMiniBlocks -
func (*RequestHandlerStub) RequestRewardTransactions ¶
func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
RequestRewardTransactions -
func (*RequestHandlerStub) RequestShardHeader ¶
func (rhs *RequestHandlerStub) RequestShardHeader(shardID uint32, hash []byte)
RequestShardHeader -
func (*RequestHandlerStub) RequestShardHeaderByNonce ¶
func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardID uint32, nonce uint64)
RequestShardHeaderByNonce -
func (*RequestHandlerStub) RequestTransaction ¶
func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)
RequestTransaction -
func (*RequestHandlerStub) RequestTrieNodes ¶
func (rhs *RequestHandlerStub) RequestTrieNodes(destShardID uint32, miniblockHash []byte, topic string)
RequestTrieNodes -
func (*RequestHandlerStub) RequestUnsignedTransactions ¶
func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
RequestUnsignedTransactions -
func (*RequestHandlerStub) SetEpoch ¶
func (rhs *RequestHandlerStub) SetEpoch(epoch uint32)
SetEpoch -
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 ResolversFinderStub ¶
type ResolversFinderStub 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 IntraShardResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) MetaChainResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) CrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error) }
ResolversFinderStub -
func (*ResolversFinderStub) Add ¶
func (rfs *ResolversFinderStub) Add(key string, val dataRetriever.Resolver) error
Add -
func (*ResolversFinderStub) AddMultiple ¶
func (rfs *ResolversFinderStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
AddMultiple -
func (*ResolversFinderStub) CrossShardResolver ¶
func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
CrossShardResolver -
func (*ResolversFinderStub) Get ¶
func (rfs *ResolversFinderStub) Get(key string) (dataRetriever.Resolver, error)
Get -
func (*ResolversFinderStub) IntraShardResolver ¶
func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
IntraShardResolver -
func (*ResolversFinderStub) IsInterfaceNil ¶
func (rfs *ResolversFinderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolversFinderStub) MetaChainResolver ¶
func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
MetaChainResolver -
func (*ResolversFinderStub) Replace ¶
func (rfs *ResolversFinderStub) Replace(key string, val dataRetriever.Resolver) error
Replace -
type RounderMock ¶
type RounderMock struct { IndexCalled func() int64 TimeDurationCalled func() time.Duration TimeStampCalled func() time.Time UpdateRoundCalled func(time.Time, time.Time) RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration // contains filtered or unexported fields }
RounderMock -
func (*RounderMock) IsInterfaceNil ¶
func (rndm *RounderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RounderMock) RemainingTime ¶
RemainingTime -
func (*RounderMock) TimeDuration ¶
func (rndm *RounderMock) TimeDuration() time.Duration
TimeDuration -
func (*RounderMock) UpdateRound ¶
func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
UpdateRound -
type SCQueryServiceStub ¶
type SCQueryServiceStub struct {
ExecuteQueryCalled func(*process.SCQuery) (*vmcommon.VMOutput, error)
}
SCQueryServiceStub -
func (*SCQueryServiceStub) ExecuteQuery ¶
func (serviceStub *SCQueryServiceStub) ExecuteQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)
ExecuteQuery -
func (*SCQueryServiceStub) IsInterfaceNil ¶
func (serviceStub *SCQueryServiceStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type ShardCoordinatorMock ¶
type ShardCoordinatorMock struct {
SelfShardId uint32
}
ShardCoordinatorMock -
func (ShardCoordinatorMock) CommunicationIdentifier ¶
func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (ShardCoordinatorMock) ComputeId ¶
func (scm ShardCoordinatorMock) ComputeId(address state.AddressContainer) uint32
ComputeId -
func (*ShardCoordinatorMock) IsInterfaceNil ¶
func (scm *ShardCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (ShardCoordinatorMock) NumberOfShards ¶
func (scm ShardCoordinatorMock) NumberOfShards() uint32
NumberOfShards -
func (ShardCoordinatorMock) SameShard ¶
func (scm ShardCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool
SameShard -
func (ShardCoordinatorMock) SetSelfShardId ¶
func (scm ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
SetSelfShardId -
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) }
ShardedDataStub -
func (*ShardedDataStub) AddData ¶
func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
AddData -
func (*ShardedDataStub) ClearShardStore ¶
func (sd *ShardedDataStub) ClearShardStore(cacheId string)
ClearShardStore -
func (*ShardedDataStub) CreateShardStore ¶
func (sd *ShardedDataStub) CreateShardStore(cacheId string)
CreateShardStore -
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)
MergeShardStores -
func (*ShardedDataStub) RegisterHandler ¶
func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
RegisterHandler -
func (*ShardedDataStub) RemoveData ¶
func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
RemoveData -
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
RemoveDataFromAllShards -
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
RemoveSetOfDataFromPool -
func (*ShardedDataStub) SearchFirstData ¶
func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
SearchFirstData -
func (*ShardedDataStub) ShardDataStore ¶
func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
ShardDataStore -
type SingleSignerMock ¶
type SingleSignerMock struct { SignStub func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyStub func(public crypto.PublicKey, msg []byte, sig []byte) error }
SingleSignerMock -
func (*SingleSignerMock) IsInterfaceNil ¶
func (s *SingleSignerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SingleSignerMock) Sign ¶
func (s *SingleSignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign -
type SinglesignFailMock ¶
type SinglesignFailMock struct { }
SinglesignFailMock -
func (*SinglesignFailMock) IsInterfaceNil ¶
func (s *SinglesignFailMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SinglesignFailMock) Sign ¶
func (s *SinglesignFailMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type SinglesignMock ¶
type SinglesignMock struct { }
SinglesignMock -
func (*SinglesignMock) IsInterfaceNil ¶
func (s *SinglesignMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SinglesignMock) Sign ¶
func (s *SinglesignMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type SinglesignStub ¶
type SinglesignStub struct { SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error }
SinglesignStub -
func (*SinglesignStub) IsInterfaceNil ¶
func (s *SinglesignStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SinglesignStub) Sign ¶
func (s *SinglesignStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign Signs a message with using a single signature schnorr scheme
type StatusMetricsStub ¶
type StatusMetricsStub struct { StatusMetricsMapCalled func() (map[string]interface{}, error) IsInterfaceNilCalled func() bool }
StatusMetricsStub -
func (*StatusMetricsStub) IsInterfaceNil ¶
func (nds *StatusMetricsStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*StatusMetricsStub) StatusMetricsMap ¶ added in v1.0.17
func (nds *StatusMetricsStub) StatusMetricsMap() (map[string]interface{}, error)
StatusMetricsMap -
type StorerMock ¶
type StorerMock struct {
// contains filtered or unexported fields
}
StorerMock -
func (*StorerMock) GetFromEpoch ¶
func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
GetFromEpoch -
func (*StorerMock) HasInEpoch ¶
func (sm *StorerMock) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerMock) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerMock) SearchFirst ¶
func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type StorerStub ¶
type StorerStub struct { PutCalled func(key, data []byte) error GetCalled func(key []byte) ([]byte, error) GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error) HasCalled func(key []byte) error HasInEpochCalled func(key []byte, epoch uint32) error SearchFirstCalled func(key []byte) ([]byte, error) RemoveCalled func(key []byte) error ClearCacheCalled func() DestroyUnitCalled func() error }
StorerStub -
func (*StorerStub) GetFromEpoch ¶
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
GetFromEpoch -
func (*StorerStub) HasInEpoch ¶
func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerStub) IsInterfaceNil ¶
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) SearchFirst ¶
func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type Streamer ¶
type Streamer struct {
// contains filtered or unexported fields
}
Streamer -
func (*Streamer) XORKeyStream ¶
XORKeyStream -
type SuiteMock ¶
type SuiteMock struct { StringStub func() string ScalarLenStub func() int CreateScalarStub func() crypto.Scalar PointLenStub func() int CreatePointStub func() crypto.Point RandomStreamStub func() cipher.Stream GetUnderlyingSuiteStub func() interface{} }
SuiteMock -
func (*SuiteMock) GetUnderlyingSuite ¶
func (s *SuiteMock) GetUnderlyingSuite() interface{}
GetUnderlyingSuite -
func (*SuiteMock) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
type SyncStub ¶
type SyncStub struct { }
SyncStub -
func (*SyncStub) FormattedCurrentTime ¶
FormattedCurrentTime -
func (*SyncStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
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 }
TrieStub -
func (*TrieStub) AppendToOldHashes ¶
AppendToOldHashes appends the given hashes to the trie's oldHashes variable
func (*TrieStub) CancelPrune ¶
func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune invalidates the hashes that correspond to the given root hash from the eviction waiting list
func (*TrieStub) GetAllLeaves ¶
GetAllLeaves -
func (*TrieStub) GetSerializedNodes ¶
GetSerializedNodes -
func (*TrieStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*TrieStub) Prune ¶
func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier) 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
type Uint64CacherStub ¶
type Uint64CacherStub struct { ClearCalled func() PutCalled func(uint64, []byte) bool GetCalled func(uint64) ([]byte, bool) HasCalled func(uint64) bool PeekCalled func(uint64) ([]byte, bool) HasOrAddCalled func(uint64, []byte) (bool, bool) RemoveCalled func(uint64) RemoveOldestCalled func() KeysCalled func() []uint64 LenCalled func() int RegisterHandlerCalled func(handler func(nonce uint64)) }
Uint64CacherStub -
func (*Uint64CacherStub) HasOrAdd ¶
func (ucs *Uint64CacherStub) HasOrAdd(nonce uint64, value []byte) (bool, bool)
HasOrAdd -
func (*Uint64CacherStub) Peek ¶
func (ucs *Uint64CacherStub) Peek(nonce uint64) ([]byte, bool)
Peek -
func (*Uint64CacherStub) Put ¶
func (ucs *Uint64CacherStub) Put(nonce uint64, value []byte) bool
Put -
func (*Uint64CacherStub) RegisterHandler ¶
func (ucs *Uint64CacherStub) RegisterHandler(handler func(nonce uint64))
RegisterHandler -
type ValidatorMock ¶
type ValidatorMock struct {
// contains filtered or unexported fields
}
ValidatorMock -
func NewValidatorMock ¶
NewValidatorMock -
type ValidatorStatisticsProcessorMock ¶
type ValidatorStatisticsProcessorMock struct { UpdatePeerStateCalled func(header data.HeaderHandler) ([]byte, error) RevertPeerStateCalled func(header data.HeaderHandler) error IsInterfaceNilCalled func() bool RevertPeerStateToSnapshotCalled func(snapshot int) error GetPeerAccountCalled func(address []byte) (state.PeerAccountHandler, error) CommitCalled func() ([]byte, error) RootHashCalled func() ([]byte, error) }
ValidatorStatisticsProcessorMock -
func (*ValidatorStatisticsProcessorMock) Commit ¶ added in v0.0.5
func (vsp *ValidatorStatisticsProcessorMock) Commit() ([]byte, error)
Commit -
func (*ValidatorStatisticsProcessorMock) GetPeerAccount ¶
func (vsp *ValidatorStatisticsProcessorMock) GetPeerAccount(address []byte) (state.PeerAccountHandler, error)
GetPeerAccount -
func (*ValidatorStatisticsProcessorMock) IsInterfaceNil ¶
func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorStatisticsProcessorMock) RevertPeerState ¶
func (vsp *ValidatorStatisticsProcessorMock) RevertPeerState(header data.HeaderHandler) error
RevertPeerState -
func (*ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot ¶ added in v1.0.63
func (vsp *ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot(snapshot int) error
RevertPeerStateToSnapshot -
func (*ValidatorStatisticsProcessorMock) RootHash ¶
func (vsp *ValidatorStatisticsProcessorMock) RootHash() ([]byte, error)
RootHash -
func (*ValidatorStatisticsProcessorMock) UpdatePeerState ¶
func (vsp *ValidatorStatisticsProcessorMock) UpdatePeerState(header data.HeaderHandler) ([]byte, error)
UpdatePeerState -
Source Files ¶
- accountFactoryStub.go
- accountTrackerStub.go
- accountsStub.go
- addressConverterFake.go
- addressConverterStub.go
- addressMock.go
- appStatusHandlerStub.go
- blockChainMock.go
- blockProcessorStub.go
- blockTrackerStub.go
- bootstrapStorerMock.go
- cacherStub.go
- chainHandlerStub.go
- chainStorerMock.go
- endOfEpochTriggerStub.go
- forkDetectorMock.go
- hasherFake.go
- hasherMock.go
- headerResolverStub.go
- headerSigVerifierStub.go
- headersCacherStub.go
- heartbeatStorerStub.go
- indexerMock.go
- interceptorContainerStub.go
- keyMock.go
- marshalizerFake.go
- marshalizerMock.go
- messageHandlerStub.go
- messengerStub.go
- miniBlocksResolverStub.go
- mockTimer.go
- multipleShardsCoordinatorMock.go
- multisignMock.go
- nodesCoordinatorMock.go
- nonceHashConverterMock.go
- oneShardCoordinatorMock.go
- p2pMessageMock.go
- p2pMessageStub.go
- peerAccountHandlerMock.go
- peerProcessorMock.go
- pendingMiniBlocksHandlerStub.go
- poolsHolderStub.go
- requestHandlerStub.go
- requestedItemsHandlerStub.go
- resolversFinderStub.go
- rounderMock.go
- scQueryServiceStub.go
- shardCoordinatorMock.go
- shardedDataStub.go
- singleSigMock.go
- singlesignerMock.go
- statusMetricsStub.go
- storerMock.go
- storerStub.go
- streamerMock.go
- suiteStub.go
- syncStub.go
- trieStub.go
- txFeeHandlerStub.go
- uint64CacherStub.go
- validatorMock.go