mock

package
v1.3.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2022 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAccumulatorMock

func NewAccumulatorMock() *accumulatorMock

NewAccumulatorMock returns a mock implementation of the accumulator interface

func NewMultiShardsCoordinatorMock

func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock

NewMultiShardsCoordinatorMock -

func NewNonceHashConverterMock

func NewNonceHashConverterMock() *nonceHashConverterMock

NewNonceHashConverterMock -

func NewOneShardCoordinatorMock

func NewOneShardCoordinatorMock() *oneShardCoordinatorMock

NewOneShardCoordinatorMock -

Types

type AccountWrapMock added in v1.1.1

type AccountWrapMock struct {
	MockValue int

	SetNonceWithJournalCalled    func(nonce uint64) error    `json:"-"`
	SetCodeHashWithJournalCalled func(codeHash []byte) error `json:"-"`
	SetCodeWithJournalCalled     func(codeHash []byte) error `json:"-"`
	// contains filtered or unexported fields
}

AccountWrapMock -

func (*AccountWrapMock) AddToBalance added in v1.1.1

func (awm *AccountWrapMock) AddToBalance(_ *big.Int) error

AddToBalance -

func (*AccountWrapMock) AddToDeveloperReward added in v1.1.1

func (awm *AccountWrapMock) AddToDeveloperReward(*big.Int)

AddToDeveloperReward -

func (*AccountWrapMock) AddressBytes added in v1.1.1

func (awm *AccountWrapMock) AddressBytes() []byte

AddressBytes -

func (*AccountWrapMock) ChangeOwnerAddress added in v1.1.1

func (awm *AccountWrapMock) ChangeOwnerAddress([]byte, []byte) error

ChangeOwnerAddress -

func (*AccountWrapMock) ClaimDeveloperRewards added in v1.1.1

func (awm *AccountWrapMock) ClaimDeveloperRewards([]byte) (*big.Int, error)

ClaimDeveloperRewards -

func (*AccountWrapMock) DataTrie added in v1.1.1

func (awm *AccountWrapMock) DataTrie() common.Trie

DataTrie -

func (*AccountWrapMock) DataTrieTracker added in v1.1.1

func (awm *AccountWrapMock) DataTrieTracker() state.DataTrieTracker

DataTrieTracker -

func (*AccountWrapMock) GetBalance added in v1.1.1

func (awm *AccountWrapMock) GetBalance() *big.Int

GetBalance -

func (*AccountWrapMock) GetCodeHash added in v1.1.1

func (awm *AccountWrapMock) GetCodeHash() []byte

GetCodeHash -

func (*AccountWrapMock) GetCodeMetadata added in v1.1.1

func (awm *AccountWrapMock) GetCodeMetadata() []byte

GetCodeMetadata -

func (*AccountWrapMock) GetDeveloperReward added in v1.1.1

func (awm *AccountWrapMock) GetDeveloperReward() *big.Int

GetDeveloperReward -

func (*AccountWrapMock) GetNonce added in v1.1.1

func (awm *AccountWrapMock) GetNonce() uint64

GetNonce -

func (*AccountWrapMock) GetOwnerAddress added in v1.1.1

func (awm *AccountWrapMock) GetOwnerAddress() []byte

GetOwnerAddress -

func (*AccountWrapMock) GetRootHash added in v1.1.1

func (awm *AccountWrapMock) GetRootHash() []byte

GetRootHash -

func (*AccountWrapMock) GetUserName added in v1.1.1

func (awm *AccountWrapMock) GetUserName() []byte

GetUserName -

func (*AccountWrapMock) HasNewCode added in v1.1.22

func (awm *AccountWrapMock) HasNewCode() bool

HasNewCode -

func (*AccountWrapMock) IncreaseNonce added in v1.1.1

func (awm *AccountWrapMock) IncreaseNonce(val uint64)

IncreaseNonce -

func (*AccountWrapMock) IsInterfaceNil added in v1.1.1

func (awm *AccountWrapMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*AccountWrapMock) RetrieveValueFromDataTrieTracker added in v1.2.10

func (awm *AccountWrapMock) RetrieveValueFromDataTrieTracker(key []byte) ([]byte, error)

RetrieveValueFromDataTrieTracker -

func (*AccountWrapMock) SetCode added in v1.1.1

func (awm *AccountWrapMock) SetCode(code []byte)

SetCode -

func (*AccountWrapMock) SetCodeHash added in v1.1.1

func (awm *AccountWrapMock) SetCodeHash(codeHash []byte)

SetCodeHash -

func (*AccountWrapMock) SetCodeMetadata added in v1.1.1

func (awm *AccountWrapMock) SetCodeMetadata(codeMetadata []byte)

SetCodeMetadata -

func (*AccountWrapMock) SetDataTrie added in v1.1.1

func (awm *AccountWrapMock) SetDataTrie(trie common.Trie)

SetDataTrie -

func (*AccountWrapMock) SetOwnerAddress added in v1.1.1

func (awm *AccountWrapMock) SetOwnerAddress([]byte)

SetOwnerAddress -

func (*AccountWrapMock) SetRootHash added in v1.1.1

func (awm *AccountWrapMock) SetRootHash(rootHash []byte)

SetRootHash -

func (*AccountWrapMock) SetTrackableDataTrie added in v1.2.23

func (awm *AccountWrapMock) SetTrackableDataTrie(tdt state.DataTrieTracker)

SetTrackableDataTrie -

func (*AccountWrapMock) SetUserName added in v1.1.1

func (awm *AccountWrapMock) SetUserName(_ []byte)

SetUserName -

func (*AccountWrapMock) SubFromBalance added in v1.1.1

func (awm *AccountWrapMock) SubFromBalance(_ *big.Int) error

SubFromBalance -

type AccountsFactoryStub

type AccountsFactoryStub struct {
	CreateAccountCalled func(address []byte) (vmcommon.AccountHandler, error)
}

AccountsFactoryStub -

func (*AccountsFactoryStub) CreateAccount

func (afs *AccountsFactoryStub) CreateAccount(address []byte) (vmcommon.AccountHandler, error)

CreateAccount -

func (*AccountsFactoryStub) IsInterfaceNil

func (afs *AccountsFactoryStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type BlockChainHookHandlerStub added in v1.2.0

type BlockChainHookHandlerStub struct {
	SetCurrentHeaderCalled             func(hdr data.HeaderHandler)
	NewAddressCalled                   func(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)
	IsPayableCalled                    func(sndAddress []byte, rcvAddress []byte) (bool, error)
	DeleteCompiledCodeCalled           func(codeHash []byte)
	ProcessBuiltInFunctionCalled       func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	FilterCodeMetadataForUpgradeCalled func(input []byte) ([]byte, error)
	ApplyFiltersOnCodeMetadataCalled   func(codeMetadata vmcommon.CodeMetadata) vmcommon.CodeMetadata
}

BlockChainHookHandlerStub -

func (*BlockChainHookHandlerStub) ApplyFiltersOnCodeMetadata added in v1.3.7

func (e *BlockChainHookHandlerStub) ApplyFiltersOnCodeMetadata(codeMetadata vmcommon.CodeMetadata) vmcommon.CodeMetadata

ApplyFiltersOnCodeMetadata -

func (*BlockChainHookHandlerStub) DeleteCompiledCode added in v1.2.0

func (e *BlockChainHookHandlerStub) DeleteCompiledCode(codeHash []byte)

DeleteCompiledCode -

func (*BlockChainHookHandlerStub) FilterCodeMetadataForUpgrade added in v1.3.7

func (e *BlockChainHookHandlerStub) FilterCodeMetadataForUpgrade(input []byte) ([]byte, error)

FilterCodeMetadataForUpgrade -

func (*BlockChainHookHandlerStub) IsInterfaceNil added in v1.2.0

func (e *BlockChainHookHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BlockChainHookHandlerStub) IsPayable added in v1.2.0

func (e *BlockChainHookHandlerStub) IsPayable(sndAddress []byte, recvAddress []byte) (bool, error)

IsPayable -

func (*BlockChainHookHandlerStub) NewAddress added in v1.2.0

func (e *BlockChainHookHandlerStub) NewAddress(creatorAddress []byte, creatorNonce uint64, vmType []byte) ([]byte, error)

NewAddress -

func (*BlockChainHookHandlerStub) ProcessBuiltInFunction added in v1.2.4

func (e *BlockChainHookHandlerStub) ProcessBuiltInFunction(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)

ProcessBuiltInFunction -

func (*BlockChainHookHandlerStub) SaveNFTMetaDataToSystemAccount added in v1.2.35

func (e *BlockChainHookHandlerStub) SaveNFTMetaDataToSystemAccount(_ data.TransactionHandler) error

SaveNFTMetaDataToSystemAccount -

func (*BlockChainHookHandlerStub) SetCurrentHeader added in v1.2.0

func (e *BlockChainHookHandlerStub) SetCurrentHeader(hdr data.HeaderHandler)

SetCurrentHeader -

type BlockProcessorStub

type BlockProcessorStub struct {
	ProcessBlockCalled               func(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
	ProcessScheduledBlockCalled      func(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
	CommitBlockCalled                func(header data.HeaderHandler, body data.BodyHandler) error
	RevertCurrentBlockCalled         func()
	CreateGenesisBlockCalled         func(balances map[string]*big.Int) (data.HeaderHandler, error)
	CreateBlockCalled                func(initialHdrData data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, data.BodyHandler, error)
	RestoreBlockIntoPoolsCalled      func(header data.HeaderHandler, body data.BodyHandler) error
	RestoreBlockBodyIntoPoolsCalled  func(body data.BodyHandler) error
	SetOnRequestTransactionCalled    func(f func(destShardID uint32, txHash []byte))
	MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
	DecodeBlockBodyCalled            func(dta []byte) data.BodyHandler
	DecodeBlockHeaderCalled          func(dta []byte) data.HeaderHandler
	AddLastNotarizedHdrCalled        func(shardId uint32, processedHdr data.HeaderHandler)
	CreateNewHeaderCalled            func(round uint64, nonce uint64) (data.HeaderHandler, error)
	PruneStateOnRollbackCalled       func(currHeader data.HeaderHandler, currHeaderHash []byte, prevHeader data.HeaderHandler, prevHeaderHash []byte)
	RevertStateToBlockCalled         func(header data.HeaderHandler, rootHash []byte) error
	RevertIndexedBlockCalled         func(header data.HeaderHandler)
}

BlockProcessorStub mocks the implementation for a blockProcessor

func (*BlockProcessorStub) AddLastNotarizedHdr

func (bps *BlockProcessorStub) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)

AddLastNotarizedHdr -

func (*BlockProcessorStub) ApplyProcessedMiniBlocks

func (bps *BlockProcessorStub) ApplyProcessedMiniBlocks(_ *processedMb.ProcessedMiniBlockTracker)

ApplyProcessedMiniBlocks -

func (*BlockProcessorStub) Close added in v1.2.0

func (bps *BlockProcessorStub) Close() error

Close -

func (*BlockProcessorStub) CommitBlock

func (bps *BlockProcessorStub) CommitBlock(header data.HeaderHandler, body data.BodyHandler) error

CommitBlock mocks the commit of a block

func (*BlockProcessorStub) CreateBlock

func (bps *BlockProcessorStub) CreateBlock(initialHdrData data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, data.BodyHandler, error)

CreateBlock mocks the creation of a new block with header and body

func (*BlockProcessorStub) CreateGenesisBlock

func (bps *BlockProcessorStub) CreateGenesisBlock(balances map[string]*big.Int) (data.HeaderHandler, error)

CreateGenesisBlock mocks the creation of a genesis block body

func (*BlockProcessorStub) CreateNewHeader

func (bps *BlockProcessorStub) CreateNewHeader(round uint64, nonce uint64) (data.HeaderHandler, error)

CreateNewHeader creates a new header

func (*BlockProcessorStub) DecodeBlockBody

func (bps *BlockProcessorStub) DecodeBlockBody(dta []byte) data.BodyHandler

DecodeBlockBody -

func (*BlockProcessorStub) DecodeBlockHeader

func (bps *BlockProcessorStub) DecodeBlockHeader(dta []byte) data.HeaderHandler

DecodeBlockHeader -

func (*BlockProcessorStub) IsInterfaceNil

func (bps *BlockProcessorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*BlockProcessorStub) MarshalizedDataToBroadcast

func (bps *BlockProcessorStub) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)

MarshalizedDataToBroadcast -

func (*BlockProcessorStub) ProcessBlock

func (bps *BlockProcessorStub) ProcessBlock(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error

ProcessBlock mocks processing a block

func (*BlockProcessorStub) ProcessScheduledBlock added in v1.3.0

func (bps *BlockProcessorStub) ProcessScheduledBlock(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error

ProcessScheduledBlock mocks processing a scheduled block

func (*BlockProcessorStub) PruneStateOnRollback

func (bps *BlockProcessorStub) PruneStateOnRollback(currHeader data.HeaderHandler, currHeaderHash []byte, prevHeader data.HeaderHandler, prevHeaderHash []byte)

PruneStateOnRollback recreates thee state tries to the root hashes indicated by the provided header

func (*BlockProcessorStub) RestoreBlockBodyIntoPools added in v1.3.7

func (bps *BlockProcessorStub) RestoreBlockBodyIntoPools(body data.BodyHandler) error

RestoreBlockBodyIntoPools -

func (*BlockProcessorStub) RestoreBlockIntoPools

func (bps *BlockProcessorStub) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error

RestoreBlockIntoPools -

func (*BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis

func (bps *BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis()

RestoreLastNotarizedHrdsToGenesis -

func (*BlockProcessorStub) RevertCurrentBlock added in v1.3.0

func (bps *BlockProcessorStub) RevertCurrentBlock()

RevertCurrentBlock mocks revert of the current block

func (*BlockProcessorStub) RevertIndexedBlock added in v1.1.6

func (bps *BlockProcessorStub) RevertIndexedBlock(header data.HeaderHandler)

RevertIndexedBlock -

func (*BlockProcessorStub) RevertStateToBlock

func (bps *BlockProcessorStub) RevertStateToBlock(header data.HeaderHandler, rootHash []byte) error

RevertStateToBlock recreates the state tries to the root hashes indicated by the provided header

func (*BlockProcessorStub) SetNumProcessedObj

func (bps *BlockProcessorStub) SetNumProcessedObj(_ uint64)

SetNumProcessedObj -

type BlockTrackerStub

type BlockTrackerStub struct {
	AddTrackedHeaderCalled                             func(header data.HeaderHandler, hash []byte)
	AddCrossNotarizedHeaderCalled                      func(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte)
	AddSelfNotarizedHeaderCalled                       func(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte)
	CheckBlockAgainstRoundHandlerCalled                func(headerHandler data.HeaderHandler) error
	CheckBlockAgainstFinalCalled                       func(headerHandler data.HeaderHandler) error
	CheckBlockAgainstWhitelistCalled                   func(interceptedData process.InterceptedData) bool
	CleanupHeadersBehindNonceCalled                    func(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)
	ComputeLongestChainCalled                          func(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte)
	ComputeLongestMetaChainFromLastNotarizedCalled     func() ([]data.HeaderHandler, [][]byte, error)
	ComputeLongestShardsChainsFromLastNotarizedCalled  func() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error)
	DisplayTrackedHeadersCalled                        func()
	GetCrossNotarizedHeaderCalled                      func(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeaderCalled                  func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeadersForAllShardsCalled     func() (map[uint32]data.HeaderHandler, error)
	GetLastSelfNotarizedHeaderCalled                   func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetSelfNotarizedHeaderCalled                       func(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
	GetTrackedHeadersCalled                            func(shardID uint32) ([]data.HeaderHandler, [][]byte)
	GetTrackedHeadersForAllShardsCalled                func() map[uint32][]data.HeaderHandler
	GetTrackedHeadersWithNonceCalled                   func(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)
	IsShardStuckCalled                                 func(shardId uint32) bool
	RegisterCrossNotarizedHeadersHandlerCalled         func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedFromCrossHeadersHandlerCalled func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedHeadersHandlerCalled          func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterFinalMetachainHeadersHandlerCalled         func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RemoveLastNotarizedHeadersCalled                   func()
	RestoreToGenesisCalled                             func()
	ShouldAddHeaderCalled                              func(headerHandler data.HeaderHandler) bool
}

BlockTrackerStub -

func (*BlockTrackerStub) AddCrossNotarizedHeader

func (bts *BlockTrackerStub) AddCrossNotarizedHeader(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte)

AddCrossNotarizedHeader -

func (*BlockTrackerStub) AddSelfNotarizedHeader

func (bts *BlockTrackerStub) AddSelfNotarizedHeader(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte)

AddSelfNotarizedHeader -

func (*BlockTrackerStub) AddTrackedHeader

func (bts *BlockTrackerStub) AddTrackedHeader(header data.HeaderHandler, hash []byte)

AddTrackedHeader -

func (*BlockTrackerStub) CheckBlockAgainstFinal

func (bts *BlockTrackerStub) CheckBlockAgainstFinal(headerHandler data.HeaderHandler) error

CheckBlockAgainstFinal -

func (*BlockTrackerStub) CheckBlockAgainstRoundHandler added in v1.2.0

func (bts *BlockTrackerStub) CheckBlockAgainstRoundHandler(headerHandler data.HeaderHandler) error

CheckBlockAgainstRoundHandler -

func (*BlockTrackerStub) CheckBlockAgainstWhitelist added in v1.0.138

func (bts *BlockTrackerStub) CheckBlockAgainstWhitelist(interceptedData process.InterceptedData) bool

CheckBlockAgainstWhitelist -

func (*BlockTrackerStub) CleanupHeadersBehindNonce

func (bts *BlockTrackerStub) CleanupHeadersBehindNonce(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)

CleanupHeadersBehindNonce -

func (*BlockTrackerStub) CleanupInvalidCrossHeaders

func (bts *BlockTrackerStub) CleanupInvalidCrossHeaders(_ uint32, _ uint64)

CleanupInvalidCrossHeaders -

func (*BlockTrackerStub) ComputeLongestChain

func (bts *BlockTrackerStub) ComputeLongestChain(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte)

ComputeLongestChain -

func (*BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized

func (bts *BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized() ([]data.HeaderHandler, [][]byte, error)

ComputeLongestMetaChainFromLastNotarized -

func (*BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized

func (bts *BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error)

ComputeLongestShardsChainsFromLastNotarized -

func (*BlockTrackerStub) DisplayTrackedHeaders

func (bts *BlockTrackerStub) DisplayTrackedHeaders()

DisplayTrackedHeaders -

func (*BlockTrackerStub) GetCrossNotarizedHeader

func (bts *BlockTrackerStub) GetCrossNotarizedHeader(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)

GetCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeader

func (bts *BlockTrackerStub) GetLastCrossNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)

GetLastCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards

func (bts *BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards() (map[uint32]data.HeaderHandler, error)

GetLastCrossNotarizedHeadersForAllShards -

func (*BlockTrackerStub) GetLastSelfNotarizedHeader

func (bts *BlockTrackerStub) GetLastSelfNotarizedHeader(shardID uint32) (data.HeaderHandler, []byte, error)

GetLastSelfNotarizedHeader -

func (*BlockTrackerStub) GetSelfNotarizedHeader added in v1.0.104

func (bts *BlockTrackerStub) GetSelfNotarizedHeader(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)

GetSelfNotarizedHeader -

func (*BlockTrackerStub) GetTrackedHeaders

func (bts *BlockTrackerStub) GetTrackedHeaders(shardID uint32) ([]data.HeaderHandler, [][]byte)

GetTrackedHeaders -

func (*BlockTrackerStub) GetTrackedHeadersForAllShards

func (bts *BlockTrackerStub) GetTrackedHeadersForAllShards() map[uint32][]data.HeaderHandler

GetTrackedHeadersForAllShards -

func (*BlockTrackerStub) GetTrackedHeadersWithNonce

func (bts *BlockTrackerStub) GetTrackedHeadersWithNonce(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)

GetTrackedHeadersWithNonce -

func (*BlockTrackerStub) IsInterfaceNil

func (bts *BlockTrackerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BlockTrackerStub) IsShardStuck

func (bts *BlockTrackerStub) IsShardStuck(shardId uint32) bool

IsShardStuck -

func (*BlockTrackerStub) RegisterCrossNotarizedHeadersHandler

func (bts *BlockTrackerStub) RegisterCrossNotarizedHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))

RegisterCrossNotarizedHeadersHandler -

func (*BlockTrackerStub) RegisterFinalMetachainHeadersHandler added in v1.1.1

func (bts *BlockTrackerStub) RegisterFinalMetachainHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))

RegisterFinalMetachainHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedFromCrossHeadersHandler added in v1.1.1

func (bts *BlockTrackerStub) RegisterSelfNotarizedFromCrossHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))

RegisterSelfNotarizedFromCrossHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedHeadersHandler

func (bts *BlockTrackerStub) RegisterSelfNotarizedHeadersHandler(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))

RegisterSelfNotarizedHeadersHandler -

func (*BlockTrackerStub) RemoveLastNotarizedHeaders

func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()

RemoveLastNotarizedHeaders -

func (*BlockTrackerStub) RestoreToGenesis

func (bts *BlockTrackerStub) RestoreToGenesis()

RestoreToGenesis -

func (*BlockTrackerStub) ShouldAddHeader

func (bts *BlockTrackerStub) ShouldAddHeader(headerHandler data.HeaderHandler) bool

ShouldAddHeader -

type BootstrapStorerMock added in v1.2.0

type BootstrapStorerMock struct {
	PutCalled             func(round int64, bootData bootstrapStorage.BootstrapData) error
	GetCalled             func(round int64) (bootstrapStorage.BootstrapData, error)
	GetHighestRoundCalled func() int64
}

BootstrapStorerMock -

func (*BootstrapStorerMock) Get added in v1.2.0

Get -

func (*BootstrapStorerMock) GetHighestRound added in v1.2.0

func (bsm *BootstrapStorerMock) GetHighestRound() int64

GetHighestRound -

func (*BootstrapStorerMock) IsInterfaceNil added in v1.2.0

func (bsm *BootstrapStorerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*BootstrapStorerMock) Put added in v1.2.0

func (bsm *BootstrapStorerMock) Put(round int64, bootData bootstrapStorage.BootstrapData) error

Put -

func (*BootstrapStorerMock) SaveLastRound added in v1.2.0

func (bsm *BootstrapStorerMock) SaveLastRound(_ int64) error

SaveLastRound -

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)
	GetAllStorersCalled func() map[dataRetriever.UnitType]storage.Storer
	DestroyCalled       func() error
	CloseAllCalled      func() error
}

ChainStorerMock is a mock implementation of the ChainStorer interface

func (*ChainStorerMock) AddStorer

func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer will add a new storer to the chain map

func (*ChainStorerMock) CloseAll

func (bc *ChainStorerMock) CloseAll() error

CloseAll -

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) GetAllStorers added in v1.2.4

func (bc *ChainStorerMock) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

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(_ uint32)

SetEpochForPutOperation won't do anything

type ChainStorerStub added in v1.2.0

type ChainStorerStub 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)
	GetAllStorersCalled func() map[dataRetriever.UnitType]storage.Storer
	DestroyCalled       func() error
	CloseAllCalled      func() error
}

ChainStorerStub is a mock implementation of the ChainStorer interface

func (*ChainStorerStub) AddStorer added in v1.2.0

func (bc *ChainStorerStub) AddStorer(key dataRetriever.UnitType, s storage.Storer)

AddStorer -

func (*ChainStorerStub) CloseAll added in v1.2.0

func (bc *ChainStorerStub) CloseAll() error

CloseAll -

func (*ChainStorerStub) Destroy added in v1.2.0

func (bc *ChainStorerStub) Destroy() error

Destroy -

func (*ChainStorerStub) Get added in v1.2.0

func (bc *ChainStorerStub) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error)

Get -

func (*ChainStorerStub) GetAll added in v1.2.0

func (bc *ChainStorerStub) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)

GetAll -

func (*ChainStorerStub) GetAllStorers added in v1.2.4

func (bc *ChainStorerStub) GetAllStorers() map[dataRetriever.UnitType]storage.Storer

GetAllStorers -

func (*ChainStorerStub) GetStorer added in v1.2.0

func (bc *ChainStorerStub) GetStorer(unitType dataRetriever.UnitType) storage.Storer

GetStorer -

func (*ChainStorerStub) Has added in v1.2.0

func (bc *ChainStorerStub) Has(unitType dataRetriever.UnitType, key []byte) error

Has -

func (*ChainStorerStub) IsInterfaceNil added in v1.2.0

func (bc *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ChainStorerStub) Put added in v1.2.0

func (bc *ChainStorerStub) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error

Put -

func (*ChainStorerStub) SetEpochForPutOperation added in v1.2.0

func (bc *ChainStorerStub) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation -

type CloserStub added in v1.2.0

type CloserStub struct {
	CloseCalled func() error
}

CloserStub -

func (*CloserStub) Close added in v1.2.0

func (c *CloserStub) Close() error

Close -

type DelegatedListProcessorStub added in v1.1.45

type DelegatedListProcessorStub struct {
	GetDelegatorsListCalled func() ([]*api.Delegator, error)
}

DelegatedListProcessorStub -

func (*DelegatedListProcessorStub) GetDelegatorsList added in v1.1.45

func (dlps *DelegatedListProcessorStub) GetDelegatorsList() ([]*api.Delegator, error)

GetDelegatorsList -

func (*DelegatedListProcessorStub) IsInterfaceNil added in v1.1.45

func (dlps *DelegatedListProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type DirectStakedListProcessorStub added in v1.1.45

type DirectStakedListProcessorStub struct {
	GetDirectStakedListCalled func() ([]*api.DirectStakedValue, error)
}

DirectStakedListProcessorStub -

func (*DirectStakedListProcessorStub) GetDirectStakedList added in v1.1.45

func (dslps *DirectStakedListProcessorStub) GetDirectStakedList() ([]*api.DirectStakedValue, error)

GetDirectStakedList -

func (*DirectStakedListProcessorStub) IsInterfaceNil added in v1.1.45

func (dslps *DirectStakedListProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type EconomicsHandlerStub added in v1.2.0

type EconomicsHandlerStub struct {
	MaxGasLimitPerBlockCalled                      func() uint64
	MaxGasLimitPerMiniBlockCalled                  func() uint64
	MaxGasLimitPerBlockForSafeCrossShardCalled     func() uint64
	MaxGasLimitPerMiniBlockForSafeCrossShardCalled func() uint64
	MaxGasLimitPerTxCalled                         func() uint64
	SetMinGasPriceCalled                           func(minGasPrice uint64)
	SetMinGasLimitCalled                           func(minGasLimit uint64)
	ComputeGasLimitCalled                          func(tx data.TransactionWithFeeHandler) uint64
	ComputeMoveBalanceFeeCalled                    func(tx data.TransactionWithFeeHandler) *big.Int
	ComputeTxFeeCalled                             func(tx data.TransactionWithFeeHandler) *big.Int
	CheckValidityTxValuesCalled                    func(tx data.TransactionWithFeeHandler) error
	DeveloperPercentageCalled                      func() float64
	MinGasPriceCalled                              func() uint64
	LeaderPercentageCalled                         func() float64
	ProtocolSustainabilityPercentageCalled         func() float64
	ProtocolSustainabilityAddressCalled            func() string
	MinInflationRateCalled                         func() float64
	MaxInflationRateCalled                         func(year uint32) float64
	GasPriceModifierCalled                         func() float64
	ComputeFeeForProcessingCalled                  func(tx data.TransactionWithFeeHandler, gasToUse uint64) *big.Int
	GenesisTotalSupplyCalled                       func() *big.Int
	RewardsTopUpGradientPointCalled                func() *big.Int
	RewardsTopUpFactorCalled                       func() float64
	SplitTxGasInCategoriesCalled                   func(tx data.TransactionWithFeeHandler) (uint64, uint64)
	GasPriceForProcessingCalled                    func(tx data.TransactionWithFeeHandler) uint64
	GasPriceForMoveCalled                          func(tx data.TransactionWithFeeHandler) uint64
	MinGasPriceForProcessingCalled                 func() uint64
	ComputeGasUsedAndFeeBasedOnRefundValueCalled   func(tx data.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)
	ComputeTxFeeBasedOnGasUsedCalled               func(tx data.TransactionWithFeeHandler, gasUsed uint64) *big.Int
	ComputeGasLimitBasedOnBalanceCalled            func(tx data.TransactionWithFeeHandler, balance *big.Int) (uint64, error)
}

EconomicsHandlerStub -

func (*EconomicsHandlerStub) CheckValidityTxValues added in v1.2.0

func (ehs *EconomicsHandlerStub) CheckValidityTxValues(tx data.TransactionWithFeeHandler) error

CheckValidityTxValues -

func (*EconomicsHandlerStub) ComputeFeeForProcessing added in v1.2.0

func (ehs *EconomicsHandlerStub) ComputeFeeForProcessing(tx data.TransactionWithFeeHandler, gasToUse uint64) *big.Int

ComputeFeeForProcessing -

func (*EconomicsHandlerStub) ComputeGasLimit added in v1.2.0

func (ehs *EconomicsHandlerStub) ComputeGasLimit(tx data.TransactionWithFeeHandler) uint64

ComputeGasLimit -

func (*EconomicsHandlerStub) ComputeGasLimitBasedOnBalance added in v1.2.4

func (ehs *EconomicsHandlerStub) ComputeGasLimitBasedOnBalance(tx data.TransactionWithFeeHandler, balance *big.Int) (uint64, error)

ComputeGasLimitBasedOnBalance -

func (*EconomicsHandlerStub) ComputeGasUsedAndFeeBasedOnRefundValue added in v1.2.0

func (ehs *EconomicsHandlerStub) ComputeGasUsedAndFeeBasedOnRefundValue(tx data.TransactionWithFeeHandler, refundValue *big.Int) (uint64, *big.Int)

ComputeGasUsedAndFeeBasedOnRefundValue -

func (*EconomicsHandlerStub) ComputeMoveBalanceFee added in v1.2.0

func (ehs *EconomicsHandlerStub) ComputeMoveBalanceFee(tx data.TransactionWithFeeHandler) *big.Int

ComputeMoveBalanceFee -

func (*EconomicsHandlerStub) ComputeTxFee added in v1.2.0

ComputeTxFee -

func (*EconomicsHandlerStub) ComputeTxFeeBasedOnGasUsed added in v1.2.0

func (ehs *EconomicsHandlerStub) ComputeTxFeeBasedOnGasUsed(tx data.TransactionWithFeeHandler, gasUsed uint64) *big.Int

ComputeTxFeeBasedOnGasUsed -

func (*EconomicsHandlerStub) DeveloperPercentage added in v1.2.0

func (ehs *EconomicsHandlerStub) DeveloperPercentage() float64

DeveloperPercentage -

func (*EconomicsHandlerStub) GasPerDataByte added in v1.2.0

func (ehs *EconomicsHandlerStub) GasPerDataByte() uint64

GasPerDataByte -

func (*EconomicsHandlerStub) GasPriceForMove added in v1.2.0

func (ehs *EconomicsHandlerStub) GasPriceForMove(tx data.TransactionWithFeeHandler) uint64

GasPriceForMove -

func (*EconomicsHandlerStub) GasPriceForProcessing added in v1.2.0

func (ehs *EconomicsHandlerStub) GasPriceForProcessing(tx data.TransactionWithFeeHandler) uint64

GasPriceForProcessing -

func (*EconomicsHandlerStub) GasPriceModifier added in v1.2.0

func (ehs *EconomicsHandlerStub) GasPriceModifier() float64

GasPriceModifier -

func (*EconomicsHandlerStub) GenesisTotalSupply added in v1.2.0

func (ehs *EconomicsHandlerStub) GenesisTotalSupply() *big.Int

GenesisTotalSupply -

func (*EconomicsHandlerStub) IsInterfaceNil added in v1.2.0

func (ehs *EconomicsHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*EconomicsHandlerStub) LeaderPercentage added in v1.2.0

func (ehs *EconomicsHandlerStub) LeaderPercentage() float64

LeaderPercentage -

func (*EconomicsHandlerStub) MaxGasLimitPerBlock added in v1.2.0

func (ehs *EconomicsHandlerStub) MaxGasLimitPerBlock(uint32) uint64

MaxGasLimitPerBlock -

func (*EconomicsHandlerStub) MaxGasLimitPerBlockForSafeCrossShard added in v1.2.23

func (ehs *EconomicsHandlerStub) MaxGasLimitPerBlockForSafeCrossShard() uint64

MaxGasLimitPerBlockForSafeCrossShard -

func (*EconomicsHandlerStub) MaxGasLimitPerMiniBlock added in v1.2.23

func (ehs *EconomicsHandlerStub) MaxGasLimitPerMiniBlock(uint32) uint64

MaxGasLimitPerMiniBlock -

func (*EconomicsHandlerStub) MaxGasLimitPerMiniBlockForSafeCrossShard added in v1.2.23

func (ehs *EconomicsHandlerStub) MaxGasLimitPerMiniBlockForSafeCrossShard() uint64

MaxGasLimitPerMiniBlockForSafeCrossShard -

func (*EconomicsHandlerStub) MaxGasLimitPerTx added in v1.3.0

func (ehs *EconomicsHandlerStub) MaxGasLimitPerTx() uint64

MaxGasLimitPerTx -

func (*EconomicsHandlerStub) MaxInflationRate added in v1.2.0

func (ehs *EconomicsHandlerStub) MaxInflationRate(year uint32) float64

MaxInflationRate -

func (*EconomicsHandlerStub) MinGasLimit added in v1.2.0

func (ehs *EconomicsHandlerStub) MinGasLimit() uint64

MinGasLimit will return min gas limit

func (*EconomicsHandlerStub) MinGasPrice added in v1.2.0

func (ehs *EconomicsHandlerStub) MinGasPrice() uint64

MinGasPrice -

func (*EconomicsHandlerStub) MinGasPriceForProcessing added in v1.2.0

func (ehs *EconomicsHandlerStub) MinGasPriceForProcessing() uint64

MinGasPriceForProcessing -

func (*EconomicsHandlerStub) MinInflationRate added in v1.2.0

func (ehs *EconomicsHandlerStub) MinInflationRate() float64

MinInflationRate -

func (*EconomicsHandlerStub) ProtocolSustainabilityAddress added in v1.2.0

func (ehs *EconomicsHandlerStub) ProtocolSustainabilityAddress() string

ProtocolSustainabilityAddress will return the protocol sustainability address

func (*EconomicsHandlerStub) ProtocolSustainabilityPercentage added in v1.2.0

func (ehs *EconomicsHandlerStub) ProtocolSustainabilityPercentage() float64

ProtocolSustainabilityPercentage will return the protocol sustainability percentage value

func (*EconomicsHandlerStub) RewardsTopUpFactor added in v1.2.0

func (ehs *EconomicsHandlerStub) RewardsTopUpFactor() float64

RewardsTopUpFactor -

func (*EconomicsHandlerStub) RewardsTopUpGradientPoint added in v1.2.0

func (ehs *EconomicsHandlerStub) RewardsTopUpGradientPoint() *big.Int

RewardsTopUpGradientPoint -

func (*EconomicsHandlerStub) SplitTxGasInCategories added in v1.2.0

func (ehs *EconomicsHandlerStub) SplitTxGasInCategories(tx data.TransactionWithFeeHandler) (uint64, uint64)

SplitTxGasInCategories -

type EpochStartNotifierStub

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)
	// contains filtered or unexported fields
}

EpochStartNotifierStub -

func (*EpochStartNotifierStub) IsInterfaceNil

func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartNotifierStub) NotifyAll

func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)

NotifyAll -

func (*EpochStartNotifierStub) NotifyAllPrepare

func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

NotifyAllPrepare -

func (*EpochStartNotifierStub) NotifyEpochChangeConfirmed added in v1.2.0

func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)

NotifyEpochChangeConfirmed -

func (*EpochStartNotifierStub) RegisterHandler

func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)

RegisterHandler -

func (*EpochStartNotifierStub) UnregisterHandler

func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)

UnregisterHandler -

type EpochStartTriggerStub

type EpochStartTriggerStub struct {
	ForceEpochStartCalled func(round uint64)
	IsEpochStartCalled    func() bool
	EpochCalled           func() uint32
	MetaEpochCalled       func() uint32
	ReceivedHeaderCalled  func(handler data.HeaderHandler)
	UpdateCalled          func(round uint64, nonce uint64)
	ProcessedCalled       func(header data.HeaderHandler)
	EpochStartRoundCalled func() uint64
}

EpochStartTriggerStub -

func (*EpochStartTriggerStub) Close added in v1.0.116

func (e *EpochStartTriggerStub) Close() error

Close -

func (*EpochStartTriggerStub) Epoch

func (e *EpochStartTriggerStub) Epoch() uint32

Epoch -

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)

ForceEpochStart -

func (*EpochStartTriggerStub) GetSavedStateKey

func (e *EpochStartTriggerStub) GetSavedStateKey() []byte

GetSavedStateKey -

func (*EpochStartTriggerStub) IsEpochStart

func (e *EpochStartTriggerStub) IsEpochStart() bool

IsEpochStart -

func (*EpochStartTriggerStub) IsInterfaceNil

func (e *EpochStartTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartTriggerStub) LoadState

func (e *EpochStartTriggerStub) LoadState(_ []byte) error

LoadState -

func (*EpochStartTriggerStub) MetaEpoch added in v1.0.104

func (e *EpochStartTriggerStub) MetaEpoch() uint32

MetaEpoch -

func (*EpochStartTriggerStub) NotifyAll

func (e *EpochStartTriggerStub) NotifyAll(_ data.HeaderHandler)

NotifyAll -

func (*EpochStartTriggerStub) RequestEpochStartIfNeeded

func (e *EpochStartTriggerStub) RequestEpochStartIfNeeded(_ data.HeaderHandler)

RequestEpochStartIfNeeded -

func (*EpochStartTriggerStub) Revert

Revert -

func (*EpochStartTriggerStub) RevertStateToBlock

func (e *EpochStartTriggerStub) RevertStateToBlock(_ data.HeaderHandler) error

RevertStateToBlock -

func (*EpochStartTriggerStub) SetAppStatusHandler added in v0.0.5

func (e *EpochStartTriggerStub) SetAppStatusHandler(_ core.AppStatusHandler) error

SetAppStatusHandler -

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, _ data.BodyHandler)

SetProcessed -

func (*EpochStartTriggerStub) Update

func (e *EpochStartTriggerStub) Update(round uint64, nonce uint64)

Update -

type EsdtStorageHandlerStub added in v1.3.3

type EsdtStorageHandlerStub struct {
	SaveESDTNFTTokenCalled                               func(senderAddress []byte, acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64, esdtData *esdt.ESDigitalToken, isCreation bool, isReturnWithError bool) ([]byte, error)
	GetESDTNFTTokenOnSenderCalled                        func(acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, error)
	GetESDTNFTTokenOnDestinationCalled                   func(acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, bool, error)
	WasAlreadySentToDestinationShardAndUpdateStateCalled func(tickerID []byte, nonce uint64, dstAddress []byte) (bool, error)
	SaveNFTMetaDataToSystemAccountCalled                 func(tx data.TransactionHandler) error
}

EsdtStorageHandlerStub -

func (*EsdtStorageHandlerStub) GetESDTNFTTokenOnDestination added in v1.3.3

func (e *EsdtStorageHandlerStub) GetESDTNFTTokenOnDestination(acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, bool, error)

GetESDTNFTTokenOnDestination -

func (*EsdtStorageHandlerStub) GetESDTNFTTokenOnSender added in v1.3.3

func (e *EsdtStorageHandlerStub) GetESDTNFTTokenOnSender(acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64) (*esdt.ESDigitalToken, error)

GetESDTNFTTokenOnSender -

func (*EsdtStorageHandlerStub) IsInterfaceNil added in v1.3.3

func (e *EsdtStorageHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EsdtStorageHandlerStub) SaveESDTNFTToken added in v1.3.3

func (e *EsdtStorageHandlerStub) SaveESDTNFTToken(senderAddress []byte, acnt vmcommon.UserAccountHandler, esdtTokenKey []byte, nonce uint64, esdtData *esdt.ESDigitalToken, isCreation bool, isReturnWithError bool) ([]byte, error)

SaveESDTNFTToken -

func (*EsdtStorageHandlerStub) SaveNFTMetaDataToSystemAccount added in v1.3.3

func (e *EsdtStorageHandlerStub) SaveNFTMetaDataToSystemAccount(tx data.TransactionHandler) error

SaveNFTMetaDataToSystemAccount -

func (*EsdtStorageHandlerStub) WasAlreadySentToDestinationShardAndUpdateState added in v1.3.3

func (e *EsdtStorageHandlerStub) WasAlreadySentToDestinationShardAndUpdateState(tickerID []byte, nonce uint64, dstAddress []byte) (bool, error)

WasAlreadySentToDestinationShardAndUpdateState -

type ForkDetectorMock

type ForkDetectorMock struct {
	AddHeaderCalled                 func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error
	RemoveHeaderCalled              func(nonce uint64, hash []byte)
	CheckForkCalled                 func() *process.ForkInfo
	GetHighestFinalBlockNonceCalled func() uint64
	GetHighestFinalBlockHashCalled  func() []byte
	ProbableHighestNonceCalled      func() uint64
	ResetForkCalled                 func()
	GetNotarizedHeaderHashCalled    func(nonce uint64) []byte
	SetRollBackNonceCalled          func(nonce uint64)
	RestoreToGenesisCalled          func()
	ResetProbableHighestNonceCalled func()
	SetFinalToLastCheckpointCalled  func()
}

ForkDetectorMock is a mock implementation for the ForkDetector interface

func (*ForkDetectorMock) AddHeader

func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error

AddHeader is a mock implementation for AddHeader

func (*ForkDetectorMock) CheckFork

func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo

CheckFork is a mock implementation for CheckFork

func (*ForkDetectorMock) GetHighestFinalBlockHash

func (fdm *ForkDetectorMock) GetHighestFinalBlockHash() []byte

GetHighestFinalBlockHash -

func (*ForkDetectorMock) GetHighestFinalBlockNonce

func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64

GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce

func (*ForkDetectorMock) GetNotarizedHeaderHash

func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte

GetNotarizedHeaderHash -

func (*ForkDetectorMock) IsInterfaceNil

func (fdm *ForkDetectorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ForkDetectorMock) ProbableHighestNonce

func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64

ProbableHighestNonce is a mock implementation for GetProbableHighestNonce

func (*ForkDetectorMock) RemoveHeader

func (fdm *ForkDetectorMock) RemoveHeader(nonce uint64, hash []byte)

RemoveHeader is a mock implementation for RemoveHeader

func (*ForkDetectorMock) ResetFork

func (fdm *ForkDetectorMock) ResetFork()

ResetFork -

func (*ForkDetectorMock) ResetProbableHighestNonce

func (fdm *ForkDetectorMock) ResetProbableHighestNonce()

ResetProbableHighestNonce -

func (*ForkDetectorMock) RestoreToGenesis

func (fdm *ForkDetectorMock) RestoreToGenesis()

RestoreToGenesis -

func (*ForkDetectorMock) SetFinalToLastCheckpoint added in v1.1.1

func (fdm *ForkDetectorMock) SetFinalToLastCheckpoint()

SetFinalToLastCheckpoint -

func (*ForkDetectorMock) SetRollBackNonce

func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)

SetRollBackNonce -

type GeneratorSuite

type GeneratorSuite struct {
	SuiteMock
	CreateKeyStub func(cipher.Stream) crypto.Scalar
}

GeneratorSuite -

func (*GeneratorSuite) CreateKey

func (gs *GeneratorSuite) CreateKey(c cipher.Stream) crypto.Scalar

CreateKey -

type HardforkTriggerStub added in v1.0.102

type HardforkTriggerStub struct {
	TriggerCalled                func(epoch uint32, withEarlyEndOfEpoch bool) error
	IsSelfTriggerCalled          func() bool
	TriggerReceivedCalled        func(payload []byte, data []byte, pkBytes []byte) (bool, error)
	RecordedTriggerMessageCalled func() ([]byte, bool)
	CreateDataCalled             func() []byte
	AddCloserCalled              func(closer update.Closer) error
	NotifyTriggerReceivedCalled  func() <-chan struct{}
}

HardforkTriggerStub -

func (*HardforkTriggerStub) AddCloser added in v1.0.133

func (hts *HardforkTriggerStub) AddCloser(closer update.Closer) error

AddCloser -

func (*HardforkTriggerStub) CreateData added in v1.0.102

func (hts *HardforkTriggerStub) CreateData() []byte

CreateData -

func (*HardforkTriggerStub) IsInterfaceNil added in v1.0.102

func (hts *HardforkTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HardforkTriggerStub) IsSelfTrigger added in v1.0.102

func (hts *HardforkTriggerStub) IsSelfTrigger() bool

IsSelfTrigger -

func (*HardforkTriggerStub) NotifyTriggerReceived added in v1.0.133

func (hts *HardforkTriggerStub) NotifyTriggerReceived() <-chan struct{}

NotifyTriggerReceived -

func (*HardforkTriggerStub) RecordedTriggerMessage added in v1.0.102

func (hts *HardforkTriggerStub) RecordedTriggerMessage() ([]byte, bool)

RecordedTriggerMessage -

func (*HardforkTriggerStub) Trigger added in v1.0.102

func (hts *HardforkTriggerStub) Trigger(epoch uint32, withEarlyEndOfEpoch bool) error

Trigger -

func (*HardforkTriggerStub) TriggerReceived added in v1.0.102

func (hts *HardforkTriggerStub) TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error)

TriggerReceived -

type HasherFake

type HasherFake struct {
}

HasherFake that will be used for testing

func (HasherFake) Compute

func (sha HasherFake) Compute(s string) []byte

Compute will output the SHA's equivalent of the input string

func (HasherFake) EmptyHash

func (sha HasherFake) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (*HasherFake) IsInterfaceNil

func (sha *HasherFake) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherFake) Size

func (HasherFake) Size() int

Size return the required size in bytes

type HasherMock

type HasherMock struct {
	ComputeCalled   func(s string) []byte
	EmptyHashCalled func() []byte
}

HasherMock -

func (HasherMock) Compute

func (hash HasherMock) Compute(s string) []byte

Compute -

func (HasherMock) EmptyHash

func (hash HasherMock) EmptyHash() []byte

EmptyHash -

func (HasherMock) IsInterfaceNil

func (hash HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size

func (HasherMock) Size() int

Size -

type HeaderIntegrityVerifierStub added in v1.0.117

type HeaderIntegrityVerifierStub struct {
	VerifyCalled     func(header data.HeaderHandler) error
	GetVersionCalled func(epoch uint32) string
}

HeaderIntegrityVerifierStub -

func (*HeaderIntegrityVerifierStub) GetVersion added in v1.1.1

func (h *HeaderIntegrityVerifierStub) GetVersion(epoch uint32) string

GetVersion -

func (*HeaderIntegrityVerifierStub) IsInterfaceNil added in v1.0.117

func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderIntegrityVerifierStub) Verify added in v1.0.117

Verify -

type HeaderResolverStub

type HeaderResolverStub struct {
	RequestDataFromHashCalled     func(hash []byte, epoch uint32) error
	ProcessReceivedMessageCalled  func(message p2p.MessageP2P) error
	RequestDataFromNonceCalled    func(nonce uint64, epoch uint32) error
	RequestDataFromEpochCalled    func(identifier []byte) error
	SetEpochHandlerCalled         func(epochHandler dataRetriever.EpochHandler) error
	SetNumPeersToQueryCalled      func(intra int, cross int)
	NumPeersToQueryCalled         func() (int, int)
	SetResolverDebugHandlerCalled func(handler dataRetriever.ResolverDebugHandler) error
	CloseCalled                   func() error
}

HeaderResolverStub -

func (*HeaderResolverStub) Close added in v1.2.0

func (hrs *HeaderResolverStub) Close() error

Close -

func (*HeaderResolverStub) IsInterfaceNil

func (hrs *HeaderResolverStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HeaderResolverStub) NumPeersToQuery added in v1.0.110

func (hrs *HeaderResolverStub) NumPeersToQuery() (int, int)

NumPeersToQuery -

func (*HeaderResolverStub) ProcessReceivedMessage

func (hrs *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error

ProcessReceivedMessage -

func (*HeaderResolverStub) RequestDataFromEpoch

func (hrs *HeaderResolverStub) RequestDataFromEpoch(identifier []byte) error

RequestDataFromEpoch -

func (*HeaderResolverStub) RequestDataFromHash

func (hrs *HeaderResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error

RequestDataFromHash -

func (*HeaderResolverStub) RequestDataFromNonce

func (hrs *HeaderResolverStub) RequestDataFromNonce(nonce uint64, epoch uint32) error

RequestDataFromNonce -

func (*HeaderResolverStub) SetEpochHandler

func (hrs *HeaderResolverStub) SetEpochHandler(epochHandler dataRetriever.EpochHandler) error

SetEpochHandler -

func (*HeaderResolverStub) SetNumPeersToQuery added in v1.0.102

func (hrs *HeaderResolverStub) SetNumPeersToQuery(intra int, cross int)

SetNumPeersToQuery -

func (*HeaderResolverStub) SetResolverDebugHandler added in v1.0.110

func (hrs *HeaderResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error

SetResolverDebugHandler -

type HeaderSigVerifierStub

type HeaderSigVerifierStub struct {
	VerifyRandSeedAndLeaderSignatureCalled func(header data.HeaderHandler) error
	VerifySignatureCalled                  func(header data.HeaderHandler) error
	VerifyRandSeedCalled                   func(header data.HeaderHandler) error
	VerifyLeaderSignatureCalled            func(header data.HeaderHandler) error
}

HeaderSigVerifierStub -

func (*HeaderSigVerifierStub) IsInterfaceNil

func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderSigVerifierStub) VerifyLeaderSignature added in v1.1.2

func (hsvm *HeaderSigVerifierStub) VerifyLeaderSignature(header data.HeaderHandler) error

VerifyLeaderSignature -

func (*HeaderSigVerifierStub) VerifyRandSeed

func (hsvm *HeaderSigVerifierStub) VerifyRandSeed(header data.HeaderHandler) error

VerifyRandSeed -

func (*HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature added in v1.1.2

func (hsvm *HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error

VerifyRandSeedAndLeaderSignature -

func (*HeaderSigVerifierStub) VerifySignature added in v1.1.2

func (hsvm *HeaderSigVerifierStub) VerifySignature(header data.HeaderHandler) error

VerifySignature -

type HeaderValidatorStub added in v1.2.0

type HeaderValidatorStub struct {
	IsHeaderConstructionValidCalled func(currHdr, prevHdr data.HeaderHandler) error
}

HeaderValidatorStub -

func (*HeaderValidatorStub) IsHeaderConstructionValid added in v1.2.0

func (hvs *HeaderValidatorStub) IsHeaderConstructionValid(currHdr, prevHdr data.HeaderHandler) error

IsHeaderConstructionValid -

func (*HeaderValidatorStub) IsInterfaceNil added in v1.2.0

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) Clear

func (hcs *HeadersCacherStub) Clear()

Clear -

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) Len

func (hcs *HeadersCacherStub) Len() int

Len -

func (*HeadersCacherStub) MaxSize

func (hcs *HeadersCacherStub) MaxSize() int

MaxSize -

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 IndexerStub added in v1.1.38

type IndexerStub struct {
	SaveBlockCalled func(args *indexer.ArgsSaveBlockData)
}

IndexerStub is a mock implementation fot the Indexer interface

func (*IndexerStub) Close added in v1.1.38

func (im *IndexerStub) Close() error

Close will do nothing

func (*IndexerStub) IsInterfaceNil added in v1.1.38

func (im *IndexerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*IndexerStub) IsNilIndexer added in v1.1.38

func (im *IndexerStub) IsNilIndexer() bool

IsNilIndexer -

func (*IndexerStub) RevertIndexedBlock added in v1.1.38

func (im *IndexerStub) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler)

RevertIndexedBlock -

func (*IndexerStub) SaveAccounts added in v1.1.38

func (im *IndexerStub) SaveAccounts(_ uint64, _ []state.UserAccountHandler)

SaveAccounts -

func (*IndexerStub) SaveBlock added in v1.1.38

func (im *IndexerStub) SaveBlock(args *indexer.ArgsSaveBlockData)

SaveBlock -

func (*IndexerStub) SaveRoundsInfo added in v1.1.38

func (im *IndexerStub) SaveRoundsInfo(_ []*indexer.RoundInfo)

SaveRoundsInfo -

func (*IndexerStub) SaveValidatorsPubKeys added in v1.1.38

func (im *IndexerStub) SaveValidatorsPubKeys(_ map[uint32][][]byte, _ uint32)

SaveValidatorsPubKeys -

func (*IndexerStub) SaveValidatorsRating added in v1.1.38

func (im *IndexerStub) SaveValidatorsRating(_ string, _ []*indexer.ValidatorRatingInfo)

SaveValidatorsRating -

func (*IndexerStub) SetTxLogsProcessor added in v1.1.38

func (im *IndexerStub) SetTxLogsProcessor(_ process.TransactionLogProcessorDatabase)

SetTxLogsProcessor will do nothing

type KeyGenMock

type KeyGenMock struct {
	GeneratePairMock            func() (crypto.PrivateKey, crypto.PublicKey)
	PrivateKeyFromByteArrayMock func(b []byte) (crypto.PrivateKey, error)
	PublicKeyFromByteArrayMock  func(b []byte) (crypto.PublicKey, error)
	SuiteMock                   func() crypto.Suite
}

KeyGenMock -

func (*KeyGenMock) CheckPublicKeyValid added in v1.0.120

func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error

CheckPublicKeyValid -

func (*KeyGenMock) GeneratePair

func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGenMock) IsInterfaceNil

func (keyGen *KeyGenMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*KeyGenMock) PrivateKeyFromByteArray

func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGenMock) PublicKeyFromByteArray

func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGenMock) Suite

func (keyGen *KeyGenMock) Suite() crypto.Suite

Suite -

type MarshalizerFake

type MarshalizerFake struct {
	Fail bool
}

MarshalizerFake that will be used for testing

func (*MarshalizerFake) IsInterfaceNil

func (mm *MarshalizerFake) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshalizerFake) Marshal

func (mm *MarshalizerFake) Marshal(obj interface{}) ([]byte, error)

Marshal converts the input object in a slice of bytes

func (*MarshalizerFake) Unmarshal

func (mm *MarshalizerFake) Unmarshal(obj interface{}, buff []byte) error

Unmarshal applies the serialized values over an instantiated object

type MarshalizerMock

type MarshalizerMock struct {
	MarshalHandler   func(obj interface{}) ([]byte, error)
	UnmarshalHandler func(obj interface{}, buff []byte) error
}

MarshalizerMock -

func (*MarshalizerMock) IsInterfaceNil

func (j *MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (MarshalizerMock) Marshal

func (j MarshalizerMock) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (MarshalizerMock) Unmarshal

func (j MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

type MiniBlocksProviderStub added in v1.2.0

type MiniBlocksProviderStub struct {
	GetMiniBlocksCalled           func(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
	GetMiniBlocksFromPoolCalled   func(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
	GetMiniBlocksFromStorerCalled func(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)
}

MiniBlocksProviderStub -

func (*MiniBlocksProviderStub) GetMiniBlocks added in v1.2.0

func (mbps *MiniBlocksProviderStub) GetMiniBlocks(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)

GetMiniBlocks -

func (*MiniBlocksProviderStub) GetMiniBlocksFromPool added in v1.2.0

func (mbps *MiniBlocksProviderStub) GetMiniBlocksFromPool(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)

GetMiniBlocksFromPool -

func (*MiniBlocksProviderStub) GetMiniBlocksFromStorer added in v1.3.7

func (mbps *MiniBlocksProviderStub) GetMiniBlocksFromStorer(hashes [][]byte) ([]*block.MiniblockAndHash, [][]byte)

GetMiniBlocksFromStorer -

func (*MiniBlocksProviderStub) IsInterfaceNil added in v1.2.0

func (mbps *MiniBlocksProviderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type MiniBlocksResolverStub

type MiniBlocksResolverStub struct {
	RequestDataFromHashCalled      func(hash []byte, epoch uint32) error
	RequestDataFromHashArrayCalled func(hashes [][]byte, epoch uint32) error
	ProcessReceivedMessageCalled   func(message p2p.MessageP2P) error
	SetNumPeersToQueryCalled       func(intra int, cross int)
	NumPeersToQueryCalled          func() (int, int)
	SetResolverDebugHandlerCalled  func(handler dataRetriever.ResolverDebugHandler) error
}

MiniBlocksResolverStub -

func (*MiniBlocksResolverStub) IsInterfaceNil

func (mbrs *MiniBlocksResolverStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MiniBlocksResolverStub) NumPeersToQuery added in v1.0.110

func (mbrs *MiniBlocksResolverStub) NumPeersToQuery() (int, int)

NumPeersToQuery -

func (*MiniBlocksResolverStub) ProcessReceivedMessage

func (mbrs *MiniBlocksResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error

ProcessReceivedMessage -

func (*MiniBlocksResolverStub) RequestDataFromHash

func (mbrs *MiniBlocksResolverStub) RequestDataFromHash(hash []byte, epoch uint32) error

RequestDataFromHash -

func (*MiniBlocksResolverStub) RequestDataFromHashArray

func (mbrs *MiniBlocksResolverStub) RequestDataFromHashArray(hashes [][]byte, epoch uint32) error

RequestDataFromHashArray -

func (*MiniBlocksResolverStub) SetNumPeersToQuery added in v1.0.102

func (mbrs *MiniBlocksResolverStub) SetNumPeersToQuery(intra int, cross int)

SetNumPeersToQuery -

func (*MiniBlocksResolverStub) SetResolverDebugHandler added in v1.0.110

func (mbrs *MiniBlocksResolverStub) SetResolverDebugHandler(handler dataRetriever.ResolverDebugHandler) error

SetResolverDebugHandler -

type NodeRedundancyHandlerStub added in v1.1.31

type NodeRedundancyHandlerStub struct {
	IsRedundancyNodeCalled         func() bool
	IsMainMachineActiveCalled      func() bool
	AdjustInactivityIfNeededCalled func(selfPubKey string, consensusPubKeys []string, roundIndex int64)
	ResetInactivityIfNeededCalled  func(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID)
	ObserverPrivateKeyCalled       func() crypto.PrivateKey
}

NodeRedundancyHandlerStub -

func (*NodeRedundancyHandlerStub) AdjustInactivityIfNeeded added in v1.1.31

func (nrhs *NodeRedundancyHandlerStub) AdjustInactivityIfNeeded(selfPubKey string, consensusPubKeys []string, roundIndex int64)

AdjustInactivityIfNeeded -

func (*NodeRedundancyHandlerStub) IsInterfaceNil added in v1.1.31

func (nrhs *NodeRedundancyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeRedundancyHandlerStub) IsMainMachineActive added in v1.1.31

func (nrhs *NodeRedundancyHandlerStub) IsMainMachineActive() bool

IsMainMachineActive -

func (*NodeRedundancyHandlerStub) IsRedundancyNode added in v1.1.31

func (nrhs *NodeRedundancyHandlerStub) IsRedundancyNode() bool

IsRedundancyNode -

func (*NodeRedundancyHandlerStub) ObserverPrivateKey added in v1.1.32

func (nrhs *NodeRedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey

ObserverPrivateKey -

func (*NodeRedundancyHandlerStub) ResetInactivityIfNeeded added in v1.1.31

func (nrhs *NodeRedundancyHandlerStub) ResetInactivityIfNeeded(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID)

ResetInactivityIfNeeded -

type NodeWrapperStub added in v1.0.110

type NodeWrapperStub struct {
	AddQueryHandlerCalled func(name string, handler debug.QueryHandler) error
}

NodeWrapperStub -

func (*NodeWrapperStub) AddQueryHandler added in v1.0.110

func (nws *NodeWrapperStub) AddQueryHandler(name string, handler debug.QueryHandler) error

AddQueryHandler -

func (*NodeWrapperStub) IsInterfaceNil added in v1.0.110

func (nws *NodeWrapperStub) IsInterfaceNil() bool

IsInterfaceNil -

type NodesCoordinatorMock

type NodesCoordinatorMock struct {
	ComputeValidatorsGroupCalled             func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]sharding.Validator, error)
	GetValidatorsPublicKeysCalled            func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorsRewardsAddressesCalled      func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetAllEligibleValidatorsPublicKeysCalled func() (map[uint32][][]byte, error)
}

NodesCoordinatorMock -

func (*NodesCoordinatorMock) ComputeAdditionalLeaving added in v1.0.115

func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving([]*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)

ComputeAdditionalLeaving -

func (*NodesCoordinatorMock) ComputeConsensusGroup

func (ncm *NodesCoordinatorMock) ComputeConsensusGroup(
	randomness []byte,
	round uint64,
	shardId uint32,
	epoch uint32,
) (validatorsGroup []sharding.Validator, err error)

ComputeConsensusGroup -

func (*NodesCoordinatorMock) ConsensusGroupSize

func (ncm *NodesCoordinatorMock) ConsensusGroupSize(uint32) int

ConsensusGroupSize -

func (*NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys

func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllEligibleValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys added in v1.0.102

func (ncm *NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllLeavingValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys

func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllWaitingValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetChance added in v1.0.102

func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32

GetChance -

func (*NodesCoordinatorMock) GetConsensusValidatorsPublicKeys

func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys(
	randomness []byte,
	round uint64,
	shardId uint32,
	epoch uint32,
) ([]string, error)

GetConsensusValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetConsensusWhitelistedNodes

func (ncm *NodesCoordinatorMock) GetConsensusWhitelistedNodes(
	_ uint32,
) (map[string]struct{}, error)

GetConsensusWhitelistedNodes return the whitelisted nodes allowed to send consensus messages, for each of the shards

func (*NodesCoordinatorMock) GetNumTotalEligible

func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64

GetNumTotalEligible -

func (*NodesCoordinatorMock) GetOwnPublicKey

func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte

GetOwnPublicKey -

func (*NodesCoordinatorMock) GetSavedStateKey

func (ncm *NodesCoordinatorMock) GetSavedStateKey() []byte

GetSavedStateKey -

func (*NodesCoordinatorMock) GetSelectedPublicKeys

func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) (publicKeys []string, err error)

GetSelectedPublicKeys -

func (*NodesCoordinatorMock) GetValidatorWithPublicKey

func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(_ []byte) (sharding.Validator, uint32, error)

GetValidatorWithPublicKey -

func (*NodesCoordinatorMock) GetValidatorsIndexes

func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)

GetValidatorsIndexes -

func (*NodesCoordinatorMock) IsInterfaceNil

func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*NodesCoordinatorMock) LoadState

func (ncm *NodesCoordinatorMock) LoadState(_ []byte) error

LoadState -

func (*NodesCoordinatorMock) SetConsensusGroupSize

func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(_ int) error

SetConsensusGroupSize -

func (*NodesCoordinatorMock) SetNodesPerShards

func (ncm *NodesCoordinatorMock) SetNodesPerShards(
	_ map[uint32][]sharding.Validator,
	_ map[uint32][]sharding.Validator,
	_ uint32,
) error

SetNodesPerShards -

func (*NodesCoordinatorMock) ShardIdForEpoch

func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error)

ShardIdForEpoch returns the nodesCoordinator configured ShardId for specified epoch if epoch configuration exists, otherwise error

func (*NodesCoordinatorMock) ShuffleOutForEpoch added in v1.0.111

func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)

ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler

func (*NodesCoordinatorMock) ValidatorsWeights added in v0.0.5

func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)

ValidatorsWeights -

type P2PAntifloodHandlerStub

type P2PAntifloodHandlerStub struct {
	CanProcessMessageCalled            func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
	CanProcessMessagesOnTopicCalled    func(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error
	ApplyConsensusSizeCalled           func(size int)
	SetDebuggerCalled                  func(debugger process.AntifloodDebugger) error
	BlacklistPeerCalled                func(peer core.PeerID, reason string, duration time.Duration)
	IsOriginatorEligibleForTopicCalled func(pid core.PeerID, topic string) error
}

P2PAntifloodHandlerStub -

func (*P2PAntifloodHandlerStub) ApplyConsensusSize added in v1.0.123

func (p2pahs *P2PAntifloodHandlerStub) ApplyConsensusSize(size int)

ApplyConsensusSize -

func (*P2PAntifloodHandlerStub) BlacklistPeer added in v1.0.132

func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)

BlacklistPeer -

func (*P2PAntifloodHandlerStub) CanProcessMessage

func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error

CanProcessMessage -

func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic added in v1.0.106

func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error

CanProcessMessagesOnTopic -

func (*P2PAntifloodHandlerStub) Close added in v1.2.0

func (p2pahs *P2PAntifloodHandlerStub) Close() error

Close -

func (*P2PAntifloodHandlerStub) IsInterfaceNil

func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*P2PAntifloodHandlerStub) IsOriginatorEligibleForTopic added in v1.2.0

func (p2pahs *P2PAntifloodHandlerStub) IsOriginatorEligibleForTopic(pid core.PeerID, topic string) error

IsOriginatorEligibleForTopic -

func (*P2PAntifloodHandlerStub) ResetForTopic

func (p2pahs *P2PAntifloodHandlerStub) ResetForTopic(_ string)

ResetForTopic -

func (*P2PAntifloodHandlerStub) SetDebugger added in v1.2.0

func (p2pahs *P2PAntifloodHandlerStub) SetDebugger(debugger process.AntifloodDebugger) error

SetDebugger -

func (*P2PAntifloodHandlerStub) SetMaxMessagesForTopic

func (p2pahs *P2PAntifloodHandlerStub) SetMaxMessagesForTopic(_ string, _ uint32)

SetMaxMessagesForTopic -

func (*P2PAntifloodHandlerStub) SetPeerValidatorMapper added in v1.2.0

func (p2pahs *P2PAntifloodHandlerStub) SetPeerValidatorMapper(_ process.PeerValidatorMapper) error

SetPeerValidatorMapper -

func (*P2PAntifloodHandlerStub) SetTopicsForAll added in v1.2.0

func (p2pahs *P2PAntifloodHandlerStub) SetTopicsForAll(_ ...string)

SetTopicsForAll -

type P2PMessageStub

type P2PMessageStub struct {
	FromField      []byte
	DataField      []byte
	SeqNoField     []byte
	TopicsField    []string
	SignatureField []byte
	KeyField       []byte
	PeerField      core.PeerID
}

P2PMessageStub -

func (*P2PMessageStub) Data

func (msg *P2PMessageStub) Data() []byte

Data -

func (*P2PMessageStub) From

func (msg *P2PMessageStub) From() []byte

From -

func (*P2PMessageStub) IsInterfaceNil

func (msg *P2PMessageStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*P2PMessageStub) Key

func (msg *P2PMessageStub) Key() []byte

Key -

func (*P2PMessageStub) Peer

func (msg *P2PMessageStub) Peer() core.PeerID

Peer -

func (*P2PMessageStub) SeqNo

func (msg *P2PMessageStub) SeqNo() []byte

SeqNo -

func (*P2PMessageStub) Signature

func (msg *P2PMessageStub) Signature() []byte

Signature -

func (*P2PMessageStub) Topics

func (msg *P2PMessageStub) Topics() []string

Topics -

type PeerBlackListHandlerStub added in v1.0.127

type PeerBlackListHandlerStub struct {
	UpsertCalled func(pid core.PeerID, span time.Duration) error
	HasCalled    func(pid core.PeerID) bool
	SweepCalled  func()
}

PeerBlackListHandlerStub -

func (*PeerBlackListHandlerStub) Has added in v1.0.127

func (pblhs *PeerBlackListHandlerStub) Has(pid core.PeerID) bool

Has -

func (*PeerBlackListHandlerStub) IsInterfaceNil added in v1.0.127

func (pblhs *PeerBlackListHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerBlackListHandlerStub) Sweep added in v1.0.127

func (pblhs *PeerBlackListHandlerStub) Sweep()

Sweep -

func (*PeerBlackListHandlerStub) Upsert added in v1.2.0

func (pblhs *PeerBlackListHandlerStub) Upsert(pid core.PeerID, span time.Duration) error

Upsert -

type PeerDenialEvaluatorStub added in v1.0.133

type PeerDenialEvaluatorStub struct {
	IsDeniedCalled     func(pid core.PeerID) bool
	UpsertPeerIDCalled func(pid core.PeerID, duration time.Duration) error
}

PeerDenialEvaluatorStub -

func (*PeerDenialEvaluatorStub) IsDenied added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) IsDenied(pid core.PeerID) bool

IsDenied -

func (*PeerDenialEvaluatorStub) IsInterfaceNil added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerDenialEvaluatorStub) UpsertPeerID added in v1.0.133

func (pdes *PeerDenialEvaluatorStub) UpsertPeerID(pid core.PeerID, duration time.Duration) error

UpsertPeerID -

type PeerSignatureHandler added in v1.0.138

type PeerSignatureHandler struct{}

PeerSignatureHandler -

func (*PeerSignatureHandler) GetPeerSignature added in v1.0.138

func (p *PeerSignatureHandler) GetPeerSignature(_ crypto.PrivateKey, _ []byte) ([]byte, error)

GetPeerSignature -

func (*PeerSignatureHandler) IsInterfaceNil added in v1.0.138

func (p *PeerSignatureHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerSignatureHandler) VerifyPeerSignature added in v1.0.138

func (p *PeerSignatureHandler) VerifyPeerSignature(_ []byte, _ core.PeerID, _ []byte) error

VerifyPeerSignature -

type PendingMiniBlocksHandlerStub

type PendingMiniBlocksHandlerStub struct {
	AddProcessedHeaderCalled   func(handler data.HeaderHandler) error
	RevertHeaderCalled         func(handler data.HeaderHandler) error
	GetPendingMiniBlocksCalled func(shardID uint32) [][]byte
	SetPendingMiniBlocksCalled func(shardID uint32, mbHashes [][]byte)
}

PendingMiniBlocksHandlerStub -

func (*PendingMiniBlocksHandlerStub) AddProcessedHeader

func (p *PendingMiniBlocksHandlerStub) AddProcessedHeader(handler data.HeaderHandler) error

AddProcessedHeader -

func (*PendingMiniBlocksHandlerStub) GetPendingMiniBlocks

func (p *PendingMiniBlocksHandlerStub) GetPendingMiniBlocks(shardID uint32) [][]byte

GetPendingMiniBlocks -

func (*PendingMiniBlocksHandlerStub) IsInterfaceNil

func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PendingMiniBlocksHandlerStub) RevertHeader

func (p *PendingMiniBlocksHandlerStub) RevertHeader(handler data.HeaderHandler) error

RevertHeader -

func (*PendingMiniBlocksHandlerStub) SetPendingMiniBlocks

func (p *PendingMiniBlocksHandlerStub) SetPendingMiniBlocks(shardID uint32, mbHashes [][]byte)

SetPendingMiniBlocks -

type PrivateKeyStub

type PrivateKeyStub struct {
	ToByteArrayHandler    func() ([]byte, error)
	GeneratePublicHandler func() crypto.PublicKey
	SuiteHandler          func() crypto.Suite
	ScalarHandler         func() crypto.Scalar
}

PrivateKeyStub -

func (*PrivateKeyStub) GeneratePublic

func (sk *PrivateKeyStub) GeneratePublic() crypto.PublicKey

GeneratePublic -

func (*PrivateKeyStub) IsInterfaceNil

func (sk *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar

func (sk *PrivateKeyStub) Scalar() crypto.Scalar

Scalar -

func (*PrivateKeyStub) Suite

func (sk *PrivateKeyStub) Suite() crypto.Suite

Suite -

func (*PrivateKeyStub) ToByteArray

func (sk *PrivateKeyStub) ToByteArray() ([]byte, error)

ToByteArray -

type PubkeyConverterMock added in v1.0.104

type PubkeyConverterMock struct {
	// contains filtered or unexported fields
}

PubkeyConverterMock -

func NewPubkeyConverterMock added in v1.0.104

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode added in v1.0.104

func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterMock) Encode added in v1.0.104

func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterMock) IsInterfaceNil added in v1.0.104

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len added in v1.0.104

func (pcm *PubkeyConverterMock) Len() int

Len -

type PubkeyConverterStub added in v1.0.104

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.104

func (pcs *PubkeyConverterStub) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterStub) Encode added in v1.0.104

func (pcs *PubkeyConverterStub) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterStub) IsInterfaceNil added in v1.0.104

func (pcs *PubkeyConverterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterStub) Len added in v1.0.104

func (pcs *PubkeyConverterStub) Len() int

Len -

type PublicKeyMock

type PublicKeyMock struct {
	ToByteArrayHandler func() ([]byte, error)
	SuiteCalled        func() crypto.Suite
	PointCalled        func() crypto.Point
}

PublicKeyMock -

func (*PublicKeyMock) IsInterfaceNil

func (sspk *PublicKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyMock) Point

func (sspk *PublicKeyMock) Point() crypto.Point

Point -

func (*PublicKeyMock) Suite

func (sspk *PublicKeyMock) Suite() crypto.Suite

Suite -

func (*PublicKeyMock) ToByteArray

func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

type QueryHandlerStub added in v1.0.110

type QueryHandlerStub struct {
	QueryCalled func(search string) []string
	CloseCalled func() error
}

QueryHandlerStub -

func (*QueryHandlerStub) Close added in v1.2.0

func (qhs *QueryHandlerStub) Close() error

Close -

func (*QueryHandlerStub) IsInterfaceNil added in v1.0.110

func (qhs *QueryHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*QueryHandlerStub) Query added in v1.0.110

func (qhs *QueryHandlerStub) Query(search string) []string

Query -

type ResolversFinderStub

type ResolversFinderStub struct {
	GetCalled                    func(key string) (dataRetriever.Resolver, error)
	AddCalled                    func(key string, val dataRetriever.Resolver) error
	ReplaceCalled                func(key string, val dataRetriever.Resolver) error
	RemoveCalled                 func(key string)
	LenCalled                    func() int
	IntraShardResolverCalled     func(baseTopic string) (dataRetriever.Resolver, error)
	MetaChainResolverCalled      func(baseTopic string) (dataRetriever.Resolver, error)
	CrossShardResolverCalled     func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
	ResolverKeysCalled           func() string
	MetaCrossShardResolverCalled func(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)
	IterateCalled                func(handler func(key string, resolver dataRetriever.Resolver) bool)
	CloseCalled                  func() error
}

ResolversFinderStub -

func (*ResolversFinderStub) Add

Add -

func (*ResolversFinderStub) AddMultiple

func (rfs *ResolversFinderStub) AddMultiple(_ []string, _ []dataRetriever.Resolver) error

AddMultiple -

func (*ResolversFinderStub) Close added in v1.2.0

func (rfs *ResolversFinderStub) Close() error

Close -

func (*ResolversFinderStub) CrossShardResolver

func (rfs *ResolversFinderStub) CrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)

CrossShardResolver -

func (*ResolversFinderStub) Get

Get -

func (*ResolversFinderStub) IntraShardResolver

func (rfs *ResolversFinderStub) IntraShardResolver(baseTopic string) (dataRetriever.Resolver, error)

IntraShardResolver -

func (*ResolversFinderStub) IsInterfaceNil

func (rfs *ResolversFinderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ResolversFinderStub) Iterate added in v1.0.110

func (rfs *ResolversFinderStub) Iterate(handler func(key string, resolver dataRetriever.Resolver) bool)

Iterate -

func (*ResolversFinderStub) Len

func (rfs *ResolversFinderStub) Len() int

Len -

func (*ResolversFinderStub) MetaChainResolver

func (rfs *ResolversFinderStub) MetaChainResolver(baseTopic string) (dataRetriever.Resolver, error)

MetaChainResolver -

func (*ResolversFinderStub) MetaCrossShardResolver added in v1.0.102

func (rfs *ResolversFinderStub) MetaCrossShardResolver(baseTopic string, crossShard uint32) (dataRetriever.Resolver, error)

MetaCrossShardResolver -

func (*ResolversFinderStub) Remove

func (rfs *ResolversFinderStub) Remove(key string)

Remove -

func (*ResolversFinderStub) Replace

func (rfs *ResolversFinderStub) Replace(key string, val dataRetriever.Resolver) error

Replace -

func (*ResolversFinderStub) ResolverKeys

func (rfs *ResolversFinderStub) ResolverKeys() string

ResolverKeys -

type RoundHandlerMock added in v1.2.0

type RoundHandlerMock struct {
	IndexCalled         func() int64
	TimeDurationCalled  func() time.Duration
	TimeStampCalled     func() time.Time
	UpdateRoundCalled   func(time.Time, time.Time)
	RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration
	BeforeGenesisCalled func() bool
	// contains filtered or unexported fields
}

RoundHandlerMock -

func (*RoundHandlerMock) BeforeGenesis added in v1.2.0

func (rndm *RoundHandlerMock) BeforeGenesis() bool

BeforeGenesis -

func (*RoundHandlerMock) Index added in v1.2.0

func (rndm *RoundHandlerMock) Index() int64

Index -

func (*RoundHandlerMock) IsInterfaceNil added in v1.2.0

func (rndm *RoundHandlerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RoundHandlerMock) RemainingTime added in v1.2.0

func (rndm *RoundHandlerMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration

RemainingTime -

func (*RoundHandlerMock) TimeDuration added in v1.2.0

func (rndm *RoundHandlerMock) TimeDuration() time.Duration

TimeDuration -

func (*RoundHandlerMock) TimeStamp added in v1.2.0

func (rndm *RoundHandlerMock) TimeStamp() time.Time

TimeStamp -

func (*RoundHandlerMock) UpdateRound added in v1.2.0

func (rndm *RoundHandlerMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)

UpdateRound -

type SCQueryServiceStub

type SCQueryServiceStub struct {
	ExecuteQueryCalled           func(*process.SCQuery) (*vmcommon.VMOutput, error)
	ComputeScCallGasLimitHandler func(tx *transaction.Transaction) (uint64, error)
	CloseCalled                  func() error
}

SCQueryServiceStub -

func (*SCQueryServiceStub) Close added in v1.2.0

func (serviceStub *SCQueryServiceStub) Close() error

Close -

func (*SCQueryServiceStub) ComputeScCallGasLimit

func (serviceStub *SCQueryServiceStub) ComputeScCallGasLimit(tx *transaction.Transaction) (uint64, error)

ComputeScCallGasLimit -

func (*SCQueryServiceStub) ExecuteQuery

func (serviceStub *SCQueryServiceStub) ExecuteQuery(query *process.SCQuery) (*vmcommon.VMOutput, error)

ExecuteQuery -

func (*SCQueryServiceStub) IsInterfaceNil

func (serviceStub *SCQueryServiceStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	SelfShardId     uint32
	ComputeIdCalled func([]byte) uint32
}

ShardCoordinatorMock -

func (*ShardCoordinatorMock) CommunicationIdentifier

func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorMock) ComputeId

func (scm *ShardCoordinatorMock) ComputeId(addr []byte) uint32

ComputeId -

func (*ShardCoordinatorMock) IsInterfaceNil

func (scm *ShardCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardCoordinatorMock) NumberOfShards

func (scm *ShardCoordinatorMock) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorMock) SameShard

func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool

SameShard -

func (*ShardCoordinatorMock) SelfId

func (scm *ShardCoordinatorMock) SelfId() uint32

SelfId -

func (*ShardCoordinatorMock) SetSelfShardId

func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error

SetSelfShardId -

type SingleSignerMock

type SingleSignerMock struct {
	SignStub   func(private crypto.PrivateKey, msg []byte) ([]byte, error)
	VerifyStub func(public crypto.PublicKey, msg []byte, sig []byte) error
}

SingleSignerMock -

func (*SingleSignerMock) IsInterfaceNil

func (s *SingleSignerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SingleSignerMock) Sign

func (s *SingleSignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)

Sign -

func (*SingleSignerMock) Verify

func (s *SingleSignerMock) Verify(public crypto.PublicKey, msg []byte, sig []byte) error

Verify -

type SinglesignFailMock

type SinglesignFailMock struct {
}

SinglesignFailMock -

func (*SinglesignFailMock) IsInterfaceNil

func (s *SinglesignFailMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignFailMock) Sign

func (s *SinglesignFailMock) Sign(_ crypto.PrivateKey, _ []byte) ([]byte, error)

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignFailMock) Verify

func (s *SinglesignFailMock) Verify(_ crypto.PublicKey, _ []byte, _ []byte) error

Verify verifies a signature using a single signature schnorr scheme

type SinglesignMock

type SinglesignMock struct {
}

SinglesignMock -

func (*SinglesignMock) IsInterfaceNil

func (s *SinglesignMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignMock) Sign

func (s *SinglesignMock) Sign(_ crypto.PrivateKey, _ []byte) ([]byte, error)

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignMock) Verify

func (s *SinglesignMock) Verify(_ crypto.PublicKey, _ []byte, sig []byte) error

Verify verifies a signature using a single signature schnorr scheme

type SinglesignStub

type SinglesignStub struct {
	SignCalled   func(private crypto.PrivateKey, msg []byte) ([]byte, error)
	VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error
}

SinglesignStub -

func (*SinglesignStub) IsInterfaceNil

func (s *SinglesignStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignStub) Sign

func (s *SinglesignStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignStub) Verify

func (s *SinglesignStub) Verify(public crypto.PublicKey, msg []byte, sig []byte) error

Verify verifies a signature using a single signature schnorr scheme

type StakeValuesProcessorStub added in v1.1.45

type StakeValuesProcessorStub struct {
	GetTotalStakedValueCalled func() (*api.StakeValues, error)
}

StakeValuesProcessorStub -

func (*StakeValuesProcessorStub) GetTotalStakedValue added in v1.1.45

func (svps *StakeValuesProcessorStub) GetTotalStakedValue() (*api.StakeValues, error)

GetTotalStakedValue -

func (*StakeValuesProcessorStub) IsInterfaceNil added in v1.1.45

func (svps *StakeValuesProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type StatusMetricsStub

type StatusMetricsStub struct {
	StatusMetricsMapWithoutP2PCalled              func() map[string]interface{}
	StatusP2pMetricsMapCalled                     func() map[string]interface{}
	ConfigMetricsCalled                           func() map[string]interface{}
	NetworkMetricsCalled                          func() map[string]interface{}
	EconomicsMetricsCalled                        func() map[string]interface{}
	EnableEpochsMetricsCalled                     func() map[string]interface{}
	StatusMetricsWithoutP2PPrometheusStringCalled func() string
}

StatusMetricsStub -

func (*StatusMetricsStub) ConfigMetrics added in v1.0.114

func (sms *StatusMetricsStub) ConfigMetrics() map[string]interface{}

ConfigMetrics -

func (*StatusMetricsStub) EconomicsMetrics added in v1.1.3

func (sms *StatusMetricsStub) EconomicsMetrics() map[string]interface{}

EconomicsMetrics -

func (*StatusMetricsStub) EnableEpochsMetrics added in v1.2.0

func (sms *StatusMetricsStub) EnableEpochsMetrics() map[string]interface{}

EnableEpochsMetrics -

func (*StatusMetricsStub) IsInterfaceNil

func (sms *StatusMetricsStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StatusMetricsStub) NetworkMetrics added in v1.0.114

func (sms *StatusMetricsStub) NetworkMetrics() map[string]interface{}

NetworkMetrics -

func (*StatusMetricsStub) StatusMetricsMapWithoutP2P

func (sms *StatusMetricsStub) StatusMetricsMapWithoutP2P() map[string]interface{}

StatusMetricsMapWithoutP2P -

func (*StatusMetricsStub) StatusMetricsWithoutP2PPrometheusString added in v1.0.147

func (sms *StatusMetricsStub) StatusMetricsWithoutP2PPrometheusString() string

StatusMetricsWithoutP2PPrometheusString -

func (*StatusMetricsStub) StatusP2pMetricsMap

func (sms *StatusMetricsStub) StatusP2pMetricsMap() map[string]interface{}

StatusP2pMetricsMap -

type StorerMock

type StorerMock struct {
	// contains filtered or unexported fields
}

StorerMock -

func NewStorerMock

func NewStorerMock() *StorerMock

NewStorerMock -

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

ClearCache -

func (*StorerMock) Close

func (sm *StorerMock) Close() error

Close -

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

DestroyUnit -

func (*StorerMock) Get

func (sm *StorerMock) Get(key []byte) ([]byte, error)

Get -

func (*StorerMock) GetBulkFromEpoch added in v1.0.147

func (sm *StorerMock) GetBulkFromEpoch(keys [][]byte, _ uint32) (map[string][]byte, error)

GetBulkFromEpoch -

func (*StorerMock) GetFromEpoch

func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)

GetFromEpoch -

func (*StorerMock) GetOldestEpoch added in v1.2.4

func (sm *StorerMock) GetOldestEpoch() (uint32, error)

GetOldestEpoch -

func (*StorerMock) Has

func (sm *StorerMock) Has(_ []byte) error

Has -

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

func (sm *StorerMock) Put(key, data []byte) error

Put -

func (*StorerMock) PutInEpoch added in v1.1.1

func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error

PutInEpoch -

func (*StorerMock) RangeKeys added in v1.0.147

func (sm *StorerMock) RangeKeys(_ func(_ []byte, _ []byte) bool)

RangeKeys -

func (*StorerMock) Remove

func (sm *StorerMock) Remove(_ []byte) error

Remove -

func (*StorerMock) RemoveFromCurrentEpoch added in v1.3.7

func (sm *StorerMock) RemoveFromCurrentEpoch(_ []byte) error

RemoveFromCurrentEpoch -

func (*StorerMock) SearchFirst

func (sm *StorerMock) SearchFirst(_ []byte) ([]byte, error)

SearchFirst -

type Streamer

type Streamer struct {
	// contains filtered or unexported fields
}

Streamer -

func NewStreamer

func NewStreamer() *Streamer

NewStreamer -

func (*Streamer) XORKeyStream

func (stream *Streamer) XORKeyStream(dst, src []byte)

XORKeyStream -

type SuiteMock

type SuiteMock struct {
	StringStub               func() string
	ScalarLenStub            func() int
	CreateScalarStub         func() crypto.Scalar
	PointLenStub             func() int
	CreatePointStub          func() crypto.Point
	CreatePointForScalarStub func(scalar crypto.Scalar) crypto.Point
	RandomStreamStub         func() cipher.Stream
	GetUnderlyingSuiteStub   func() interface{}
}

SuiteMock -

func (*SuiteMock) CreatePoint

func (s *SuiteMock) CreatePoint() crypto.Point

CreatePoint -

func (*SuiteMock) CreateScalar

func (s *SuiteMock) CreateScalar() crypto.Scalar

CreateScalar -

func (*SuiteMock) GetUnderlyingSuite

func (s *SuiteMock) GetUnderlyingSuite() interface{}

GetUnderlyingSuite -

func (*SuiteMock) IsInterfaceNil

func (s *SuiteMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SuiteMock) PointLen

func (s *SuiteMock) PointLen() int

PointLen -

func (*SuiteMock) RandomStream

func (s *SuiteMock) RandomStream() cipher.Stream

RandomStream -

func (*SuiteMock) ScalarLen

func (s *SuiteMock) ScalarLen() int

ScalarLen -

func (*SuiteMock) String

func (s *SuiteMock) String() string

String -

type SyncTimerStub added in v1.0.116

type SyncTimerStub struct {
}

SyncTimerStub -

func (*SyncTimerStub) ClockOffset added in v1.0.116

func (sts *SyncTimerStub) ClockOffset() time.Duration

ClockOffset -

func (*SyncTimerStub) Close added in v1.0.116

func (sts *SyncTimerStub) Close() error

Close -

func (*SyncTimerStub) CurrentTime added in v1.0.116

func (sts *SyncTimerStub) CurrentTime() time.Time

CurrentTime -

func (*SyncTimerStub) FormattedCurrentTime added in v1.0.116

func (sts *SyncTimerStub) FormattedCurrentTime() string

FormattedCurrentTime -

func (*SyncTimerStub) IsInterfaceNil added in v1.0.116

func (sts *SyncTimerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SyncTimerStub) StartSyncingTime added in v1.0.116

func (sts *SyncTimerStub) StartSyncingTime()

StartSyncingTime -

type ThrottlerStub added in v1.0.125

type ThrottlerStub struct {
	CanProcessCalled      func() bool
	StartProcessingCalled func()
	EndProcessingCalled   func()
	StartWasCalled        bool
	EndWasCalled          bool
}

ThrottlerStub -

func (*ThrottlerStub) CanProcess added in v1.0.125

func (ts *ThrottlerStub) CanProcess() bool

CanProcess -

func (*ThrottlerStub) EndProcessing added in v1.0.125

func (ts *ThrottlerStub) EndProcessing()

EndProcessing -

func (*ThrottlerStub) IsInterfaceNil added in v1.0.125

func (ts *ThrottlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ThrottlerStub) StartProcessing added in v1.0.125

func (ts *ThrottlerStub) StartProcessing()

StartProcessing -

type TimeCacheStub added in v1.0.133

type TimeCacheStub struct {
	AddCalled    func(key string) error
	UpsertCalled func(key string, span time.Duration) error
	HasCalled    func(key string) bool
	SweepCalled  func()
	LenCalled    func() int
}

TimeCacheStub -

func (*TimeCacheStub) Add added in v1.0.133

func (tcs *TimeCacheStub) Add(key string) error

Add -

func (*TimeCacheStub) Has added in v1.0.133

func (tcs *TimeCacheStub) Has(key string) bool

Has -

func (*TimeCacheStub) IsInterfaceNil added in v1.0.133

func (tcs *TimeCacheStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*TimeCacheStub) Len added in v1.1.1

func (tcs *TimeCacheStub) Len() int

Len -

func (*TimeCacheStub) Sweep added in v1.0.133

func (tcs *TimeCacheStub) Sweep()

Sweep -

func (*TimeCacheStub) Upsert added in v1.0.133

func (tcs *TimeCacheStub) Upsert(key string, span time.Duration) error

Upsert -

type TransactionCostEstimatorMock

type TransactionCostEstimatorMock struct {
	ComputeTransactionGasLimitCalled func(tx *transaction.Transaction) (*transaction.CostResponse, error)
}

TransactionCostEstimatorMock --

func (*TransactionCostEstimatorMock) ComputeTransactionGasLimit

func (tcem *TransactionCostEstimatorMock) ComputeTransactionGasLimit(tx *transaction.Transaction) (*transaction.CostResponse, error)

ComputeTransactionGasLimit --

func (*TransactionCostEstimatorMock) IsInterfaceNil

func (tcem *TransactionCostEstimatorMock) IsInterfaceNil() bool

IsInterfaceNil --

type TriesHolderStub added in v1.2.0

type TriesHolderStub struct {
	PutCalled    func([]byte, common.Trie)
	RemoveCalled func([]byte, common.Trie)
	GetCalled    func([]byte) common.Trie
	GetAllCalled func() []common.Trie
	ResetCalled  func()
}

TriesHolderStub -

func (*TriesHolderStub) Get added in v1.2.0

func (ths *TriesHolderStub) Get(key []byte) common.Trie

Get -

func (*TriesHolderStub) GetAll added in v1.2.0

func (ths *TriesHolderStub) GetAll() []common.Trie

GetAll -

func (*TriesHolderStub) IsInterfaceNil added in v1.2.0

func (ths *TriesHolderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TriesHolderStub) Put added in v1.2.0

func (ths *TriesHolderStub) Put(key []byte, trie common.Trie)

Put -

func (*TriesHolderStub) Replace added in v1.2.0

func (ths *TriesHolderStub) Replace(key []byte, trie common.Trie)

Replace -

func (*TriesHolderStub) Reset added in v1.2.0

func (ths *TriesHolderStub) Reset()

Reset -

type TxLogProcessorMock added in v1.2.0

type TxLogProcessorMock struct {
}

TxLogProcessorMock -

func (*TxLogProcessorMock) Clean added in v1.2.0

func (t *TxLogProcessorMock) Clean()

Clean -

func (*TxLogProcessorMock) EnableLogToBeSavedInCache added in v1.2.0

func (t *TxLogProcessorMock) EnableLogToBeSavedInCache()

EnableLogToBeSavedInCache -

func (*TxLogProcessorMock) GetLogFromCache added in v1.2.0

func (t *TxLogProcessorMock) GetLogFromCache(_ []byte) (*data.LogData, bool)

GetLogFromCache -

func (*TxLogProcessorMock) IsInterfaceNil added in v1.2.0

func (t *TxLogProcessorMock) IsInterfaceNil() bool

IsInterfaceNil -

type VMContainerMock added in v1.2.0

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
	CloseCalled       func() error
}

VMContainerMock -

func (*VMContainerMock) Add added in v1.2.0

Add -

func (*VMContainerMock) AddMultiple added in v1.2.0

func (v *VMContainerMock) AddMultiple(keys [][]byte, vms []vmcommon.VMExecutionHandler) error

AddMultiple -

func (*VMContainerMock) Close added in v1.2.0

func (v *VMContainerMock) Close() error

Close -

func (*VMContainerMock) Get added in v1.2.0

Get -

func (*VMContainerMock) IsInterfaceNil added in v1.2.0

func (v *VMContainerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*VMContainerMock) Keys added in v1.2.0

func (v *VMContainerMock) Keys() [][]byte

Keys -

func (*VMContainerMock) Len added in v1.2.0

func (v *VMContainerMock) Len() int

Len -

func (*VMContainerMock) Remove added in v1.2.0

func (v *VMContainerMock) Remove(key []byte)

Remove -

func (*VMContainerMock) Replace added in v1.2.0

func (v *VMContainerMock) Replace(key []byte, val vmcommon.VMExecutionHandler) error

Replace -

type VMExecutionHandlerStub added in v1.2.0

type VMExecutionHandlerStub struct {
	RunSmartContractCreateCalled func(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)
	RunSmartContractCallCalled   func(input *vmcommon.ContractCallInput) (*vmcommon.VMOutput, error)
	GasScheduleChangeCalled      func(newGasSchedule map[string]map[string]uint64)
	GetVersionCalled             func() string
}

VMExecutionHandlerStub -

func (*VMExecutionHandlerStub) GasScheduleChange added in v1.2.0

func (vm *VMExecutionHandlerStub) GasScheduleChange(newGasSchedule map[string]map[string]uint64)

GasScheduleChange sets a new gas schedule for the VM

func (*VMExecutionHandlerStub) GetVersion added in v1.2.1

func (vm *VMExecutionHandlerStub) GetVersion() string

GetVersionCalled -

func (*VMExecutionHandlerStub) IsInterfaceNil added in v1.2.0

func (vm *VMExecutionHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*VMExecutionHandlerStub) RunSmartContractCall added in v1.2.0

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 added in v1.2.0

func (vm *VMExecutionHandlerStub) RunSmartContractCreate(input *vmcommon.ContractCreateInput) (*vmcommon.VMOutput, error)

RunSmartContractCreate computes how a smart contract creation should be performed

type ValidatorMock

type ValidatorMock struct {
	// contains filtered or unexported fields
}

ValidatorMock -

func NewValidatorMock

func NewValidatorMock(pubKey []byte, chances uint32, index uint32) *ValidatorMock

NewValidatorMock -

func (*ValidatorMock) Chances added in v0.0.5

func (vm *ValidatorMock) Chances() uint32

Chances -

func (*ValidatorMock) Index added in v1.0.102

func (vm *ValidatorMock) Index() uint32

Index -

func (*ValidatorMock) PubKey

func (vm *ValidatorMock) PubKey() []byte

PubKey -

func (*ValidatorMock) Size added in v1.0.123

func (vm *ValidatorMock) Size() int

Size -

type ValidatorStatisticsProcessorMock

type ValidatorStatisticsProcessorMock struct {
	UpdatePeerStateCalled func(header data.MetaHeaderHandler) ([]byte, error)
	RevertPeerStateCalled func(header data.MetaHeaderHandler) error
	IsInterfaceNilCalled  func() bool

	GetPeerAccountCalled                     func(address []byte) (state.PeerAccountHandler, error)
	RootHashCalled                           func() ([]byte, error)
	ResetValidatorStatisticsAtNewEpochCalled func(vInfos map[uint32][]*state.ValidatorInfo) error
	GetValidatorInfoForRootHashCalled        func(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
	ProcessCalled                            func(validatorInfo data.ShardValidatorInfoHandler) error
	CommitCalled                             func() ([]byte, error)
	ProcessRatingsEndOfEpochCalled           func(validatorInfos map[uint32][]*state.ValidatorInfo, epoch uint32) error
	PeerAccountToValidatorInfoCalled         func(peerAccount state.PeerAccountHandler) *state.ValidatorInfo
	SaveNodesCoordinatorUpdatesCalled        func(epoch uint32) (bool, error)
}

ValidatorStatisticsProcessorMock -

func (*ValidatorStatisticsProcessorMock) Commit added in v0.0.5

func (vsp *ValidatorStatisticsProcessorMock) Commit() ([]byte, error)

Commit -

func (*ValidatorStatisticsProcessorMock) DisplayRatings added in v1.0.111

func (vsp *ValidatorStatisticsProcessorMock) DisplayRatings(_ uint32)

DisplayRatings -

func (*ValidatorStatisticsProcessorMock) GetExistingPeerAccount added in v1.1.1

func (vsp *ValidatorStatisticsProcessorMock) GetExistingPeerAccount(address []byte) (state.PeerAccountHandler, error)

GetExistingPeerAccount -

func (*ValidatorStatisticsProcessorMock) GetValidatorInfoForRootHash

func (vsp *ValidatorStatisticsProcessorMock) GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)

GetValidatorInfoForRootHash -

func (*ValidatorStatisticsProcessorMock) IsInterfaceNil

func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsProcessorMock) LastFinalizedRootHash added in v1.0.118

func (vsp *ValidatorStatisticsProcessorMock) LastFinalizedRootHash() []byte

LastFinalizedRootHash -

func (*ValidatorStatisticsProcessorMock) PeerAccountToValidatorInfo added in v1.1.1

func (vsp *ValidatorStatisticsProcessorMock) PeerAccountToValidatorInfo(peerAccount state.PeerAccountHandler) *state.ValidatorInfo

PeerAccountToValidatorInfo -

func (*ValidatorStatisticsProcessorMock) Process

Process -

func (*ValidatorStatisticsProcessorMock) ProcessRatingsEndOfEpoch added in v0.0.5

func (vsp *ValidatorStatisticsProcessorMock) ProcessRatingsEndOfEpoch(validatorInfos map[uint32][]*state.ValidatorInfo, epoch uint32) error

ProcessRatingsEndOfEpoch -

func (*ValidatorStatisticsProcessorMock) ResetValidatorStatisticsAtNewEpoch

func (vsp *ValidatorStatisticsProcessorMock) ResetValidatorStatisticsAtNewEpoch(vInfos map[uint32][]*state.ValidatorInfo) error

ResetValidatorStatisticsAtNewEpoch -

func (*ValidatorStatisticsProcessorMock) RevertPeerState

func (vsp *ValidatorStatisticsProcessorMock) RevertPeerState(header data.MetaHeaderHandler) error

RevertPeerState -

func (*ValidatorStatisticsProcessorMock) RootHash

func (vsp *ValidatorStatisticsProcessorMock) RootHash() ([]byte, error)

RootHash -

func (*ValidatorStatisticsProcessorMock) SaveNodesCoordinatorUpdates added in v1.1.15

func (vsp *ValidatorStatisticsProcessorMock) SaveNodesCoordinatorUpdates(epoch uint32) (bool, error)

SaveNodesCoordinatorUpdates -

func (*ValidatorStatisticsProcessorMock) SetLastFinalizedRootHash added in v1.0.118

func (vsp *ValidatorStatisticsProcessorMock) SetLastFinalizedRootHash(_ []byte)

SetLastFinalizedRootHash -

func (*ValidatorStatisticsProcessorMock) UpdatePeerState

func (vsp *ValidatorStatisticsProcessorMock) UpdatePeerState(header data.MetaHeaderHandler, _ map[string]data.HeaderHandler) ([]byte, error)

UpdatePeerState -

type ValidatorStatisticsProcessorStub

type ValidatorStatisticsProcessorStub struct {
	UpdatePeerStateCalled                    func(header data.MetaHeaderHandler) ([]byte, error)
	RevertPeerStateCalled                    func(header data.MetaHeaderHandler) error
	GetPeerAccountCalled                     func(address []byte) (state.PeerAccountHandler, error)
	RootHashCalled                           func() ([]byte, error)
	ResetValidatorStatisticsAtNewEpochCalled func(vInfos map[uint32][]*state.ValidatorInfo) error
	GetValidatorInfoForRootHashCalled        func(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
	ProcessRatingsEndOfEpochCalled           func(validatorInfos map[uint32][]*state.ValidatorInfo, epoch uint32) error
	ProcessCalled                            func(validatorInfo data.ShardValidatorInfoHandler) error
	CommitCalled                             func() ([]byte, error)
	PeerAccountToValidatorInfoCalled         func(peerAccount state.PeerAccountHandler) *state.ValidatorInfo
	SaveNodesCoordinatorUpdatesCalled        func(epoch uint32) (bool, error)
}

ValidatorStatisticsProcessorStub -

func (*ValidatorStatisticsProcessorStub) Commit added in v0.0.5

func (vsp *ValidatorStatisticsProcessorStub) Commit() ([]byte, error)

Commit -

func (*ValidatorStatisticsProcessorStub) DisplayRatings added in v1.0.111

func (vsp *ValidatorStatisticsProcessorStub) DisplayRatings(_ uint32)

DisplayRatings -

func (*ValidatorStatisticsProcessorStub) GetExistingPeerAccount added in v1.1.1

func (vsp *ValidatorStatisticsProcessorStub) GetExistingPeerAccount(address []byte) (state.PeerAccountHandler, error)

GetExistingPeerAccount -

func (*ValidatorStatisticsProcessorStub) GetValidatorInfoForRootHash

func (vsp *ValidatorStatisticsProcessorStub) GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)

GetValidatorInfoForRootHash -

func (*ValidatorStatisticsProcessorStub) IsInterfaceNil

func (vsp *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsProcessorStub) LastFinalizedRootHash added in v1.0.118

func (vsp *ValidatorStatisticsProcessorStub) LastFinalizedRootHash() []byte

LastFinalizedRootHash -

func (*ValidatorStatisticsProcessorStub) PeerAccountToValidatorInfo added in v1.1.1

func (vsp *ValidatorStatisticsProcessorStub) PeerAccountToValidatorInfo(peerAccount state.PeerAccountHandler) *state.ValidatorInfo

PeerAccountToValidatorInfo -

func (*ValidatorStatisticsProcessorStub) Process

Process -

func (*ValidatorStatisticsProcessorStub) ProcessRatingsEndOfEpoch added in v0.0.5

func (vsp *ValidatorStatisticsProcessorStub) ProcessRatingsEndOfEpoch(validatorInfos map[uint32][]*state.ValidatorInfo, epoch uint32) error

ProcessRatingsEndOfEpoch -

func (*ValidatorStatisticsProcessorStub) ResetValidatorStatisticsAtNewEpoch

func (vsp *ValidatorStatisticsProcessorStub) ResetValidatorStatisticsAtNewEpoch(vInfos map[uint32][]*state.ValidatorInfo) error

ResetValidatorStatisticsAtNewEpoch -

func (*ValidatorStatisticsProcessorStub) RevertPeerState

func (vsp *ValidatorStatisticsProcessorStub) RevertPeerState(header data.MetaHeaderHandler) error

RevertPeerState -

func (*ValidatorStatisticsProcessorStub) RootHash

func (vsp *ValidatorStatisticsProcessorStub) RootHash() ([]byte, error)

RootHash -

func (*ValidatorStatisticsProcessorStub) SaveNodesCoordinatorUpdates added in v1.1.15

func (vsp *ValidatorStatisticsProcessorStub) SaveNodesCoordinatorUpdates(epoch uint32) (bool, error)

SaveNodesCoordinatorUpdates -

func (*ValidatorStatisticsProcessorStub) SetLastFinalizedRootHash added in v1.0.118

func (vsp *ValidatorStatisticsProcessorStub) SetLastFinalizedRootHash(_ []byte)

SetLastFinalizedRootHash -

func (*ValidatorStatisticsProcessorStub) UpdatePeerState

func (vsp *ValidatorStatisticsProcessorStub) UpdatePeerState(header data.MetaHeaderHandler, _ map[string]data.HeaderHandler) ([]byte, error)

UpdatePeerState -

type ValidatorsProviderStub added in v0.0.5

type ValidatorsProviderStub struct {
	GetLatestValidatorsCalled func() map[string]*state.ValidatorApiResponse
}

ValidatorsProviderStub -

func (*ValidatorsProviderStub) Close added in v1.2.0

func (vp *ValidatorsProviderStub) Close() error

Close -

func (*ValidatorsProviderStub) GetLatestValidators added in v0.0.5

func (vp *ValidatorsProviderStub) GetLatestValidators() map[string]*state.ValidatorApiResponse

GetLatestValidators -

func (*ValidatorsProviderStub) IsInterfaceNil added in v0.0.5

func (vp *ValidatorsProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type VmMachinesContainerFactoryMock added in v1.2.0

type VmMachinesContainerFactoryMock struct {
}

VmMachinesContainerFactoryMock -

func (*VmMachinesContainerFactoryMock) BlockChainHookImpl added in v1.2.0

BlockChainHookImpl -

func (*VmMachinesContainerFactoryMock) Close added in v1.2.0

Close -

func (*VmMachinesContainerFactoryMock) Create added in v1.2.0

Create -

func (*VmMachinesContainerFactoryMock) IsInterfaceNil added in v1.2.0

func (v *VmMachinesContainerFactoryMock) IsInterfaceNil() bool

IsInterfaceNil -

type WatchdogMock added in v1.0.133

type WatchdogMock struct {
}

WatchdogMock -

func (*WatchdogMock) IsInterfaceNil added in v1.0.133

func (w *WatchdogMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*WatchdogMock) Reset added in v1.0.133

func (w *WatchdogMock) Reset(_ string)

Reset -

func (*WatchdogMock) Set added in v1.0.133

func (w *WatchdogMock) Set(_ func(alarmID string), _ time.Duration, _ string)

Set -

func (*WatchdogMock) SetDefault added in v1.0.133

func (w *WatchdogMock) SetDefault(_ time.Duration, _ string)

SetDefault -

func (*WatchdogMock) Stop added in v1.0.133

func (w *WatchdogMock) Stop(_ string)

Stop -

Source Files

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL