Documentation ¶
Index ¶
- func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
- type AccountsDBSyncerStub
- type AccountsDBSyncersStub
- func (a *AccountsDBSyncersStub) Add(key string, val update.AccountsDBSyncer) error
- func (a *AccountsDBSyncersStub) AddMultiple(keys []string, interceptors []update.AccountsDBSyncer) error
- func (a *AccountsDBSyncersStub) Get(key string) (update.AccountsDBSyncer, error)
- func (a *AccountsDBSyncersStub) IsInterfaceNil() bool
- func (a *AccountsDBSyncersStub) Len() int
- func (a *AccountsDBSyncersStub) Remove(key string)
- func (a *AccountsDBSyncersStub) Replace(key string, val update.AccountsDBSyncer) error
- type AccountsStub
- func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
- func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) Commit() ([]byte, error)
- func (as *AccountsStub) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
- func (as *AccountsStub) GetExistingAccount(address []byte) (state.AccountHandler, error)
- func (as *AccountsStub) IsInterfaceNil() bool
- func (as *AccountsStub) IsPruningEnabled() bool
- func (as *AccountsStub) JournalLen() int
- func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
- func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) RecreateAllTries(rootHash []byte) (map[string]data.Trie, error)
- func (as *AccountsStub) RecreateTrie(rootHash []byte) error
- func (as *AccountsStub) RemoveAccount(address []byte) error
- func (as *AccountsStub) RevertToSnapshot(snapshot int) error
- func (as *AccountsStub) RootHash() ([]byte, error)
- func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
- func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
- func (as *AccountsStub) SnapshotState(rootHash []byte)
- type AddressMock
- 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{}, _ int) (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{}, _ int) (evicted bool)
- func (cm *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cm *CacherMock) Remove(key []byte)
- func (cm *CacherMock) UnRegisterHandler(string)
- 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{}, sizeInBytes int) (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{}, sizeInBytes int) (evicted bool)
- func (cs *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
- func (cs *CacherStub) Remove(key []byte)
- func (cs *CacherStub) UnRegisterHandler(id string)
- type ChainStorerMock
- func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
- func (bc *ChainStorerMock) CloseAll() error
- func (bc *ChainStorerMock) Destroy() error
- func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
- func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
- func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
- func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
- func (bc *ChainStorerMock) IsInterfaceNil() bool
- func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
- func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
- type CoordinatorStub
- func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
- func (coordinator *CoordinatorStub) ComputeId(address []byte) uint32
- func (coordinator *CoordinatorStub) IsInterfaceNil() bool
- func (coordinator *CoordinatorStub) NumberOfShards() uint32
- func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
- func (coordinator *CoordinatorStub) SelfId() uint32
- type EpochHandlerStub
- type EpochStartNotifierStub
- func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
- func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
- func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)
- func (esnm *EpochStartNotifierStub) RegisterForEpochChangeConfirmed(handler func(epoch uint32))
- func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
- func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
- type EpochStartPendingMiniBlocksSyncHandlerMock
- func (ep *EpochStartPendingMiniBlocksSyncHandlerMock) GetMiniBlocks() (map[string]*block.MiniBlock, error)
- func (ep *EpochStartPendingMiniBlocksSyncHandlerMock) IsInterfaceNil() bool
- func (ep *EpochStartPendingMiniBlocksSyncHandlerMock) SyncPendingMiniBlocksFromMeta(epochStart *block.MetaBlock, unFinished map[string]*block.MetaBlock, ...) error
- type EpochStartTriesSyncHandlerMock
- type EpochStartTriggerStub
- func (e *EpochStartTriggerStub) Epoch() uint32
- func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64
- func (e *EpochStartTriggerStub) EpochStartMetaHdrHash() []byte
- func (e *EpochStartTriggerStub) EpochStartRound() uint64
- func (e *EpochStartTriggerStub) ForceEpochStart(round uint64) error
- func (e *EpochStartTriggerStub) GetRoundsPerEpoch() uint64
- func (e *EpochStartTriggerStub) IsEpochStart() bool
- func (e *EpochStartTriggerStub) IsInterfaceNil() bool
- func (e *EpochStartTriggerStub) NotifyAll(_ data.HeaderHandler)
- func (e *EpochStartTriggerStub) ReceivedHeader(header data.HeaderHandler)
- func (e *EpochStartTriggerStub) Revert()
- func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)
- func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)
- func (e *EpochStartTriggerStub) SetProcessed(header data.HeaderHandler)
- func (e *EpochStartTriggerStub) SetRoundsPerEpoch(_ uint64)
- func (e *EpochStartTriggerStub) SetTrigger(_ epochStart.TriggerHandler)
- func (e *EpochStartTriggerStub) Update(round uint64)
- type ExportFactoryHandlerStub
- type ExportHandlerStub
- type HardForkBlockProcessor
- type HasherMock
- type HasherStub
- type HeaderSyncHandlerStub
- func (hsh *HeaderSyncHandlerStub) GetEpochStartMetaBlock() (*block.MetaBlock, error)
- func (hsh *HeaderSyncHandlerStub) GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
- func (hsh *HeaderSyncHandlerStub) IsInterfaceNil() bool
- func (hsh *HeaderSyncHandlerStub) SyncUnFinishedMetaHeaders(epoch uint32) error
- type HeaderValidatorStub
- type HeadersCacherStub
- func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
- func (hcs *HeadersCacherStub) Clear()
- func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
- func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
- func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int
- func (hcs *HeadersCacherStub) IsInterfaceNil() bool
- func (hcs *HeadersCacherStub) Len() int
- func (hcs *HeadersCacherStub) MaxSize() int
- func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
- func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
- func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
- func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
- type ImportHandlerStub
- func (ihs *ImportHandlerStub) GetAccountsDBForShard(shardID uint32) state.AccountsAdapter
- func (ihs *ImportHandlerStub) GetHardForkMetaBlock() *block.MetaBlock
- func (ihs *ImportHandlerStub) GetMiniBlocks() map[string]*block.MiniBlock
- func (ihs *ImportHandlerStub) GetTransactions() map[string]data.TransactionHandler
- func (ihs *ImportHandlerStub) GetValidatorAccountsDB() state.AccountsAdapter
- func (ihs *ImportHandlerStub) ImportAll() error
- func (ihs *ImportHandlerStub) IsInterfaceNil() bool
- type MarshalizerFake
- type MarshalizerMock
- type MultiFileReaderStub
- type MultiFileWriterStub
- type PendingTransactionProcessorStub
- type PendingTransactionsSyncHandlerMock
- func (et *PendingTransactionsSyncHandlerMock) GetTransactions() (map[string]data.TransactionHandler, error)
- func (et *PendingTransactionsSyncHandlerMock) IsInterfaceNil() bool
- func (et *PendingTransactionsSyncHandlerMock) SyncPendingTransactionsFor(miniBlocks map[string]*block.MiniBlock, epoch uint32, ctx context.Context) error
- type PoolsHolderMock
- func (phm *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
- func (phm *PoolsHolderMock) Headers() dataRetriever.HeadersPool
- func (phm *PoolsHolderMock) IsInterfaceNil() bool
- 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) TrieNodes() storage.Cacher
- func (phm *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- type PubkeyConverterStub
- type RequestHandlerStub
- func (rhs *RequestHandlerStub) GetNumPeersToQuery(key string) (int, int, error)
- func (rhs *RequestHandlerStub) IsInterfaceNil() bool
- func (rhs *RequestHandlerStub) RequestInterval() time.Duration
- func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)
- func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)
- func (rhs *RequestHandlerStub) RequestMiniBlock(shardId uint32, miniblockHash []byte)
- func (rhs *RequestHandlerStub) RequestMiniBlocks(_ uint32, _ [][]byte)
- func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestShardHeader(shardId uint32, hash []byte)
- func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardId uint32, nonce uint64)
- func (rhs *RequestHandlerStub) RequestStartOfEpochMetaBlock(epoch uint32)
- func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) RequestTrieNodes(_ uint32, _ [][]byte, _ string)
- func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
- func (rhs *RequestHandlerStub) SetEpoch(_ uint32)
- func (rhs *RequestHandlerStub) SetNumPeersToQuery(key string, intra int, cross int) error
- type RewardTxProcessorMock
- type SCProcessorMock
- func (sc *SCProcessorMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
- func (sc *SCProcessorMock) DeploySmartContract(tx data.TransactionHandler, acntSrc state.UserAccountHandler) error
- func (sc *SCProcessorMock) ExecuteSmartContractTransaction(tx data.TransactionHandler, acntSrc, acntDst state.UserAccountHandler) error
- func (sc *SCProcessorMock) IsInterfaceNil() bool
- func (sc *SCProcessorMock) ProcessIfError(acntSnd state.UserAccountHandler, txHash []byte, tx data.TransactionHandler, ...) error
- func (sc *SCProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
- type StorageManagerStub
- func (sms *StorageManagerStub) CancelPrune([]byte, data.TriePruningIdentifier)
- func (sms *StorageManagerStub) Database() data.DBWriteCacher
- func (sms *StorageManagerStub) EnterSnapshotMode()
- func (sms *StorageManagerStub) ExitSnapshotMode()
- func (sms *StorageManagerStub) GetDbThatContainsHash(d []byte) data.DBWriteCacher
- func (sms *StorageManagerStub) IsInterfaceNil() bool
- func (sms *StorageManagerStub) IsPruningEnabled() bool
- func (sms *StorageManagerStub) MarkForEviction(d []byte, m data.ModifiedHashes) error
- func (sms *StorageManagerStub) Prune([]byte, data.TriePruningIdentifier)
- func (sms *StorageManagerStub) SetCheckpoint([]byte)
- func (sms *StorageManagerStub) TakeSnapshot([]byte)
- type StorerMock
- func (sm *StorerMock) ClearCache()
- func (sm *StorerMock) Close() error
- func (sm *StorerMock) DestroyUnit() error
- func (sm *StorerMock) Get(key []byte) ([]byte, error)
- func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (sm *StorerMock) Has(_ []byte) error
- func (sm *StorerMock) HasInEpoch(key []byte, _ uint32) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, data []byte) error
- func (sm *StorerMock) Remove(_ []byte) error
- func (sm *StorerMock) SearchFirst(_ []byte) ([]byte, error)
- type StorerStub
- func (ss *StorerStub) ClearCache()
- func (ss *StorerStub) Close() error
- func (ss *StorerStub) DestroyUnit() error
- func (ss *StorerStub) Get(key []byte) ([]byte, error)
- func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
- func (ss *StorerStub) Has(key []byte) error
- func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
- func (ss *StorerStub) IsInterfaceNil() bool
- func (ss *StorerStub) Put(key, data []byte) error
- func (ss *StorerStub) Remove(key []byte) error
- func (ss *StorerStub) SearchFirst(_ []byte) ([]byte, error)
- type SyncStateStub
- func (sss *SyncStateStub) GetAllMiniBlocks() (map[string]*block.MiniBlock, error)
- func (sss *SyncStateStub) GetAllTransactions() (map[string]data.TransactionHandler, error)
- func (sss *SyncStateStub) GetAllTries() (map[string]data.Trie, error)
- func (sss *SyncStateStub) GetEpochStartMetaBlock() (*block.MetaBlock, error)
- func (sss *SyncStateStub) GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
- func (sss *SyncStateStub) IsInterfaceNil() bool
- func (sss *SyncStateStub) SyncAllState(epoch uint32) error
- type TransactionCoordinatorMock
- func (tcm *TransactionCoordinatorMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
- func (tcm *TransactionCoordinatorMock) CreateBlockStarted()
- func (tcm *TransactionCoordinatorMock) CreateMarshalizedData(body *block.Body) map[string][][]byte
- func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, ...) (block.MiniBlockSlice, uint32, bool, error)
- func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe(haveTime func() bool) block.MiniBlockSlice
- func (tcm *TransactionCoordinatorMock) CreatePostProcessMiniBlocks() block.MiniBlockSlice
- func (tcm *TransactionCoordinatorMock) CreateReceiptsHash() ([]byte, error)
- 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, 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(hdr data.HeaderHandler, body *block.Body) error
- type TrieFactoryStub
- type TrieStub
- func (ts *TrieStub) AppendToOldHashes(hashes [][]byte)
- func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (ts *TrieStub) ClosePersister() error
- func (ts *TrieStub) Commit() error
- func (ts *TrieStub) Database() data.DBWriteCacher
- func (ts *TrieStub) Delete(key []byte) error
- func (ts *TrieStub) EnterSnapshotMode()
- func (ts *TrieStub) ExitSnapshotMode()
- func (ts *TrieStub) Get(key []byte) ([]byte, error)
- func (ts *TrieStub) GetAllLeaves() (map[string][]byte, error)
- func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
- func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, uint64, error)
- func (ts *TrieStub) IsInterfaceNil() bool
- func (ts *TrieStub) IsPruningEnabled() bool
- func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)
- func (ts *TrieStub) ResetOldHashes() [][]byte
- func (ts *TrieStub) Root() ([]byte, error)
- func (ts *TrieStub) SetCheckpoint(_ []byte)
- func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)
- func (ts *TrieStub) Snapshot() error
- func (ts *TrieStub) String() string
- func (ts *TrieStub) TakeSnapshot(_ []byte)
- func (ts *TrieStub) Update(key, value []byte) error
- type TrieSyncersStub
- func (tss *TrieSyncersStub) Add(key string, val update.TrieSyncer) error
- func (tss *TrieSyncersStub) AddMultiple(keys []string, interceptors []update.TrieSyncer) error
- func (tss *TrieSyncersStub) Get(key string) (update.TrieSyncer, error)
- func (tss *TrieSyncersStub) IsInterfaceNil() bool
- func (tss *TrieSyncersStub) Len() int
- func (tss *TrieSyncersStub) Remove(key string)
- func (tss *TrieSyncersStub) Replace(key string, val update.TrieSyncer) error
- func (tss *TrieSyncersStub) StartSyncing(rootHash []byte, ctx context.Context) error
- func (tss *TrieSyncersStub) Trie() data.Trie
- type TriesHolderMock
- func (thm *TriesHolderMock) Get(key []byte) data.Trie
- func (thm *TriesHolderMock) GetAll() []data.Trie
- func (thm *TriesHolderMock) IsInterfaceNil() bool
- func (thm *TriesHolderMock) Put(key []byte, trie data.Trie)
- func (thm *TriesHolderMock) Replace(key []byte, trie data.Trie)
- func (thm *TriesHolderMock) Reset()
- type TxProcessorMock
- func (etm *TxProcessorMock) IsInterfaceNil() bool
- func (etm *TxProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
- func (etm *TxProcessorMock) ProcessTransaction(transaction *transaction.Transaction) error
- func (etm *TxProcessorMock) SetBalancesToTrie(accBalance map[string]*big.Int) (rootHash []byte, err error)
- type Uint64ByteSliceConverterStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewOneShardCoordinatorMock ¶
func NewOneShardCoordinatorMock() *oneShardCoordinatorMock
NewOneShardCoordinatorMock -
Types ¶
type AccountsDBSyncerStub ¶
type AccountsDBSyncerStub struct { GetSyncedTriesCalled func() map[string]data.Trie SyncAccountsCalled func(rootHash []byte) error }
AccountsDBSyncerStub -
func (*AccountsDBSyncerStub) GetSyncedTries ¶
func (a *AccountsDBSyncerStub) GetSyncedTries() map[string]data.Trie
GetSyncedTries -
func (*AccountsDBSyncerStub) IsInterfaceNil ¶
func (a *AccountsDBSyncerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AccountsDBSyncerStub) SyncAccounts ¶
func (a *AccountsDBSyncerStub) SyncAccounts(rootHash []byte) error
SyncAccounts -
type AccountsDBSyncersStub ¶
type AccountsDBSyncersStub struct { GetCalled func(key string) (update.AccountsDBSyncer, error) AddCalled func(key string, val update.AccountsDBSyncer) error AddMultipleCalled func(keys []string, interceptors []update.AccountsDBSyncer) error ReplaceCalled func(key string, val update.AccountsDBSyncer) error RemoveCalled func(key string) LenCalled func() int StartSyncingCalled func(rootHash []byte) error TrieCalled func() data.Trie }
AccountsDBSyncersStub -
func (*AccountsDBSyncersStub) Add ¶
func (a *AccountsDBSyncersStub) Add(key string, val update.AccountsDBSyncer) error
Add -
func (*AccountsDBSyncersStub) AddMultiple ¶
func (a *AccountsDBSyncersStub) AddMultiple(keys []string, interceptors []update.AccountsDBSyncer) error
AddMultiple -
func (*AccountsDBSyncersStub) Get ¶
func (a *AccountsDBSyncersStub) Get(key string) (update.AccountsDBSyncer, error)
Get -
func (*AccountsDBSyncersStub) IsInterfaceNil ¶
func (a *AccountsDBSyncersStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AccountsDBSyncersStub) Replace ¶
func (a *AccountsDBSyncersStub) Replace(key string, val update.AccountsDBSyncer) error
Replace -
type AccountsStub ¶
type AccountsStub struct { AddJournalEntryCalled func(je state.JournalEntry) GetExistingAccountCalled func(address []byte) (state.AccountHandler, error) LoadAccountCalled func(address []byte) (state.AccountHandler, error) SaveAccountCalled func(account state.AccountHandler) error RemoveAccountCalled func(address []byte) error CommitCalled func() ([]byte, error) JournalLenCalled func() int RevertToSnapshotCalled func(snapshot int) error RootHashCalled func() ([]byte, error) RecreateTrieCalled func(rootHash []byte) error PruneTrieCalled func(rootHash []byte, identifier data.TriePruningIdentifier) CancelPruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) SnapshotStateCalled func(rootHash []byte) SetStateCheckpointCalled func(rootHash []byte) IsPruningEnabledCalled func() bool GetAllLeavesCalled func(rootHash []byte) (map[string][]byte, error) RecreateAllTriesCalled func(rootHash []byte) (map[string]data.Trie, error) }
AccountsStub -
func (*AccountsStub) AddJournalEntry ¶
func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)
AddJournalEntry -
func (*AccountsStub) CancelPrune ¶
func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune -
func (*AccountsStub) GetAllLeaves ¶
func (as *AccountsStub) GetAllLeaves(rootHash []byte) (map[string][]byte, error)
GetAllLeaves -
func (*AccountsStub) GetExistingAccount ¶
func (as *AccountsStub) GetExistingAccount(address []byte) (state.AccountHandler, error)
GetExistingAccount -
func (*AccountsStub) IsInterfaceNil ¶
func (as *AccountsStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AccountsStub) IsPruningEnabled ¶
func (as *AccountsStub) IsPruningEnabled() bool
IsPruningEnabled -
func (*AccountsStub) LoadAccount ¶
func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
LoadAccount -
func (*AccountsStub) PruneTrie ¶
func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
PruneTrie -
func (*AccountsStub) RecreateAllTries ¶
RecreateAllTries -
func (*AccountsStub) RecreateTrie ¶
func (as *AccountsStub) RecreateTrie(rootHash []byte) error
RecreateTrie -
func (*AccountsStub) RemoveAccount ¶
func (as *AccountsStub) RemoveAccount(address []byte) error
RemoveAccount -
func (*AccountsStub) RevertToSnapshot ¶
func (as *AccountsStub) RevertToSnapshot(snapshot int) error
RevertToSnapshot -
func (*AccountsStub) SaveAccount ¶
func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
SaveAccount -
func (*AccountsStub) SetStateCheckpoint ¶
func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)
SetStateCheckpoint -
func (*AccountsStub) SnapshotState ¶
func (as *AccountsStub) SnapshotState(rootHash []byte)
SnapshotState -
type AddressMock ¶ added in v1.0.115
type AddressMock struct {
// contains filtered or unexported fields
}
AddressMock implements a mock address generator used in testing
func NewAddressMock ¶ added in v1.0.115
func NewAddressMock() *AddressMock
NewAddressMock generates a new address
func (*AddressMock) Bytes ¶ added in v1.0.115
func (address *AddressMock) Bytes() []byte
Bytes returns the address' bytes
func (*AddressMock) IsInterfaceNil ¶ added in v1.0.115
func (address *AddressMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
CacherMock -
func (*CacherMock) HasOrAdd ¶
func (cm *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (bool, bool)
HasOrAdd -
func (*CacherMock) IsInterfaceNil ¶
func (cm *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Peek ¶
func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherMock) Put ¶
func (cm *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
Put -
func (*CacherMock) RegisterHandler ¶
func (cm *CacherMock) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherMock) UnRegisterHandler ¶ added in v1.0.126
func (cm *CacherMock) UnRegisterHandler(string)
UnRegisterHandler -
type CacherStub ¶
type CacherStub struct { ClearCalled func() PutCalled func(key []byte, value interface{}, sizeInBytes int) (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{}, sizeInBytes int) (ok, evicted bool) RemoveCalled func(key []byte) RemoveOldestCalled func() KeysCalled func() [][]byte LenCalled func() int MaxSizeCalled func() int RegisterHandlerCalled func(func(key []byte, val interface{})) UnRegisterHandlerCalled func(id string) }
CacherStub -
func (*CacherStub) HasOrAdd ¶
func (cs *CacherStub) HasOrAdd(key []byte, value interface{}, sizeInBytes int) (ok, evicted bool)
HasOrAdd -
func (*CacherStub) IsInterfaceNil ¶
func (cs *CacherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherStub) Peek ¶
func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherStub) Put ¶
func (cs *CacherStub) Put(key []byte, value interface{}, sizeInBytes int) (evicted bool)
Put -
func (*CacherStub) RegisterHandler ¶
func (cs *CacherStub) RegisterHandler(handler func(key []byte, value interface{}), _ string)
RegisterHandler -
func (*CacherStub) UnRegisterHandler ¶ added in v1.0.126
func (cs *CacherStub) UnRegisterHandler(id string)
UnRegisterHandler -
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 ChainStorer interface
func (*ChainStorerMock) AddStorer ¶
func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)
AddStorer will add a new storer to the chain map
func (*ChainStorerMock) Destroy ¶
func (bc *ChainStorerMock) Destroy() error
Destroy removes the underlying files/resources used by the storage service
func (*ChainStorerMock) Get ¶
func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
Get returns the value for the given key if found in the selected storage unit, nil otherwise. It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
func (*ChainStorerMock) GetAll ¶
func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
GetAll gets all the elements with keys in the keys array, from the selected storage unit It can report an error if the provided unit type is not supported, if there is a missing key in the unit, or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) GetStorer ¶
func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer
GetStorer returns the storer from the chain map or nil if the storer was not found
func (*ChainStorerMock) Has ¶
func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) error
Has returns true if the key is found in the selected Unit or false otherwise It can return an error if the provided unit type is not supported or if the underlying implementation of the storage unit reports an error.
func (*ChainStorerMock) IsInterfaceNil ¶
func (bc *ChainStorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChainStorerMock) Put ¶
func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error
Put stores the key, value pair in the selected storage unit It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error
func (*ChainStorerMock) SetEpochForPutOperation ¶ added in v1.0.109
func (bc *ChainStorerMock) SetEpochForPutOperation(epoch uint32)
SetEpochForPutOperation won't do anything
type CoordinatorStub ¶ added in v1.0.115
type CoordinatorStub struct { NumberOfShardsCalled func() uint32 ComputeIdCalled func(address []byte) uint32 SelfIdCalled func() uint32 SameShardCalled func(firstAddress, secondAddress []byte) bool CommunicationIdentifierCalled func(destShardID uint32) string }
CoordinatorStub -
func (*CoordinatorStub) CommunicationIdentifier ¶ added in v1.0.115
func (coordinator *CoordinatorStub) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (*CoordinatorStub) ComputeId ¶ added in v1.0.115
func (coordinator *CoordinatorStub) ComputeId(address []byte) uint32
ComputeId -
func (*CoordinatorStub) IsInterfaceNil ¶ added in v1.0.115
func (coordinator *CoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CoordinatorStub) NumberOfShards ¶ added in v1.0.115
func (coordinator *CoordinatorStub) NumberOfShards() uint32
NumberOfShards -
func (*CoordinatorStub) SameShard ¶ added in v1.0.115
func (coordinator *CoordinatorStub) SameShard(firstAddress, secondAddress []byte) bool
SameShard -
func (*CoordinatorStub) SelfId ¶ added in v1.0.115
func (coordinator *CoordinatorStub) SelfId() uint32
SelfId -
type EpochHandlerStub ¶ added in v1.0.120
type EpochHandlerStub struct {
MetaEpochCalled func() uint32
}
EpochHandlerStub -
func (*EpochHandlerStub) IsInterfaceNil ¶ added in v1.0.120
func (ehs *EpochHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochHandlerStub) MetaEpoch ¶ added in v1.0.120
func (ehs *EpochHandlerStub) MetaEpoch() uint32
MetaEpoch -
type EpochStartNotifierStub ¶ added in v1.0.120
type EpochStartNotifierStub struct { RegisterHandlerCalled func(handler epochStart.ActionHandler) UnregisterHandlerCalled func(handler epochStart.ActionHandler) NotifyAllCalled func(hdr data.HeaderHandler) NotifyAllPrepareCalled func(hdr data.HeaderHandler, body data.BodyHandler) NotifyEpochChangeConfirmedCalled func(epoch uint32) RegisterForEpochChangeConfirmedCalled func(handler func(epoch uint32)) // contains filtered or unexported fields }
EpochStartNotifierStub -
func (*EpochStartNotifierStub) IsInterfaceNil ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartNotifierStub) NotifyAll ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
NotifyAll -
func (*EpochStartNotifierStub) NotifyAllPrepare ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
NotifyAllPrepare -
func (*EpochStartNotifierStub) NotifyEpochChangeConfirmed ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)
NotifyEpochChangeConfirmed -
func (*EpochStartNotifierStub) RegisterForEpochChangeConfirmed ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) RegisterForEpochChangeConfirmed(handler func(epoch uint32))
RegisterForEpochChangeConfirmed -
func (*EpochStartNotifierStub) RegisterHandler ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
RegisterHandler -
func (*EpochStartNotifierStub) UnregisterHandler ¶ added in v1.0.120
func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
UnregisterHandler -
type EpochStartPendingMiniBlocksSyncHandlerMock ¶
type EpochStartPendingMiniBlocksSyncHandlerMock struct { SyncPendingMiniBlocksFromMetaCalled func(epochStart *block.MetaBlock, unFinished map[string]*block.MetaBlock, ctx context.Context) error GetMiniBlocksCalled func() (map[string]*block.MiniBlock, error) }
EpochStartPendingMiniBlocksSyncHandlerMock -
func (*EpochStartPendingMiniBlocksSyncHandlerMock) GetMiniBlocks ¶
func (ep *EpochStartPendingMiniBlocksSyncHandlerMock) GetMiniBlocks() (map[string]*block.MiniBlock, error)
GetMiniBlocks -
func (*EpochStartPendingMiniBlocksSyncHandlerMock) IsInterfaceNil ¶
func (ep *EpochStartPendingMiniBlocksSyncHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
type EpochStartTriesSyncHandlerMock ¶
type EpochStartTriesSyncHandlerMock struct { SyncTriesFromCalled func(meta *block.MetaBlock, waitTime time.Duration) error GetTriesCalled func() (map[string]data.Trie, error) }
EpochStartTriesSyncHandlerMock -
func (*EpochStartTriesSyncHandlerMock) GetTries ¶
func (es *EpochStartTriesSyncHandlerMock) GetTries() (map[string]data.Trie, error)
GetTries -
func (*EpochStartTriesSyncHandlerMock) IsInterfaceNil ¶
func (es *EpochStartTriesSyncHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartTriesSyncHandlerMock) SyncTriesFrom ¶
func (es *EpochStartTriesSyncHandlerMock) SyncTriesFrom(meta *block.MetaBlock, waitTime time.Duration) error
SyncTriesFrom -
type EpochStartTriggerStub ¶
type EpochStartTriggerStub struct { ForceEpochStartCalled func(round uint64) error IsEpochStartCalled func() bool EpochCalled func() uint32 ReceivedHeaderCalled func(handler data.HeaderHandler) UpdateCalled func(round uint64) ProcessedCalled func(header data.HeaderHandler) EpochStartRoundCalled func() uint64 EpochStartMetaHdrHashCalled func() []byte }
EpochStartTriggerStub -
func (*EpochStartTriggerStub) EpochFinalityAttestingRound ¶
func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64
EpochFinalityAttestingRound -
func (*EpochStartTriggerStub) EpochStartMetaHdrHash ¶
func (e *EpochStartTriggerStub) EpochStartMetaHdrHash() []byte
EpochStartMetaHdrHash -
func (*EpochStartTriggerStub) EpochStartRound ¶
func (e *EpochStartTriggerStub) EpochStartRound() uint64
EpochStartRound -
func (*EpochStartTriggerStub) ForceEpochStart ¶
func (e *EpochStartTriggerStub) ForceEpochStart(round uint64) error
ForceEpochStart -
func (*EpochStartTriggerStub) GetRoundsPerEpoch ¶
func (e *EpochStartTriggerStub) GetRoundsPerEpoch() uint64
GetRoundsPerEpoch -
func (*EpochStartTriggerStub) IsEpochStart ¶
func (e *EpochStartTriggerStub) IsEpochStart() bool
IsEpochStart -
func (*EpochStartTriggerStub) IsInterfaceNil ¶
func (e *EpochStartTriggerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartTriggerStub) NotifyAll ¶
func (e *EpochStartTriggerStub) NotifyAll(_ data.HeaderHandler)
NotifyAll -
func (*EpochStartTriggerStub) ReceivedHeader ¶
func (e *EpochStartTriggerStub) ReceivedHeader(header data.HeaderHandler)
ReceivedHeader -
func (*EpochStartTriggerStub) SetCurrentEpochStartRound ¶
func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)
SetCurrentEpochStartRound -
func (*EpochStartTriggerStub) SetFinalityAttestingRound ¶
func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)
SetFinalityAttestingRound -
func (*EpochStartTriggerStub) SetProcessed ¶
func (e *EpochStartTriggerStub) SetProcessed(header data.HeaderHandler)
SetProcessed -
func (*EpochStartTriggerStub) SetRoundsPerEpoch ¶
func (e *EpochStartTriggerStub) SetRoundsPerEpoch(_ uint64)
SetRoundsPerEpoch -
func (*EpochStartTriggerStub) SetTrigger ¶
func (e *EpochStartTriggerStub) SetTrigger(_ epochStart.TriggerHandler)
SetTrigger -
func (*EpochStartTriggerStub) Update ¶
func (e *EpochStartTriggerStub) Update(round uint64)
Update -
type ExportFactoryHandlerStub ¶ added in v1.0.120
type ExportFactoryHandlerStub struct {
CreateCalled func() (update.ExportHandler, error)
}
ExportFactoryHandlerStub -
func (*ExportFactoryHandlerStub) Create ¶ added in v1.0.120
func (e *ExportFactoryHandlerStub) Create() (update.ExportHandler, error)
Create -
func (*ExportFactoryHandlerStub) IsInterfaceNil ¶ added in v1.0.120
func (e *ExportFactoryHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type ExportHandlerStub ¶ added in v1.0.120
ExportHandlerStub -
func (*ExportHandlerStub) ExportAll ¶ added in v1.0.120
func (e *ExportHandlerStub) ExportAll(epoch uint32) error
ExportAll -
func (*ExportHandlerStub) IsInterfaceNil ¶ added in v1.0.120
func (e *ExportHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type HardForkBlockProcessor ¶ added in v1.0.115
type HardForkBlockProcessor struct { CreateNewBlockCalled func( chainID string, round uint64, nonce uint64, epoch uint32, ) (data.HeaderHandler, data.BodyHandler, error) }
HardForkBlockProcessor --
func (*HardForkBlockProcessor) CreateNewBlock ¶ added in v1.0.115
func (hfbp *HardForkBlockProcessor) CreateNewBlock(chainID string, round uint64, nonce uint64, epoch uint32) (data.HeaderHandler, data.BodyHandler, error)
CreateNewBlock --
func (*HardForkBlockProcessor) IsInterfaceNil ¶ added in v1.0.115
func (hfbp *HardForkBlockProcessor) IsInterfaceNil() bool
IsInterfaceNil returns true if underlying object is nil
type HasherMock ¶
type HasherMock struct { }
HasherMock that will be used for testing
func (HasherMock) Compute ¶
func (sha HasherMock) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (HasherMock) EmptyHash ¶
func (sha HasherMock) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (HasherMock) IsInterfaceNil ¶
func (sha HasherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HasherStub ¶
HasherStub -
func (*HasherStub) IsInterfaceNil ¶
func (hash *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HeaderSyncHandlerStub ¶
type HeaderSyncHandlerStub struct { SyncUnFinishedMetaHeadersCalled func(epoch uint32) error GetEpochStartMetaBlockCalled func() (*block.MetaBlock, error) GetUnfinishedMetaBlocksCalled func() (map[string]*block.MetaBlock, error) }
HeaderSyncHandlerStub -
func (*HeaderSyncHandlerStub) GetEpochStartMetaBlock ¶
func (hsh *HeaderSyncHandlerStub) GetEpochStartMetaBlock() (*block.MetaBlock, error)
GetEpochStartMetaBlock -
func (*HeaderSyncHandlerStub) GetUnfinishedMetaBlocks ¶
func (hsh *HeaderSyncHandlerStub) GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
GetUnfinishedMetaBlocks -
func (*HeaderSyncHandlerStub) IsInterfaceNil ¶
func (hsh *HeaderSyncHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeaderSyncHandlerStub) SyncUnFinishedMetaHeaders ¶
func (hsh *HeaderSyncHandlerStub) SyncUnFinishedMetaHeaders(epoch uint32) error
SyncUnFinishedMetaHeaders -
type HeaderValidatorStub ¶
type HeaderValidatorStub struct {
IsHeaderConstructionValidCalled func(currHdr, prevHdr data.HeaderHandler) error
}
HeaderValidatorStub -
func (*HeaderValidatorStub) IsHeaderConstructionValid ¶
func (hvs *HeaderValidatorStub) IsHeaderConstructionValid(currHdr, prevHdr data.HeaderHandler) error
IsHeaderConstructionValid -
func (*HeaderValidatorStub) IsInterfaceNil ¶
func (hvs *HeaderValidatorStub) IsInterfaceNil() bool
IsInterfaceNil returns if underlying object is true
type HeadersCacherStub ¶
type HeadersCacherStub struct { AddCalled func(headerHash []byte, header data.HeaderHandler) RemoveHeaderByHashCalled func(headerHash []byte) RemoveHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32) GetHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error) GetHeaderByHashCalled func(hash []byte) (data.HeaderHandler, error) ClearCalled func() RegisterHandlerCalled func(handler func(header data.HeaderHandler, shardHeaderHash []byte)) NoncesCalled func(shardId uint32) []uint64 LenCalled func() int MaxSizeCalled func() int GetNumHeadersCalled func(shardId uint32) int }
HeadersCacherStub -
func (*HeadersCacherStub) AddHeader ¶
func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
AddHeader -
func (*HeadersCacherStub) GetHeaderByHash ¶
func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
GetHeaderByHash -
func (*HeadersCacherStub) GetHeadersByNonceAndShardId ¶
func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
GetHeadersByNonceAndShardId -
func (*HeadersCacherStub) GetNumHeaders ¶
func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int
GetNumHeaders -
func (*HeadersCacherStub) IsInterfaceNil ¶
func (hcs *HeadersCacherStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeadersCacherStub) Nonces ¶
func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
Nonces -
func (*HeadersCacherStub) RegisterHandler ¶
func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
RegisterHandler -
func (*HeadersCacherStub) RemoveHeaderByHash ¶
func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
RemoveHeaderByHash -
func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId ¶
func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
RemoveHeaderByNonceAndShardId -
type ImportHandlerStub ¶ added in v1.0.115
type ImportHandlerStub struct { ImportAllCalled func() error GetValidatorAccountsDBCalled func() state.AccountsAdapter GetMiniBlocksCalled func() map[string]*block.MiniBlock GetHardForkMetaBlockCalled func() *block.MetaBlock GetTransactionsCalled func() map[string]data.TransactionHandler GetAccountsDBForShardCalled func(shardID uint32) state.AccountsAdapter }
ImportHandlerStub -
func (*ImportHandlerStub) GetAccountsDBForShard ¶ added in v1.0.115
func (ihs *ImportHandlerStub) GetAccountsDBForShard(shardID uint32) state.AccountsAdapter
GetAccountsDBForShard -
func (*ImportHandlerStub) GetHardForkMetaBlock ¶ added in v1.0.115
func (ihs *ImportHandlerStub) GetHardForkMetaBlock() *block.MetaBlock
GetHardForkMetaBlock -
func (*ImportHandlerStub) GetMiniBlocks ¶ added in v1.0.115
func (ihs *ImportHandlerStub) GetMiniBlocks() map[string]*block.MiniBlock
GetMiniBlocks -
func (*ImportHandlerStub) GetTransactions ¶ added in v1.0.115
func (ihs *ImportHandlerStub) GetTransactions() map[string]data.TransactionHandler
GetTransactions -
func (*ImportHandlerStub) GetValidatorAccountsDB ¶ added in v1.0.115
func (ihs *ImportHandlerStub) GetValidatorAccountsDB() state.AccountsAdapter
GetValidatorAccountsDB -
func (*ImportHandlerStub) ImportAll ¶ added in v1.0.115
func (ihs *ImportHandlerStub) ImportAll() error
ImportAll -
func (*ImportHandlerStub) IsInterfaceNil ¶ added in v1.0.115
func (ihs *ImportHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type MarshalizerFake ¶
type MarshalizerFake struct {
Fail bool
}
MarshalizerFake that will be used for testing
func (*MarshalizerFake) IsInterfaceNil ¶
func (mm *MarshalizerFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerFake) Marshal ¶
func (mm *MarshalizerFake) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerFake) Unmarshal ¶
func (mm *MarshalizerFake) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type MarshalizerMock ¶
type MarshalizerMock struct {
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 MultiFileReaderStub ¶
type MultiFileReaderStub struct { GetFileNamesCalled func() []string ReadNextItemCalled func(fileName string) (string, []byte, error) FinishCalled func() CloseFileCalled func(fileName string) }
MultiFileReaderStub -
func (*MultiFileReaderStub) CloseFile ¶ added in v1.0.115
func (mf *MultiFileReaderStub) CloseFile(fileName string)
CloseFile -
func (*MultiFileReaderStub) GetFileNames ¶
func (mf *MultiFileReaderStub) GetFileNames() []string
GetFileNames -
func (*MultiFileReaderStub) IsInterfaceNil ¶
func (mf *MultiFileReaderStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MultiFileReaderStub) ReadNextItem ¶
func (mf *MultiFileReaderStub) ReadNextItem(fileName string) (string, []byte, error)
ReadNextItem -
type MultiFileWriterStub ¶
type MultiFileWriterStub struct { NewFileCalled func(name string) error WriteCalled func(fileName string, key string, value []byte) error FinishCalled func() CloseFileCalled func(fileName string) }
MultiFileWriterStub -
func (*MultiFileWriterStub) CloseFile ¶ added in v1.0.115
func (mfw *MultiFileWriterStub) CloseFile(fileName string)
CloseFile -
func (*MultiFileWriterStub) IsInterfaceNil ¶
func (mfw *MultiFileWriterStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*MultiFileWriterStub) NewFile ¶
func (mfw *MultiFileWriterStub) NewFile(name string) error
NewFile -
type PendingTransactionProcessorStub ¶ added in v1.0.115
type PendingTransactionProcessorStub struct { ProcessTransactionsDstMeCalled func(mapTxs map[string]data.TransactionHandler) (block.MiniBlockSlice, error) RootHashCalled func() ([]byte, error) }
PendingTransactionProcessorStub -
func (*PendingTransactionProcessorStub) IsInterfaceNil ¶ added in v1.0.115
func (ptps *PendingTransactionProcessorStub) IsInterfaceNil() bool
IsInterfaceNil --
func (*PendingTransactionProcessorStub) ProcessTransactionsDstMe ¶ added in v1.0.115
func (ptps *PendingTransactionProcessorStub) ProcessTransactionsDstMe(mapTxs map[string]data.TransactionHandler) (block.MiniBlockSlice, error)
ProcessTransactionsDstMe -
func (*PendingTransactionProcessorStub) RootHash ¶ added in v1.0.115
func (ptps *PendingTransactionProcessorStub) RootHash() ([]byte, error)
RootHash --
type PendingTransactionsSyncHandlerMock ¶
type PendingTransactionsSyncHandlerMock struct { SyncPendingTransactionsForCalled func(miniBlocks map[string]*block.MiniBlock, epoch uint32, ctx context.Context) error GetTransactionsCalled func() (map[string]data.TransactionHandler, error) }
PendingTransactionsSyncHandlerMock -
func (*PendingTransactionsSyncHandlerMock) GetTransactions ¶
func (et *PendingTransactionsSyncHandlerMock) GetTransactions() (map[string]data.TransactionHandler, error)
GetTransactions -
func (*PendingTransactionsSyncHandlerMock) IsInterfaceNil ¶
func (et *PendingTransactionsSyncHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*PendingTransactionsSyncHandlerMock) SyncPendingTransactionsFor ¶
func (et *PendingTransactionsSyncHandlerMock) SyncPendingTransactionsFor(miniBlocks map[string]*block.MiniBlock, epoch uint32, ctx context.Context) error
SyncPendingTransactionsFor -
type PoolsHolderMock ¶
type PoolsHolderMock struct {
// contains filtered or unexported fields
}
PoolsHolderMock -
func (*PoolsHolderMock) CurrentBlockTxs ¶
func (phm *PoolsHolderMock) CurrentBlockTxs() dataRetriever.TransactionCacher
CurrentBlockTxs -
func (*PoolsHolderMock) Headers ¶
func (phm *PoolsHolderMock) Headers() dataRetriever.HeadersPool
Headers -
func (*PoolsHolderMock) IsInterfaceNil ¶
func (phm *PoolsHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PoolsHolderMock) MiniBlocks ¶
func (phm *PoolsHolderMock) MiniBlocks() storage.Cacher
MiniBlocks -
func (*PoolsHolderMock) PeerChangesBlocks ¶
func (phm *PoolsHolderMock) PeerChangesBlocks() storage.Cacher
PeerChangesBlocks -
func (*PoolsHolderMock) RewardTransactions ¶
func (phm *PoolsHolderMock) RewardTransactions() dataRetriever.ShardedDataCacherNotifier
RewardTransactions -
func (*PoolsHolderMock) SetTransactions ¶
func (phm *PoolsHolderMock) SetTransactions(transactions dataRetriever.ShardedDataCacherNotifier)
SetTransactions -
func (*PoolsHolderMock) SetUnsignedTransactions ¶
func (phm *PoolsHolderMock) SetUnsignedTransactions(scrs dataRetriever.ShardedDataCacherNotifier)
SetUnsignedTransactions -
func (*PoolsHolderMock) Transactions ¶
func (phm *PoolsHolderMock) Transactions() dataRetriever.ShardedDataCacherNotifier
Transactions -
func (*PoolsHolderMock) TrieNodes ¶
func (phm *PoolsHolderMock) TrieNodes() storage.Cacher
TrieNodes -
func (*PoolsHolderMock) UnsignedTransactions ¶
func (phm *PoolsHolderMock) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
UnsignedTransactions -
type PubkeyConverterStub ¶ added in v1.0.115
type PubkeyConverterStub struct { LenCalled func() int DecodeCalled func(humanReadable string) ([]byte, error) EncodeCalled func(pkBytes []byte) string }
PubkeyConverterStub -
func (*PubkeyConverterStub) Decode ¶ added in v1.0.115
func (pcs *PubkeyConverterStub) Decode(humanReadable string) ([]byte, error)
Decode -
func (*PubkeyConverterStub) Encode ¶ added in v1.0.115
func (pcs *PubkeyConverterStub) Encode(pkBytes []byte) string
Encode -
func (*PubkeyConverterStub) IsInterfaceNil ¶ added in v1.0.115
func (pcs *PubkeyConverterStub) IsInterfaceNil() bool
IsInterfaceNil -
type RequestHandlerStub ¶
type RequestHandlerStub struct { RequestShardHeaderCalled func(shardId uint32, hash []byte) RequestMetaHeaderCalled func(hash []byte) RequestMetaHeaderByNonceCalled func(nonce uint64) RequestShardHeaderByNonceCalled func(shardId uint32, nonce uint64) RequestTransactionHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestScrHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestRewardTxHandlerCalled func(destShardID uint32, txHashes [][]byte) RequestMiniBlockHandlerCalled func(destShardID uint32, miniblockHash []byte) RequestTrieNodesCalled func(shardId uint32, hash []byte) RequestStartOfEpochMetaBlockCalled func(epoch uint32) SetNumPeersToQueryCalled func(key string, intra int, cross int) error GetNumPeersToQueryCalled func(key string) (int, int, error) }
RequestHandlerStub -
func (*RequestHandlerStub) GetNumPeersToQuery ¶
func (rhs *RequestHandlerStub) GetNumPeersToQuery(key string) (int, int, error)
GetNumPeersToQuery -
func (*RequestHandlerStub) IsInterfaceNil ¶
func (rhs *RequestHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RequestHandlerStub) RequestInterval ¶
func (rhs *RequestHandlerStub) RequestInterval() time.Duration
RequestInterval -
func (*RequestHandlerStub) RequestMetaHeader ¶
func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)
RequestMetaHeader -
func (*RequestHandlerStub) RequestMetaHeaderByNonce ¶
func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)
RequestMetaHeaderByNonce -
func (*RequestHandlerStub) RequestMiniBlock ¶
func (rhs *RequestHandlerStub) RequestMiniBlock(shardId uint32, miniblockHash []byte)
RequestMiniBlock -
func (*RequestHandlerStub) RequestMiniBlocks ¶
func (rhs *RequestHandlerStub) RequestMiniBlocks(_ uint32, _ [][]byte)
RequestMiniBlocks -
func (*RequestHandlerStub) RequestRewardTransactions ¶
func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)
RequestRewardTransactions -
func (*RequestHandlerStub) RequestShardHeader ¶
func (rhs *RequestHandlerStub) RequestShardHeader(shardId uint32, hash []byte)
RequestShardHeader -
func (*RequestHandlerStub) RequestShardHeaderByNonce ¶
func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardId uint32, nonce uint64)
RequestShardHeaderByNonce -
func (*RequestHandlerStub) RequestStartOfEpochMetaBlock ¶
func (rhs *RequestHandlerStub) RequestStartOfEpochMetaBlock(epoch uint32)
RequestStartOfEpochMetaBlock -
func (*RequestHandlerStub) RequestTransaction ¶
func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)
RequestTransaction -
func (*RequestHandlerStub) RequestTrieNodes ¶
func (rhs *RequestHandlerStub) RequestTrieNodes(_ uint32, _ [][]byte, _ string)
RequestTrieNodes -
func (*RequestHandlerStub) RequestUnsignedTransactions ¶
func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)
RequestUnsignedTransactions -
func (*RequestHandlerStub) SetNumPeersToQuery ¶
func (rhs *RequestHandlerStub) SetNumPeersToQuery(key string, intra int, cross int) error
SetNumPeersToQuery -
type RewardTxProcessorMock ¶ added in v1.0.115
type RewardTxProcessorMock struct {
ProcessRewardTransactionCalled func(rTx *rewardTx.RewardTx) error
}
RewardTxProcessorMock -
func (*RewardTxProcessorMock) IsInterfaceNil ¶ added in v1.0.115
func (scrp *RewardTxProcessorMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*RewardTxProcessorMock) ProcessRewardTransaction ¶ added in v1.0.115
func (scrp *RewardTxProcessorMock) ProcessRewardTransaction(rTx *rewardTx.RewardTx) error
ProcessRewardTransaction -
type SCProcessorMock ¶ added in v1.0.115
type SCProcessorMock struct { ComputeTransactionTypeCalled func(tx data.TransactionHandler) (process.TransactionType, error) ExecuteSmartContractTransactionCalled func(tx data.TransactionHandler, acntSrc, acntDst state.UserAccountHandler) error DeploySmartContractCalled func(tx data.TransactionHandler, acntSrc state.UserAccountHandler) error ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error ProcessIfErrorCalled func(acntSnd state.UserAccountHandler, txHash []byte, tx data.TransactionHandler, returnCode string, snapshot int) error }
SCProcessorMock -
func (*SCProcessorMock) ComputeTransactionType ¶ added in v1.0.115
func (sc *SCProcessorMock) ComputeTransactionType( tx data.TransactionHandler, ) (process.TransactionType, error)
ComputeTransactionType -
func (*SCProcessorMock) DeploySmartContract ¶ added in v1.0.115
func (sc *SCProcessorMock) DeploySmartContract( tx data.TransactionHandler, acntSrc state.UserAccountHandler, ) error
DeploySmartContract -
func (*SCProcessorMock) ExecuteSmartContractTransaction ¶ added in v1.0.115
func (sc *SCProcessorMock) ExecuteSmartContractTransaction( tx data.TransactionHandler, acntSrc, acntDst state.UserAccountHandler, ) error
ExecuteSmartContractTransaction -
func (*SCProcessorMock) IsInterfaceNil ¶ added in v1.0.115
func (sc *SCProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SCProcessorMock) ProcessIfError ¶ added in v1.0.115
func (sc *SCProcessorMock) ProcessIfError(acntSnd state.UserAccountHandler, txHash []byte, tx data.TransactionHandler, returnCode string, snapshot int) error
ProcessIfError -
func (*SCProcessorMock) ProcessSmartContractResult ¶ added in v1.0.115
func (sc *SCProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
ProcessSmartContractResult -
type StorageManagerStub ¶ added in v1.0.115
type StorageManagerStub struct { DatabaseCalled func() data.DBWriteCacher TakeSnapshotCalled func([]byte) SetCheckpointCalled func([]byte) PruneCalled func([]byte) CancelPruneCalled func([]byte) MarkForEvictionCalled func([]byte, data.ModifiedHashes) error GetDbThatContainsHashCalled func([]byte) data.DBWriteCacher IsPruningEnabledCalled func() bool EnterSnapshotModeCalled func() ExitSnapshotModeCalled func() IsInterfaceNilCalled func() bool }
StorageManagerStub --
func (*StorageManagerStub) CancelPrune ¶ added in v1.0.115
func (sms *StorageManagerStub) CancelPrune([]byte, data.TriePruningIdentifier)
CancelPrune --
func (*StorageManagerStub) Database ¶ added in v1.0.115
func (sms *StorageManagerStub) Database() data.DBWriteCacher
Database --
func (*StorageManagerStub) EnterSnapshotMode ¶ added in v1.0.115
func (sms *StorageManagerStub) EnterSnapshotMode()
EnterSnapshotMode --
func (*StorageManagerStub) ExitSnapshotMode ¶ added in v1.0.115
func (sms *StorageManagerStub) ExitSnapshotMode()
ExitSnapshotMode --
func (*StorageManagerStub) GetDbThatContainsHash ¶ added in v1.0.115
func (sms *StorageManagerStub) GetDbThatContainsHash(d []byte) data.DBWriteCacher
GetDbThatContainsHash --
func (*StorageManagerStub) IsInterfaceNil ¶ added in v1.0.115
func (sms *StorageManagerStub) IsInterfaceNil() bool
IsInterfaceNil --
func (*StorageManagerStub) IsPruningEnabled ¶ added in v1.0.115
func (sms *StorageManagerStub) IsPruningEnabled() bool
IsPruningEnabled --
func (*StorageManagerStub) MarkForEviction ¶ added in v1.0.115
func (sms *StorageManagerStub) MarkForEviction(d []byte, m data.ModifiedHashes) error
MarkForEviction --
func (*StorageManagerStub) Prune ¶ added in v1.0.115
func (sms *StorageManagerStub) Prune([]byte, data.TriePruningIdentifier)
Prune --
func (*StorageManagerStub) SetCheckpoint ¶ added in v1.0.115
func (sms *StorageManagerStub) SetCheckpoint([]byte)
SetCheckpoint --
func (*StorageManagerStub) TakeSnapshot ¶ added in v1.0.115
func (sms *StorageManagerStub) TakeSnapshot([]byte)
TakeSnapshot --
type StorerMock ¶
type StorerMock struct {
// contains filtered or unexported fields
}
StorerMock -
func (*StorerMock) GetFromEpoch ¶
func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
GetFromEpoch -
func (*StorerMock) HasInEpoch ¶
func (sm *StorerMock) HasInEpoch(key []byte, _ uint32) error
HasInEpoch -
func (*StorerMock) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerMock) SearchFirst ¶
func (sm *StorerMock) SearchFirst(_ []byte) ([]byte, error)
SearchFirst -
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 GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error) HasInEpochCalled func(key []byte, epoch uint32) error ClearCacheCalled func() DestroyUnitCalled func() error }
StorerStub -
func (*StorerStub) GetFromEpoch ¶
func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)
GetFromEpoch -
func (*StorerStub) HasInEpoch ¶
func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error
HasInEpoch -
func (*StorerStub) IsInterfaceNil ¶
func (ss *StorerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerStub) SearchFirst ¶
func (ss *StorerStub) SearchFirst(_ []byte) ([]byte, error)
SearchFirst -
type SyncStateStub ¶
type SyncStateStub struct { GetEpochStartMetaBlockCalled func() (*block.MetaBlock, error) GetUnfinishedMetaBlocksCalled func() (map[string]*block.MetaBlock, error) SyncAllStateCalled func(epoch uint32) error GetAllTriesCalled func() (map[string]data.Trie, error) GetAllTransactionsCalled func() (map[string]data.TransactionHandler, error) GetAllMiniBlocksCalled func() (map[string]*block.MiniBlock, error) }
SyncStateStub -
func (*SyncStateStub) GetAllMiniBlocks ¶
func (sss *SyncStateStub) GetAllMiniBlocks() (map[string]*block.MiniBlock, error)
GetAllMiniBlocks -
func (*SyncStateStub) GetAllTransactions ¶
func (sss *SyncStateStub) GetAllTransactions() (map[string]data.TransactionHandler, error)
GetAllTransactions -
func (*SyncStateStub) GetAllTries ¶
func (sss *SyncStateStub) GetAllTries() (map[string]data.Trie, error)
GetAllTries -
func (*SyncStateStub) GetEpochStartMetaBlock ¶
func (sss *SyncStateStub) GetEpochStartMetaBlock() (*block.MetaBlock, error)
GetEpochStartMetaBlock -
func (*SyncStateStub) GetUnfinishedMetaBlocks ¶
func (sss *SyncStateStub) GetUnfinishedMetaBlocks() (map[string]*block.MetaBlock, error)
GetUnfinishedMetaBlocks -
func (*SyncStateStub) IsInterfaceNil ¶
func (sss *SyncStateStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*SyncStateStub) SyncAllState ¶
func (sss *SyncStateStub) SyncAllState(epoch uint32) error
SyncAllState -
type TransactionCoordinatorMock ¶ added in v1.0.115
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, haveTime func() time.Duration) error CreateBlockStartedCalled func() CreateMbsAndProcessCrossShardTransactionsDstMeCalled func(header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, haveTime func() bool, ) (block.MiniBlockSlice, uint32, bool, error) CreateMbsAndProcessTransactionsFromMeCalled func(haveTime func() bool) block.MiniBlockSlice CreateMarshalizedDataCalled func(body *block.Body) map[string][][]byte GetAllCurrentUsedTxsCalled func(blockType block.Type) map[string]data.TransactionHandler VerifyCreatedBlockTransactionsCalled func(hdr data.HeaderHandler, body *block.Body) error CreatePostProcessMiniBlocksCalled func() block.MiniBlockSlice }
TransactionCoordinatorMock -
func (*TransactionCoordinatorMock) ComputeTransactionType ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) ComputeTransactionType(tx data.TransactionHandler) (process.TransactionType, error)
ComputeTransactionType -
func (*TransactionCoordinatorMock) CreateBlockStarted ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreateBlockStarted()
CreateBlockStarted -
func (*TransactionCoordinatorMock) CreateMarshalizedData ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreateMarshalizedData(body *block.Body) map[string][][]byte
CreateMarshalizedData -
func (*TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessCrossShardTransactionsDstMe( header data.HeaderHandler, processedMiniBlocksHashes map[string]struct{}, haveTime func() bool, ) (block.MiniBlockSlice, uint32, bool, error)
CreateMbsAndProcessCrossShardTransactionsDstMe -
func (*TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreateMbsAndProcessTransactionsFromMe(haveTime func() bool) block.MiniBlockSlice
CreateMbsAndProcessTransactionsFromMe -
func (*TransactionCoordinatorMock) CreatePostProcessMiniBlocks ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreatePostProcessMiniBlocks() block.MiniBlockSlice
CreatePostProcessMiniBlocks -
func (*TransactionCoordinatorMock) CreateReceiptsHash ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) CreateReceiptsHash() ([]byte, error)
CreateReceiptsHash -
func (*TransactionCoordinatorMock) GetAllCurrentUsedTxs ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) GetAllCurrentUsedTxs(blockType block.Type) map[string]data.TransactionHandler
GetAllCurrentUsedTxs -
func (*TransactionCoordinatorMock) IsDataPreparedForProcessing ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) IsDataPreparedForProcessing(haveTime func() time.Duration) error
IsDataPreparedForProcessing -
func (*TransactionCoordinatorMock) IsInterfaceNil ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TransactionCoordinatorMock) ProcessBlockTransaction ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) ProcessBlockTransaction(body *block.Body, haveTime func() time.Duration) error
ProcessBlockTransaction -
func (*TransactionCoordinatorMock) RemoveBlockDataFromPool ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) RemoveBlockDataFromPool(body *block.Body) error
RemoveBlockDataFromPool -
func (*TransactionCoordinatorMock) RequestBlockTransactions ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) RequestBlockTransactions(body *block.Body)
RequestBlockTransactions -
func (*TransactionCoordinatorMock) RequestMiniBlocks ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) RequestMiniBlocks(header data.HeaderHandler)
RequestMiniBlocks -
func (*TransactionCoordinatorMock) RestoreBlockDataFromStorage ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) RestoreBlockDataFromStorage(body *block.Body) (int, error)
RestoreBlockDataFromStorage -
func (*TransactionCoordinatorMock) SaveBlockDataToStorage ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) SaveBlockDataToStorage(body *block.Body) error
SaveBlockDataToStorage -
func (*TransactionCoordinatorMock) VerifyCreatedBlockTransactions ¶ added in v1.0.115
func (tcm *TransactionCoordinatorMock) VerifyCreatedBlockTransactions(hdr data.HeaderHandler, body *block.Body) error
VerifyCreatedBlockTransactions -
type TrieFactoryStub ¶ added in v1.0.115
type TrieFactoryStub struct {
CreateCalled func(config config.StorageConfig, s string, b bool) (data.StorageManager, data.Trie, error)
}
TrieFactoryStub -
func (*TrieFactoryStub) Create ¶ added in v1.0.115
func (t *TrieFactoryStub) Create(config config.StorageConfig, s string, b bool) (data.StorageManager, data.Trie, error)
Create -
func (*TrieFactoryStub) IsInterfaceNil ¶ added in v1.0.115
func (t *TrieFactoryStub) IsInterfaceNil() bool
IsInterfaceNil -
type TrieStub ¶
type TrieStub struct { GetCalled func(key []byte) ([]byte, error) UpdateCalled func(key, value []byte) error DeleteCalled func(key []byte) error RootCalled func() ([]byte, error) CommitCalled func() error RecreateCalled func(root []byte) (data.Trie, error) CancelPruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) PruneCalled func(rootHash []byte, identifier data.TriePruningIdentifier) ResetOldHashesCalled func() [][]byte AppendToOldHashesCalled func([][]byte) SnapshotCalled func() error GetSerializedNodesCalled func([]byte, uint64) ([][]byte, uint64, error) DatabaseCalled func() data.DBWriteCacher }
TrieStub -
func (*TrieStub) AppendToOldHashes ¶
AppendToOldHashes appends the given hashes to the trie's oldHashes variable
func (*TrieStub) CancelPrune ¶
func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
CancelPrune invalidates the hashes that correspond to the given root hash from the eviction waiting list
func (*TrieStub) GetAllLeaves ¶
GetAllLeaves -
func (*TrieStub) GetDirtyHashes ¶ added in v1.0.111
func (ts *TrieStub) GetDirtyHashes() (data.ModifiedHashes, error)
GetDirtyHashes -
func (*TrieStub) GetSerializedNodes ¶
GetSerializedNodes -
func (*TrieStub) IsInterfaceNil ¶
IsInterfaceNil returns true if there is no value under the interface
func (*TrieStub) Prune ¶
func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier)
Prune removes from the database all the old hashes that correspond to the given root hash
func (*TrieStub) ResetOldHashes ¶
ResetOldHashes resets the oldHashes and oldRoot variables and returns the old hashes
func (*TrieStub) SetNewHashes ¶ added in v1.0.111
func (ts *TrieStub) SetNewHashes(_ data.ModifiedHashes)
SetNewHashes -
type TrieSyncersStub ¶
type TrieSyncersStub struct { GetCalled func(key string) (update.TrieSyncer, error) AddCalled func(key string, val update.TrieSyncer) error AddMultipleCalled func(keys []string, interceptors []update.TrieSyncer) error ReplaceCalled func(key string, val update.TrieSyncer) error RemoveCalled func(key string) LenCalled func() int StartSyncingCalled func(rootHash []byte, ctx context.Context) error TrieCalled func() data.Trie }
TrieSyncersStub -
func (*TrieSyncersStub) Add ¶
func (tss *TrieSyncersStub) Add(key string, val update.TrieSyncer) error
Add -
func (*TrieSyncersStub) AddMultiple ¶
func (tss *TrieSyncersStub) AddMultiple(keys []string, interceptors []update.TrieSyncer) error
AddMultiple -
func (*TrieSyncersStub) Get ¶
func (tss *TrieSyncersStub) Get(key string) (update.TrieSyncer, error)
Get -
func (*TrieSyncersStub) IsInterfaceNil ¶
func (tss *TrieSyncersStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*TrieSyncersStub) Replace ¶
func (tss *TrieSyncersStub) Replace(key string, val update.TrieSyncer) error
Replace -
func (*TrieSyncersStub) StartSyncing ¶
func (tss *TrieSyncersStub) StartSyncing(rootHash []byte, ctx context.Context) error
StartSyncing -
type TriesHolderMock ¶
type TriesHolderMock struct { PutCalled func([]byte, data.Trie) RemoveCalled func([]byte, data.Trie) GetCalled func([]byte) data.Trie GetAllCalled func() []data.Trie ResetCalled func() }
TriesHolderMock -
func (*TriesHolderMock) IsInterfaceNil ¶
func (thm *TriesHolderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type TxProcessorMock ¶ added in v1.0.115
type TxProcessorMock struct { ProcessTransactionCalled func(transaction *transaction.Transaction) error SetBalancesToTrieCalled func(accBalance map[string]*big.Int) (rootHash []byte, err error) ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error }
TxProcessorMock -
func (*TxProcessorMock) IsInterfaceNil ¶ added in v1.0.115
func (etm *TxProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*TxProcessorMock) ProcessSmartContractResult ¶ added in v1.0.115
func (etm *TxProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
ProcessSmartContractResult -
func (*TxProcessorMock) ProcessTransaction ¶ added in v1.0.115
func (etm *TxProcessorMock) ProcessTransaction(transaction *transaction.Transaction) error
ProcessTransaction -
func (*TxProcessorMock) SetBalancesToTrie ¶ added in v1.0.115
func (etm *TxProcessorMock) SetBalancesToTrie(accBalance map[string]*big.Int) (rootHash []byte, err error)
SetBalancesToTrie -
type Uint64ByteSliceConverterStub ¶
type Uint64ByteSliceConverterStub struct { ToByteSliceCalled func(uint64) []byte ToUint64Called func([]byte) (uint64, error) }
Uint64ByteSliceConverterStub converts byte slice to/from uint64
func (*Uint64ByteSliceConverterStub) IsInterfaceNil ¶
func (u *Uint64ByteSliceConverterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*Uint64ByteSliceConverterStub) ToByteSlice ¶
func (u *Uint64ByteSliceConverterStub) ToByteSlice(p uint64) []byte
ToByteSlice is a mock implementation for Uint64ByteSliceConverter
Source Files ¶
- accountsDBSyncerStub.go
- accountsDBSyncersStub.go
- accountsStub.go
- addressMock.go
- cacherMock.go
- cacherStub.go
- chainStorerMock.go
- coordinatorStub.go
- endOfEpochTriggerStub.go
- epochHandlerStub.go
- epochMiniBlocksSyncHandlerMock.go
- epochStartNotifierStub.go
- epochStartTriesSyncHandlerMock.go
- exportFactoryHandlerStub.go
- exportHandlerStub.go
- hardForkBlockProcessor.go
- hasherMock.go
- hasherStub.go
- headerSyncHandlerStub.go
- headerValidatorStub.go
- headersCacherStub.go
- importHandlerStub.go
- marshalizerFake.go
- marshalizerMock.go
- multiFileReaderStub.go
- multiFileWriterStub.go
- oneShardCoordinatorMock.go
- pendingTransactionProcessorStub.go
- pendingTransactionsSyncHandlerMock.go
- poolsHolderMock.go
- pubkeyConverterStub.go
- requestHandlerStub.go
- rewardTxProcessorMock.go
- scProcessorMock.go
- storageManagerStub.go
- storerMock.go
- storerStub.go
- syncStateStub.go
- transactionCoordinatorMock.go
- trieFactoryStub.go
- trieStub.go
- trieSyncersStub.go
- triesHolderMock.go
- txProcessorMock.go
- uint64ByteSliceConverterStub.go