Documentation ¶
Index ¶
- func NewCountingDB() *countingDB
- func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
- func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
- type AccountsFactoryStub
- 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) Reset(pubKeys []string, index uint16) error
- func (bnm *BelNevMock) SetAggregatedSig(aggSig []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 BlockProcessorMock
- func (blProcMock BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
- func (blProcMock *BlockProcessorMock) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
- func (blProcMock *BlockProcessorMock) CreateBlockBody(round uint64, haveTime func() bool) (data.BodyHandler, error)
- func (blProcMock BlockProcessorMock) CreateBlockHeader(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, error)
- func (blProcMock BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
- func (blProcMock BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
- func (blProcMock BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
- func (blProcMock *BlockProcessorMock) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, ...) error
- func (blProcMock *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
- func (blProcMock *BlockProcessorMock) RevertAccountState()
- type BlocksTrackerMock
- func (btm *BlocksTrackerMock) AddBlock(headerHandler data.HeaderHandler)
- func (btm *BlocksTrackerMock) BlockBroadcastRound(nonce uint64) int64
- func (btm *BlocksTrackerMock) RemoveNotarisedBlocks(headerHandler data.HeaderHandler) error
- func (btm *BlocksTrackerMock) SetBlockBroadcastRound(nonce uint64, round int64)
- func (btm *BlocksTrackerMock) UnnotarisedBlocks() []data.HeaderHandler
- 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) Keys() [][]byte
- func (cs *CacherStub) Len() 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 ChronologyValidatorMock
- type ForkDetectorMock
- func (f *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, ...) error
- func (f *ForkDetectorMock) CheckFork() (bool, uint64, []byte)
- func (f *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
- func (f *ForkDetectorMock) ProbableHighestNonce() uint64
- func (f *ForkDetectorMock) RemoveHeaders(nonce uint64, hash []byte)
- func (fdm *ForkDetectorMock) ResetProbableHighestNonceIfNeeded()
- type HeaderResolverMock
- 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) 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) SaveCurrentIntermediateTxToStorage() error
- func (ith *IntermediateTransactionHandlerMock) VerifyInterMiniBlocks(body block.Body) error
- type MiniBlocksResolverMock
- func (hrm *MiniBlocksResolverMock) GetMiniBlocks(hashes [][]byte) block.MiniBlockSlice
- func (hrm *MiniBlocksResolverMock) ProcessReceivedMessage(message p2p.MessageP2P) error
- func (hrm *MiniBlocksResolverMock) RequestDataFromHash(hash []byte) error
- func (hrm *MiniBlocksResolverMock) RequestDataFromHashArray(hashes [][]byte) error
- type MockDB
- type OneSCExecutorMockVM
- func (vm *OneSCExecutorMockVM) G0Call(input *vmcommon.ContractCallInput) (*big.Int, error)
- func (vm *OneSCExecutorMockVM) G0Create(input *vmcommon.ContractCreateInput) (*big.Int, error)
- func (vm *OneSCExecutorMockVM) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
- func (vm *OneSCExecutorMockVM) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
- type PoolsHolderStub
- func (phs *PoolsHolderStub) Headers() storage.Cacher
- func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
- func (phs *PoolsHolderStub) MetaBlocks() storage.Cacher
- func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher
- func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher
- func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
- func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
- 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) 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 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) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
- type ServiceContainerMock
- 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) 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 SmartContractResultsProcessorMock
- type SyncTimerMock
- type TxProcessorMock
- 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 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) 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)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCountingDB ¶
func NewCountingDB() *countingDB
func NewMultiShardsCoordinatorMock ¶
func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock
func NewMultipleShardsCoordinatorMock ¶ added in v1.0.3
func NewMultipleShardsCoordinatorMock() *multipleShardsCoordinatorMock
Types ¶
type AccountsFactoryStub ¶
type AccountsFactoryStub struct {
CreateAccountCalled func(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, error)
}
func (*AccountsFactoryStub) CreateAccount ¶
func (afs *AccountsFactoryStub) CreateAccount(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, 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) CreateCalled func(pubKeys []string, index uint16) (crypto.MultiSigner, error) ResetCalled func(pubKeys []string, index uint16) error // contains filtered or unexported fields }
BelNevMock is used to mock belare neven multisignature scheme
func NewMultiSigner ¶
func NewMultiSigner(nrConsens uint32) *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 creates a multiSigner using receiver as template 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) SetAggregatedSig ¶
func (bnm *BelNevMock) SetAggregatedSig(aggSig []byte) error
SetAggregatedSig sets the aggregated signature according to the given byte array
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 BlockProcessorMock ¶
type BlockProcessorMock struct { NrCommitBlockCalled uint32 Marshalizer marshal.Marshalizer 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() CreateBlockCalled func(round uint64, haveTime func() bool) (data.BodyHandler, error) RestoreBlockIntoPoolsCalled func(header data.HeaderHandler, body data.BodyHandler) error CreateBlockHeaderCalled func(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, 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) }
BlockProcessorMock mocks the implementation for a blockProcessor
func (BlockProcessorMock) AddLastNotarizedHdr ¶
func (blProcMock BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
func (*BlockProcessorMock) CommitBlock ¶
func (blProcMock *BlockProcessorMock) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
CommitBlock mocks the commit of a block
func (*BlockProcessorMock) CreateBlockBody ¶ added in v1.0.3
func (blProcMock *BlockProcessorMock) CreateBlockBody(round uint64, haveTime func() bool) (data.BodyHandler, error)
CreateTxBlockBody mocks the creation of a transaction block body
func (BlockProcessorMock) CreateBlockHeader ¶ added in v1.0.3
func (blProcMock BlockProcessorMock) CreateBlockHeader(body data.BodyHandler, round uint64, haveTime func() bool) (data.HeaderHandler, error)
func (BlockProcessorMock) DecodeBlockBody ¶
func (blProcMock BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
DecodeBlockBody method decodes block body from a given byte array
func (BlockProcessorMock) DecodeBlockHeader ¶
func (blProcMock BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
DecodeBlockHeader method decodes block header from a given byte array
func (BlockProcessorMock) MarshalizedDataToBroadcast ¶
func (blProcMock BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
func (*BlockProcessorMock) ProcessBlock ¶
func (blProcMock *BlockProcessorMock) ProcessBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
ProcessBlock mocks pocessing a block
func (*BlockProcessorMock) RestoreBlockIntoPools ¶
func (blProcMock *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
func (*BlockProcessorMock) RevertAccountState ¶
func (blProcMock *BlockProcessorMock) RevertAccountState()
RevertAccountState mocks revert of the accounts state
type BlocksTrackerMock ¶ added in v1.0.3
type BlocksTrackerMock struct { UnnotarisedBlocksCalled func() []data.HeaderHandler RemoveNotarisedBlocksCalled func(headerHandler data.HeaderHandler) error AddBlockCalled func(headerHandler data.HeaderHandler) SetBlockBroadcastRoundCalled func(nonce uint64, round int64) BlockBroadcastRoundCalled func(nonce uint64) int64 }
func (*BlocksTrackerMock) AddBlock ¶ added in v1.0.3
func (btm *BlocksTrackerMock) AddBlock(headerHandler data.HeaderHandler)
func (*BlocksTrackerMock) BlockBroadcastRound ¶ added in v1.0.3
func (btm *BlocksTrackerMock) BlockBroadcastRound(nonce uint64) int64
func (*BlocksTrackerMock) RemoveNotarisedBlocks ¶ added in v1.0.3
func (btm *BlocksTrackerMock) RemoveNotarisedBlocks(headerHandler data.HeaderHandler) error
func (*BlocksTrackerMock) SetBlockBroadcastRound ¶ added in v1.0.3
func (btm *BlocksTrackerMock) SetBlockBroadcastRound(nonce uint64, round int64)
func (*BlocksTrackerMock) UnnotarisedBlocks ¶ added in v1.0.3
func (btm *BlocksTrackerMock) UnnotarisedBlocks() []data.HeaderHandler
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 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) Keys ¶
func (cs *CacherStub) Keys() [][]byte
func (*CacherStub) Len ¶
func (cs *CacherStub) Len() 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 ChronologyValidatorMock ¶ added in v1.0.3
type ChronologyValidatorMock struct { }
func (*ChronologyValidatorMock) ValidateReceivedBlock ¶ added in v1.0.3
type ForkDetectorMock ¶
type ForkDetectorMock struct { AddHeaderCalled func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeader data.HeaderHandler, finalHeaderHash []byte) error RemoveHeadersCalled func(nonce uint64, hash []byte) CheckForkCalled func() (bool, uint64, []byte) GetHighestFinalBlockNonceCalled func() uint64 ProbableHighestNonceCalled func() uint64 ResetProbableHighestNonceIfNeededCalled func() }
ForkDetectorMock is a mock implementation for the ForkDetector interface
func (*ForkDetectorMock) AddHeader ¶
func (f *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, finalHeader data.HeaderHandler, finalHeaderHash []byte) error
AddHeader is a mock implementation for AddHeader
func (*ForkDetectorMock) CheckFork ¶
func (f *ForkDetectorMock) CheckFork() (bool, uint64, []byte)
CheckFork is a mock implementation for CheckFork
func (*ForkDetectorMock) GetHighestFinalBlockNonce ¶
func (f *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce
func (*ForkDetectorMock) ProbableHighestNonce ¶
func (f *ForkDetectorMock) ProbableHighestNonce() uint64
GetProbableHighestNonce is a mock implementation for GetProbableHighestNonce
func (*ForkDetectorMock) RemoveHeaders ¶ added in v1.0.3
func (f *ForkDetectorMock) RemoveHeaders(nonce uint64, hash []byte)
RemoveHeaders is a mock implementation for RemoveHeaders
func (*ForkDetectorMock) ResetProbableHighestNonceIfNeeded ¶ added in v1.0.11
func (fdm *ForkDetectorMock) ResetProbableHighestNonceIfNeeded()
type HeaderResolverMock ¶
type HeaderResolverMock struct { RequestDataFromHashCalled func(hash []byte) error ProcessReceivedMessageCalled func(message p2p.MessageP2P) error RequestDataFromNonceCalled func(nonce uint64) error }
func (*HeaderResolverMock) ProcessReceivedMessage ¶
func (hrm *HeaderResolverMock) ProcessReceivedMessage(message p2p.MessageP2P) error
func (*HeaderResolverMock) RequestDataFromHash ¶
func (hrm *HeaderResolverMock) RequestDataFromHash(hash []byte) error
func (*HeaderResolverMock) RequestDataFromNonce ¶
func (hrm *HeaderResolverMock) RequestDataFromNonce(nonce uint64) error
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) 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) }
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) SaveCurrentIntermediateTxToStorage ¶
func (ith *IntermediateTransactionHandlerMock) SaveCurrentIntermediateTxToStorage() error
func (*IntermediateTransactionHandlerMock) VerifyInterMiniBlocks ¶
func (ith *IntermediateTransactionHandlerMock) VerifyInterMiniBlocks(body block.Body) error
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 }
func (*MiniBlocksResolverMock) GetMiniBlocks ¶
func (hrm *MiniBlocksResolverMock) GetMiniBlocks(hashes [][]byte) block.MiniBlockSlice
func (*MiniBlocksResolverMock) ProcessReceivedMessage ¶
func (hrm *MiniBlocksResolverMock) ProcessReceivedMessage(message p2p.MessageP2P) error
func (*MiniBlocksResolverMock) RequestDataFromHash ¶
func (hrm *MiniBlocksResolverMock) RequestDataFromHash(hash []byte) error
func (*MiniBlocksResolverMock) RequestDataFromHashArray ¶
func (hrm *MiniBlocksResolverMock) RequestDataFromHashArray(hashes [][]byte) error
type OneSCExecutorMockVM ¶
type OneSCExecutorMockVM struct { GasForOperation uint64 // contains filtered or unexported fields }
OneSCExecutorMockVM contains one hardcoded SC with the following behaviour (written in golang): ------------------------------------- var a int
func init(initial int){ a = initial }
func Add(value int){ a += value }
func Get() int{ return a }
-------------------------------------
func NewOneSCExecutorMockVM ¶
func NewOneSCExecutorMockVM(blockchainHook vmcommon.BlockchainHook, hasher hashing.Hasher) (*OneSCExecutorMockVM, error)
func (*OneSCExecutorMockVM) G0Call ¶ added in v1.0.3
func (vm *OneSCExecutorMockVM) G0Call(input *vmcommon.ContractCallInput) (*big.Int, error)
func (*OneSCExecutorMockVM) G0Create ¶ added in v1.0.3
func (vm *OneSCExecutorMockVM) G0Create(input *vmcommon.ContractCreateInput) (*big.Int, error)
func (*OneSCExecutorMockVM) RunSmartContractCall ¶
func (vm *OneSCExecutorMockVM) RunSmartContractCall(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
func (*OneSCExecutorMockVM) RunSmartContractCreate ¶
func (vm *OneSCExecutorMockVM) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
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 MiniBlocksCalled func() storage.Cacher MetaBlocksCalled func() storage.Cacher }
func (*PoolsHolderStub) Headers ¶
func (phs *PoolsHolderStub) Headers() storage.Cacher
func (*PoolsHolderStub) HeadersNonces ¶ added in v1.0.12
func (phs *PoolsHolderStub) HeadersNonces() dataRetriever.Uint64SyncMapCacher
func (*PoolsHolderStub) MetaBlocks ¶ added in v1.0.12
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) Transactions ¶
func (phs *PoolsHolderStub) Transactions() dataRetriever.ShardedDataCacherNotifier
func (*PoolsHolderStub) UnsignedTransactions ¶
func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier
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) 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 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) ProcessSmartContractResult ¶
func (sc *SCProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) error
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) TPSBenchmark ¶
func (scm *ServiceContainerMock) TPSBenchmark() statistics.TPSBenchmark
TPSBenchmark returns a mock implementation for core.TPSBenchmark
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) 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 SmartContractResultsProcessorMock ¶
type SmartContractResultsProcessorMock struct {
ProcessSmartContractResultCalled func(scr *smartContractResult.SmartContractResult) error
}
func (*SmartContractResultsProcessorMock) ProcessSmartContractResult ¶
func (scrp *SmartContractResultsProcessorMock) ProcessSmartContractResult(scr *smartContractResult.SmartContractResult) 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) 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 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) 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 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) 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 ¶
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 ¶
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
Source Files ¶
- DbMock.go
- accountFactoryStub.go
- blockProcessorMock.go
- blocksTrackerMock.go
- cacherStub.go
- chronologyValidatorMock.go
- countingDB.go
- forkDetectorMock.go
- headerResolverMock.go
- interimProcessorContainerMock.go
- intermediateTransactionHandlerMock.go
- miniBlocksResolverMock.go
- multiSigMock.go
- multipleShardsCoordinatorMock.go
- oneSCExecutorMockVM.go
- poolsHolderStub.go
- resolversContainerStub.go
- resolversFinderStub.go
- scProcessorMock.go
- serviceContainerMock.go
- shardedDataStub.go
- smartContractResultProcessorMock.go
- syncTimerMock.go
- txProcessorMock.go
- vmContainerMock.go
- vmExecutionHandlerStub.go