Documentation ¶
Index ¶
- func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
- func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
- func NewNilTxValidator() (*nilTxValidator, error)
- func NewNonceHashConverterMock() *nonceHashConverterMock
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- func NewTopicMessageHandlerStub() *topicMessageHandlerStub
- type AccountTrackerStub
- type AccountWrapMock
- func (awm *AccountWrapMock) AddressContainer() state.AddressContainer
- func (awm *AccountWrapMock) DataTrie() data.Trie
- func (awm *AccountWrapMock) DataTrieTracker() state.DataTrieTracker
- func (awm *AccountWrapMock) GetCode() []byte
- func (awm *AccountWrapMock) GetCodeHash() []byte
- func (awm *AccountWrapMock) GetNonce() uint64
- func (awm *AccountWrapMock) GetRootHash() []byte
- func (awm *AccountWrapMock) IsInterfaceNil() bool
- func (awm *AccountWrapMock) SetCode(code []byte)
- func (awm *AccountWrapMock) SetCodeHash(codeHash []byte)
- func (awm *AccountWrapMock) SetCodeHashWithJournal(codeHash []byte) error
- func (awm *AccountWrapMock) SetDataTrie(trie data.Trie)
- func (awm *AccountWrapMock) SetDataTrieTracker(tracker state.DataTrieTracker)
- func (awm *AccountWrapMock) SetNonce(nonce uint64)
- func (awm *AccountWrapMock) SetNonceWithJournal(nonce uint64) error
- func (awm *AccountWrapMock) SetRootHash(rootHash []byte)
- func (awm *AccountWrapMock) SetRootHashWithJournal(rootHash []byte) error
- type AccountsStub
- func (aam *AccountsStub) AddJournalEntry(je state.JournalEntry)
- func (aam *AccountsStub) Commit() ([]byte, error)
- func (aam *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (aam *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
- func (aam *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
- func (aam *AccountsStub) IsInterfaceNil() bool
- func (aam *AccountsStub) JournalLen() int
- func (aam *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
- func (aam *AccountsStub) RecreateTrie(rootHash []byte) error
- func (aam *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
- func (aam *AccountsStub) RemoveCode(codeHash []byte) error
- func (aam *AccountsStub) RevertToSnapshot(snapshot int) error
- func (aam *AccountsStub) RootHash() ([]byte, error)
- func (aam *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
- func (aam *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
- 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 AddressConverterMock
- func (acm *AddressConverterMock) AddressLen() int
- func (acm *AddressConverterMock) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (acm *AddressConverterMock) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (acm *AddressConverterMock) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (acm *AddressConverterMock) IsInterfaceNil() bool
- func (acm *AddressConverterMock) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AddressConverterStub
- func (acs AddressConverterStub) AddressLen() int
- func (acs *AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (acs *AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (acs *AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (acs *AddressConverterStub) IsInterfaceNil() bool
- func (acs *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 ArgumentParserMock
- func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string
- func (ap *ArgumentParserMock) GetArguments() ([]*big.Int, error)
- func (ap *ArgumentParserMock) GetCode() ([]byte, error)
- func (ap *ArgumentParserMock) GetFunction() (string, error)
- func (ap *ArgumentParserMock) GetSeparator() string
- func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)
- func (ap *ArgumentParserMock) IsInterfaceNil() bool
- func (ap *ArgumentParserMock) ParseData(data string) error
- type BelNevMock
- func (bnm *BelNevMock) AggregateCommitments(bitmap []byte) error
- func (bnm *BelNevMock) AggregateSigs(bitmap []byte) ([]byte, error)
- func (bnm *BelNevMock) Commitment(index uint16) ([]byte, error)
- func (bnm *BelNevMock) CommitmentHash(index uint16) ([]byte, error)
- func (bnm *BelNevMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
- func (bnm *BelNevMock) CreateCommitment() (commSecret []byte, commitment []byte)
- func (bnm *BelNevMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
- func (bnm *BelNevMock) IsInterfaceNil() bool
- func (bnm *BelNevMock) Reset(pubKeys []string, index uint16) error
- func (bnm *BelNevMock) SetAggregatedSig(aggSig []byte) error
- func (bnm *BelNevMock) SetMessage(msg []byte) error
- func (bnm *BelNevMock) SignatureShare(index uint16) ([]byte, error)
- func (bnm *BelNevMock) StoreCommitment(index uint16, value []byte) error
- func (bnm *BelNevMock) StoreCommitmentHash(index uint16, commHash []byte) error
- func (bnm *BelNevMock) StoreSignatureShare(index uint16, sig []byte) error
- func (bnm *BelNevMock) Verify(msg []byte, bitmap []byte) error
- func (bnm *BelNevMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
- type BlackListHandlerStub
- type BlockChainHookHandlerMock
- func (e *BlockChainHookHandlerMock) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
- func (e *BlockChainHookHandlerMock) CleanTempAccounts()
- func (e *BlockChainHookHandlerMock) IsInterfaceNil() bool
- func (e *BlockChainHookHandlerMock) SetCurrentHeader(hdr data.HeaderHandler)
- func (e *BlockChainHookHandlerMock) TempAccount(address []byte) state.AccountHandler
- 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 BlockProcessorMock
- func (bpm *BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
- func (bpm *BlockProcessorMock) ApplyBodyToHeader(header data.HeaderHandler, body data.BodyHandler) error
- func (bpm *BlockProcessorMock) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
- func (bpm *BlockProcessorMock) CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)
- func (bpm *BlockProcessorMock) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
- func (bpm *BlockProcessorMock) CreateNewHeader() data.HeaderHandler
- func (bpm *BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
- func (bpm *BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
- func (bpm *BlockProcessorMock) IsInterfaceNil() bool
- func (bpm *BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
- func (bpm *BlockProcessorMock) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, ...) error
- func (bpm *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
- func (bpm *BlockProcessorMock) RevertAccountState()
- func (blProcMock *BlockProcessorMock) RevertStateToBlock(header data.HeaderHandler) error
- func (bpm *BlockProcessorMock) SetConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32)
- type BlockSizeThrottlerStub
- type CacherMock
- func (cm *CacherMock) Clear()
- func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Has(key []byte) bool
- func (cm *CacherMock) HasOrAdd(key []byte, value interface{}) (bool, bool)
- func (cm *CacherMock) IsInterfaceNil() bool
- func (cm *CacherMock) Keys() [][]byte
- func (cm *CacherMock) Len() int
- func (cm *CacherMock) MaxSize() int
- func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Put(key []byte, value interface{}) (evicted bool)
- func (cm *CacherMock) RegisterHandler(func(key []byte))
- func (cm *CacherMock) Remove(key []byte)
- func (cm *CacherMock) RemoveOldest()
- type CacherStub
- func (cs *CacherStub) Clear()
- func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Has(key []byte) bool
- func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
- func (cs *CacherStub) IsInterfaceNil() bool
- func (cs *CacherStub) Keys() [][]byte
- func (cs *CacherStub) Len() int
- func (cs *CacherStub) MaxSize() int
- func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
- func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
- func (cs *CacherStub) RegisterHandler(handler func(key []byte))
- func (cs *CacherStub) Remove(key []byte)
- func (cs *CacherStub) RemoveOldest()
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) IsInterfaceNil() bool
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- type CoordinatorStub
- func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
- func (coordinator *CoordinatorStub) ComputeId(address state.AddressContainer) uint32
- func (coordinator *CoordinatorStub) IsInterfaceNil() bool
- func (coordinator *CoordinatorStub) NumberOfShards() uint32
- func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress state.AddressContainer) bool
- func (coordinator *CoordinatorStub) SelfId() uint32
- type 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
- type ForkDetectorMock
- func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, ...) error
- func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
- 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) RemoveHeaders(nonce uint64, hash []byte)
- func (fdm *ForkDetectorMock) ResetFork()
- func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
- type GetHdrHandlerStub
- type HasherMock
- type HasherStub
- type HeaderHandlerStub
- func (hhs *HeaderHandlerStub) GetEpoch() uint32
- func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
- func (hhs *HeaderHandlerStub) GetMiniBlockProcessed(hash []byte) bool
- func (hhs *HeaderHandlerStub) GetNonce() uint64
- func (hhs *HeaderHandlerStub) GetPrevHash() []byte
- func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
- func (hhs *HeaderHandlerStub) GetRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetRootHash() []byte
- func (hhs *HeaderHandlerStub) GetRound() uint64
- func (hhs *HeaderHandlerStub) GetShardID() uint32
- func (hhs *HeaderHandlerStub) GetSignature() []byte
- func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
- func (hhs *HeaderHandlerStub) GetTxCount() uint32
- func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
- func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
- func (hhs *HeaderHandlerStub) ItemsInBody() uint32
- func (hhs *HeaderHandlerStub) ItemsInHeader() uint32
- func (hhs *HeaderHandlerStub) SetEpoch(e uint32)
- func (hhs *HeaderHandlerStub) SetMiniBlockProcessed(hash []byte, processed bool)
- func (hhs *HeaderHandlerStub) SetNonce(n uint64)
- func (hhs *HeaderHandlerStub) SetPrevHash(pvHash []byte)
- func (hhs *HeaderHandlerStub) SetPrevRandSeed(pvRandSeed []byte)
- func (hhs *HeaderHandlerStub) SetPubKeysBitmap(pkbm []byte)
- func (hhs *HeaderHandlerStub) SetRandSeed(randSeed []byte)
- func (hhs *HeaderHandlerStub) SetRootHash(rHash []byte)
- func (hhs *HeaderHandlerStub) SetRound(r uint64)
- func (hhs *HeaderHandlerStub) SetSignature(sg []byte)
- func (hhs *HeaderHandlerStub) SetTimeStamp(ts uint64)
- func (hhs *HeaderHandlerStub) SetTxCount(txCount uint32)
- func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(vrh []byte)
- type HeaderResolverMock
- func (hrm *HeaderResolverMock) IsInterfaceNil() bool
- func (hrm *HeaderResolverMock) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hrm *HeaderResolverMock) RequestDataFromHash(hash []byte) error
- func (hrm *HeaderResolverMock) RequestDataFromNonce(nonce uint64) error
- type HeaderValidatorStub
- 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 InterceptedDataFactoryStub
- type InterceptedDataStub
- type InterceptedTxHandlerStub
- func (iths *InterceptedTxHandlerStub) Nonce() uint64
- func (iths *InterceptedTxHandlerStub) ReceiverShardId() uint32
- func (iths *InterceptedTxHandlerStub) SenderAddress() state.AddressContainer
- func (iths *InterceptedTxHandlerStub) SenderShardId() uint32
- func (iths *InterceptedTxHandlerStub) TotalValue() *big.Int
- func (iths *InterceptedTxHandlerStub) Transaction() data.TransactionHandler
- type InterceptorProcessorStub
- type InterceptorStub
- type InterceptorThrottlerStub
- func (its *InterceptorThrottlerStub) CanProcess() bool
- func (its *InterceptorThrottlerStub) EndProcessing()
- func (it *InterceptorThrottlerStub) EndProcessingCount() int32
- func (its *InterceptorThrottlerStub) IsInterfaceNil() bool
- func (its *InterceptorThrottlerStub) StartProcessing()
- func (it *InterceptorThrottlerStub) StartProcessingCount() int32
- type InterimProcessorContainerMock
- func (ppcm *InterimProcessorContainerMock) Add(key block.Type, val process.IntermediateTransactionHandler) error
- func (ppcm *InterimProcessorContainerMock) AddMultiple(keys []block.Type, preprocessors []process.IntermediateTransactionHandler) error
- func (ipcm *InterimProcessorContainerMock) Get(key block.Type) (process.IntermediateTransactionHandler, error)
- func (ppcm *InterimProcessorContainerMock) IsInterfaceNil() bool
- func (ppcm *InterimProcessorContainerMock) Keys() []block.Type
- func (ppcm *InterimProcessorContainerMock) Len() int
- func (ppcm *InterimProcessorContainerMock) Remove(key block.Type)
- func (ppcm *InterimProcessorContainerMock) Replace(key block.Type, val process.IntermediateTransactionHandler) error
- type IntermediateTransactionHandlerMock
- func (ith *IntermediateTransactionHandlerMock) AddIntermediateTransactions(txs []data.TransactionHandler) error
- func (ith *IntermediateTransactionHandlerMock) CreateAllInterMiniBlocks() map[uint32]*block.MiniBlock
- func (ith *IntermediateTransactionHandlerMock) CreateBlockStarted()
- func (ith *IntermediateTransactionHandlerMock) CreateMarshalizedData(txHashes [][]byte) ([][]byte, error)
- func (ith *IntermediateTransactionHandlerMock) GetAllCurrentFinishedTxs() map[string]data.TransactionHandler
- func (ith *IntermediateTransactionHandlerMock) IsInterfaceNil() bool
- func (ith *IntermediateTransactionHandlerMock) SaveCurrentIntermediateTxToStorage() error
- func (ith *IntermediateTransactionHandlerMock) VerifyInterMiniBlocks(body block.Body) error
- type MarshalizerMock
- type MarshalizerStub
- type MessageHandlerStub
- type MessengerStub
- func (ms *MessengerStub) Addresses() []string
- func (ms *MessengerStub) Bootstrap() error
- func (ms *MessengerStub) Broadcast(topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
- func (ms *MessengerStub) Close() error
- func (ms *MessengerStub) ConnectToPeer(address string) error
- func (ms *MessengerStub) ConnectedPeers() []p2p.PeerID
- func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
- func (ms *MessengerStub) HasTopic(name string) bool
- func (ms *MessengerStub) HasTopicValidator(name string) bool
- func (ms *MessengerStub) ID() p2p.PeerID
- func (ms *MessengerStub) IsConnected(peerID p2p.PeerID) bool
- func (ms *MessengerStub) IsInterfaceNil() bool
- func (ms *MessengerStub) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer
- func (ms *MessengerStub) Peers() []p2p.PeerID
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
- func (ms *MessengerStub) SendToConnectedPeer(topic string, buff []byte, peerID p2p.PeerID) error
- func (ms *MessengerStub) TrimConnections()
- func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
- type MetaPoolsHolderFake
- func (mphf *MetaPoolsHolderFake) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (mphf *MetaPoolsHolderFake) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (mphf *MetaPoolsHolderFake) IsInterfaceNil() bool
- func (mphf *MetaPoolsHolderFake) MetaBlocks() storage.Cacher
- func (mphf *MetaPoolsHolderFake) MiniBlocks() storage.Cacher
- func (mphf *MetaPoolsHolderFake) ShardHeaders() storage.Cacher
- func (mphf *MetaPoolsHolderFake) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (mphf *MetaPoolsHolderFake) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type MetaPoolsHolderStub
- func (mphs *MetaPoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (mphs *MetaPoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (mphs *MetaPoolsHolderStub) IsInterfaceNil() bool
- func (mphs *MetaPoolsHolderStub) MetaBlocks() storage.Cacher
- func (mphs *MetaPoolsHolderStub) MiniBlocks() storage.Cacher
- func (mphs *MetaPoolsHolderStub) ShardHeaders() storage.Cacher
- func (mphs *MetaPoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (mphs *MetaPoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type MiniBlocksCompacterMock
- type MiniBlocksResolverMock
- func (hrm *MiniBlocksResolverMock) GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
- func (hrm *MiniBlocksResolverMock) GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
- func (hrm *MiniBlocksResolverMock) IsInterfaceNil() bool
- func (hrm *MiniBlocksResolverMock) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
- func (hrm *MiniBlocksResolverMock) RequestDataFromHash(hash []byte) error
- func (hrm *MiniBlocksResolverMock) RequestDataFromHashArray(hashes [][]byte) error
- type NetworkConnectionWatcherStub
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeValidatorsGroup(randomess []byte, round uint64, shardId uint32) ([]sharding.Validator, error)
- 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) SetNodesPerShards(nodes map[uint32][]sharding.Validator) error
- type ObjectsContainerStub
- func (ocs *ObjectsContainerStub) Add(key string, val interface{}) error
- func (ocs *ObjectsContainerStub) Get(key string) (interface{}, error)
- func (ocs *ObjectsContainerStub) Len() int
- func (ocs *ObjectsContainerStub) Remove(key string)
- func (ocs *ObjectsContainerStub) Replace(key string, val interface{}) 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 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) GetRootHash() []byte
- 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) SetRootHash(rootHash []byte)
- func (pahm *PeerAccountHandlerMock) SetRootHashWithJournal(rootHash []byte) error
- type PeerChangesHandler
- type PoolsHolderMock
- func (phm *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (phm *PoolsHolderMock) Headers() storage.Cacher
- func (phm *PoolsHolderMock) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phf *PoolsHolderMock) IsInterfaceNil() bool
- func (phm *PoolsHolderMock) MetaBlocks() storage.Cacher
- func (phm *PoolsHolderMock) MetaHeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phm *PoolsHolderMock) MiniBlocks() storage.Cacher
- func (phm *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
- func (phm *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
- func (phm *PoolsHolderMock) SetTransactions(transactions dataRetriever.ShardedDataCacherNotifier)
- func (phm *PoolsHolderMock) SetUnsignedTransactions(scrs dataRetriever.ShardedDataCacherNotifier)
- func (phm *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (phm *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PoolsHolderStub
- func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (phs *PoolsHolderStub) Headers() storage.Cacher
- func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phs *PoolsHolderStub) IsInterfaceNil() bool
- func (phs *PoolsHolderStub) MetaBlocks() storage.Cacher
- 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) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PreProcessorContainerMock
- func (ppcm *PreProcessorContainerMock) Add(key block.Type, val process.PreProcessor) error
- func (ppcm *PreProcessorContainerMock) AddMultiple(keys []block.Type, preprocessors []process.PreProcessor) error
- func (ppcm *PreProcessorContainerMock) Get(key block.Type) (process.PreProcessor, error)
- func (ppcm *PreProcessorContainerMock) IsInterfaceNil() bool
- func (ppcm *PreProcessorContainerMock) Keys() []block.Type
- func (ppcm *PreProcessorContainerMock) Len() int
- func (ppcm *PreProcessorContainerMock) Remove(key block.Type)
- func (ppcm *PreProcessorContainerMock) Replace(key block.Type, val process.PreProcessor) error
- type PreProcessorMock
- func (ppm *PreProcessorMock) CreateAndProcessMiniBlock(sndShardId, dstShardId uint32, spaceRemained int, haveTime func() bool, ...) (*block.MiniBlock, error)
- func (ppm *PreProcessorMock) CreateAndProcessMiniBlocks(maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, round uint64, ...) (block.MiniBlockSlice, error)
- func (ppm *PreProcessorMock) CreateBlockStarted()
- func (ppm *PreProcessorMock) CreateMarshalizedData(txHashes [][]byte) ([][]byte, error)
- func (ppm *PreProcessorMock) GetAllCurrentUsedTxs() map[string]data.TransactionHandler
- func (ppm *PreProcessorMock) IsDataPrepared(requestedTxs int, haveTime func() time.Duration) error
- func (ppm *PreProcessorMock) IsInterfaceNil() bool
- func (ppm *PreProcessorMock) ProcessBlockTransactions(body block.Body, round uint64, haveTime func() bool) error
- func (ppm *PreProcessorMock) ProcessMiniBlock(miniBlock *block.MiniBlock, haveTime func() bool, round uint64) error
- func (ppm *PreProcessorMock) RemoveTxBlockFromPools(body block.Body, miniBlockPool storage.Cacher) error
- func (ppm *PreProcessorMock) RequestBlockTransactions(body block.Body) int
- func (ppm *PreProcessorMock) RequestTransactionsForMiniBlock(miniBlock *block.MiniBlock) int
- func (ppm *PreProcessorMock) RestoreTxBlockIntoPools(body block.Body, miniBlockPool storage.Cacher) (int, error)
- func (ppm *PreProcessorMock) SaveTxBlockToStorage(body block.Body) error
- type RequestHandlerMock
- func (rrh *RequestHandlerMock) IsInterfaceNil() bool
- func (rrh *RequestHandlerMock) RequestHeader(shardId uint32, hash []byte)
- func (rrh *RequestHandlerMock) RequestHeaderByNonce(destShardID uint32, nonce uint64)
- func (rrh *RequestHandlerMock) RequestMiniBlock(shardId uint32, miniblockHash []byte)
- func (rrh *RequestHandlerMock) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
- func (rrh *RequestHandlerMock) RequestTransaction(destShardID uint32, txHashes [][]byte)
- func (rrh *RequestHandlerMock) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
- type ResolverStub
- type ResolversContainerStub
- func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
- func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
- func (rcs *ResolversContainerStub) IsInterfaceNil() bool
- func (rcs *ResolversContainerStub) Len() int
- func (rcs *ResolversContainerStub) Remove(key string)
- func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
- type ResolversFinderStub
- func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
- func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
- type RewardTxProcessorMock
- type RewardsHandlerMock
- type RoundStub
- func (rnds *RoundStub) Index() int32
- func (rnds *RoundStub) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rnds *RoundStub) TimeDuration() time.Duration
- func (rnds *RoundStub) TimeStamp() time.Time
- func (rnds *RoundStub) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- 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 SCProcessorMock
- func (sc *SCProcessorMock) ComputeTransactionType(tx *transaction.Transaction) (process.TransactionType, error)
- func (sc *SCProcessorMock) DeploySmartContract(tx *transaction.Transaction, acntSrc state.AccountHandler, round uint64) error
- func (sc *SCProcessorMock) ExecuteSmartContractTransaction(tx *transaction.Transaction, acntSrc, acntDst state.AccountHandler, ...) error
- func (sc *SCProcessorMock) IsInterfaceNil() bool
- func (sc *SCProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
- type SCToProtocolStub
- type ScDataGetterMock
- type ServiceContainerMock
- type ShardIdHasMapMock
- func (sihsm *ShardIdHasMapMock) Delete(shardId uint32)
- func (sihsm *ShardIdHasMapMock) IsInterfaceNil() bool
- func (sihsm *ShardIdHasMapMock) Load(shardId uint32) ([]byte, bool)
- func (sihsm *ShardIdHasMapMock) Range(f func(shardId uint32, hash []byte) bool)
- func (sihsm *ShardIdHasMapMock) Store(shardId uint32, hash []byte)
- 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) MoveData(sourceCacheId, destCacheId string, key [][]byte)
- 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 SignerMock
- type SingleSignKeyGenMock
- func (sskgm *SingleSignKeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
- func (sskgm *SingleSignKeyGenMock) IsInterfaceNil() bool
- func (sskgm *SingleSignKeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
- func (sskgm *SingleSignKeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
- func (sskgm *SingleSignKeyGenMock) Suite() crypto.Suite
- type SingleSignPublicKey
- type SmartContractResultsProcessorMock
- type SpecialAddressHandlerMock
- func (sh *SpecialAddressHandlerMock) BurnAddress() []byte
- func (sh *SpecialAddressHandlerMock) ClearMetaConsensusData()
- func (sh *SpecialAddressHandlerMock) ConsensusMetaRewardData() []*data.ConsensusRewardData
- func (sh *SpecialAddressHandlerMock) ConsensusShardRewardData() *data.ConsensusRewardData
- func (sh *SpecialAddressHandlerMock) ElrondCommunityAddress() []byte
- func (sh *SpecialAddressHandlerMock) Epoch() uint32
- func (sh *SpecialAddressHandlerMock) IsCurrentNodeInConsensus() bool
- func (sh *SpecialAddressHandlerMock) IsInterfaceNil() bool
- func (sh *SpecialAddressHandlerMock) LeaderAddress() []byte
- func (sh *SpecialAddressHandlerMock) Round() uint64
- func (sh *SpecialAddressHandlerMock) SetElrondCommunityAddress(elrond []byte)
- func (sh *SpecialAddressHandlerMock) SetMetaConsensusData(randomness []byte, round uint64, epoch uint32) error
- func (sh *SpecialAddressHandlerMock) SetShardConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32) error
- func (sh *SpecialAddressHandlerMock) ShardIdForAddress(addr []byte) (uint32, error)
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) Remove(key []byte) error
- type SyncStarterStub
- type SyncTimerMock
- type TemporaryAccountsHandlerMock
- func (tahm *TemporaryAccountsHandlerMock) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
- func (tahm *TemporaryAccountsHandlerMock) CleanTempAccounts()
- func (tahm *TemporaryAccountsHandlerMock) IsInterfaceNil() bool
- func (tahm *TemporaryAccountsHandlerMock) TempAccount(address []byte) state.AccountHandler
- type TopicHandlerStub
- type TransactionCoordinatorMock
- func (tcm *TransactionCoordinatorMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
- func (tcm *TransactionCoordinatorMock) CreateBlockStarted()
- func (tcm *TransactionCoordinatorMock) CreateMarshalizedData(body block.Body) (map[uint32]block.MiniBlockSlice, map[string][][]byte)
- func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, ...) (block.MiniBlockSlice, uint32, bool)
- func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe(maxTxRemaining uint32, maxMbRemaining uint32, round uint64, ...) block.MiniBlockSlice
- func (tcm *TransactionCoordinatorMock) GetAllCurrentUsedTxs(blockType block.Type) map[string]data.TransactionHandler
- func (tcm *TransactionCoordinatorMock) IsDataPreparedForProcessing(haveTime func() time.Duration) error
- func (tcm *TransactionCoordinatorMock) IsInterfaceNil() bool
- func (tcm *TransactionCoordinatorMock) ProcessBlockTransaction(body block.Body, round uint64, haveTime func() time.Duration) error
- func (tcm *TransactionCoordinatorMock) RemoveBlockDataFromPool(body block.Body) error
- func (tcm *TransactionCoordinatorMock) RequestBlockTransactions(body block.Body)
- func (tcm *TransactionCoordinatorMock) RequestMiniBlocks(header data.HeaderHandler)
- func (tcm *TransactionCoordinatorMock) RestoreBlockDataFromStorage(body block.Body) (int, error)
- func (tcm *TransactionCoordinatorMock) SaveBlockDataToStorage(body block.Body) error
- func (tcm *TransactionCoordinatorMock) VerifyCreatedBlockTransactions(body block.Body) error
- type TransactionInterceptorMock
- func (tim *TransactionInterceptorMock) AddressConverter() state.AddressConverter
- func (tim *TransactionInterceptorMock) Check() bool
- func (tim *TransactionInterceptorMock) GetTransaction() *transaction.Transaction
- func (tim *TransactionInterceptorMock) Hash() []byte
- func (tim *TransactionInterceptorMock) ID() string
- func (tim *TransactionInterceptorMock) IsAddressedToOtherShards() bool
- func (tim *TransactionInterceptorMock) IsInterfaceNil() bool
- func (tim *TransactionInterceptorMock) RcvShard() uint32
- func (tim *TransactionInterceptorMock) SetAddressConverter(converter state.AddressConverter)
- func (tim *TransactionInterceptorMock) SetHash(hash []byte)
- func (tim *TransactionInterceptorMock) SndShard() uint32
- func (tim *TransactionInterceptorMock) VerifySig() bool
- type TransactionPoolMock
- type TxForCurrentBlockStub
- type TxPoolsCleanerMock
- type TxProcessorMock
- func (etm *TxProcessorMock) IsInterfaceNil() bool
- func (etm *TxProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
- func (etm *TxProcessorMock) ProcessTransaction(transaction *transaction.Transaction, round uint64) error
- func (etm *TxProcessorMock) SetBalancesToTrie(accBalance map[string]*big.Int) (rootHash []byte, err error)
- type TxTypeHandlerMock
- type TxValidatorHandlerStub
- type TxValidatorStub
- type Uint64ByteSliceConverterMock
- type Uint64SyncMapCacherStub
- func (usmcs *Uint64SyncMapCacherStub) Clear()
- func (usmcs *Uint64SyncMapCacherStub) Get(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
- func (usmcs *Uint64SyncMapCacherStub) Has(nonce uint64, shardId uint32) bool
- func (usmcs *Uint64SyncMapCacherStub) IsInterfaceNil() bool
- func (usmcs *Uint64SyncMapCacherStub) Merge(nonce uint64, src dataRetriever.ShardIdHashMap)
- func (usmcs *Uint64SyncMapCacherStub) RegisterHandler(handler func(nonce uint64, shardId uint32, value []byte))
- func (usmcs *Uint64SyncMapCacherStub) Remove(nonce uint64, shardId uint32)
- type UnsignedTxHandlerMock
- func (ut *UnsignedTxHandlerMock) AddRewardTxFromBlock(tx data.TransactionHandler)
- func (ut *UnsignedTxHandlerMock) CleanProcessedUTxs()
- func (ut *UnsignedTxHandlerMock) CreateAllUTxs() []data.TransactionHandler
- func (ut *UnsignedTxHandlerMock) IsInterfaceNil() bool
- func (ut *UnsignedTxHandlerMock) ProcessTransactionFee(cost *big.Int)
- func (ut *UnsignedTxHandlerMock) VerifyCreatedUTxs() error
- type VMContainerMock
- func (V *VMContainerMock) Add(key []byte, val vmcommon.VMExecutionHandler) error
- func (V *VMContainerMock) AddMultiple(keys [][]byte, vms []vmcommon.VMExecutionHandler) error
- func (V *VMContainerMock) Get(key []byte) (vmcommon.VMExecutionHandler, error)
- func (V *VMContainerMock) IsInterfaceNil() bool
- func (V *VMContainerMock) Keys() [][]byte
- func (V *VMContainerMock) Len() int
- func (V *VMContainerMock) Remove(key []byte)
- func (V *VMContainerMock) Replace(key []byte, val vmcommon.VMExecutionHandler) error
- type VMExecutionHandlerStub
- func (vm *VMExecutionHandlerStub) G0Call(input *vmcommon.ContractCallInput) (*big.Int, error)
- func (vm *VMExecutionHandlerStub) G0Create(input *vmcommon.ContractCreateInput) (*big.Int, error)
- func (vm *VMExecutionHandlerStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (vm *VMExecutionHandlerStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
- type ValidatorMock
- type ValidatorSettingsStub
- type ValidatorStatisticsProcessorMock
- func (vsp *ValidatorStatisticsProcessorMock) Commit() ([]byte, error)
- func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool
- func (vsp *ValidatorStatisticsProcessorMock) RevertPeerState(header data.HeaderHandler) error
- func (vsp *ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot(snapshot int) 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
func NewMultipleShardsCoordinatorMock ¶
func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
func NewNilTxValidator ¶
func NewNilTxValidator() (*nilTxValidator, error)
NewNilTxValidator creates a new nil tx handler validator instance
func NewNonceHashConverterMock ¶
func NewNonceHashConverterMock() *nonceHashConverterMock
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
func NewTopicMessageHandlerStub ¶ added in v1.0.3
func NewTopicMessageHandlerStub() *topicMessageHandlerStub
Types ¶
type AccountTrackerStub ¶ added in v1.0.3
type AccountTrackerStub struct { SaveAccountCalled func(accountHandler state.AccountHandler) error JournalizeCalled func(entry state.JournalEntry) }
func (*AccountTrackerStub) IsInterfaceNil ¶ added in v1.0.16
func (ats *AccountTrackerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountTrackerStub) Journalize ¶ added in v1.0.3
func (ats *AccountTrackerStub) Journalize(entry state.JournalEntry)
func (*AccountTrackerStub) SaveAccount ¶ added in v1.0.3
func (ats *AccountTrackerStub) SaveAccount(accountHandler state.AccountHandler) error
type AccountWrapMock ¶
type AccountWrapMock struct { MockValue int SetNonceWithJournalCalled func(nonce uint64) error `json:"-"` SetCodeHashWithJournalCalled func(codeHash []byte) error `json:"-"` SetRootHashWithJournalCalled func([]byte) error `json:"-"` SetCodeWithJournalCalled func(codeHash []byte) error `json:"-"` // contains filtered or unexported fields }
func NewAccountWrapMock ¶
func NewAccountWrapMock(adr state.AddressContainer, tracker state.AccountTracker) *AccountWrapMock
func (*AccountWrapMock) AddressContainer ¶
func (awm *AccountWrapMock) AddressContainer() state.AddressContainer
func (*AccountWrapMock) DataTrie ¶
func (awm *AccountWrapMock) DataTrie() data.Trie
func (*AccountWrapMock) DataTrieTracker ¶
func (awm *AccountWrapMock) DataTrieTracker() state.DataTrieTracker
func (*AccountWrapMock) GetCode ¶
func (awm *AccountWrapMock) GetCode() []byte
func (*AccountWrapMock) GetCodeHash ¶
func (awm *AccountWrapMock) GetCodeHash() []byte
func (*AccountWrapMock) GetNonce ¶
func (awm *AccountWrapMock) GetNonce() uint64
func (*AccountWrapMock) GetRootHash ¶
func (awm *AccountWrapMock) GetRootHash() []byte
func (*AccountWrapMock) IsInterfaceNil ¶
func (awm *AccountWrapMock) IsInterfaceNil() bool
func (*AccountWrapMock) SetCode ¶
func (awm *AccountWrapMock) SetCode(code []byte)
func (*AccountWrapMock) SetCodeHash ¶
func (awm *AccountWrapMock) SetCodeHash(codeHash []byte)
func (*AccountWrapMock) SetCodeHashWithJournal ¶ added in v1.0.3
func (awm *AccountWrapMock) SetCodeHashWithJournal(codeHash []byte) error
func (*AccountWrapMock) SetDataTrie ¶
func (awm *AccountWrapMock) SetDataTrie(trie data.Trie)
func (*AccountWrapMock) SetDataTrieTracker ¶ added in v1.0.3
func (awm *AccountWrapMock) SetDataTrieTracker(tracker state.DataTrieTracker)
func (*AccountWrapMock) SetNonce ¶ added in v1.0.3
func (awm *AccountWrapMock) SetNonce(nonce uint64)
func (*AccountWrapMock) SetNonceWithJournal ¶ added in v1.0.3
func (awm *AccountWrapMock) SetNonceWithJournal(nonce uint64) error
func (*AccountWrapMock) SetRootHash ¶
func (awm *AccountWrapMock) SetRootHash(rootHash []byte)
func (*AccountWrapMock) SetRootHashWithJournal ¶ added in v1.0.3
func (awm *AccountWrapMock) SetRootHashWithJournal(rootHash []byte) error
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 }
func NewAccountsStub ¶ added in v1.0.3
func NewAccountsStub() *AccountsStub
func (*AccountsStub) AddJournalEntry ¶
func (aam *AccountsStub) AddJournalEntry(je state.JournalEntry)
func (*AccountsStub) Commit ¶
func (aam *AccountsStub) Commit() ([]byte, error)
func (*AccountsStub) GetAccountWithJournal ¶ added in v1.0.3
func (aam *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)
func (*AccountsStub) GetExistingAccount ¶
func (aam *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)
func (*AccountsStub) HasAccount ¶ added in v1.0.3
func (aam *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)
func (*AccountsStub) IsInterfaceNil ¶
func (aam *AccountsStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsStub) JournalLen ¶
func (aam *AccountsStub) JournalLen() int
func (*AccountsStub) PutCode ¶ added in v1.0.3
func (aam *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error
func (*AccountsStub) RecreateTrie ¶
func (aam *AccountsStub) RecreateTrie(rootHash []byte) error
func (*AccountsStub) RemoveAccount ¶
func (aam *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error
func (*AccountsStub) RemoveCode ¶ added in v1.0.3
func (aam *AccountsStub) RemoveCode(codeHash []byte) error
func (*AccountsStub) RevertToSnapshot ¶
func (aam *AccountsStub) RevertToSnapshot(snapshot int) error
func (*AccountsStub) RootHash ¶
func (aam *AccountsStub) RootHash() ([]byte, error)
func (*AccountsStub) SaveDataTrie ¶ added in v1.0.3
func (aam *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error
func (*AccountsStub) SaveJournalizedAccount ¶ added in v1.0.3
func (aam *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error
type AddressConverterFake ¶
type AddressConverterFake struct {
// contains filtered or unexported fields
}
func NewAddressConverterFake ¶
func NewAddressConverterFake(addressLen int, prefix string) *AddressConverterFake
func (*AddressConverterFake) AddressLen ¶
func (acf *AddressConverterFake) AddressLen() int
func (*AddressConverterFake) ConvertToHex ¶
func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (*AddressConverterFake) CreateAddressFromHex ¶
func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (*AddressConverterFake) CreateAddressFromPublicKeyBytes ¶
func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
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)
type AddressConverterMock ¶
func (*AddressConverterMock) AddressLen ¶
func (acm *AddressConverterMock) AddressLen() int
func (*AddressConverterMock) ConvertToHex ¶
func (acm *AddressConverterMock) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (*AddressConverterMock) CreateAddressFromHex ¶
func (acm *AddressConverterMock) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (*AddressConverterMock) CreateAddressFromPublicKeyBytes ¶
func (acm *AddressConverterMock) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
func (*AddressConverterMock) IsInterfaceNil ¶
func (acm *AddressConverterMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AddressConverterMock) PrepareAddressBytes ¶
func (acm *AddressConverterMock) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
type AddressConverterStub ¶
type AddressConverterStub struct { CreateAddressFromPublicKeyBytesCalled func(pubKey []byte) (state.AddressContainer, error) ConvertToHexCalled func(addressContainer state.AddressContainer) (string, error) CreateAddressFromHexCalled func(hexAddress string) (state.AddressContainer, error) PrepareAddressBytesCalled func(addressBytes []byte) ([]byte, error) AddressLenHandler func() int }
func (AddressConverterStub) AddressLen ¶
func (acs AddressConverterStub) AddressLen() int
func (*AddressConverterStub) ConvertToHex ¶
func (acs *AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (*AddressConverterStub) CreateAddressFromHex ¶
func (acs *AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (*AddressConverterStub) CreateAddressFromPublicKeyBytes ¶
func (acs *AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
func (*AddressConverterStub) IsInterfaceNil ¶
func (acs *AddressConverterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AddressConverterStub) PrepareAddressBytes ¶
func (acs *AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
type AddressMock ¶
type AddressMock struct {
// contains filtered or unexported fields
}
AddressMock is the struct holding a mock address
func NewAddressMock ¶
func NewAddressMock(adr []byte) *AddressMock
NewAddressMock creates a new Address with the same byte slice as the parameter received
func (*AddressMock) Bytes ¶
func (adr *AddressMock) Bytes() []byte
Bytes returns the data corresponding to this address
func (*AddressMock) IsInterfaceNil ¶
func (adr *AddressMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type AppStatusHandlerStub ¶
type AppStatusHandlerStub struct { AddUint64Handler func(key string, value uint64) IncrementHandler func(key string) DecrementHandler func(key string) SetUInt64ValueHandler func(key string, value uint64) SetInt64ValueHandler func(key string, value int64) SetStringValueHandler func(key string, value string) CloseHandler func() }
AppStatusHandlerStub is a stub implementation of AppStatusHandler
func (*AppStatusHandlerStub) AddUint64 ¶
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
AddUint64 will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an string value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
type ArgumentParserMock ¶
type ArgumentParserMock struct { ParseDataCalled func(data string) error GetArgumentsCalled func() ([]*big.Int, error) GetCodeCalled func() ([]byte, error) GetFunctionCalled func() (string, error) GetSeparatorCalled func() string CreateDataFromStorageUpdateCalled func(storageUpdates []*vmcommon.StorageUpdate) string GetStorageUpdatesCalled func(data string) ([]*vmcommon.StorageUpdate, error) }
func (*ArgumentParserMock) CreateDataFromStorageUpdate ¶
func (ap *ArgumentParserMock) CreateDataFromStorageUpdate(storageUpdates []*vmcommon.StorageUpdate) string
func (*ArgumentParserMock) GetArguments ¶
func (ap *ArgumentParserMock) GetArguments() ([]*big.Int, error)
func (*ArgumentParserMock) GetCode ¶
func (ap *ArgumentParserMock) GetCode() ([]byte, error)
func (*ArgumentParserMock) GetFunction ¶
func (ap *ArgumentParserMock) GetFunction() (string, error)
func (*ArgumentParserMock) GetSeparator ¶
func (ap *ArgumentParserMock) GetSeparator() string
func (*ArgumentParserMock) GetStorageUpdates ¶
func (ap *ArgumentParserMock) GetStorageUpdates(data string) ([]*vmcommon.StorageUpdate, error)
func (*ArgumentParserMock) IsInterfaceNil ¶
func (ap *ArgumentParserMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ArgumentParserMock) ParseData ¶
func (ap *ArgumentParserMock) ParseData(data string) error
type BelNevMock ¶
type BelNevMock struct { VerifyMock func(msg []byte, bitmap []byte) error CommitmentHashMock func(index uint16) ([]byte, error) CreateCommitmentMock func() ([]byte, []byte) AggregateCommitmentsMock func(bitmap []byte) error AggregateSigsMock func(bitmap []byte) ([]byte, error) StoreCommitmentMock func(index uint16, value []byte) error StoreCommitmentHashMock func(uint16, []byte) error CommitmentMock func(uint16) ([]byte, error) // contains filtered or unexported fields }
BelNevMock is used to mock belare neven multisignature scheme
func NewMultiSigner ¶
func NewMultiSigner() *BelNevMock
func (*BelNevMock) AggregateCommitments ¶
func (bnm *BelNevMock) AggregateCommitments(bitmap []byte) error
AggregateCommitments aggregates the list of commitments
func (*BelNevMock) AggregateSigs ¶
func (bnm *BelNevMock) AggregateSigs(bitmap []byte) ([]byte, error)
AggregateSigs aggregates all collected partial signatures
func (*BelNevMock) Commitment ¶
func (bnm *BelNevMock) Commitment(index uint16) ([]byte, error)
Commitment returns the commitment from the list with the specified position
func (*BelNevMock) CommitmentHash ¶
func (bnm *BelNevMock) CommitmentHash(index uint16) ([]byte, error)
CommitmentHash returns the commitment hash from the list on the specified position
func (*BelNevMock) Create ¶
func (bnm *BelNevMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
Create resets the multiSigner and initializes corresponding fields with the given params
func (*BelNevMock) CreateCommitment ¶
func (bnm *BelNevMock) CreateCommitment() (commSecret []byte, commitment []byte)
CreateCommitment creates a secret commitment and the corresponding public commitment point
func (*BelNevMock) CreateSignatureShare ¶
func (bnm *BelNevMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
CreateSignatureShare creates a partial signature
func (*BelNevMock) IsInterfaceNil ¶
func (bnm *BelNevMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BelNevMock) SetAggregatedSig ¶
func (bnm *BelNevMock) SetAggregatedSig(aggSig []byte) error
SetAggregatedSig sets the aggregated signature according to the given byte array
func (*BelNevMock) SetMessage ¶
func (bnm *BelNevMock) SetMessage(msg []byte) error
SetMessage sets the message to be signed
func (*BelNevMock) SignatureShare ¶
func (bnm *BelNevMock) SignatureShare(index uint16) ([]byte, error)
SignatureShare
func (*BelNevMock) StoreCommitment ¶
func (bnm *BelNevMock) StoreCommitment(index uint16, value []byte) error
StoreCommitment adds a commitment to the list on the specified position
func (*BelNevMock) StoreCommitmentHash ¶
func (bnm *BelNevMock) StoreCommitmentHash(index uint16, commHash []byte) error
StoreCommitmentHash adds a commitment hash to the list on the specified position
func (*BelNevMock) StoreSignatureShare ¶
func (bnm *BelNevMock) StoreSignatureShare(index uint16, sig []byte) error
StoreSignatureShare adds the partial signature of the signer with specified position
func (*BelNevMock) Verify ¶
func (bnm *BelNevMock) Verify(msg []byte, bitmap []byte) error
Verify returns nil if the aggregateed signature is verified for the given public keys
func (*BelNevMock) VerifySignatureShare ¶
func (bnm *BelNevMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
VerifySignatureShare verifies the partial signature of the signer with specified position
type BlackListHandlerStub ¶
type BlackListHandlerStub struct { AddCalled func(key string) error HasCalled func(key string) bool }
func (*BlackListHandlerStub) Add ¶
func (blhs *BlackListHandlerStub) Add(key string) error
func (*BlackListHandlerStub) Has ¶
func (blhs *BlackListHandlerStub) Has(key string) bool
func (*BlackListHandlerStub) IsInterfaceNil ¶
func (blhs *BlackListHandlerStub) IsInterfaceNil() bool
type BlockChainHookHandlerMock ¶
type BlockChainHookHandlerMock struct { AddTempAccountCalled func(address []byte, balance *big.Int, nonce uint64) CleanTempAccountsCalled func() TempAccountCalled func(address []byte) state.AccountHandler SetCurrentHeaderCalled func(hdr data.HeaderHandler) }
func (*BlockChainHookHandlerMock) AddTempAccount ¶
func (e *BlockChainHookHandlerMock) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
func (*BlockChainHookHandlerMock) CleanTempAccounts ¶
func (e *BlockChainHookHandlerMock) CleanTempAccounts()
func (*BlockChainHookHandlerMock) IsInterfaceNil ¶
func (e *BlockChainHookHandlerMock) IsInterfaceNil() bool
func (*BlockChainHookHandlerMock) SetCurrentHeader ¶
func (e *BlockChainHookHandlerMock) SetCurrentHeader(hdr data.HeaderHandler)
func (*BlockChainHookHandlerMock) TempAccount ¶
func (e *BlockChainHookHandlerMock) TempAccount(address []byte) state.AccountHandler
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 BlockProcessorMock ¶
type BlockProcessorMock 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) CreateBlockCalled 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) error MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error) 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 // contains filtered or unexported fields }
func (*BlockProcessorMock) AddLastNotarizedHdr ¶
func (bpm *BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
func (*BlockProcessorMock) ApplyBodyToHeader ¶ added in v1.0.39
func (bpm *BlockProcessorMock) ApplyBodyToHeader(header data.HeaderHandler, body data.BodyHandler) error
func (*BlockProcessorMock) CommitBlock ¶
func (bpm *BlockProcessorMock) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
func (*BlockProcessorMock) CreateBlockBody ¶ added in v1.0.3
func (bpm *BlockProcessorMock) CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)
func (*BlockProcessorMock) CreateGenesisBlock ¶
func (bpm *BlockProcessorMock) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)
func (*BlockProcessorMock) CreateNewHeader ¶
func (bpm *BlockProcessorMock) CreateNewHeader() data.HeaderHandler
func (*BlockProcessorMock) DecodeBlockBody ¶
func (bpm *BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
func (*BlockProcessorMock) DecodeBlockHeader ¶
func (bpm *BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
func (*BlockProcessorMock) IsInterfaceNil ¶
func (bpm *BlockProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockProcessorMock) MarshalizedDataToBroadcast ¶
func (bpm *BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
func (*BlockProcessorMock) ProcessBlock ¶
func (bpm *BlockProcessorMock) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
func (*BlockProcessorMock) RestoreBlockIntoPools ¶
func (bpm *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
func (*BlockProcessorMock) RevertAccountState ¶
func (bpm *BlockProcessorMock) RevertAccountState()
func (*BlockProcessorMock) RevertStateToBlock ¶
func (blProcMock *BlockProcessorMock) RevertStateToBlock(header data.HeaderHandler) error
RevertStateToBlock recreates thee state tries to the root hashes indicated by the provided header
func (*BlockProcessorMock) SetConsensusData ¶ added in v1.0.20
func (bpm *BlockProcessorMock) SetConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32)
type BlockSizeThrottlerStub ¶
type BlockSizeThrottlerStub struct { MaxItemsToAddCalled func() uint32 AddCalled func(round uint64, items uint32) SucceedCalled func(round uint64) ComputeMaxItemsCalled func() }
func (*BlockSizeThrottlerStub) Add ¶
func (bsts *BlockSizeThrottlerStub) Add(round uint64, items uint32)
func (*BlockSizeThrottlerStub) ComputeMaxItems ¶ added in v1.0.11
func (bsts *BlockSizeThrottlerStub) ComputeMaxItems()
func (*BlockSizeThrottlerStub) IsInterfaceNil ¶
func (bsts *BlockSizeThrottlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockSizeThrottlerStub) MaxItemsToAdd ¶ added in v1.0.11
func (bsts *BlockSizeThrottlerStub) MaxItemsToAdd() uint32
func (*BlockSizeThrottlerStub) Succeed ¶
func (bsts *BlockSizeThrottlerStub) Succeed(round uint64)
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
func NewCacherMock ¶
func NewCacherMock() *CacherMock
func (*CacherMock) Clear ¶
func (cm *CacherMock) Clear()
func (*CacherMock) Get ¶
func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
func (*CacherMock) Has ¶
func (cm *CacherMock) Has(key []byte) bool
func (*CacherMock) HasOrAdd ¶
func (cm *CacherMock) HasOrAdd(key []byte, value interface{}) (bool, bool)
func (*CacherMock) IsInterfaceNil ¶
func (cm *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Keys ¶
func (cm *CacherMock) Keys() [][]byte
func (*CacherMock) Len ¶
func (cm *CacherMock) Len() int
func (*CacherMock) MaxSize ¶
func (cm *CacherMock) MaxSize() int
func (*CacherMock) Peek ¶
func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
func (*CacherMock) Put ¶
func (cm *CacherMock) Put(key []byte, value interface{}) (evicted bool)
func (*CacherMock) RegisterHandler ¶
func (cm *CacherMock) RegisterHandler(func(key []byte))
func (*CacherMock) Remove ¶
func (cm *CacherMock) Remove(key []byte)
func (*CacherMock) RemoveOldest ¶
func (cm *CacherMock) RemoveOldest()
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) HasCalled func(key []byte) bool PeekCalled func(key []byte) (value interface{}, ok bool) HasOrAddCalled func(key []byte, value interface{}) (ok, evicted bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte)) }
func (*CacherStub) Clear ¶
func (cs *CacherStub) Clear()
func (*CacherStub) Get ¶
func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)
func (*CacherStub) Has ¶
func (cs *CacherStub) Has(key []byte) bool
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)
func (*CacherStub) IsInterfaceNil ¶
func (cs *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Keys ¶
func (cs *CacherStub) Keys() [][]byte
func (*CacherStub) Len ¶
func (cs *CacherStub) Len() int
func (*CacherStub) MaxSize ¶
func (cs *CacherStub) MaxSize() int
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte))
func (*CacherStub) Remove ¶
func (cs *CacherStub) Remove(key []byte)
func (*CacherStub) RemoveOldest ¶
func (cs *CacherStub) RemoveOldest()
type ChainStorerMock ¶
type ChainStorerMock struct { AddStorerCalled func(key dataRetriever.UnitType, s storage.Storer) GetStorerCalled func(unitType dataRetriever.UnitType) storage.Storer HasCalled func(unitType dataRetriever.UnitType, key []byte) error GetCalled func(unitType dataRetriever.UnitType, key []byte) ([]byte, error) PutCalled func(unitType dataRetriever.UnitType, key []byte, value []byte) error GetAllCalled func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error) DestroyCalled func() error }
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 CoordinatorStub ¶
type CoordinatorStub struct { NumberOfShardsCalled func() uint32 ComputeIdCalled func(address state.AddressContainer) uint32 SelfIdCalled func() uint32 SameShardCalled func(firstAddress, secondAddress state.AddressContainer) bool CommunicationIdentifierCalled func(destShardID uint32) string }
func (*CoordinatorStub) CommunicationIdentifier ¶
func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
func (*CoordinatorStub) ComputeId ¶
func (coordinator *CoordinatorStub) ComputeId(address state.AddressContainer) uint32
func (*CoordinatorStub) IsInterfaceNil ¶
func (coordinator *CoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CoordinatorStub) NumberOfShards ¶
func (coordinator *CoordinatorStub) NumberOfShards() uint32
func (*CoordinatorStub) SameShard ¶
func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress state.AddressContainer) bool
func (*CoordinatorStub) SelfId ¶
func (coordinator *CoordinatorStub) SelfId() uint32
type FeeHandlerStub ¶
type FeeHandlerStub struct { 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 }
func (*FeeHandlerStub) CheckValidityTxValues ¶
func (fhs *FeeHandlerStub) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error
func (*FeeHandlerStub) ComputeFee ¶
func (fhs *FeeHandlerStub) ComputeFee(tx process.TransactionWithFeeHandler) *big.Int
func (*FeeHandlerStub) ComputeGasLimit ¶
func (fhs *FeeHandlerStub) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64
func (*FeeHandlerStub) IsInterfaceNil ¶
func (fhs *FeeHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type ForkDetectorMock ¶
type ForkDetectorMock struct { AddHeaderCalled func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeaders []data.HeaderHandler, finalHeadersHashes [][]byte, isNotarizedShardStuck bool) error RemoveHeadersCalled func(nonce uint64, hash []byte) CheckForkCalled func() *process.ForkInfo GetHighestFinalBlockNonceCalled func() uint64 ProbableHighestNonceCalled func() uint64 ResetProbableHighestNonceCalled func() ResetForkCalled func() GetNotarizedHeaderHashCalled func(nonce uint64) []byte }
func (*ForkDetectorMock) AddHeader ¶
func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeaders []data.HeaderHandler, finalHeadersHashes [][]byte, isNotarizedShardStuck bool) error
func (*ForkDetectorMock) CheckFork ¶
func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
func (*ForkDetectorMock) GetHighestFinalBlockNonce ¶
func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
func (*ForkDetectorMock) GetNotarizedHeaderHash ¶
func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte
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
func (*ForkDetectorMock) RemoveHeaders ¶ added in v1.0.3
func (fdm *ForkDetectorMock) RemoveHeaders(nonce uint64, hash []byte)
func (*ForkDetectorMock) ResetFork ¶
func (fdm *ForkDetectorMock) ResetFork()
func (*ForkDetectorMock) ResetProbableHighestNonce ¶
func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
type GetHdrHandlerStub ¶
type GetHdrHandlerStub struct {
HeaderHandlerCalled func() data.HeaderHandler
}
func (*GetHdrHandlerStub) HeaderHandler ¶
func (ghhs *GetHdrHandlerStub) HeaderHandler() data.HeaderHandler
type HasherMock ¶
type HasherMock struct { }
HasherMock that will be used for testing
func (HasherMock) Compute ¶
func (sha HasherMock) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherMock) EmptyHash ¶
func (sha HasherMock) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (HasherMock) IsInterfaceNil ¶
func (sha HasherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HasherStub ¶
func (*HasherStub) Compute ¶
func (hash *HasherStub) Compute(s string) []byte
func (*HasherStub) EmptyHash ¶
func (hash *HasherStub) EmptyHash() []byte
func (*HasherStub) IsInterfaceNil ¶
func (hash *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HasherStub) Size ¶
func (hash *HasherStub) Size() int
type HeaderHandlerStub ¶
type HeaderHandlerStub struct { GetMiniBlockHeadersWithDstCalled func(destId uint32) map[string]uint32 GetPubKeysBitmapCalled func() []byte GetSignatureCalled func() []byte GetRootHashCalled func() []byte GetRandSeedCalled func() []byte GetPrevRandSeedCalled func() []byte GetPrevHashCalled func() []byte }
func (*HeaderHandlerStub) GetEpoch ¶
func (hhs *HeaderHandlerStub) GetEpoch() uint32
func (*HeaderHandlerStub) GetMiniBlockHeadersWithDst ¶
func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
func (*HeaderHandlerStub) GetMiniBlockProcessed ¶
func (hhs *HeaderHandlerStub) GetMiniBlockProcessed(hash []byte) bool
func (*HeaderHandlerStub) GetNonce ¶
func (hhs *HeaderHandlerStub) GetNonce() uint64
func (*HeaderHandlerStub) GetPrevHash ¶
func (hhs *HeaderHandlerStub) GetPrevHash() []byte
func (*HeaderHandlerStub) GetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
func (*HeaderHandlerStub) GetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
func (*HeaderHandlerStub) GetRandSeed ¶
func (hhs *HeaderHandlerStub) GetRandSeed() []byte
func (*HeaderHandlerStub) GetRootHash ¶
func (hhs *HeaderHandlerStub) GetRootHash() []byte
func (*HeaderHandlerStub) GetRound ¶
func (hhs *HeaderHandlerStub) GetRound() uint64
func (*HeaderHandlerStub) GetShardID ¶
func (hhs *HeaderHandlerStub) GetShardID() uint32
func (*HeaderHandlerStub) GetSignature ¶
func (hhs *HeaderHandlerStub) GetSignature() []byte
func (*HeaderHandlerStub) GetTimeStamp ¶
func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
func (*HeaderHandlerStub) GetTxCount ¶
func (hhs *HeaderHandlerStub) GetTxCount() uint32
func (*HeaderHandlerStub) GetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
func (*HeaderHandlerStub) IsInterfaceNil ¶
func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderHandlerStub) ItemsInBody ¶
func (hhs *HeaderHandlerStub) ItemsInBody() uint32
func (*HeaderHandlerStub) ItemsInHeader ¶
func (hhs *HeaderHandlerStub) ItemsInHeader() uint32
func (*HeaderHandlerStub) SetEpoch ¶
func (hhs *HeaderHandlerStub) SetEpoch(e uint32)
func (*HeaderHandlerStub) SetMiniBlockProcessed ¶
func (hhs *HeaderHandlerStub) SetMiniBlockProcessed(hash []byte, processed bool)
func (*HeaderHandlerStub) SetNonce ¶
func (hhs *HeaderHandlerStub) SetNonce(n uint64)
func (*HeaderHandlerStub) SetPrevHash ¶
func (hhs *HeaderHandlerStub) SetPrevHash(pvHash []byte)
func (*HeaderHandlerStub) SetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) SetPrevRandSeed(pvRandSeed []byte)
func (*HeaderHandlerStub) SetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) SetPubKeysBitmap(pkbm []byte)
func (*HeaderHandlerStub) SetRandSeed ¶
func (hhs *HeaderHandlerStub) SetRandSeed(randSeed []byte)
func (*HeaderHandlerStub) SetRootHash ¶
func (hhs *HeaderHandlerStub) SetRootHash(rHash []byte)
func (*HeaderHandlerStub) SetRound ¶
func (hhs *HeaderHandlerStub) SetRound(r uint64)
func (*HeaderHandlerStub) SetSignature ¶
func (hhs *HeaderHandlerStub) SetSignature(sg []byte)
func (*HeaderHandlerStub) SetTimeStamp ¶
func (hhs *HeaderHandlerStub) SetTimeStamp(ts uint64)
func (*HeaderHandlerStub) SetTxCount ¶
func (hhs *HeaderHandlerStub) SetTxCount(txCount uint32)
func (*HeaderHandlerStub) SetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(vrh []byte)
type HeaderResolverMock ¶
type HeaderResolverMock struct { RequestDataFromHashCalled func(hash []byte) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error RequestDataFromNonceCalled func(nonce uint64) error }
func (*HeaderResolverMock) IsInterfaceNil ¶
func (hrm *HeaderResolverMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderResolverMock) ProcessReceivedMessage ¶
func (hrm *HeaderResolverMock) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
func (*HeaderResolverMock) RequestDataFromHash ¶
func (hrm *HeaderResolverMock) RequestDataFromHash(hash []byte) error
func (*HeaderResolverMock) RequestDataFromNonce ¶
func (hrm *HeaderResolverMock) RequestDataFromNonce(nonce uint64) error
type HeaderValidatorStub ¶
type HeaderValidatorStub struct {
HeaderValidForProcessingCalled func(headerHandler process.HdrValidatorHandler) error
}
func (*HeaderValidatorStub) HeaderValidForProcessing ¶
func (h *HeaderValidatorStub) HeaderValidForProcessing(headerHandler process.HdrValidatorHandler) error
func (*HeaderValidatorStub) IsInterfaceNil ¶
func (h *HeaderValidatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type IndexerMock ¶
type IndexerMock struct {
SaveBlockCalled func(body data.BodyHandler, header data.HeaderHandler, txPool map[string]data.TransactionHandler)
}
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) IsNilIndexer ¶
func (im *IndexerMock) IsNilIndexer() bool
func (*IndexerMock) SaveBlock ¶
func (im *IndexerMock) SaveBlock(body data.BodyHandler, header data.HeaderHandler, txPool map[string]data.TransactionHandler, signersIndexes []uint64)
func (*IndexerMock) SaveMetaBlock ¶
func (im *IndexerMock) SaveMetaBlock(header data.HeaderHandler, signersIndexes []uint64)
func (*IndexerMock) SaveRoundInfo ¶
func (im *IndexerMock) SaveRoundInfo(roundInfo indexer.RoundInfo)
func (*IndexerMock) SaveValidatorsPubKeys ¶
func (im *IndexerMock) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte)
func (*IndexerMock) UpdateTPS ¶
func (im *IndexerMock) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)
type InterceptedDataFactoryStub ¶
type InterceptedDataFactoryStub struct {
CreateCalled func(buff []byte) (process.InterceptedData, error)
}
func (*InterceptedDataFactoryStub) Create ¶
func (idfs *InterceptedDataFactoryStub) Create(buff []byte) (process.InterceptedData, error)
func (*InterceptedDataFactoryStub) IsInterfaceNil ¶
func (idfs *InterceptedDataFactoryStub) IsInterfaceNil() bool
type InterceptedDataStub ¶
type InterceptedDataStub struct { CheckValidityCalled func() error IsForCurrentShardCalled func() bool HashCalled func() []byte }
func (*InterceptedDataStub) CheckValidity ¶
func (ids *InterceptedDataStub) CheckValidity() error
func (*InterceptedDataStub) Hash ¶
func (ids *InterceptedDataStub) Hash() []byte
func (*InterceptedDataStub) IsForCurrentShard ¶
func (ids *InterceptedDataStub) IsForCurrentShard() bool
func (*InterceptedDataStub) IsInterfaceNil ¶
func (ids *InterceptedDataStub) IsInterfaceNil() bool
type InterceptedTxHandlerStub ¶
type InterceptedTxHandlerStub struct { SenderShardIdCalled func() uint32 ReceiverShardIdCalled func() uint32 NonceCalled func() uint64 SenderAddressCalled func() state.AddressContainer TotalValueCalled func() *big.Int TransactionCalled func() data.TransactionHandler }
func (*InterceptedTxHandlerStub) Nonce ¶
func (iths *InterceptedTxHandlerStub) Nonce() uint64
func (*InterceptedTxHandlerStub) ReceiverShardId ¶
func (iths *InterceptedTxHandlerStub) ReceiverShardId() uint32
func (*InterceptedTxHandlerStub) SenderAddress ¶
func (iths *InterceptedTxHandlerStub) SenderAddress() state.AddressContainer
func (*InterceptedTxHandlerStub) SenderShardId ¶
func (iths *InterceptedTxHandlerStub) SenderShardId() uint32
func (*InterceptedTxHandlerStub) TotalValue ¶ added in v1.0.36
func (iths *InterceptedTxHandlerStub) TotalValue() *big.Int
func (*InterceptedTxHandlerStub) Transaction ¶
func (iths *InterceptedTxHandlerStub) Transaction() data.TransactionHandler
type InterceptorProcessorStub ¶
type InterceptorProcessorStub struct { ValidateCalled func(data process.InterceptedData) error SaveCalled func(data process.InterceptedData) error }
func (*InterceptorProcessorStub) IsInterfaceNil ¶
func (ips *InterceptorProcessorStub) IsInterfaceNil() bool
func (*InterceptorProcessorStub) Save ¶
func (ips *InterceptorProcessorStub) Save(data process.InterceptedData) error
func (*InterceptorProcessorStub) Validate ¶
func (ips *InterceptorProcessorStub) Validate(data process.InterceptedData) error
type InterceptorStub ¶
type InterceptorStub struct {
ProcessReceivedMessageCalled func(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error
}
func (*InterceptorStub) IsInterfaceNil ¶
func (is *InterceptorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*InterceptorStub) ProcessReceivedMessage ¶
func (is *InterceptorStub) ProcessReceivedMessage(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error
type InterceptorThrottlerStub ¶
type InterceptorThrottlerStub struct { CanProcessCalled func() bool // contains filtered or unexported fields }
func (*InterceptorThrottlerStub) CanProcess ¶
func (its *InterceptorThrottlerStub) CanProcess() bool
func (*InterceptorThrottlerStub) EndProcessing ¶
func (its *InterceptorThrottlerStub) EndProcessing()
func (*InterceptorThrottlerStub) EndProcessingCount ¶
func (it *InterceptorThrottlerStub) EndProcessingCount() int32
func (*InterceptorThrottlerStub) IsInterfaceNil ¶
func (its *InterceptorThrottlerStub) IsInterfaceNil() bool
func (*InterceptorThrottlerStub) StartProcessing ¶
func (its *InterceptorThrottlerStub) StartProcessing()
func (*InterceptorThrottlerStub) StartProcessingCount ¶
func (it *InterceptorThrottlerStub) StartProcessingCount() int32
type InterimProcessorContainerMock ¶
type InterimProcessorContainerMock struct { GetCalled func(key block.Type) (process.IntermediateTransactionHandler, error) KeysCalled func() []block.Type }
func (*InterimProcessorContainerMock) Add ¶
func (ppcm *InterimProcessorContainerMock) Add(key block.Type, val process.IntermediateTransactionHandler) error
func (*InterimProcessorContainerMock) AddMultiple ¶
func (ppcm *InterimProcessorContainerMock) AddMultiple(keys []block.Type, preprocessors []process.IntermediateTransactionHandler) error
func (*InterimProcessorContainerMock) Get ¶
func (ipcm *InterimProcessorContainerMock) Get(key block.Type) (process.IntermediateTransactionHandler, error)
func (*InterimProcessorContainerMock) IsInterfaceNil ¶
func (ppcm *InterimProcessorContainerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*InterimProcessorContainerMock) Keys ¶
func (ppcm *InterimProcessorContainerMock) Keys() []block.Type
func (*InterimProcessorContainerMock) Len ¶
func (ppcm *InterimProcessorContainerMock) Len() int
func (*InterimProcessorContainerMock) Remove ¶
func (ppcm *InterimProcessorContainerMock) Remove(key block.Type)
func (*InterimProcessorContainerMock) Replace ¶
func (ppcm *InterimProcessorContainerMock) Replace(key block.Type, val process.IntermediateTransactionHandler) error
type IntermediateTransactionHandlerMock ¶
type IntermediateTransactionHandlerMock struct { AddIntermediateTransactionsCalled func(txs []data.TransactionHandler) error CreateAllInterMiniBlocksCalled func() map[uint32]*block.MiniBlock VerifyInterMiniBlocksCalled func(body block.Body) error SaveCurrentIntermediateTxToStorageCalled func() error CreateBlockStartedCalled func() CreateMarshalizedDataCalled func(txHashes [][]byte) ([][]byte, error) GetAllCurrentFinishedTxsCalled func() map[string]data.TransactionHandler }
func (*IntermediateTransactionHandlerMock) AddIntermediateTransactions ¶
func (ith *IntermediateTransactionHandlerMock) AddIntermediateTransactions(txs []data.TransactionHandler) error
func (*IntermediateTransactionHandlerMock) CreateAllInterMiniBlocks ¶
func (ith *IntermediateTransactionHandlerMock) CreateAllInterMiniBlocks() map[uint32]*block.MiniBlock
func (*IntermediateTransactionHandlerMock) CreateBlockStarted ¶
func (ith *IntermediateTransactionHandlerMock) CreateBlockStarted()
func (*IntermediateTransactionHandlerMock) CreateMarshalizedData ¶
func (ith *IntermediateTransactionHandlerMock) CreateMarshalizedData(txHashes [][]byte) ([][]byte, error)
func (*IntermediateTransactionHandlerMock) GetAllCurrentFinishedTxs ¶
func (ith *IntermediateTransactionHandlerMock) GetAllCurrentFinishedTxs() map[string]data.TransactionHandler
func (*IntermediateTransactionHandlerMock) IsInterfaceNil ¶
func (ith *IntermediateTransactionHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*IntermediateTransactionHandlerMock) SaveCurrentIntermediateTxToStorage ¶
func (ith *IntermediateTransactionHandlerMock) SaveCurrentIntermediateTxToStorage() error
func (*IntermediateTransactionHandlerMock) VerifyInterMiniBlocks ¶
func (ith *IntermediateTransactionHandlerMock) VerifyInterMiniBlocks(body block.Body) error
type MarshalizerMock ¶
type MarshalizerMock struct {
Fail bool
}
MarshalizerMock that will be used for testing
func (*MarshalizerMock) IsInterfaceNil ¶
func (mm *MarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerMock) Marshal ¶
func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerMock) Unmarshal ¶
func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type MarshalizerStub ¶
type MarshalizerStub struct { MarshalCalled func(obj interface{}) ([]byte, error) UnmarshalCalled func(obj interface{}, buff []byte) error }
func (*MarshalizerStub) IsInterfaceNil ¶
func (ms *MarshalizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerStub) Marshal ¶
func (ms *MarshalizerStub) Marshal(obj interface{}) ([]byte, error)
func (*MarshalizerStub) Unmarshal ¶
func (ms *MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error
type MessageHandlerStub ¶
type MessageHandlerStub struct { ConnectedPeersOnTopicCalled func(topic string) []p2p.PeerID SendToConnectedPeerCalled func(topic string, buff []byte, peerID p2p.PeerID) error }
func (*MessageHandlerStub) ConnectedPeersOnTopic ¶
func (mhs *MessageHandlerStub) ConnectedPeersOnTopic(topic string) []p2p.PeerID
func (*MessageHandlerStub) IsInterfaceNil ¶
func (mhs *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessageHandlerStub) SendToConnectedPeer ¶
type MessengerStub ¶
type MessengerStub struct { CloseCalled func() error IDCalled func() p2p.PeerID PeersCalled func() []p2p.PeerID AddressesCalled func() []string ConnectToPeerCalled func(address string) error TrimConnectionsCalled func() IsConnectedCalled func(peerID p2p.PeerID) bool ConnectedPeersCalled func() []p2p.PeerID CreateTopicCalled func(name string, createChannelForTopic bool) error HasTopicCalled func(name string) bool HasTopicValidatorCalled func(name string) bool BroadcastOnChannelCalled func(channel string, topic string, buff []byte) BroadcastCalled func(topic string, buff []byte) RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error UnregisterMessageProcessorCalled func(topic string) error SendToConnectedPeerCalled func(topic string, buff []byte, peerID p2p.PeerID) error OutgoingChannelLoadBalancerCalled func() p2p.ChannelLoadBalancer BootstrapCalled func() error }
func (*MessengerStub) Addresses ¶
func (ms *MessengerStub) Addresses() []string
func (*MessengerStub) Bootstrap ¶
func (ms *MessengerStub) Bootstrap() error
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
func (*MessengerStub) BroadcastOnChannel ¶
func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
func (*MessengerStub) Close ¶
func (ms *MessengerStub) Close() error
func (*MessengerStub) ConnectToPeer ¶
func (ms *MessengerStub) ConnectToPeer(address string) error
func (*MessengerStub) ConnectedPeers ¶
func (ms *MessengerStub) ConnectedPeers() []p2p.PeerID
func (*MessengerStub) CreateTopic ¶
func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
func (*MessengerStub) HasTopic ¶
func (ms *MessengerStub) HasTopic(name string) bool
func (*MessengerStub) HasTopicValidator ¶
func (ms *MessengerStub) HasTopicValidator(name string) bool
func (*MessengerStub) ID ¶
func (ms *MessengerStub) ID() p2p.PeerID
func (*MessengerStub) IsConnected ¶
func (ms *MessengerStub) IsConnected(peerID p2p.PeerID) bool
func (*MessengerStub) IsInterfaceNil ¶
func (ms *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessengerStub) OutgoingChannelLoadBalancer ¶
func (ms *MessengerStub) OutgoingChannelLoadBalancer() p2p.ChannelLoadBalancer
func (*MessengerStub) Peers ¶
func (ms *MessengerStub) Peers() []p2p.PeerID
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
func (*MessengerStub) SendToConnectedPeer ¶
func (*MessengerStub) TrimConnections ¶
func (ms *MessengerStub) TrimConnections()
func (*MessengerStub) UnregisterMessageProcessor ¶
func (ms *MessengerStub) UnregisterMessageProcessor(topic string) error
type MetaPoolsHolderFake ¶ added in v1.0.3
type MetaPoolsHolderFake struct { MetaBlocksCalled func() storage.Cacher // contains filtered or unexported fields }
func NewMetaPoolsHolderFake ¶ added in v1.0.3
func NewMetaPoolsHolderFake() *MetaPoolsHolderFake
func (*MetaPoolsHolderFake) CurrentBlockTxs ¶ added in v1.0.39
func (mphf *MetaPoolsHolderFake) CurrentBlockTxs() dataRetriever.TransactionCacher
func (*MetaPoolsHolderFake) HeadersNonces ¶ added in v1.0.11
func (mphf *MetaPoolsHolderFake) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*MetaPoolsHolderFake) IsInterfaceNil ¶ added in v1.0.16
func (mphf *MetaPoolsHolderFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MetaPoolsHolderFake) MetaBlocks ¶ added in v1.0.30
func (mphf *MetaPoolsHolderFake) MetaBlocks() storage.Cacher
func (*MetaPoolsHolderFake) MiniBlocks ¶ added in v1.0.28
func (mphf *MetaPoolsHolderFake) MiniBlocks() storage.Cacher
func (*MetaPoolsHolderFake) ShardHeaders ¶ added in v1.0.3
func (mphf *MetaPoolsHolderFake) ShardHeaders() storage.Cacher
func (*MetaPoolsHolderFake) Transactions ¶ added in v1.0.28
func (mphf *MetaPoolsHolderFake) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*MetaPoolsHolderFake) UnsignedTransactions ¶ added in v1.0.28
func (mphf *MetaPoolsHolderFake) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type MetaPoolsHolderStub ¶ added in v1.0.3
type MetaPoolsHolderStub struct { MetaBlocksCalled func() storage.Cacher MiniBlocksCalled func() storage.Cacher ShardHeadersCalled func() storage.Cacher HeadersNoncesCalled func() dataRetriever.Uint64SyncMapCacher TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier CurrBlockTxsCalled func() dataRetriever.TransactionCacher }
func (*MetaPoolsHolderStub) CurrentBlockTxs ¶ added in v1.0.39
func (mphs *MetaPoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
func (*MetaPoolsHolderStub) HeadersNonces ¶ added in v1.0.11
func (mphs *MetaPoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*MetaPoolsHolderStub) IsInterfaceNil ¶ added in v1.0.16
func (mphs *MetaPoolsHolderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MetaPoolsHolderStub) MetaBlocks ¶ added in v1.0.30
func (mphs *MetaPoolsHolderStub) MetaBlocks() storage.Cacher
func (*MetaPoolsHolderStub) MiniBlocks ¶ added in v1.0.28
func (mphs *MetaPoolsHolderStub) MiniBlocks() storage.Cacher
func (*MetaPoolsHolderStub) ShardHeaders ¶ added in v1.0.3
func (mphs *MetaPoolsHolderStub) ShardHeaders() storage.Cacher
func (*MetaPoolsHolderStub) Transactions ¶ added in v1.0.28
func (mphs *MetaPoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*MetaPoolsHolderStub) UnsignedTransactions ¶ added in v1.0.28
func (mphs *MetaPoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type MiniBlocksCompacterMock ¶ added in v1.0.36
type MiniBlocksCompacterMock struct { CompactCalled func(block.MiniBlockSlice, map[string]data.TransactionHandler) block.MiniBlockSlice ExpandCalled func(block.MiniBlockSlice, map[string]data.TransactionHandler) (block.MiniBlockSlice, error) }
func (*MiniBlocksCompacterMock) Compact ¶ added in v1.0.36
func (mbcm *MiniBlocksCompacterMock) Compact(miniBlocks block.MiniBlockSlice, mapHashesAndTxs map[string]data.TransactionHandler) block.MiniBlockSlice
func (*MiniBlocksCompacterMock) Expand ¶ added in v1.0.36
func (mbcm *MiniBlocksCompacterMock) Expand(miniBlocks block.MiniBlockSlice, mapHashesAndTxs map[string]data.TransactionHandler) (block.MiniBlockSlice, error)
func (*MiniBlocksCompacterMock) IsInterfaceNil ¶ added in v1.0.36
func (mbcm *MiniBlocksCompacterMock) IsInterfaceNil() bool
type MiniBlocksResolverMock ¶
type MiniBlocksResolverMock struct { RequestDataFromHashCalled func(hash []byte) error RequestDataFromHashArrayCalled func(hashes [][]byte) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error GetMiniBlocksCalled func(hashes [][]byte) (block.MiniBlockSlice, [][]byte) GetMiniBlocksFromPoolCalled func(hashes [][]byte) (block.MiniBlockSlice, [][]byte) }
func (*MiniBlocksResolverMock) GetMiniBlocks ¶
func (hrm *MiniBlocksResolverMock) GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
func (*MiniBlocksResolverMock) GetMiniBlocksFromPool ¶
func (hrm *MiniBlocksResolverMock) GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
func (*MiniBlocksResolverMock) IsInterfaceNil ¶
func (hrm *MiniBlocksResolverMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MiniBlocksResolverMock) ProcessReceivedMessage ¶
func (hrm *MiniBlocksResolverMock) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error
func (*MiniBlocksResolverMock) RequestDataFromHash ¶
func (hrm *MiniBlocksResolverMock) RequestDataFromHash(hash []byte) error
func (*MiniBlocksResolverMock) RequestDataFromHashArray ¶
func (hrm *MiniBlocksResolverMock) RequestDataFromHashArray(hashes [][]byte) error
type NetworkConnectionWatcherStub ¶
type NetworkConnectionWatcherStub struct {
IsConnectedToTheNetworkCalled func() bool
}
func (*NetworkConnectionWatcherStub) IsConnectedToTheNetwork ¶
func (cws *NetworkConnectionWatcherStub) IsConnectedToTheNetwork() bool
func (*NetworkConnectionWatcherStub) IsInterfaceNil ¶
func (cws *NetworkConnectionWatcherStub) IsInterfaceNil() bool
type NodesCoordinatorMock ¶
type NodesCoordinatorMock struct { Validators map[uint32][]sharding.Validator ShardConsensusSize uint32 MetaConsensusSize uint32 ShardId uint32 NbShards uint32 GetSelectedPublicKeysCalled func(selection []byte, shardId uint32) (publicKeys []string, err error) GetValidatorsPublicKeysCalled func(randomness []byte, round uint64, shardId uint32) ([]string, error) GetValidatorsRewardsAddressesCalled func(randomness []byte, round uint64, shardId uint32) ([]string, error) LoadNodesPerShardsCalled func(nodes map[uint32][]sharding.Validator) error ComputeValidatorsGroupCalled func(randomness []byte, round uint64, shardId uint32) (validatorsGroup []sharding.Validator, err error) GetValidatorWithPublicKeyCalled func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error) }
NodesCoordinator defines the behaviour of a struct able to do validator group selection
func NewNodesCoordinatorMock ¶
func NewNodesCoordinatorMock() *NodesCoordinatorMock
func (*NodesCoordinatorMock) ComputeValidatorsGroup ¶ added in v1.0.20
func (*NodesCoordinatorMock) GetAllValidatorsPublicKeys ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte
func (*NodesCoordinatorMock) GetOwnPublicKey ¶
func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
func (*NodesCoordinatorMock) GetSelectedPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32) (publicKeys []string, err error)
func (*NodesCoordinatorMock) GetValidatorWithPublicKey ¶
func (*NodesCoordinatorMock) GetValidatorsIndexes ¶
func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64
func (*NodesCoordinatorMock) GetValidatorsPublicKeys ¶ added in v1.0.20
func (*NodesCoordinatorMock) GetValidatorsRewardsAddresses ¶ added in v1.0.20
func (*NodesCoordinatorMock) IsInterfaceNil ¶
func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
func (*NodesCoordinatorMock) SetNodesPerShards ¶
func (ncm *NodesCoordinatorMock) SetNodesPerShards(nodes map[uint32][]sharding.Validator) error
type ObjectsContainerStub ¶
type ObjectsContainerStub struct { GetCalled func(key string) (interface{}, error) AddCalled func(key string, val interface{}) error ReplaceCalled func(key string, val interface{}) error RemoveCalled func(key string) LenCalled func() int }
func (*ObjectsContainerStub) Add ¶
func (ocs *ObjectsContainerStub) Add(key string, val interface{}) error
func (*ObjectsContainerStub) Get ¶
func (ocs *ObjectsContainerStub) Get(key string) (interface{}, error)
func (*ObjectsContainerStub) Len ¶
func (ocs *ObjectsContainerStub) Len() int
func (*ObjectsContainerStub) Remove ¶
func (ocs *ObjectsContainerStub) Remove(key string)
func (*ObjectsContainerStub) Replace ¶
func (ocs *ObjectsContainerStub) Replace(key string, val interface{}) error
type P2PMessageMock ¶
type P2PMessageMock struct { FromField []byte DataField []byte SeqNoField []byte TopicIDsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
func (*P2PMessageMock) Data ¶
func (msg *P2PMessageMock) Data() []byte
func (*P2PMessageMock) From ¶
func (msg *P2PMessageMock) From() []byte
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageMock) Key ¶
func (msg *P2PMessageMock) Key() []byte
func (*P2PMessageMock) Peer ¶
func (msg *P2PMessageMock) Peer() p2p.PeerID
func (*P2PMessageMock) SeqNo ¶
func (msg *P2PMessageMock) SeqNo() []byte
func (*P2PMessageMock) Signature ¶
func (msg *P2PMessageMock) Signature() []byte
func (*P2PMessageMock) TopicIDs ¶ added in v1.0.3
func (msg *P2PMessageMock) TopicIDs() []string
type PeerAccountHandlerMock ¶
type PeerAccountHandlerMock struct { MockValue int SetNonceWithJournalCalled func(nonce uint64) error `json:"-"` SetCodeHashWithJournalCalled func(codeHash []byte) error `json:"-"` SetRootHashWithJournalCalled func([]byte) error `json:"-"` SetCodeWithJournalCalled func(codeHash []byte) error `json:"-"` IncreaseLeaderSuccessRateWithJournalCalled func() error DecreaseLeaderSuccessRateWithJournalCalled func() error IncreaseValidatorSuccessRateWithJournalCalled func() error DecreaseValidatorSuccessRateWithJournalCalled func() error // contains filtered or unexported fields }
func (*PeerAccountHandlerMock) AddressContainer ¶
func (pahm *PeerAccountHandlerMock) AddressContainer() state.AddressContainer
func (*PeerAccountHandlerMock) DataTrie ¶
func (pahm *PeerAccountHandlerMock) DataTrie() data.Trie
func (*PeerAccountHandlerMock) DataTrieTracker ¶
func (pahm *PeerAccountHandlerMock) DataTrieTracker() state.DataTrieTracker
func (*PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal() error
func (*PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal() error
func (*PeerAccountHandlerMock) GetCode ¶
func (pahm *PeerAccountHandlerMock) GetCode() []byte
func (*PeerAccountHandlerMock) GetCodeHash ¶
func (pahm *PeerAccountHandlerMock) GetCodeHash() []byte
func (*PeerAccountHandlerMock) GetNonce ¶
func (pahm *PeerAccountHandlerMock) GetNonce() uint64
func (*PeerAccountHandlerMock) GetRootHash ¶
func (pahm *PeerAccountHandlerMock) GetRootHash() []byte
func (*PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal() error
func (*PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal() error
func (*PeerAccountHandlerMock) IsInterfaceNil ¶
func (pahm *PeerAccountHandlerMock) IsInterfaceNil() bool
func (*PeerAccountHandlerMock) SetCode ¶
func (pahm *PeerAccountHandlerMock) SetCode(code []byte)
func (*PeerAccountHandlerMock) SetCodeHash ¶
func (pahm *PeerAccountHandlerMock) SetCodeHash(codeHash []byte)
func (*PeerAccountHandlerMock) SetCodeHashWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) SetCodeHashWithJournal(codeHash []byte) error
func (*PeerAccountHandlerMock) SetDataTrie ¶
func (pahm *PeerAccountHandlerMock) SetDataTrie(trie data.Trie)
func (*PeerAccountHandlerMock) SetDataTrieTracker ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) SetDataTrieTracker(tracker state.DataTrieTracker)
func (*PeerAccountHandlerMock) SetNonce ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) SetNonce(nonce uint64)
func (*PeerAccountHandlerMock) SetNonceWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) SetNonceWithJournal(nonce uint64) error
func (*PeerAccountHandlerMock) SetRootHash ¶
func (pahm *PeerAccountHandlerMock) SetRootHash(rootHash []byte)
func (*PeerAccountHandlerMock) SetRootHashWithJournal ¶ added in v1.0.39
func (pahm *PeerAccountHandlerMock) SetRootHashWithJournal(rootHash []byte) error
type PeerChangesHandler ¶
type PeerChangesHandler struct { PeerChangesCalled func() []block.PeerData VerifyPeerChangesCalled func(peerChanges []block.PeerData) error }
func (*PeerChangesHandler) IsInterfaceNil ¶
func (p *PeerChangesHandler) IsInterfaceNil() bool
func (*PeerChangesHandler) PeerChanges ¶
func (p *PeerChangesHandler) PeerChanges() []block.PeerData
func (*PeerChangesHandler) VerifyPeerChanges ¶
func (p *PeerChangesHandler) VerifyPeerChanges(peerChanges []block.PeerData) error
type PoolsHolderMock ¶
type PoolsHolderMock struct {
// contains filtered or unexported fields
}
func NewPoolsHolderMock ¶
func NewPoolsHolderMock() *PoolsHolderMock
func (*PoolsHolderMock) CurrentBlockTxs ¶
func (phm *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
func (*PoolsHolderMock) Headers ¶
func (phm *PoolsHolderMock) Headers() storage.Cacher
func (*PoolsHolderMock) HeadersNonces ¶ added in v1.0.20
func (phm *PoolsHolderMock) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderMock) IsInterfaceNil ¶
func (phf *PoolsHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderMock) MetaBlocks ¶ added in v1.0.20
func (phm *PoolsHolderMock) MetaBlocks() storage.Cacher
func (*PoolsHolderMock) MetaHeadersNonces ¶ added in v1.0.20
func (phm *PoolsHolderMock) MetaHeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderMock) MiniBlocks ¶
func (phm *PoolsHolderMock) MiniBlocks() storage.Cacher
func (*PoolsHolderMock) PeerChangesBlocks ¶
func (phm *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
func (*PoolsHolderMock) RewardTransactions ¶
func (phm *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderMock) SetTransactions ¶
func (phm *PoolsHolderMock) SetTransactions(transactions dataRetriever.ShardedDataCacherNotifier)
func (*PoolsHolderMock) SetUnsignedTransactions ¶
func (phm *PoolsHolderMock) SetUnsignedTransactions(scrs dataRetriever.ShardedDataCacherNotifier)
func (*PoolsHolderMock) Transactions ¶
func (phm *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderMock) UnsignedTransactions ¶
func (phm *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type PoolsHolderStub ¶
type PoolsHolderStub struct { HeadersCalled func() storage.Cacher HeadersNoncesCalled func() dataRetriever.Uint64SyncMapCacher PeerChangesBlocksCalled func() storage.Cacher TransactionsCalled func() dataRetriever.ShardedDataCacherNotifier UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier RewardTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier MiniBlocksCalled func() storage.Cacher MetaBlocksCalled func() storage.Cacher CurrBlockTxsCalled func() dataRetriever.TransactionCacher }
func (*PoolsHolderStub) CurrentBlockTxs ¶
func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher
func (*PoolsHolderStub) Headers ¶
func (phs *PoolsHolderStub) Headers() storage.Cacher
func (*PoolsHolderStub) HeadersNonces ¶ added in v1.0.3
func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderStub) IsInterfaceNil ¶
func (phs *PoolsHolderStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderStub) MetaBlocks ¶
func (phs *PoolsHolderStub) MetaBlocks() storage.Cacher
func (*PoolsHolderStub) MiniBlocks ¶
func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
func (*PoolsHolderStub) PeerChangesBlocks ¶
func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
func (*PoolsHolderStub) RewardTransactions ¶
func (phs *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) Transactions ¶
func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) UnsignedTransactions ¶
func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
type PreProcessorContainerMock ¶
type PreProcessorContainerMock struct { GetCalled func(key block.Type) (process.PreProcessor, error) KeysCalled func() []block.Type }
func (*PreProcessorContainerMock) Add ¶
func (ppcm *PreProcessorContainerMock) Add(key block.Type, val process.PreProcessor) error
func (*PreProcessorContainerMock) AddMultiple ¶
func (ppcm *PreProcessorContainerMock) AddMultiple(keys []block.Type, preprocessors []process.PreProcessor) error
func (*PreProcessorContainerMock) Get ¶
func (ppcm *PreProcessorContainerMock) Get(key block.Type) (process.PreProcessor, error)
func (*PreProcessorContainerMock) IsInterfaceNil ¶
func (ppcm *PreProcessorContainerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PreProcessorContainerMock) Keys ¶
func (ppcm *PreProcessorContainerMock) Keys() []block.Type
func (*PreProcessorContainerMock) Len ¶
func (ppcm *PreProcessorContainerMock) Len() int
func (*PreProcessorContainerMock) Remove ¶
func (ppcm *PreProcessorContainerMock) Remove(key block.Type)
func (*PreProcessorContainerMock) Replace ¶
func (ppcm *PreProcessorContainerMock) Replace(key block.Type, val process.PreProcessor) error
type PreProcessorMock ¶
type PreProcessorMock struct { CreateBlockStartedCalled func() IsDataPreparedCalled func(requestedTxs int, haveTime func() time.Duration) error RemoveTxBlockFromPoolsCalled func(body block.Body, miniBlockPool storage.Cacher) error RestoreTxBlockIntoPoolsCalled func(body block.Body, miniBlockPool storage.Cacher) (int, error) SaveTxBlockToStorageCalled func(body block.Body) error ProcessBlockTransactionsCalled func(body block.Body, round uint64, haveTime func() bool) error RequestBlockTransactionsCalled func(body block.Body) int CreateMarshalizedDataCalled func(txHashes [][]byte) ([][]byte, error) RequestTransactionsForMiniBlockCalled func(miniBlock *block.MiniBlock) int ProcessMiniBlockCalled func(miniBlock *block.MiniBlock, haveTime func() bool, round uint64) error CreateAndProcessMiniBlocksCalled func(maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, round uint64, haveTime func() bool) (block.MiniBlockSlice, error) CreateAndProcessMiniBlockCalled func(sndShardId, dstShardId uint32, spaceRemained int, haveTime func() bool, round uint64) (*block.MiniBlock, error) GetAllCurrentUsedTxsCalled func() map[string]data.TransactionHandler }
func (*PreProcessorMock) CreateAndProcessMiniBlock ¶ added in v1.0.11
func (*PreProcessorMock) CreateAndProcessMiniBlocks ¶
func (ppm *PreProcessorMock) CreateAndProcessMiniBlocks( maxTxSpaceRemained uint32, maxMbSpaceRemained uint32, round uint64, haveTime func() bool, ) (block.MiniBlockSlice, error)
CreateAndProcessMiniBlocks creates miniblocks from storage and processes the reward transactions added into the miniblocks as long as it has time
func (*PreProcessorMock) CreateBlockStarted ¶
func (ppm *PreProcessorMock) CreateBlockStarted()
func (*PreProcessorMock) CreateMarshalizedData ¶
func (ppm *PreProcessorMock) CreateMarshalizedData(txHashes [][]byte) ([][]byte, error)
func (*PreProcessorMock) GetAllCurrentUsedTxs ¶
func (ppm *PreProcessorMock) GetAllCurrentUsedTxs() map[string]data.TransactionHandler
func (*PreProcessorMock) IsDataPrepared ¶
func (ppm *PreProcessorMock) IsDataPrepared(requestedTxs int, haveTime func() time.Duration) error
func (*PreProcessorMock) IsInterfaceNil ¶
func (ppm *PreProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PreProcessorMock) ProcessBlockTransactions ¶
func (*PreProcessorMock) ProcessMiniBlock ¶
func (*PreProcessorMock) RemoveTxBlockFromPools ¶
func (*PreProcessorMock) RequestBlockTransactions ¶
func (ppm *PreProcessorMock) RequestBlockTransactions(body block.Body) int
func (*PreProcessorMock) RequestTransactionsForMiniBlock ¶
func (ppm *PreProcessorMock) RequestTransactionsForMiniBlock(miniBlock *block.MiniBlock) int
func (*PreProcessorMock) RestoreTxBlockIntoPools ¶
func (*PreProcessorMock) SaveTxBlockToStorage ¶
func (ppm *PreProcessorMock) SaveTxBlockToStorage(body block.Body) error
type RequestHandlerMock ¶ added in v1.0.3
type RequestHandlerMock struct { RequestTransactionHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestScrHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestRewardTxHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestMiniBlockHandlerCalled func(destShardID uint32, miniblockHash []byte) RequestHeaderHandlerCalled func(destShardID uint32, hash []byte) RequestHeaderHandlerByNonceCalled func(destShardID uint32, nonce uint64) }
func (*RequestHandlerMock) IsInterfaceNil ¶ added in v1.0.16
func (rrh *RequestHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RequestHandlerMock) RequestHeader ¶ added in v1.0.3
func (rrh *RequestHandlerMock) RequestHeader(shardId uint32, hash []byte)
func (*RequestHandlerMock) RequestHeaderByNonce ¶ added in v1.0.3
func (rrh *RequestHandlerMock) RequestHeaderByNonce(destShardID uint32, nonce uint64)
func (*RequestHandlerMock) RequestMiniBlock ¶ added in v1.0.3
func (rrh *RequestHandlerMock) RequestMiniBlock(shardId uint32, miniblockHash []byte)
func (*RequestHandlerMock) RequestRewardTransactions ¶ added in v1.0.20
func (rrh *RequestHandlerMock) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
func (*RequestHandlerMock) RequestTransaction ¶ added in v1.0.3
func (rrh *RequestHandlerMock) RequestTransaction(destShardID uint32, txHashes [][]byte)
func (*RequestHandlerMock) RequestUnsignedTransactions ¶ added in v1.0.11
func (rrh *RequestHandlerMock) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
type ResolverStub ¶
type ResolverStub struct { RequestDataFromHashCalled func(hash []byte) error ProcessReceivedMessageCalled func(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error }
func (*ResolverStub) IsInterfaceNil ¶
func (rs *ResolverStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolverStub) ProcessReceivedMessage ¶
func (rs *ResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, broadcastHandler func(buffToSend []byte)) error
func (*ResolverStub) RequestDataFromHash ¶
func (rs *ResolverStub) RequestDataFromHash(hash []byte) error
type ResolversContainerStub ¶
type ResolversContainerStub struct { GetCalled func(key string) (dataRetriever.Resolver, error) AddCalled func(key string, val dataRetriever.Resolver) error ReplaceCalled func(key string, val dataRetriever.Resolver) error RemoveCalled func(key string) LenCalled func() int }
func (*ResolversContainerStub) Add ¶
func (rcs *ResolversContainerStub) Add(key string, val dataRetriever.Resolver) error
func (*ResolversContainerStub) AddMultiple ¶
func (rcs *ResolversContainerStub) AddMultiple(keys []string, resolvers []dataRetriever.Resolver) error
func (*ResolversContainerStub) Get ¶
func (rcs *ResolversContainerStub) Get(key string) (dataRetriever.Resolver, error)
func (*ResolversContainerStub) IsInterfaceNil ¶
func (rcs *ResolversContainerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ResolversContainerStub) Len ¶
func (rcs *ResolversContainerStub) Len() int
func (*ResolversContainerStub) Remove ¶
func (rcs *ResolversContainerStub) Remove(key string)
func (*ResolversContainerStub) Replace ¶
func (rcs *ResolversContainerStub) Replace(key string, val dataRetriever.Resolver) error
type ResolversFinderStub ¶
type ResolversFinderStub struct { ResolversContainerStub IntraShardResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) MetaChainResolverCalled func(baseTopic string) (dataRetriever.Resolver, error) CrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error) }
func (*ResolversFinderStub) CrossShardResolver ¶
func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) IntraShardResolver ¶
func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)
func (*ResolversFinderStub) MetaChainResolver ¶
func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)
type RewardTxProcessorMock ¶
type RewardTxProcessorMock struct {
ProcessRewardTransactionCalled func(rTx *rewardTx.RewardTx) error
}
func (*RewardTxProcessorMock) IsInterfaceNil ¶
func (scrp *RewardTxProcessorMock) IsInterfaceNil() bool
func (*RewardTxProcessorMock) ProcessRewardTransaction ¶
func (scrp *RewardTxProcessorMock) ProcessRewardTransaction(rTx *rewardTx.RewardTx) error
type RewardsHandlerMock ¶
type RewardsHandlerMock struct { RewardsValueCalled func() *big.Int CommunityPercentageCalled func() float64 LeaderPercentageCalled func() float64 BurnPercentageCalled func() float64 }
func (*RewardsHandlerMock) BurnPercentage ¶ added in v1.0.20
func (rhm *RewardsHandlerMock) BurnPercentage() float64
func (*RewardsHandlerMock) CommunityPercentage ¶ added in v1.0.20
func (rhm *RewardsHandlerMock) CommunityPercentage() float64
func (*RewardsHandlerMock) IsInterfaceNil ¶
func (rhm *RewardsHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RewardsHandlerMock) LeaderPercentage ¶
func (rhm *RewardsHandlerMock) LeaderPercentage() float64
func (*RewardsHandlerMock) RewardsValue ¶ added in v1.0.20
func (rhm *RewardsHandlerMock) RewardsValue() *big.Int
type RoundStub ¶
type RoundStub struct { IndexCalled func() int32 TimeDurationCalled func() time.Duration TimeStampCalled func() time.Time UpdateRoundCalled func(time.Time, time.Time) RemainingTimeCalled func(time.Time, time.Duration) time.Duration }
func (*RoundStub) RemainingTime ¶
func (*RoundStub) TimeDuration ¶
type RounderMock ¶
type RounderMock struct { RoundIndex int64 RoundTimeStamp time.Time RoundTimeDuration time.Duration }
func (*RounderMock) Index ¶
func (rndm *RounderMock) Index() int64
func (*RounderMock) IsInterfaceNil ¶
func (rndm *RounderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RounderMock) RemainingTime ¶
func (*RounderMock) TimeDuration ¶
func (rndm *RounderMock) TimeDuration() time.Duration
func (*RounderMock) TimeStamp ¶
func (rndm *RounderMock) TimeStamp() time.Time
func (*RounderMock) UpdateRound ¶
func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
type SCProcessorMock ¶
type SCProcessorMock struct { ComputeTransactionTypeCalled func(tx *transaction.Transaction) (process.TransactionType, error) ExecuteSmartContractTransactionCalled func(tx *transaction.Transaction, acntSrc, acntDst state.AccountHandler, round uint64) error DeploySmartContractCalled func(tx *transaction.Transaction, acntSrc state.AccountHandler, round uint64) error ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error }
func (*SCProcessorMock) ComputeTransactionType ¶
func (sc *SCProcessorMock) ComputeTransactionType( tx *transaction.Transaction, ) (process.TransactionType, error)
func (*SCProcessorMock) DeploySmartContract ¶
func (sc *SCProcessorMock) DeploySmartContract( tx *transaction.Transaction, acntSrc state.AccountHandler, round uint64, ) error
func (*SCProcessorMock) ExecuteSmartContractTransaction ¶
func (sc *SCProcessorMock) ExecuteSmartContractTransaction( tx *transaction.Transaction, acntSrc, acntDst state.AccountHandler, round uint64, ) error
func (*SCProcessorMock) IsInterfaceNil ¶
func (sc *SCProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SCProcessorMock) ProcessSmartContractResult ¶
func (sc *SCProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
type SCToProtocolStub ¶
func (*SCToProtocolStub) IsInterfaceNil ¶
func (s *SCToProtocolStub) IsInterfaceNil() bool
func (*SCToProtocolStub) UpdateProtocol ¶
func (s *SCToProtocolStub) UpdateProtocol(body block.Body, nonce uint64) error
type ScDataGetterMock ¶ added in v1.0.39
type ScDataGetterMock struct {
GetCalled func(scAddress []byte, funcName string, args ...[]byte) ([]byte, error)
}
func (*ScDataGetterMock) IsInterfaceNil ¶ added in v1.0.39
func (scd *ScDataGetterMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type ServiceContainerMock ¶
type ServiceContainerMock struct { IndexerCalled func() indexer.Indexer TPSBenchmarkCalled func() statistics.TPSBenchmark }
ServiceContainerMock is a mock implementation of the Core interface
func (*ServiceContainerMock) Indexer ¶
func (scm *ServiceContainerMock) Indexer() indexer.Indexer
Indexer returns a mock implementation for core.Indexer
func (*ServiceContainerMock) IsInterfaceNil ¶
func (scm *ServiceContainerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ServiceContainerMock) TPSBenchmark ¶
func (scm *ServiceContainerMock) TPSBenchmark() statistics.TPSBenchmark
TPSBenchmark returns a mock implementation for core.TPSBenchmark
type ShardIdHasMapMock ¶
type ShardIdHasMapMock struct { LoadCalled func(shardId uint32) ([]byte, bool) StoreCalled func(shardId uint32, hash []byte) RangeCalled func(f func(shardId uint32, hash []byte) bool) DeleteCalled func(shardId uint32) }
func (*ShardIdHasMapMock) Delete ¶
func (sihsm *ShardIdHasMapMock) Delete(shardId uint32)
func (*ShardIdHasMapMock) IsInterfaceNil ¶
func (sihsm *ShardIdHasMapMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardIdHasMapMock) Load ¶
func (sihsm *ShardIdHasMapMock) Load(shardId uint32) ([]byte, bool)
func (*ShardIdHasMapMock) Range ¶
func (sihsm *ShardIdHasMapMock) Range(f func(shardId uint32, hash []byte) bool)
func (*ShardIdHasMapMock) Store ¶
func (sihsm *ShardIdHasMapMock) Store(shardId uint32, hash []byte)
type ShardedDataStub ¶
type ShardedDataStub struct { RegisterHandlerCalled func(func(key []byte)) ShardDataStoreCalled func(cacheId string) (c storage.Cacher) AddDataCalled func(key []byte, data interface{}, cacheId string) SearchFirstDataCalled func(key []byte) (value interface{}, ok bool) RemoveDataCalled func(key []byte, cacheId string) RemoveDataFromAllShardsCalled func(key []byte) MergeShardStoresCalled func(sourceCacheId, destCacheId string) MoveDataCalled func(sourceCacheId, destCacheId string, key [][]byte) ClearCalled func() ClearShardStoreCalled func(cacheId string) RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheId string) CreateShardStoreCalled func(destCacheId string) }
func (*ShardedDataStub) AddData ¶
func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)
func (*ShardedDataStub) Clear ¶
func (sd *ShardedDataStub) Clear()
func (*ShardedDataStub) ClearShardStore ¶
func (sd *ShardedDataStub) ClearShardStore(cacheId string)
func (*ShardedDataStub) CreateShardStore ¶
func (sd *ShardedDataStub) CreateShardStore(cacheId string)
func (*ShardedDataStub) IsInterfaceNil ¶
func (sd *ShardedDataStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ShardedDataStub) MergeShardStores ¶
func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)
func (*ShardedDataStub) MoveData ¶ added in v1.0.3
func (sd *ShardedDataStub) MoveData(sourceCacheId, destCacheId string, key [][]byte)
func (*ShardedDataStub) RegisterHandler ¶
func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))
func (*ShardedDataStub) RemoveData ¶
func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)
func (*ShardedDataStub) RemoveDataFromAllShards ¶
func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)
func (*ShardedDataStub) RemoveSetOfDataFromPool ¶
func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)
func (*ShardedDataStub) SearchFirstData ¶
func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)
func (*ShardedDataStub) ShardDataStore ¶
func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)
type SignerMock ¶
type SignerMock struct { SignStub func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyStub func(public crypto.PublicKey, msg []byte, sig []byte) error }
func (*SignerMock) IsInterfaceNil ¶
func (s *SignerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SignerMock) Sign ¶
func (s *SignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
type SingleSignKeyGenMock ¶
type SingleSignKeyGenMock struct { PublicKeyFromByteArrayCalled func(b []byte) (crypto.PublicKey, error) SuiteCalled func() crypto.Suite }
func (*SingleSignKeyGenMock) GeneratePair ¶
func (sskgm *SingleSignKeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
func (*SingleSignKeyGenMock) IsInterfaceNil ¶
func (sskgm *SingleSignKeyGenMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SingleSignKeyGenMock) PrivateKeyFromByteArray ¶
func (sskgm *SingleSignKeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
func (*SingleSignKeyGenMock) PublicKeyFromByteArray ¶
func (sskgm *SingleSignKeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
func (*SingleSignKeyGenMock) Suite ¶
func (sskgm *SingleSignKeyGenMock) Suite() crypto.Suite
type SingleSignPublicKey ¶
func (*SingleSignPublicKey) IsInterfaceNil ¶
func (sspk *SingleSignPublicKey) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SingleSignPublicKey) Point ¶
func (sspk *SingleSignPublicKey) Point() crypto.Point
func (*SingleSignPublicKey) Suite ¶
func (sspk *SingleSignPublicKey) Suite() crypto.Suite
func (*SingleSignPublicKey) ToByteArray ¶
func (sspk *SingleSignPublicKey) ToByteArray() ([]byte, error)
type SmartContractResultsProcessorMock ¶
type SmartContractResultsProcessorMock struct {
ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error
}
func (*SmartContractResultsProcessorMock) IsInterfaceNil ¶
func (scrp *SmartContractResultsProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SmartContractResultsProcessorMock) ProcessSmartContractResult ¶
func (scrp *SmartContractResultsProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
type SpecialAddressHandlerMock ¶ added in v1.0.20
type SpecialAddressHandlerMock struct { ElrondCommunityAddressCalled func() []byte LeaderAddressCalled func() []byte BurnAddressCalled func() []byte ShardIdForAddressCalled func([]byte) (uint32, error) AdrConv state.AddressConverter ShardCoordinator sharding.Coordinator NodesCoordinator sharding.NodesCoordinator // contains filtered or unexported fields }
func NewSpecialAddressHandlerMock ¶ added in v1.0.20
func NewSpecialAddressHandlerMock( addrConv state.AddressConverter, shardCoordinator sharding.Coordinator, nodesCoordinator sharding.NodesCoordinator, ) *SpecialAddressHandlerMock
func (*SpecialAddressHandlerMock) BurnAddress ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) BurnAddress() []byte
func (*SpecialAddressHandlerMock) ClearMetaConsensusData ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) ClearMetaConsensusData()
func (*SpecialAddressHandlerMock) ConsensusMetaRewardData ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) ConsensusMetaRewardData() []*data.ConsensusRewardData
func (*SpecialAddressHandlerMock) ConsensusShardRewardData ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) ConsensusShardRewardData() *data.ConsensusRewardData
func (*SpecialAddressHandlerMock) ElrondCommunityAddress ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) ElrondCommunityAddress() []byte
func (*SpecialAddressHandlerMock) Epoch ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) Epoch() uint32
func (*SpecialAddressHandlerMock) IsCurrentNodeInConsensus ¶ added in v1.0.28
func (sh *SpecialAddressHandlerMock) IsCurrentNodeInConsensus() bool
func (*SpecialAddressHandlerMock) IsInterfaceNil ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SpecialAddressHandlerMock) LeaderAddress ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) LeaderAddress() []byte
func (*SpecialAddressHandlerMock) Round ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) Round() uint64
func (*SpecialAddressHandlerMock) SetElrondCommunityAddress ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) SetElrondCommunityAddress(elrond []byte)
func (*SpecialAddressHandlerMock) SetMetaConsensusData ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) SetMetaConsensusData(randomness []byte, round uint64, epoch uint32) error
func (*SpecialAddressHandlerMock) SetShardConsensusData ¶ added in v1.0.20
func (*SpecialAddressHandlerMock) ShardIdForAddress ¶ added in v1.0.20
func (sh *SpecialAddressHandlerMock) ShardIdForAddress(addr []byte) (uint32, error)
type StorerStub ¶
type StorerStub struct { PutCalled func(key, data []byte) error GetCalled func(key []byte) ([]byte, error) HasCalled func(key []byte) error RemoveCalled func(key []byte) error ClearCacheCalled func() DestroyUnitCalled func() error }
func (*StorerStub) ClearCache ¶
func (ss *StorerStub) ClearCache()
func (*StorerStub) DestroyUnit ¶
func (ss *StorerStub) DestroyUnit() error
func (*StorerStub) Has ¶
func (ss *StorerStub) Has(key []byte) error
func (*StorerStub) IsInterfaceNil ¶
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) Put ¶
func (ss *StorerStub) Put(key, data []byte) error
func (*StorerStub) Remove ¶
func (ss *StorerStub) Remove(key []byte) error
type SyncStarterStub ¶
type SyncStarterStub struct {
SyncBlockCalled func() error
}
func (*SyncStarterStub) SyncBlock ¶
func (sss *SyncStarterStub) SyncBlock() error
type SyncTimerMock ¶
type SyncTimerMock struct { ClockOffsetCalled func() time.Duration CurrentTimeCalled func() time.Time }
SyncTimerMock mocks the implementation for a SyncTimer
func (SyncTimerMock) ClockOffset ¶
func (stm SyncTimerMock) ClockOffset() time.Duration
ClockOffset method gets the current time offset
func (SyncTimerMock) CurrentTime ¶
func (stm SyncTimerMock) CurrentTime() time.Time
CurrentTime method gets the current time on which is added the current offset
func (SyncTimerMock) FormattedCurrentTime ¶
func (stm SyncTimerMock) FormattedCurrentTime() string
FormattedCurrentTime method gets the formatted current time on which is added a given offset
func (*SyncTimerMock) IsInterfaceNil ¶
func (stm *SyncTimerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (SyncTimerMock) StartSync ¶
func (stm SyncTimerMock) StartSync()
StartSync method does the time synchronization at every syncPeriod time elapsed. This should be started as a go routine
type TemporaryAccountsHandlerMock ¶
type TemporaryAccountsHandlerMock struct { AddTempAccountCalled func(address []byte, balance *big.Int, nonce uint64) CleanTempAccountsCalled func() TempAccountCalled func(address []byte) state.AccountHandler }
func (*TemporaryAccountsHandlerMock) AddTempAccount ¶
func (tahm *TemporaryAccountsHandlerMock) AddTempAccount(address []byte, balance *big.Int, nonce uint64)
func (*TemporaryAccountsHandlerMock) CleanTempAccounts ¶
func (tahm *TemporaryAccountsHandlerMock) CleanTempAccounts()
func (*TemporaryAccountsHandlerMock) IsInterfaceNil ¶
func (tahm *TemporaryAccountsHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TemporaryAccountsHandlerMock) TempAccount ¶
func (tahm *TemporaryAccountsHandlerMock) TempAccount(address []byte) state.AccountHandler
type TopicHandlerStub ¶
type TopicHandlerStub struct { HasTopicCalled func(name string) bool CreateTopicCalled func(name string, createChannelForTopic bool) error RegisterMessageProcessorCalled func(topic string, handler p2p.MessageProcessor) error }
func (*TopicHandlerStub) CreateTopic ¶
func (ths *TopicHandlerStub) CreateTopic(name string, createChannelForTopic bool) error
func (*TopicHandlerStub) HasTopic ¶
func (ths *TopicHandlerStub) HasTopic(name string) bool
func (*TopicHandlerStub) IsInterfaceNil ¶
func (ths *TopicHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TopicHandlerStub) RegisterMessageProcessor ¶
func (ths *TopicHandlerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error
type TransactionCoordinatorMock ¶
type TransactionCoordinatorMock struct { ComputeTransactionTypeCalled func(tx data.TransactionHandler) (process.TransactionType, error) RequestMiniBlocksCalled func(header data.HeaderHandler) RequestBlockTransactionsCalled func(body block.Body) IsDataPreparedForProcessingCalled func(haveTime func() time.Duration) error SaveBlockDataToStorageCalled func(body block.Body) error RestoreBlockDataFromStorageCalled func(body block.Body) (int, error) RemoveBlockDataFromPoolCalled func(body block.Body) error ProcessBlockTransactionCalled func(body block.Body, round uint64, haveTime func() time.Duration) error CreateBlockStartedCalled func() CreateMbsAndProcessCrossShardTransactionsDstMeCalled func(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, maxTxRemaining uint32, maxMbRemaining uint32, round uint64, haveTime func() bool) (block.MiniBlockSlice, uint32, bool) CreateMbsAndProcessTransactionsFromMeCalled func(maxTxRemaining uint32, maxMbRemaining uint32, round uint64, haveTime func() bool) block.MiniBlockSlice CreateMarshalizedDataCalled func(body block.Body) (map[uint32]block.MiniBlockSlice, map[string][][]byte) GetAllCurrentUsedTxsCalled func(blockType block.Type) map[string]data.TransactionHandler VerifyCreatedBlockTransactionsCalled func(body block.Body) error }
func (*TransactionCoordinatorMock) ComputeTransactionType ¶
func (tcm *TransactionCoordinatorMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
func (*TransactionCoordinatorMock) CreateBlockStarted ¶
func (tcm *TransactionCoordinatorMock) CreateBlockStarted()
func (*TransactionCoordinatorMock) CreateMarshalizedData ¶
func (tcm *TransactionCoordinatorMock) CreateMarshalizedData(body block.Body) (map[uint32]block.MiniBlockSlice, map[string][][]byte)
func (*TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe ¶
func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, maxTxRemaining uint32, maxMbRemaining uint32, round uint64, haveTime func() bool) (block.MiniBlockSlice, uint32, bool)
func (*TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe ¶
func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe(maxTxRemaining uint32, maxMbRemaining uint32, round uint64, haveTime func() bool) block.MiniBlockSlice
func (*TransactionCoordinatorMock) GetAllCurrentUsedTxs ¶
func (tcm *TransactionCoordinatorMock) GetAllCurrentUsedTxs(blockType block.Type) map[string]data.TransactionHandler
func (*TransactionCoordinatorMock) IsDataPreparedForProcessing ¶
func (tcm *TransactionCoordinatorMock) IsDataPreparedForProcessing(haveTime func() time.Duration) error
func (*TransactionCoordinatorMock) IsInterfaceNil ¶
func (tcm *TransactionCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TransactionCoordinatorMock) ProcessBlockTransaction ¶
func (*TransactionCoordinatorMock) RemoveBlockDataFromPool ¶
func (tcm *TransactionCoordinatorMock) RemoveBlockDataFromPool(body block.Body) error
func (*TransactionCoordinatorMock) RequestBlockTransactions ¶
func (tcm *TransactionCoordinatorMock) RequestBlockTransactions(body block.Body)
func (*TransactionCoordinatorMock) RequestMiniBlocks ¶
func (tcm *TransactionCoordinatorMock) RequestMiniBlocks(header data.HeaderHandler)
func (*TransactionCoordinatorMock) RestoreBlockDataFromStorage ¶
func (tcm *TransactionCoordinatorMock) RestoreBlockDataFromStorage(body block.Body) (int, error)
func (*TransactionCoordinatorMock) SaveBlockDataToStorage ¶
func (tcm *TransactionCoordinatorMock) SaveBlockDataToStorage(body block.Body) error
func (*TransactionCoordinatorMock) VerifyCreatedBlockTransactions ¶
func (tcm *TransactionCoordinatorMock) VerifyCreatedBlockTransactions(body block.Body) error
type TransactionInterceptorMock ¶
type TransactionInterceptorMock struct { IsChecked bool IsVerified bool RcvShardVal uint32 SndShardVal uint32 IsAddressedToOtherShardsVal bool AddrConverter state.AddressConverter Tx *transaction.Transaction // contains filtered or unexported fields }
func (*TransactionInterceptorMock) AddressConverter ¶
func (tim *TransactionInterceptorMock) AddressConverter() state.AddressConverter
func (*TransactionInterceptorMock) Check ¶
func (tim *TransactionInterceptorMock) Check() bool
func (*TransactionInterceptorMock) GetTransaction ¶
func (tim *TransactionInterceptorMock) GetTransaction() *transaction.Transaction
func (*TransactionInterceptorMock) Hash ¶
func (tim *TransactionInterceptorMock) Hash() []byte
func (*TransactionInterceptorMock) ID ¶
func (tim *TransactionInterceptorMock) ID() string
func (*TransactionInterceptorMock) IsAddressedToOtherShards ¶
func (tim *TransactionInterceptorMock) IsAddressedToOtherShards() bool
func (*TransactionInterceptorMock) IsInterfaceNil ¶
func (tim *TransactionInterceptorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TransactionInterceptorMock) RcvShard ¶
func (tim *TransactionInterceptorMock) RcvShard() uint32
func (*TransactionInterceptorMock) SetAddressConverter ¶
func (tim *TransactionInterceptorMock) SetAddressConverter(converter state.AddressConverter)
func (*TransactionInterceptorMock) SetHash ¶
func (tim *TransactionInterceptorMock) SetHash(hash []byte)
func (*TransactionInterceptorMock) SndShard ¶
func (tim *TransactionInterceptorMock) SndShard() uint32
func (*TransactionInterceptorMock) VerifySig ¶
func (tim *TransactionInterceptorMock) VerifySig() bool
type TransactionPoolMock ¶
type TransactionPoolMock struct { RegisterTransactionHandlerCalled func(transactionHandler func(txHash []byte)) RemoveTransactionsFromPoolCalled func(txHashes [][]byte, destShardID uint32) MiniPoolTxStoreCalled func(shardID uint32) (c storage.Cacher) }
func (*TransactionPoolMock) MiniPoolTxStore ¶
func (tpm *TransactionPoolMock) MiniPoolTxStore(shardID uint32) (c storage.Cacher)
func (*TransactionPoolMock) RegisterTransactionHandler ¶
func (tpm *TransactionPoolMock) RegisterTransactionHandler(transactionHandler func(txHash []byte))
func (*TransactionPoolMock) RemoveTransactionsFromPool ¶
func (tpm *TransactionPoolMock) RemoveTransactionsFromPool(txHashes [][]byte, destShardID uint32)
type TxForCurrentBlockStub ¶
type TxForCurrentBlockStub struct { CleanCalled func() GetTxCalled func(txHash []byte) (data.TransactionHandler, error) AddTxCalled func(txHash []byte, tx data.TransactionHandler) }
func (*TxForCurrentBlockStub) AddTx ¶
func (t *TxForCurrentBlockStub) AddTx(txHash []byte, tx data.TransactionHandler)
func (*TxForCurrentBlockStub) Clean ¶
func (t *TxForCurrentBlockStub) Clean()
func (*TxForCurrentBlockStub) GetTx ¶
func (t *TxForCurrentBlockStub) GetTx(txHash []byte) (data.TransactionHandler, error)
func (*TxForCurrentBlockStub) IsInterfaceNil ¶
func (t *TxForCurrentBlockStub) IsInterfaceNil() bool
type TxPoolsCleanerMock ¶
type TxPoolsCleanerMock struct { CleanCalled func(duration time.Duration) (bool, error) NumRemovedTxsCalled func() uint64 }
func (*TxPoolsCleanerMock) Clean ¶
func (tpc *TxPoolsCleanerMock) Clean(duration time.Duration) (bool, error)
Clean will check if in pools exits transactions with nonce low that transaction sender account nonce and if tx have low nonce will be removed from pools
func (*TxPoolsCleanerMock) IsInterfaceNil ¶
func (tpc *TxPoolsCleanerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TxPoolsCleanerMock) NumRemovedTxs ¶
func (tpc *TxPoolsCleanerMock) NumRemovedTxs() uint64
NumRemovedTxs will return the number of removed txs from pools
type TxProcessorMock ¶
type TxProcessorMock struct { ProcessTransactionCalled func(transaction *transaction.Transaction, round uint64) error SetBalancesToTrieCalled func(accBalance map[string]*big.Int) (rootHash []byte, err error) ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error }
func (*TxProcessorMock) IsInterfaceNil ¶
func (etm *TxProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TxProcessorMock) ProcessSmartContractResult ¶
func (etm *TxProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
func (*TxProcessorMock) ProcessTransaction ¶
func (etm *TxProcessorMock) ProcessTransaction(transaction *transaction.Transaction, round uint64) error
func (*TxProcessorMock) SetBalancesToTrie ¶
type TxTypeHandlerMock ¶
type TxTypeHandlerMock struct {
ComputeTransactionTypeCalled func(tx data.TransactionHandler) (process.TransactionType, error)
}
func (*TxTypeHandlerMock) ComputeTransactionType ¶
func (th *TxTypeHandlerMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
func (*TxTypeHandlerMock) IsInterfaceNil ¶
func (th *TxTypeHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type TxValidatorHandlerStub ¶
type TxValidatorHandlerStub struct { SenderShardIdCalled func() uint32 NonceCalled func() uint64 SenderAddressCalled func() state.AddressContainer TotalValueCalled func() *big.Int }
func (*TxValidatorHandlerStub) Nonce ¶
func (tvhs *TxValidatorHandlerStub) Nonce() uint64
func (*TxValidatorHandlerStub) SenderAddress ¶
func (tvhs *TxValidatorHandlerStub) SenderAddress() state.AddressContainer
func (*TxValidatorHandlerStub) SenderShardId ¶
func (tvhs *TxValidatorHandlerStub) SenderShardId() uint32
func (*TxValidatorHandlerStub) TotalValue ¶ added in v1.0.16
func (tvhs *TxValidatorHandlerStub) TotalValue() *big.Int
type TxValidatorStub ¶
type TxValidatorStub struct { CheckTxValidityCalled func(txValidatorHandler process.TxValidatorHandler) error RejectedTxsCalled func() uint64 }
func (*TxValidatorStub) CheckTxValidity ¶
func (t *TxValidatorStub) CheckTxValidity(txValidatorHandler process.TxValidatorHandler) error
func (*TxValidatorStub) IsInterfaceNil ¶
func (t *TxValidatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TxValidatorStub) NumRejectedTxs ¶ added in v1.0.16
func (t *TxValidatorStub) NumRejectedTxs() uint64
type Uint64ByteSliceConverterMock ¶
type Uint64ByteSliceConverterMock struct { ToByteSliceCalled func(uint64) []byte ToUint64Called func([]byte) (uint64, error) }
Uint64ByteSliceConverterMock converts byte slice to/from uint64
func (*Uint64ByteSliceConverterMock) IsInterfaceNil ¶
func (u *Uint64ByteSliceConverterMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*Uint64ByteSliceConverterMock) ToByteSlice ¶
func (u *Uint64ByteSliceConverterMock) ToByteSlice(p uint64) []byte
ToByteSlice is a mock implementation for Uint64ByteSliceConverter
type Uint64SyncMapCacherStub ¶
type Uint64SyncMapCacherStub struct { ClearCalled func() GetCalled func(nonce uint64) (dataRetriever.ShardIdHashMap, bool) MergeCalled func(nonce uint64, src dataRetriever.ShardIdHashMap) RemoveCalled func(nonce uint64, shardId uint32) RegisterHandlerCalled func(handler func(nonce uint64, shardId uint32, value []byte)) HasCalled func(nonce uint64, shardId uint32) bool }
func (*Uint64SyncMapCacherStub) Clear ¶
func (usmcs *Uint64SyncMapCacherStub) Clear()
func (*Uint64SyncMapCacherStub) Get ¶
func (usmcs *Uint64SyncMapCacherStub) Get(nonce uint64) (dataRetriever.ShardIdHashMap, bool)
func (*Uint64SyncMapCacherStub) Has ¶
func (usmcs *Uint64SyncMapCacherStub) Has(nonce uint64, shardId uint32) bool
func (*Uint64SyncMapCacherStub) IsInterfaceNil ¶
func (usmcs *Uint64SyncMapCacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*Uint64SyncMapCacherStub) Merge ¶
func (usmcs *Uint64SyncMapCacherStub) Merge(nonce uint64, src dataRetriever.ShardIdHashMap)
func (*Uint64SyncMapCacherStub) RegisterHandler ¶
func (usmcs *Uint64SyncMapCacherStub) RegisterHandler(handler func(nonce uint64, shardId uint32, value []byte))
func (*Uint64SyncMapCacherStub) Remove ¶
func (usmcs *Uint64SyncMapCacherStub) Remove(nonce uint64, shardId uint32)
type UnsignedTxHandlerMock ¶
type UnsignedTxHandlerMock struct { CleanProcessedUtxsCalled func() ProcessTransactionFeeCalled func(cost *big.Int) CreateAllUTxsCalled func() []data.TransactionHandler VerifyCreatedUTxsCalled func() error AddTxFeeFromBlockCalled func(tx data.TransactionHandler) }
func (*UnsignedTxHandlerMock) AddRewardTxFromBlock ¶
func (ut *UnsignedTxHandlerMock) AddRewardTxFromBlock(tx data.TransactionHandler)
func (*UnsignedTxHandlerMock) CleanProcessedUTxs ¶
func (ut *UnsignedTxHandlerMock) CleanProcessedUTxs()
func (*UnsignedTxHandlerMock) CreateAllUTxs ¶
func (ut *UnsignedTxHandlerMock) CreateAllUTxs() []data.TransactionHandler
func (*UnsignedTxHandlerMock) IsInterfaceNil ¶
func (ut *UnsignedTxHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*UnsignedTxHandlerMock) ProcessTransactionFee ¶
func (ut *UnsignedTxHandlerMock) ProcessTransactionFee(cost *big.Int)
func (*UnsignedTxHandlerMock) VerifyCreatedUTxs ¶
func (ut *UnsignedTxHandlerMock) VerifyCreatedUTxs() error
type VMContainerMock ¶
type VMContainerMock struct { GetCalled func(key []byte) (vmcommon.VMExecutionHandler, error) AddCalled func(key []byte, val vmcommon.VMExecutionHandler) error AddMultipleCalled func(keys [][]byte, preprocessors []vmcommon.VMExecutionHandler) error ReplaceCalled func(key []byte, val vmcommon.VMExecutionHandler) error RemoveCalled func(key []byte) LenCalled func() int KeysCalled func() [][]byte }
func (*VMContainerMock) Add ¶
func (V *VMContainerMock) Add(key []byte, val vmcommon.VMExecutionHandler) error
func (*VMContainerMock) AddMultiple ¶
func (V *VMContainerMock) AddMultiple(keys [][]byte, vms []vmcommon.VMExecutionHandler) error
func (*VMContainerMock) Get ¶
func (V *VMContainerMock) Get(key []byte) (vmcommon.VMExecutionHandler, error)
func (*VMContainerMock) IsInterfaceNil ¶
func (V *VMContainerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*VMContainerMock) Keys ¶
func (V *VMContainerMock) Keys() [][]byte
func (*VMContainerMock) Len ¶
func (V *VMContainerMock) Len() int
func (*VMContainerMock) Remove ¶
func (V *VMContainerMock) Remove(key []byte)
func (*VMContainerMock) Replace ¶
func (V *VMContainerMock) Replace(key []byte, val vmcommon.VMExecutionHandler) error
type VMExecutionHandlerStub ¶
type VMExecutionHandlerStub struct { G0CreateCalled func(input *vmcommon.ContractCreateInput) (*big.Int, error) G0CallCalled func(input *vmcommon.ContractCallInput) (*big.Int, error) RunSmartContractCreateCalled func(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error) RunSmartContractCallCalled func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error) }
func (*VMExecutionHandlerStub) G0Call ¶ added in v1.0.3
func (vm *VMExecutionHandlerStub) G0Call(input *vmcommon.ContractCallInput) (*big.Int, error)
G0Call yields the initial gas cost of calling an existing smart contract
func (*VMExecutionHandlerStub) G0Create ¶ added in v1.0.3
func (vm *VMExecutionHandlerStub) G0Create(input *vmcommon.ContractCreateInput) (*big.Int, error)
G0Create yields the initial gas cost of creating a new smart contract
func (*VMExecutionHandlerStub) RunSmartContractCall ¶
func (vm *VMExecutionHandlerStub) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
RunSmartContractCall Computes the result of a smart contract call and how the system must change after the execution
func (*VMExecutionHandlerStub) RunSmartContractCreate ¶
func (vm *VMExecutionHandlerStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
Computes how a smart contract creation should be performed
type ValidatorMock ¶
type ValidatorMock struct {
// contains filtered or unexported fields
}
func NewValidatorMock ¶
func (*ValidatorMock) Address ¶
func (vm *ValidatorMock) Address() []byte
func (*ValidatorMock) PubKey ¶
func (vm *ValidatorMock) PubKey() []byte
func (*ValidatorMock) Rating ¶ added in v1.0.39
func (vm *ValidatorMock) Rating() int32
func (*ValidatorMock) Stake ¶ added in v1.0.39
func (vm *ValidatorMock) Stake() *big.Int
type ValidatorSettingsStub ¶
type ValidatorSettingsStub struct { }
func (*ValidatorSettingsStub) IsInterfaceNil ¶
func (v *ValidatorSettingsStub) IsInterfaceNil() bool
func (*ValidatorSettingsStub) StakeValue ¶ added in v1.0.39
func (v *ValidatorSettingsStub) StakeValue() *big.Int
func (*ValidatorSettingsStub) UnBoundPeriod ¶ added in v1.0.39
func (v *ValidatorSettingsStub) UnBoundPeriod() uint64
type ValidatorStatisticsProcessorMock ¶ added in v1.0.39
type ValidatorStatisticsProcessorMock struct { UpdatePeerStateCalled func(header data.HeaderHandler) ([]byte, error) RevertPeerStateCalled func(header data.HeaderHandler) error IsInterfaceNilCalled func() bool RevertPeerStateToSnapshotCalled func(snapshot int) error CommitCalled func() ([]byte, error) }
func (*ValidatorStatisticsProcessorMock) Commit ¶ added in v1.0.39
func (vsp *ValidatorStatisticsProcessorMock) Commit() ([]byte, error)
func (*ValidatorStatisticsProcessorMock) IsInterfaceNil ¶ added in v1.0.39
func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool
func (*ValidatorStatisticsProcessorMock) RevertPeerState ¶ added in v1.0.39
func (vsp *ValidatorStatisticsProcessorMock) RevertPeerState(header data.HeaderHandler) error
func (*ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot ¶ added in v1.0.39
func (vsp *ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot(snapshot int) error
func (*ValidatorStatisticsProcessorMock) UpdatePeerState ¶ added in v1.0.39
func (vsp *ValidatorStatisticsProcessorMock) UpdatePeerState(header data.HeaderHandler) ([]byte, error)
Source Files ¶
- accountTrackerStub.go
- accountWrapperFake.go
- accountsStub.go
- addressConverterFake.go
- addressConverterMock.go
- addressConverterStub.go
- addressMock.go
- appStatusHandlerStub.go
- argumentsParserMock.go
- blackListHandlerStub.go
- blockChainHookHandlerMock.go
- blockChainMock.go
- blockProcessorMock.go
- blockSizeThrottlerStub.go
- cacherMock.go
- cacherStub.go
- chainStorerMock.go
- coordinatorStub.go
- feeHandlerStub.go
- forkDetectorMock.go
- getHdrHandlerStub.go
- hasherMock.go
- hasherStub.go
- headerHandlerStub.go
- headerResolverMock.go
- headerValidatorStub.go
- indexerMock.go
- interceptedDataFactoryStub.go
- interceptedDataStub.go
- interceptedTxHandlerStub.go
- interceptorProcessorStub.go
- interceptorStub.go
- interceptorThrottlerStub.go
- interimProcessorContainerMock.go
- intermediateTransactionHandlerMock.go
- marshalizerMock.go
- marshalizerStub.go
- messageHandlerStub.go
- messengerStub.go
- metaPoolsHolderFake.go
- metaPoolsHolderStub.go
- miniBlocksCompacterMock.go
- miniBlocksResolverMock.go
- multiSigMock.go
- multipleShardsCoordinatorMock.go
- networkConnectionWatcherStub.go
- nilTxValidator.go
- nodesCoordinatorMock.go
- nonceHashConverterMock.go
- objectsContainerStub.go
- oneShardCoordinatorMock.go
- p2pMessageMock.go
- peerAccountHandlerMock.go
- peerChangesHandler.go
- peerProcessorMock.go
- poolsHolderMock.go
- poolsHolderStub.go
- poolscleanerMock.go
- preProcessorContainerMock.go
- preprocessorMock.go
- requestHandlerMock.go
- resolverStub.go
- resolversContainerStub.go
- resolversFinderStub.go
- rewardTxProcessorMock.go
- rewardsHandlerMock.go
- roundStub.go
- rounderMock.go
- scDataGetterMock.go
- scProcessorMock.go
- scToProtocolHandlerMock.go
- serviceContainerMock.go
- shardIdHashMapMock.go
- shardedDataStub.go
- signerMock.go
- singleSignMock.go
- smartContractResultProcessorMock.go
- specialAddressHandlerMock.go
- storerStub.go
- syncStarterStub.go
- syncTimerMock.go
- temporaryAccountsHandlerMock.go
- topicHandlerStub.go
- topicMessageHandlerStub.go
- transactionCoordinatorMock.go
- transactionInterceptorMock.go
- transactionPoolMock.go
- txForCurrentBlockMock.go
- txProcessorMock.go
- txTypeHandlerMock.go
- txValidatorHandlerStub.go
- txValidatorStub.go
- uint64ByteSliceConverterMock.go
- uint64SyncMapCacherStub.go
- unsignedTxHandlerMock.go
- validatorMock.go
- validatorSettingsStub.go
- vmContainerMock.go
- vmExecutionHandlerStub.go