mock

package
v1.3.18-indexer1.2.20 Latest Latest
Warning

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

Go to latest
Published: Apr 13, 2022 License: GPL-3.0 Imports: 43 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")

ErrMockMarshalizer -

Functions

func ShardIdToString added in v1.2.0

func ShardIdToString(shardId uint32) string

ShardIdToString returns the string according to the shard id

Types

type AccountsFactoryStub added in v1.2.0

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

AccountsFactoryStub -

func (*AccountsFactoryStub) CreateAccount added in v1.2.0

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

CreateAccount -

func (*AccountsFactoryStub) IsInterfaceNil added in v1.2.0

func (afs *AccountsFactoryStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type AccountsParserStub added in v1.2.0

type AccountsParserStub struct {
	InitialAccountsSplitOnAddressesShardsCalled           func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)
	InitialAccountsSplitOnDelegationAddressesShardsCalled func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)
	InitialAccountsCalled                                 func() []genesis.InitialAccountHandler
	GetTotalStakedForDelegationAddressCalled              func(delegationAddress string) *big.Int
	GetInitialAccountsForDelegatedCalled                  func(addressBytes []byte) []genesis.InitialAccountHandler
	GenerateInitialTransactionsCalled                     func(shardCoordinator sharding.Coordinator, initialIndexingData map[uint32]*genesis.IndexingData) ([]*block.MiniBlock, map[uint32]*indexer.Pool, error)
}

AccountsParserStub -

func (*AccountsParserStub) GenerateInitialTransactions added in v1.3.0

func (aps *AccountsParserStub) GenerateInitialTransactions(shardCoordinator sharding.Coordinator, initialIndexingData map[uint32]*genesis.IndexingData) ([]*block.MiniBlock, map[uint32]*indexer.Pool, error)

GenerateInitialTransactions -

func (*AccountsParserStub) GetInitialAccountsForDelegated added in v1.2.0

func (aps *AccountsParserStub) GetInitialAccountsForDelegated(addressBytes []byte) []genesis.InitialAccountHandler

GetInitialAccountsForDelegated -

func (*AccountsParserStub) GetTotalStakedForDelegationAddress added in v1.2.0

func (aps *AccountsParserStub) GetTotalStakedForDelegationAddress(delegationAddress string) *big.Int

GetTotalStakedForDelegationAddress -

func (*AccountsParserStub) InitialAccounts added in v1.2.0

func (aps *AccountsParserStub) InitialAccounts() []genesis.InitialAccountHandler

InitialAccounts -

func (*AccountsParserStub) InitialAccountsSplitOnAddressesShards added in v1.2.0

func (aps *AccountsParserStub) InitialAccountsSplitOnAddressesShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)

InitialAccountsSplitOnAddressesShards -

func (*AccountsParserStub) InitialAccountsSplitOnDelegationAddressesShards added in v1.2.0

func (aps *AccountsParserStub) InitialAccountsSplitOnDelegationAddressesShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialAccountHandler, error)

InitialAccountsSplitOnDelegationAddressesShards -

func (*AccountsParserStub) IsInterfaceNil added in v1.2.0

func (aps *AccountsParserStub) IsInterfaceNil() bool

IsInterfaceNil -

type BlockProcessorStub added in v1.2.0

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
}

BlockProcessorStub mocks the implementation for a blockProcessor

func (*BlockProcessorStub) AddLastNotarizedHdr added in v1.2.0

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

AddLastNotarizedHdr -

func (*BlockProcessorStub) ApplyProcessedMiniBlocks added in v1.2.0

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

ApplyProcessedMiniBlocks -

func (*BlockProcessorStub) Close added in v1.2.0

func (bps *BlockProcessorStub) Close() error

Close -

func (*BlockProcessorStub) CommitBlock added in v1.2.0

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

CommitBlock mocks the commit of a block

func (*BlockProcessorStub) CreateBlock added in v1.2.0

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

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

CreateGenesisBlock mocks the creation of a genesis block body

func (*BlockProcessorStub) CreateNewHeader added in v1.2.0

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

CreateNewHeader creates a new header

func (*BlockProcessorStub) DecodeBlockBody added in v1.2.0

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

DecodeBlockBody -

func (*BlockProcessorStub) DecodeBlockHeader added in v1.2.0

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

DecodeBlockHeader -

func (*BlockProcessorStub) IsInterfaceNil added in v1.2.0

func (bps *BlockProcessorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*BlockProcessorStub) MarshalizedDataToBroadcast added in v1.2.0

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

MarshalizedDataToBroadcast -

func (*BlockProcessorStub) ProcessBlock added in v1.2.0

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

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

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

RestoreBlockIntoPools -

func (*BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis added in v1.2.0

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

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

func (bps *BlockProcessorStub) SetNumProcessedObj(_ uint64)

SetNumProcessedObj -

type BlockTrackerStub added in v1.2.0

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
	ShouldSkipMiniBlocksCreationFromSelfCalled         func() 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 added in v1.2.0

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

AddCrossNotarizedHeader -

func (*BlockTrackerStub) AddSelfNotarizedHeader added in v1.2.0

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

AddSelfNotarizedHeader -

func (*BlockTrackerStub) AddTrackedHeader added in v1.2.0

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

AddTrackedHeader -

func (*BlockTrackerStub) CheckBlockAgainstFinal added in v1.2.0

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

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

CheckBlockAgainstWhitelist -

func (*BlockTrackerStub) CleanupHeadersBehindNonce added in v1.2.0

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

CleanupHeadersBehindNonce -

func (*BlockTrackerStub) CleanupInvalidCrossHeaders added in v1.2.0

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

CleanupInvalidCrossHeaders -

func (*BlockTrackerStub) ComputeLongestChain added in v1.2.0

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

ComputeLongestChain -

func (*BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized added in v1.2.0

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

ComputeLongestMetaChainFromLastNotarized -

func (*BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized added in v1.2.0

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

ComputeLongestShardsChainsFromLastNotarized -

func (*BlockTrackerStub) DisplayTrackedHeaders added in v1.2.0

func (bts *BlockTrackerStub) DisplayTrackedHeaders()

DisplayTrackedHeaders -

func (*BlockTrackerStub) GetCrossNotarizedHeader added in v1.2.0

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

GetCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeader added in v1.2.0

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

GetLastCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards added in v1.2.0

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

GetLastCrossNotarizedHeadersForAllShards -

func (*BlockTrackerStub) GetLastSelfNotarizedHeader added in v1.2.0

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

GetLastSelfNotarizedHeader -

func (*BlockTrackerStub) GetSelfNotarizedHeader added in v1.2.0

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

GetSelfNotarizedHeader -

func (*BlockTrackerStub) GetTrackedHeaders added in v1.2.0

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

GetTrackedHeaders -

func (*BlockTrackerStub) GetTrackedHeadersForAllShards added in v1.2.0

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

GetTrackedHeadersForAllShards -

func (*BlockTrackerStub) GetTrackedHeadersWithNonce added in v1.2.0

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

GetTrackedHeadersWithNonce -

func (*BlockTrackerStub) IsInterfaceNil added in v1.2.0

func (bts *BlockTrackerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BlockTrackerStub) IsShardStuck added in v1.2.0

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

IsShardStuck -

func (*BlockTrackerStub) RegisterCrossNotarizedHeadersHandler added in v1.2.0

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

RegisterCrossNotarizedHeadersHandler -

func (*BlockTrackerStub) RegisterFinalMetachainHeadersHandler added in v1.2.0

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

RegisterFinalMetachainHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedFromCrossHeadersHandler added in v1.2.0

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

RegisterSelfNotarizedFromCrossHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedHeadersHandler added in v1.2.0

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

RegisterSelfNotarizedHeadersHandler -

func (*BlockTrackerStub) RemoveLastNotarizedHeaders added in v1.2.0

func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()

RemoveLastNotarizedHeaders -

func (*BlockTrackerStub) RestoreToGenesis added in v1.2.0

func (bts *BlockTrackerStub) RestoreToGenesis()

RestoreToGenesis -

func (*BlockTrackerStub) ShouldAddHeader added in v1.2.0

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

ShouldAddHeader -

func (*BlockTrackerStub) ShouldSkipMiniBlocksCreationFromSelf added in v1.3.18

func (bts *BlockTrackerStub) ShouldSkipMiniBlocksCreationFromSelf() bool

ShouldSkipMiniBlocksCreationFromSelf -

type BoostrapStorerStub added in v1.2.0

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

BoostrapStorerStub -

func (*BoostrapStorerStub) Get added in v1.2.0

Get -

func (*BoostrapStorerStub) GetHighestRound added in v1.2.0

func (bsm *BoostrapStorerStub) GetHighestRound() int64

GetHighestRound -

func (*BoostrapStorerStub) IsInterfaceNil added in v1.2.0

func (bsm *BoostrapStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BoostrapStorerStub) Put added in v1.2.0

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

Put -

func (*BoostrapStorerStub) SaveLastRound added in v1.2.0

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

SaveLastRound -

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

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

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

AddStorer will add a new storer to the chain map

func (*ChainStorerMock) CloseAll added in v1.2.0

func (bc *ChainStorerMock) CloseAll() error

CloseAll -

func (*ChainStorerMock) Destroy added in v1.2.0

func (bc *ChainStorerMock) Destroy() error

Destroy removes the underlying files/resources used by the storage service

func (*ChainStorerMock) Get added in v1.2.0

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

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

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

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

func (bc *ChainStorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChainStorerMock) Put added in v1.2.0

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

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 will add a new storer to the chain map

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 removes the underlying files/resources used by the storage service

func (*ChainStorerStub) Get added in v1.2.0

func (bc *ChainStorerStub) 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 (*ChainStorerStub) GetAll added in v1.2.0

func (bc *ChainStorerStub) 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 (*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 returns the storer from the chain map or nil if the storer was not found

func (*ChainStorerStub) Has added in v1.2.0

func (bc *ChainStorerStub) 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 (*ChainStorerStub) IsInterfaceNil added in v1.2.0

func (bc *ChainStorerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChainStorerStub) Put added in v1.2.0

func (bc *ChainStorerStub) 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 (*ChainStorerStub) SetEpochForPutOperation added in v1.2.0

func (bc *ChainStorerStub) SetEpochForPutOperation(_ uint32)

SetEpochForPutOperation won't do anything

type CoreComponentsMock added in v1.2.0

type CoreComponentsMock struct {
	IntMarsh            marshal.Marshalizer
	TxMarsh             marshal.Marshalizer
	VmMarsh             marshal.Marshalizer
	Hash                hashing.Hasher
	TxSignHasherField   hashing.Hasher
	UInt64ByteSliceConv typeConverters.Uint64ByteSliceConverter
	AddrPubKeyConv      core.PubkeyConverter
	ValPubKeyConv       core.PubkeyConverter
	StatusHdlUtils      nodeFactory.StatusHandlersUtils
	AppStatusHdl        core.AppStatusHandler

	PathHdl                     storage.PathManagerHandler
	WatchdogTimer               core.WatchdogTimer
	AlarmSch                    core.TimersScheduler
	NtpSyncTimer                ntp.SyncTimer
	GenesisBlockTime            time.Time
	ChainIdCalled               func() string
	MinTransactionVersionCalled func() uint32

	RoundHandlerField            consensus.RoundHandler
	EconomicsHandler             process.EconomicsDataHandler
	APIEconomicsHandler          process.EconomicsDataHandler
	RatingsConfig                process.RatingsInfoHandler
	RatingHandler                sharding.PeerAccountListAndRatingHandler
	NodesConfig                  sharding.GenesisNodesSetupHandler
	Shuffler                     sharding.NodesShuffler
	EpochChangeNotifier          process.EpochNotifier
	RoundChangeNotifier          process.RoundNotifier
	EpochNotifierWithConfirm     factory.EpochStartNotifierWithConfirm
	TxVersionCheckHandler        process.TxVersionCheckerHandler
	ChanStopProcess              chan endProcess.ArgEndProcess
	StartTime                    time.Time
	NodeTypeProviderField        core.NodeTypeProviderHandler
	ArwenChangeLockerInternal    common.Locker
	ProcessStatusHandlerInternal common.ProcessStatusHandler
	// contains filtered or unexported fields
}

CoreComponentsMock -

func (*CoreComponentsMock) APIEconomicsData added in v1.3.0

func (ccm *CoreComponentsMock) APIEconomicsData() process.EconomicsDataHandler

APIEconomicsData -

func (*CoreComponentsMock) AddressPubKeyConverter added in v1.2.0

func (ccm *CoreComponentsMock) AddressPubKeyConverter() core.PubkeyConverter

AddressPubKeyConverter -

func (*CoreComponentsMock) AlarmScheduler added in v1.2.0

func (ccm *CoreComponentsMock) AlarmScheduler() core.TimersScheduler

AlarmScheduler -

func (*CoreComponentsMock) ArwenChangeLocker added in v1.2.23

func (ccm *CoreComponentsMock) ArwenChangeLocker() common.Locker

ArwenChangeLocker -

func (*CoreComponentsMock) ChainID added in v1.2.0

func (ccm *CoreComponentsMock) ChainID() string

ChainID -

func (*CoreComponentsMock) ChanStopNodeProcess added in v1.2.0

func (ccm *CoreComponentsMock) ChanStopNodeProcess() chan endProcess.ArgEndProcess

ChanStopNodeProcess -

func (*CoreComponentsMock) EconomicsData added in v1.2.0

func (ccm *CoreComponentsMock) EconomicsData() process.EconomicsDataHandler

EconomicsData -

func (*CoreComponentsMock) EncodedAddressLen added in v1.2.0

func (ccm *CoreComponentsMock) EncodedAddressLen() uint32

EncodedAddressLen -

func (*CoreComponentsMock) EpochNotifier added in v1.2.0

func (ccm *CoreComponentsMock) EpochNotifier() process.EpochNotifier

EpochNotifier -

func (*CoreComponentsMock) EpochStartNotifierWithConfirm added in v1.2.0

func (ccm *CoreComponentsMock) EpochStartNotifierWithConfirm() factory.EpochStartNotifierWithConfirm

EpochStartNotifierWithConfirm -

func (*CoreComponentsMock) GenesisNodesSetup added in v1.2.0

func (ccm *CoreComponentsMock) GenesisNodesSetup() sharding.GenesisNodesSetupHandler

GenesisNodesSetup -

func (*CoreComponentsMock) GenesisTime added in v1.2.0

func (ccm *CoreComponentsMock) GenesisTime() time.Time

GenesisTime -

func (*CoreComponentsMock) Hasher added in v1.2.0

func (ccm *CoreComponentsMock) Hasher() hashing.Hasher

Hasher -

func (*CoreComponentsMock) InternalMarshalizer added in v1.2.0

func (ccm *CoreComponentsMock) InternalMarshalizer() marshal.Marshalizer

InternalMarshalizer -

func (*CoreComponentsMock) IsInterfaceNil added in v1.2.0

func (ccm *CoreComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CoreComponentsMock) MinTransactionVersion added in v1.2.0

func (ccm *CoreComponentsMock) MinTransactionVersion() uint32

MinTransactionVersion -

func (*CoreComponentsMock) NodeTypeProvider added in v1.2.4

func (ccm *CoreComponentsMock) NodeTypeProvider() core.NodeTypeProviderHandler

NodeTypeProvider -

func (*CoreComponentsMock) NodesShuffler added in v1.2.0

func (ccm *CoreComponentsMock) NodesShuffler() sharding.NodesShuffler

NodesShuffler -

func (*CoreComponentsMock) PathHandler added in v1.2.0

func (ccm *CoreComponentsMock) PathHandler() storage.PathManagerHandler

PathHandler -

func (*CoreComponentsMock) ProcessStatusHandler added in v1.3.18

func (ccm *CoreComponentsMock) ProcessStatusHandler() common.ProcessStatusHandler

ProcessStatusHandler -

func (*CoreComponentsMock) Rater added in v1.2.0

Rater -

func (*CoreComponentsMock) RatingsData added in v1.2.0

func (ccm *CoreComponentsMock) RatingsData() process.RatingsInfoHandler

RatingsData -

func (*CoreComponentsMock) RoundHandler added in v1.2.0

func (ccm *CoreComponentsMock) RoundHandler() consensus.RoundHandler

RoundHandler -

func (*CoreComponentsMock) RoundNotifier added in v1.3.0

func (ccm *CoreComponentsMock) RoundNotifier() process.RoundNotifier

RoundNotifier -

func (*CoreComponentsMock) SetInternalMarshalizer added in v1.2.0

func (ccm *CoreComponentsMock) SetInternalMarshalizer(m marshal.Marshalizer) error

SetInternalMarshalizer -

func (*CoreComponentsMock) StatusHandler added in v1.2.0

func (ccm *CoreComponentsMock) StatusHandler() core.AppStatusHandler

StatusHandler -

func (*CoreComponentsMock) StatusHandlerUtils added in v1.2.0

func (ccm *CoreComponentsMock) StatusHandlerUtils() nodeFactory.StatusHandlersUtils

StatusHandlerUtils -

func (*CoreComponentsMock) SyncTimer added in v1.2.0

func (ccm *CoreComponentsMock) SyncTimer() ntp.SyncTimer

SyncTimer -

func (*CoreComponentsMock) TxMarshalizer added in v1.2.0

func (ccm *CoreComponentsMock) TxMarshalizer() marshal.Marshalizer

TxMarshalizer -

func (*CoreComponentsMock) TxSignHasher added in v1.2.0

func (ccm *CoreComponentsMock) TxSignHasher() hashing.Hasher

TxSignHasher -

func (*CoreComponentsMock) TxVersionChecker added in v1.2.0

func (ccm *CoreComponentsMock) TxVersionChecker() process.TxVersionCheckerHandler

TxVersionChecker -

func (*CoreComponentsMock) Uint64ByteSliceConverter added in v1.2.0

func (ccm *CoreComponentsMock) Uint64ByteSliceConverter() typeConverters.Uint64ByteSliceConverter

Uint64ByteSliceConverter -

func (*CoreComponentsMock) ValidatorPubKeyConverter added in v1.2.0

func (ccm *CoreComponentsMock) ValidatorPubKeyConverter() core.PubkeyConverter

ValidatorPubKeyConverter -

func (*CoreComponentsMock) VmMarshalizer added in v1.2.0

func (ccm *CoreComponentsMock) VmMarshalizer() marshal.Marshalizer

VmMarshalizer -

func (*CoreComponentsMock) Watchdog added in v1.2.0

func (ccm *CoreComponentsMock) Watchdog() core.WatchdogTimer

Watchdog -

type CryptoComponentsMock added in v1.2.0

type CryptoComponentsMock struct {
	PubKey          crypto.PublicKey
	PrivKey         crypto.PrivateKey
	PubKeyString    string
	PrivKeyBytes    []byte
	PubKeyBytes     []byte
	BlockSig        crypto.SingleSigner
	TxSig           crypto.SingleSigner
	MultiSig        crypto.MultiSigner
	PeerSignHandler crypto.PeerSignatureHandler
	BlKeyGen        crypto.KeyGenerator
	TxKeyGen        crypto.KeyGenerator
	MsgSigVerifier  vm.MessageSignVerifier
	// contains filtered or unexported fields
}

CryptoComponentsMock -

func (*CryptoComponentsMock) BlockSignKeyGen added in v1.2.0

func (ccm *CryptoComponentsMock) BlockSignKeyGen() crypto.KeyGenerator

BlockSignKeyGen -

func (*CryptoComponentsMock) BlockSigner added in v1.2.0

func (ccm *CryptoComponentsMock) BlockSigner() crypto.SingleSigner

BlockSigner -

func (*CryptoComponentsMock) Clone added in v1.2.0

func (ccm *CryptoComponentsMock) Clone() interface{}

Clone -

func (*CryptoComponentsMock) IsInterfaceNil added in v1.2.0

func (ccm *CryptoComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CryptoComponentsMock) MessageSignVerifier added in v1.2.0

func (ccm *CryptoComponentsMock) MessageSignVerifier() vm.MessageSignVerifier

MessageSignVerifier -

func (*CryptoComponentsMock) MultiSigner added in v1.2.0

func (ccm *CryptoComponentsMock) MultiSigner() crypto.MultiSigner

MultiSigner -

func (*CryptoComponentsMock) PeerSignatureHandler added in v1.2.0

func (ccm *CryptoComponentsMock) PeerSignatureHandler() crypto.PeerSignatureHandler

PeerSignatureHandler -

func (*CryptoComponentsMock) PrivateKey added in v1.2.0

func (ccm *CryptoComponentsMock) PrivateKey() crypto.PrivateKey

PrivateKey -

func (*CryptoComponentsMock) PrivateKeyBytes added in v1.2.0

func (ccm *CryptoComponentsMock) PrivateKeyBytes() []byte

PrivateKeyBytes -

func (*CryptoComponentsMock) PublicKey added in v1.2.0

func (ccm *CryptoComponentsMock) PublicKey() crypto.PublicKey

PublicKey -

func (*CryptoComponentsMock) PublicKeyBytes added in v1.2.0

func (ccm *CryptoComponentsMock) PublicKeyBytes() []byte

PublicKeyBytes -

func (*CryptoComponentsMock) PublicKeyString added in v1.2.0

func (ccm *CryptoComponentsMock) PublicKeyString() string

PublicKeyString -

func (*CryptoComponentsMock) SetMultiSigner added in v1.2.0

func (ccm *CryptoComponentsMock) SetMultiSigner(ms crypto.MultiSigner) error

SetMultiSigner -

func (*CryptoComponentsMock) TxSignKeyGen added in v1.2.0

func (ccm *CryptoComponentsMock) TxSignKeyGen() crypto.KeyGenerator

TxSignKeyGen -

func (*CryptoComponentsMock) TxSingleSigner added in v1.2.0

func (ccm *CryptoComponentsMock) TxSingleSigner() crypto.SingleSigner

TxSingleSigner -

type DataComponentsMock added in v1.2.0

type DataComponentsMock struct {
	Storage           dataRetriever.StorageService
	Blkc              data.ChainHandler
	DataPool          dataRetriever.PoolsHolder
	MiniBlockProvider factory.MiniBlockProvider
	EconomicsData     factory.EconomicsHandler
}

DataComponentsMock -

func (*DataComponentsMock) Blockchain added in v1.2.0

func (dcm *DataComponentsMock) Blockchain() data.ChainHandler

Blockchain -

func (*DataComponentsMock) Clone added in v1.2.0

func (dcm *DataComponentsMock) Clone() interface{}

Clone -

func (*DataComponentsMock) Datapool added in v1.2.0

Datapool -

func (*DataComponentsMock) EconomicsHandler added in v1.2.0

func (dcm *DataComponentsMock) EconomicsHandler() factory.EconomicsHandler

EconomicsHandler -

func (*DataComponentsMock) IsInterfaceNil added in v1.2.0

func (dcm *DataComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*DataComponentsMock) MiniBlocksProvider added in v1.2.0

func (dcm *DataComponentsMock) MiniBlocksProvider() factory.MiniBlockProvider

MiniBlocksProvider -

func (*DataComponentsMock) SetBlockchain added in v1.2.0

func (dcm *DataComponentsMock) SetBlockchain(chain data.ChainHandler)

SetBlockchain -

func (*DataComponentsMock) StorageService added in v1.2.0

func (dcm *DataComponentsMock) StorageService() dataRetriever.StorageService

StorageService -

type EpochStartNotifierStub

type EpochStartNotifierStub struct {
	RegisterHandlerCalled            func(handler epochStart.ActionHandler)
	UnregisterHandlerCalled          func(handler epochStart.ActionHandler)
	NotifyAllPrepareCalled           func(hdr data.HeaderHandler, body data.BodyHandler)
	NotifyAllCalled                  func(hdr data.HeaderHandler)
	NotifyEpochChangeConfirmedCalled func(epoch uint32)
}

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

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

func (e *EpochStartTriggerStub) Close() error

Close -

func (*EpochStartTriggerStub) Epoch added in v1.2.0

func (e *EpochStartTriggerStub) Epoch() uint32

Epoch -

func (*EpochStartTriggerStub) EpochFinalityAttestingRound added in v1.2.0

func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64

EpochFinalityAttestingRound -

func (*EpochStartTriggerStub) EpochStartMetaHdrHash added in v1.2.0

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

EpochStartMetaHdrHash -

func (*EpochStartTriggerStub) EpochStartRound added in v1.2.0

func (e *EpochStartTriggerStub) EpochStartRound() uint64

EpochStartRound -

func (*EpochStartTriggerStub) ForceEpochStart added in v1.2.0

func (e *EpochStartTriggerStub) ForceEpochStart(round uint64)

ForceEpochStart -

func (*EpochStartTriggerStub) GetRoundsPerEpoch added in v1.2.0

func (e *EpochStartTriggerStub) GetRoundsPerEpoch() uint64

GetRoundsPerEpoch -

func (*EpochStartTriggerStub) GetSavedStateKey added in v1.2.0

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

GetSavedStateKey -

func (*EpochStartTriggerStub) IsEpochStart added in v1.2.0

func (e *EpochStartTriggerStub) IsEpochStart() bool

IsEpochStart -

func (*EpochStartTriggerStub) IsInterfaceNil added in v1.2.0

func (e *EpochStartTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartTriggerStub) LoadState added in v1.2.0

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

LoadState -

func (*EpochStartTriggerStub) MetaEpoch added in v1.2.0

func (e *EpochStartTriggerStub) MetaEpoch() uint32

MetaEpoch -

func (*EpochStartTriggerStub) NotifyAll added in v1.2.0

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

NotifyAll -

func (*EpochStartTriggerStub) ReceivedHeader added in v1.2.0

func (e *EpochStartTriggerStub) ReceivedHeader(header data.HeaderHandler)

ReceivedHeader -

func (*EpochStartTriggerStub) RequestEpochStartIfNeeded added in v1.2.0

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

RequestEpochStartIfNeeded -

func (*EpochStartTriggerStub) Revert added in v1.2.0

Revert -

func (*EpochStartTriggerStub) RevertStateToBlock added in v1.2.0

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

RevertStateToBlock -

func (*EpochStartTriggerStub) SetAppStatusHandler added in v1.2.0

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

SetAppStatusHandler -

func (*EpochStartTriggerStub) SetCurrentEpochStartRound added in v1.2.0

func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)

SetCurrentEpochStartRound -

func (*EpochStartTriggerStub) SetEpoch added in v1.2.0

func (e *EpochStartTriggerStub) SetEpoch(_ uint32)

SetEpoch -

func (*EpochStartTriggerStub) SetFinalityAttestingRound added in v1.2.0

func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)

SetFinalityAttestingRound -

func (*EpochStartTriggerStub) SetProcessed added in v1.2.0

func (e *EpochStartTriggerStub) SetProcessed(header data.HeaderHandler, _ data.BodyHandler)

SetProcessed -

func (*EpochStartTriggerStub) SetRoundsPerEpoch added in v1.2.0

func (e *EpochStartTriggerStub) SetRoundsPerEpoch(_ uint64)

SetRoundsPerEpoch -

func (*EpochStartTriggerStub) SetTrigger added in v1.2.0

SetTrigger -

func (*EpochStartTriggerStub) Update added in v1.2.0

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

Update -

type ForkDetectorMock added in v1.2.0

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

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

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

CheckFork is a mock implementation for CheckFork

func (*ForkDetectorMock) GetHighestFinalBlockHash added in v1.2.0

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

GetHighestFinalBlockHash -

func (*ForkDetectorMock) GetHighestFinalBlockNonce added in v1.2.0

func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64

GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce

func (*ForkDetectorMock) GetNotarizedHeaderHash added in v1.2.0

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

GetNotarizedHeaderHash -

func (*ForkDetectorMock) IsInterfaceNil added in v1.2.0

func (fdm *ForkDetectorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ForkDetectorMock) ProbableHighestNonce added in v1.2.0

func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64

ProbableHighestNonce is a mock implementation for GetProbableHighestNonce

func (*ForkDetectorMock) RemoveHeader added in v1.2.0

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

RemoveHeader is a mock implementation for RemoveHeader

func (*ForkDetectorMock) ResetFork added in v1.2.0

func (fdm *ForkDetectorMock) ResetFork()

ResetFork -

func (*ForkDetectorMock) ResetProbableHighestNonce added in v1.2.0

func (fdm *ForkDetectorMock) ResetProbableHighestNonce()

ResetProbableHighestNonce -

func (*ForkDetectorMock) RestoreToGenesis added in v1.2.0

func (fdm *ForkDetectorMock) RestoreToGenesis()

RestoreToGenesis -

func (*ForkDetectorMock) SetFinalToLastCheckpoint added in v1.2.0

func (fdm *ForkDetectorMock) SetFinalToLastCheckpoint()

SetFinalToLastCheckpoint -

func (*ForkDetectorMock) SetRollBackNonce added in v1.2.0

func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)

SetRollBackNonce -

type ForkDetectorStub added in v1.2.0

type ForkDetectorStub 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()
}

ForkDetectorStub -

func (*ForkDetectorStub) AddHeader added in v1.2.0

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

AddHeader -

func (*ForkDetectorStub) CheckFork added in v1.2.0

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

CheckFork -

func (*ForkDetectorStub) GetHighestFinalBlockHash added in v1.2.0

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

GetHighestFinalBlockHash -

func (*ForkDetectorStub) GetHighestFinalBlockNonce added in v1.2.0

func (fdm *ForkDetectorStub) GetHighestFinalBlockNonce() uint64

GetHighestFinalBlockNonce -

func (*ForkDetectorStub) GetNotarizedHeaderHash added in v1.2.0

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

GetNotarizedHeaderHash -

func (*ForkDetectorStub) IsInterfaceNil added in v1.2.0

func (fdm *ForkDetectorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ForkDetectorStub) ProbableHighestNonce added in v1.2.0

func (fdm *ForkDetectorStub) ProbableHighestNonce() uint64

ProbableHighestNonce -

func (*ForkDetectorStub) RemoveHeader added in v1.2.0

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

RemoveHeader -

func (*ForkDetectorStub) ResetFork added in v1.2.0

func (fdm *ForkDetectorStub) ResetFork()

ResetFork -

func (*ForkDetectorStub) ResetProbableHighestNonce added in v1.2.0

func (fdm *ForkDetectorStub) ResetProbableHighestNonce()

ResetProbableHighestNonce -

func (*ForkDetectorStub) RestoreToGenesis added in v1.2.0

func (fdm *ForkDetectorStub) RestoreToGenesis()

RestoreToGenesis -

func (*ForkDetectorStub) SetFinalToLastCheckpoint added in v1.2.0

func (fdm *ForkDetectorStub) SetFinalToLastCheckpoint()

SetFinalToLastCheckpoint -

func (*ForkDetectorStub) SetRollBackNonce added in v1.2.0

func (fdm *ForkDetectorStub) SetRollBackNonce(nonce uint64)

SetRollBackNonce -

type GasScheduleNotifierMock added in v1.2.0

type GasScheduleNotifierMock struct {
	GasSchedule map[string]map[string]uint64
}

GasScheduleNotifierMock -

func NewGasScheduleNotifierMock added in v1.2.0

func NewGasScheduleNotifierMock(gasSchedule map[string]map[string]uint64) *GasScheduleNotifierMock

NewGasScheduleNotifierMock -

func (*GasScheduleNotifierMock) IsInterfaceNil added in v1.2.0

func (g *GasScheduleNotifierMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*GasScheduleNotifierMock) LatestGasSchedule added in v1.2.0

func (g *GasScheduleNotifierMock) LatestGasSchedule() map[string]map[string]uint64

LatestGasSchedule -

func (*GasScheduleNotifierMock) RegisterNotifyHandler added in v1.2.0

func (g *GasScheduleNotifierMock) RegisterNotifyHandler(handler core.GasScheduleSubscribeHandler)

RegisterNotifyHandler -

func (*GasScheduleNotifierMock) UnRegisterAll added in v1.2.0

func (g *GasScheduleNotifierMock) UnRegisterAll()

UnRegisterAll -

type HardforkTriggerStub added in v1.2.0

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

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

AddCloser -

func (*HardforkTriggerStub) CreateData added in v1.2.0

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

CreateData -

func (*HardforkTriggerStub) IsInterfaceNil added in v1.2.0

func (hts *HardforkTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HardforkTriggerStub) IsSelfTrigger added in v1.2.0

func (hts *HardforkTriggerStub) IsSelfTrigger() bool

IsSelfTrigger -

func (*HardforkTriggerStub) NotifyTriggerReceived added in v1.2.0

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

NotifyTriggerReceived -

func (*HardforkTriggerStub) RecordedTriggerMessage added in v1.2.0

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

RecordedTriggerMessage -

func (*HardforkTriggerStub) Trigger added in v1.2.0

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

Trigger -

func (*HardforkTriggerStub) TriggerReceived added in v1.2.0

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

TriggerReceived -

type HeaderIntegrityVerifierStub added in v1.2.0

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

HeaderIntegrityVerifierStub -

func (*HeaderIntegrityVerifierStub) GetVersion added in v1.2.0

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

GetVersion -

func (*HeaderIntegrityVerifierStub) IsInterfaceNil added in v1.2.0

func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderIntegrityVerifierStub) Verify added in v1.2.0

Verify -

type HeaderResolverStub added in v1.2.0

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
}

HeaderResolverStub -

func (*HeaderResolverStub) IsInterfaceNil added in v1.2.0

func (hrs *HeaderResolverStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HeaderResolverStub) NumPeersToQuery added in v1.2.0

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

NumPeersToQuery -

func (*HeaderResolverStub) ProcessReceivedMessage added in v1.2.0

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

ProcessReceivedMessage -

func (*HeaderResolverStub) RequestDataFromEpoch added in v1.2.0

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

RequestDataFromEpoch -

func (*HeaderResolverStub) RequestDataFromHash added in v1.2.0

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

RequestDataFromHash -

func (*HeaderResolverStub) RequestDataFromNonce added in v1.2.0

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

RequestDataFromNonce -

func (*HeaderResolverStub) SetEpochHandler added in v1.2.0

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

SetEpochHandler -

func (*HeaderResolverStub) SetNumPeersToQuery added in v1.2.0

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

SetNumPeersToQuery -

func (*HeaderResolverStub) SetResolverDebugHandler added in v1.2.0

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

SetResolverDebugHandler -

type HeaderSigVerifierStub added in v1.2.0

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

HeaderSigVerifierStub -

func (*HeaderSigVerifierStub) IsInterfaceNil added in v1.2.0

func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderSigVerifierStub) VerifyLeaderSignature added in v1.2.0

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

VerifyLeaderSignature -

func (*HeaderSigVerifierStub) VerifyRandSeed added in v1.2.0

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

VerifyRandSeed -

func (*HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature added in v1.2.0

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

VerifyRandSeedAndLeaderSignature -

func (*HeaderSigVerifierStub) VerifySignature added in v1.2.0

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

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

IndexerStub is a mock implementation fot the Indexer interface

func (*IndexerStub) Close added in v1.2.0

func (im *IndexerStub) Close() error

Close will do nothing

func (*IndexerStub) IsInterfaceNil added in v1.2.0

func (im *IndexerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*IndexerStub) IsNilIndexer added in v1.2.0

func (im *IndexerStub) IsNilIndexer() bool

IsNilIndexer -

func (*IndexerStub) RevertIndexedBlock added in v1.2.0

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

RevertIndexedBlock -

func (*IndexerStub) SaveAccounts added in v1.2.0

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

SaveAccounts -

func (*IndexerStub) SaveBlock added in v1.2.0

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

SaveBlock -

func (*IndexerStub) SaveRoundsInfo added in v1.2.0

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

SaveRoundsInfo -

func (*IndexerStub) SaveValidatorsPubKeys added in v1.2.0

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

SaveValidatorsPubKeys -

func (*IndexerStub) SaveValidatorsRating added in v1.2.0

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

SaveValidatorsRating -

func (*IndexerStub) SetTxLogsProcessor added in v1.2.0

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

type KeyLoaderStub struct {
	LoadKeyCalled func(relativePath string, skIndex int) ([]byte, string, error)
}

KeyLoaderStub -

func (*KeyLoaderStub) LoadKey added in v1.2.0

func (kl *KeyLoaderStub) LoadKey(relativePath string, skIndex int) ([]byte, string, error)

LoadKey -

type MarshalizerMock

type MarshalizerMock struct {
	Fail bool
}

MarshalizerMock that will be used for testing

func (MarshalizerMock) IsInterfaceNil

func (mm MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (MarshalizerMock) Marshal

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

Marshal converts the input object in a slice of bytes

func (MarshalizerMock) Unmarshal

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

Unmarshal applies the serialized values over an instantiated object

type MemDbMock added in v1.2.0

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

MemDbMock represents the memory database storage. It holds a map of key value pairs and a mutex to handle concurrent accesses to the map

func NewMemDbMock added in v1.2.0

func NewMemDbMock() *MemDbMock

NewMemDbMock creates a new memorydb object

func (*MemDbMock) Close added in v1.2.0

func (s *MemDbMock) Close() error

Close closes the files/resources associated to the storage medium

func (*MemDbMock) Destroy added in v1.2.0

func (s *MemDbMock) Destroy() error

Destroy removes the storage medium stored data

func (*MemDbMock) DestroyClosed added in v1.2.0

func (s *MemDbMock) DestroyClosed() error

DestroyClosed removes the already closed storage medium stored data

func (*MemDbMock) Get added in v1.2.0

func (s *MemDbMock) Get(key []byte) ([]byte, error)

Get gets the value associated to the key, or reports an error

func (*MemDbMock) Has added in v1.2.0

func (s *MemDbMock) Has(key []byte) error

Has returns true if the given key is present in the persistence medium, false otherwise

func (*MemDbMock) Init added in v1.2.0

func (s *MemDbMock) Init() error

Init initializes the storage medium and prepares it for usage

func (*MemDbMock) IsInterfaceNil added in v1.2.0

func (s *MemDbMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MemDbMock) Put added in v1.2.0

func (s *MemDbMock) Put(key, val []byte) error

Put adds the value to the (key, val) storage medium

func (*MemDbMock) Remove added in v1.2.0

func (s *MemDbMock) Remove(key []byte) error

Remove removes the data associated to the given key

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 MultipleShardsCoordinatorMock

type MultipleShardsCoordinatorMock struct {
	NoShards        uint32
	CurrentShard    uint32
	ComputeIdCalled func(address []byte) uint32
	SelfIDCalled    func() uint32
}

MultipleShardsCoordinatorMock -

func NewMultiShardsCoordinatorMock

func NewMultiShardsCoordinatorMock(nrShard uint32) *MultipleShardsCoordinatorMock

NewMultiShardsCoordinatorMock -

func (*MultipleShardsCoordinatorMock) CommunicationIdentifier

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

CommunicationIdentifier returns the identifier between current shard ID and destination shard ID identifier is generated such as the first shard from identifier is always smaller than the last

func (*MultipleShardsCoordinatorMock) ComputeId

func (scm *MultipleShardsCoordinatorMock) ComputeId(address []byte) uint32

ComputeId -

func (*MultipleShardsCoordinatorMock) IsInterfaceNil

func (scm *MultipleShardsCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MultipleShardsCoordinatorMock) NumberOfShards

func (scm *MultipleShardsCoordinatorMock) NumberOfShards() uint32

NumberOfShards -

func (*MultipleShardsCoordinatorMock) SameShard

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

SameShard -

func (*MultipleShardsCoordinatorMock) SelfId

func (scm *MultipleShardsCoordinatorMock) SelfId() uint32

SelfId -

func (*MultipleShardsCoordinatorMock) SetNoShards

func (scm *MultipleShardsCoordinatorMock) SetNoShards(noShards uint32)

SetNoShards -

func (*MultipleShardsCoordinatorMock) SetSelfId

func (scm *MultipleShardsCoordinatorMock) SetSelfId(_ uint32) error

SetSelfId -

type NetworkComponentsMock added in v1.2.0

type NetworkComponentsMock struct {
	Messenger            p2p.Messenger
	InputAntiFlood       factory.P2PAntifloodHandler
	OutputAntiFlood      factory.P2PAntifloodHandler
	PeerBlackList        process.PeerBlackListCacher
	PreferredPeersHolder factory.PreferredPeersHolderHandler
}

NetworkComponentsMock -

func (*NetworkComponentsMock) CheckSubcomponents added in v1.2.0

func (ncm *NetworkComponentsMock) CheckSubcomponents() error

CheckSubcomponents -

func (*NetworkComponentsMock) Close added in v1.2.0

func (ncm *NetworkComponentsMock) Close() error

Close -

func (*NetworkComponentsMock) Create added in v1.2.0

func (ncm *NetworkComponentsMock) Create() error

Create -

func (*NetworkComponentsMock) InputAntiFloodHandler added in v1.2.0

func (ncm *NetworkComponentsMock) InputAntiFloodHandler() factory.P2PAntifloodHandler

InputAntiFloodHandler -

func (*NetworkComponentsMock) IsInterfaceNil added in v1.2.0

func (ncm *NetworkComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NetworkComponentsMock) NetworkMessenger added in v1.2.0

func (ncm *NetworkComponentsMock) NetworkMessenger() p2p.Messenger

NetworkMessenger -

func (*NetworkComponentsMock) OutputAntiFloodHandler added in v1.2.0

func (ncm *NetworkComponentsMock) OutputAntiFloodHandler() factory.P2PAntifloodHandler

OutputAntiFloodHandler -

func (*NetworkComponentsMock) PeerBlackListHandler added in v1.2.0

func (ncm *NetworkComponentsMock) PeerBlackListHandler() process.PeerBlackListCacher

PeerBlackListHandler -

func (*NetworkComponentsMock) PeerHonestyHandler added in v1.2.0

func (ncm *NetworkComponentsMock) PeerHonestyHandler() factory.PeerHonestyHandler

PeerHonestyHandler -

func (*NetworkComponentsMock) PreferredPeersHolderHandler added in v1.2.3

func (ncm *NetworkComponentsMock) PreferredPeersHolderHandler() factory.PreferredPeersHolderHandler

PreferredPeersHolderHandler -

func (*NetworkComponentsMock) PubKeyCacher added in v1.2.0

func (ncm *NetworkComponentsMock) PubKeyCacher() process.TimeCacher

PubKeyCacher -

type NodeShufflerMock added in v1.2.0

type NodeShufflerMock struct {
}

NodeShufflerMock -

func (*NodeShufflerMock) IsInterfaceNil added in v1.2.0

func (nsm *NodeShufflerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeShufflerMock) UpdateNodeLists added in v1.2.0

func (nsm *NodeShufflerMock) UpdateNodeLists(args sharding.ArgsUpdateNodes) (*sharding.ResUpdateNodes, error)

UpdateNodeLists -

func (*NodeShufflerMock) UpdateParams added in v1.2.0

func (nsm *NodeShufflerMock) UpdateParams(
	_ uint32,
	_ uint32,
	_ float32,
	_ bool,
)

UpdateParams -

type NodesCoordinatorMock added in v1.2.0

type NodesCoordinatorMock struct {
	Validators                               map[uint32][]sharding.Validator
	ShardConsensusSize                       uint32
	MetaConsensusSize                        uint32
	ShardId                                  uint32
	NbShards                                 uint32
	GetSelectedPublicKeysCalled              func(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err 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)
	SetNodesPerShardsCalled                  func(nodes map[uint32][]sharding.Validator, epoch uint32) error
	ComputeValidatorsGroupCalled             func(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error)
	GetValidatorWithPublicKeyCalled          func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error)
	GetAllEligibleValidatorsPublicKeysCalled func(epoch uint32) (map[uint32][][]byte, error)
	GetAllWaitingValidatorsPublicKeysCalled  func() (map[uint32][][]byte, error)
	ConsensusGroupSizeCalled                 func(uint32) int
}

NodesCoordinatorMock defines the behaviour of a struct able to do validator group selection

func (*NodesCoordinatorMock) ComputeAdditionalLeaving added in v1.2.0

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

ComputeAdditionalLeaving -

func (*NodesCoordinatorMock) ComputeConsensusGroup added in v1.2.0

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

ComputeConsensusGroup -

func (*NodesCoordinatorMock) ConsensusGroupSize added in v1.2.0

func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int

ConsensusGroupSize -

func (*NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys added in v1.2.0

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

GetAllEligibleValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys added in v1.2.0

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

GetAllLeavingValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys added in v1.2.0

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

GetAllWaitingValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetChance added in v1.2.0

func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32

GetChance -

func (*NodesCoordinatorMock) GetConsensusValidatorsPublicKeys added in v1.2.0

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

GetConsensusValidatorsPublicKeys -

func (*NodesCoordinatorMock) GetConsensusWhitelistedNodes added in v1.2.0

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

func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64

GetNumTotalEligible -

func (*NodesCoordinatorMock) GetOwnPublicKey added in v1.2.0

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

GetOwnPublicKey -

func (*NodesCoordinatorMock) GetSavedStateKey added in v1.2.0

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

GetSavedStateKey -

func (*NodesCoordinatorMock) GetSelectedPublicKeys added in v1.2.0

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

GetSelectedPublicKeys -

func (*NodesCoordinatorMock) GetValidatorWithPublicKey added in v1.2.0

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

GetValidatorWithPublicKey -

func (*NodesCoordinatorMock) GetValidatorsIndexes added in v1.2.0

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

GetValidatorsIndexes -

func (*NodesCoordinatorMock) IsInterfaceNil added in v1.2.0

func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesCoordinatorMock) LoadState added in v1.2.0

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

LoadState -

func (*NodesCoordinatorMock) SetNodesPerShards added in v1.2.0

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

SetNodesPerShards -

func (*NodesCoordinatorMock) ShardIdForEpoch added in v1.2.0

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

func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)

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

func (*NodesCoordinatorMock) ValidatorsWeights added in v1.2.0

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

ValidatorsWeights -

type NodesSetupStub

type NodesSetupStub struct {
	InitialNodesInfoForShardCalled   func(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
	InitialNodesInfoCalled           func() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
	GetStartTimeCalled               func() int64
	GetRoundDurationCalled           func() uint64
	GetChainIdCalled                 func() string
	GetMinTransactionVersionCalled   func() uint32
	GetShardConsensusGroupSizeCalled func() uint32
	GetMetaConsensusGroupSizeCalled  func() uint32
	NumberOfShardsCalled             func() uint32
	MinNumberOfNodesCalled           func() uint32
	MinNumberOfShardNodesCalled      func() uint32
	MinNumberOfMetaNodesCalled       func() uint32
	GetHysteresisCalled              func() float32
	GetAdaptivityCalled              func() bool
}

NodesSetupStub -

func (*NodesSetupStub) GetAdaptivity added in v1.2.0

func (n *NodesSetupStub) GetAdaptivity() bool

GetAdaptivity -

func (*NodesSetupStub) GetChainId added in v1.2.0

func (n *NodesSetupStub) GetChainId() string

GetChainId -

func (*NodesSetupStub) GetHysteresis added in v1.2.0

func (n *NodesSetupStub) GetHysteresis() float32

GetHysteresis -

func (*NodesSetupStub) GetMetaConsensusGroupSize added in v1.2.0

func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32

GetMetaConsensusGroupSize -

func (*NodesSetupStub) GetMinTransactionVersion added in v1.2.0

func (n *NodesSetupStub) GetMinTransactionVersion() uint32

GetMinTransactionVersion -

func (*NodesSetupStub) GetRoundDuration added in v1.2.0

func (n *NodesSetupStub) GetRoundDuration() uint64

GetRoundDuration -

func (*NodesSetupStub) GetShardConsensusGroupSize added in v1.2.0

func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32

GetShardConsensusGroupSize -

func (*NodesSetupStub) GetStartTime added in v1.2.0

func (n *NodesSetupStub) GetStartTime() int64

GetStartTime -

func (*NodesSetupStub) InitialNodesInfo added in v1.2.0

InitialNodesInfo -

func (*NodesSetupStub) InitialNodesInfoForShard added in v1.2.0

func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)

InitialNodesInfoForShard -

func (*NodesSetupStub) IsInterfaceNil

func (n *NodesSetupStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesSetupStub) MinNumberOfMetaNodes added in v1.2.0

func (n *NodesSetupStub) MinNumberOfMetaNodes() uint32

MinNumberOfMetaNodes -

func (*NodesSetupStub) MinNumberOfNodes added in v1.2.0

func (n *NodesSetupStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*NodesSetupStub) MinNumberOfShardNodes added in v1.2.0

func (n *NodesSetupStub) MinNumberOfShardNodes() uint32

MinNumberOfShardNodes -

func (*NodesSetupStub) NumberOfShards added in v1.2.0

func (n *NodesSetupStub) NumberOfShards() uint32

NumberOfShards -

type P2PAntifloodHandlerStub added in v1.2.0

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

func (p2pahs *P2PAntifloodHandlerStub) ApplyConsensusSize(size int)

ApplyConsensusSize -

func (*P2PAntifloodHandlerStub) BlacklistPeer added in v1.2.0

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

BlacklistPeer -

func (*P2PAntifloodHandlerStub) CanProcessMessage added in v1.2.0

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

CanProcessMessage -

func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic added in v1.2.0

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

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

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

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

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

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

Has -

func (*PeerBlackListHandlerStub) IsInterfaceNil added in v1.2.0

func (pblhs *PeerBlackListHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerBlackListHandlerStub) Sweep added in v1.2.0

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

type PeerHonestyHandlerStub struct {
	ChangeScoreCalled func(pk string, topic string, units int)
}

PeerHonestyHandlerStub -

func (*PeerHonestyHandlerStub) ChangeScore added in v1.2.0

func (phhs *PeerHonestyHandlerStub) ChangeScore(pk string, topic string, units int)

ChangeScore -

func (*PeerHonestyHandlerStub) Close added in v1.2.0

func (phhs *PeerHonestyHandlerStub) Close() error

Close -

func (*PeerHonestyHandlerStub) IsInterfaceNil added in v1.2.0

func (phhs *PeerHonestyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type PeerSignatureHandler added in v1.2.0

type PeerSignatureHandler struct{}

PeerSignatureHandler -

func (*PeerSignatureHandler) GetPeerSignature added in v1.2.0

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

GetPeerSignature -

func (*PeerSignatureHandler) IsInterfaceNil added in v1.2.0

func (p *PeerSignatureHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerSignatureHandler) VerifyPeerSignature added in v1.2.0

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

VerifyPeerSignature -

type PendingMiniBlocksHandlerStub added in v1.2.0

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

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

AddProcessedHeader -

func (*PendingMiniBlocksHandlerStub) GetPendingMiniBlocks added in v1.2.0

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

GetPendingMiniBlocks -

func (*PendingMiniBlocksHandlerStub) IsInterfaceNil added in v1.2.0

func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PendingMiniBlocksHandlerStub) RevertHeader added in v1.2.0

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

RevertHeader -

func (*PendingMiniBlocksHandlerStub) SetPendingMiniBlocks added in v1.2.0

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

SetPendingMiniBlocks -

type PointMock

type PointMock struct {
	X int
	Y int

	GetUnderlyingObjStub func() interface{}
	MarshalBinaryStub    func(x, y int) ([]byte, error)
	UnmarshalBinaryStub  func([]byte) (x, y int, err error)
}

PointMock represents a mock implementation for a Point

func (*PointMock) Add

func (po *PointMock) Add(_ crypto.Point) (crypto.Point, error)

Add returns the result of adding receiver with Point p given as parameter, so that their scalars add homomorphically

func (*PointMock) Base

func (po *PointMock) Base() crypto.Point

Base returns the Group's base point.

func (*PointMock) Clone

func (po *PointMock) Clone() crypto.Point

Clone returns a clone of the receiver.

func (*PointMock) Equal

func (po *PointMock) Equal(p crypto.Point) (bool, error)

Equal tests if receiver is equal with the Point p given as parameter. Both Points need to be derived from the same Group

func (*PointMock) GetUnderlyingObj

func (po *PointMock) GetUnderlyingObj() interface{}

GetUnderlyingObj returns the object the implementation wraps

func (*PointMock) IsInterfaceNil

func (po *PointMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PointMock) MarshalBinary

func (po *PointMock) MarshalBinary() ([]byte, error)

MarshalBinary transforms the Point into a byte array

func (*PointMock) Mul

func (po *PointMock) Mul(s crypto.Scalar) (crypto.Point, error)

Mul returns the result of multiplying receiver by the scalar s. Mock multiplies the scalar to both X and Y fields

func (*PointMock) Neg

func (po *PointMock) Neg() crypto.Point

Neg returns the negation of receiver

func (*PointMock) Null

func (po *PointMock) Null() crypto.Point

Null returns the neutral identity element.

func (*PointMock) Pick

func (po *PointMock) Pick() (crypto.Point, error)

Pick returns a fresh random or pseudo-random Point.

func (*PointMock) Set

func (po *PointMock) Set(_ crypto.Point) error

Set sets the receiver equal to another Point p.

func (*PointMock) Sub

func (po *PointMock) Sub(_ crypto.Point) (crypto.Point, error)

Sub returns the result of subtracting from receiver the Point p given as parameter, so that their scalars subtract homomorphically

func (*PointMock) UnmarshalBinary

func (po *PointMock) UnmarshalBinary(point []byte) error

UnmarshalBinary recreates the Point from a byte array

type PrivateKeyStub added in v1.2.0

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

PrivateKeyStub -

func (*PrivateKeyStub) GeneratePublic added in v1.2.0

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

GeneratePublic -

func (*PrivateKeyStub) IsInterfaceNil added in v1.2.0

func (sk *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar added in v1.2.0

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

Scalar -

func (*PrivateKeyStub) Suite added in v1.2.0

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

Suite -

func (*PrivateKeyStub) ToByteArray added in v1.2.0

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

ToByteArray -

type ProcessComponentsMock added in v1.2.0

type ProcessComponentsMock struct {
	NodesCoord                           sharding.NodesCoordinator
	ShardCoord                           sharding.Coordinator
	IntContainer                         process.InterceptorsContainer
	ResFinder                            dataRetriever.ResolversFinder
	RoundHandlerField                    consensus.RoundHandler
	EpochTrigger                         epochStart.TriggerHandler
	EpochNotifier                        factory.EpochStartNotifier
	ForkDetect                           process.ForkDetector
	BlockProcess                         process.BlockProcessor
	BlackListHdl                         process.TimeCacher
	BootSore                             process.BootStorer
	HeaderSigVerif                       process.InterceptedHeaderSigVerifier
	HeaderIntegrVerif                    process.HeaderIntegrityVerifier
	ValidatorStatistics                  process.ValidatorStatisticsProcessor
	ValidatorProvider                    process.ValidatorsProvider
	BlockTrack                           process.BlockTracker
	PendingMiniBlocksHdl                 process.PendingMiniBlocksHandler
	ReqHandler                           process.RequestHandler
	TxLogsProcess                        process.TransactionLogProcessorDatabase
	HeaderConstructValidator             process.HeaderConstructionValidator
	PeerMapper                           process.NetworkShardingCollector
	TxSimulatorProcessor                 factory.TransactionSimulatorProcessor
	FallbackHdrValidator                 process.FallbackHeaderValidator
	WhiteListHandlerInternal             process.WhiteListHandler
	WhiteListerVerifiedTxsInternal       process.WhiteListHandler
	HistoryRepositoryInternal            dblookupext.HistoryRepository
	ImportStartHandlerInternal           update.ImportStartHandler
	RequestedItemsHandlerInternal        dataRetriever.RequestedItemsHandler
	NodeRedundancyHandlerInternal        consensus.NodeRedundancyHandler
	CurrentEpochProviderInternal         process.CurrentNetworkEpochProviderHandler
	ScheduledTxsExecutionHandlerInternal process.ScheduledTxsExecutionHandler
}

ProcessComponentsMock -

func (*ProcessComponentsMock) BlackListHandler added in v1.2.0

func (pcm *ProcessComponentsMock) BlackListHandler() process.TimeCacher

BlackListHandler -

func (*ProcessComponentsMock) BlockProcessor added in v1.2.0

func (pcm *ProcessComponentsMock) BlockProcessor() process.BlockProcessor

BlockProcessor -

func (*ProcessComponentsMock) BlockTracker added in v1.2.0

func (pcm *ProcessComponentsMock) BlockTracker() process.BlockTracker

BlockTracker -

func (*ProcessComponentsMock) BootStorer added in v1.2.0

func (pcm *ProcessComponentsMock) BootStorer() process.BootStorer

BootStorer -

func (*ProcessComponentsMock) CheckSubcomponents added in v1.2.0

func (pcm *ProcessComponentsMock) CheckSubcomponents() error

CheckSubcomponents -

func (*ProcessComponentsMock) Close added in v1.2.0

func (pcm *ProcessComponentsMock) Close() error

Close -

func (*ProcessComponentsMock) Create added in v1.2.0

func (pcm *ProcessComponentsMock) Create() error

Create -

func (*ProcessComponentsMock) CurrentEpochProvider added in v1.2.4

CurrentEpochProvider -

func (*ProcessComponentsMock) EpochStartNotifier added in v1.2.0

func (pcm *ProcessComponentsMock) EpochStartNotifier() factory.EpochStartNotifier

EpochStartNotifier -

func (*ProcessComponentsMock) EpochStartTrigger added in v1.2.0

func (pcm *ProcessComponentsMock) EpochStartTrigger() epochStart.TriggerHandler

EpochStartTrigger -

func (*ProcessComponentsMock) FallbackHeaderValidator added in v1.2.0

func (pcm *ProcessComponentsMock) FallbackHeaderValidator() process.FallbackHeaderValidator

FallbackHeaderValidator -

func (*ProcessComponentsMock) ForkDetector added in v1.2.0

func (pcm *ProcessComponentsMock) ForkDetector() process.ForkDetector

ForkDetector -

func (*ProcessComponentsMock) HeaderConstructionValidator added in v1.2.0

func (pcm *ProcessComponentsMock) HeaderConstructionValidator() process.HeaderConstructionValidator

HeaderConstructionValidator -

func (*ProcessComponentsMock) HeaderIntegrityVerifier added in v1.2.0

func (pcm *ProcessComponentsMock) HeaderIntegrityVerifier() process.HeaderIntegrityVerifier

HeaderIntegrityVerifier -

func (*ProcessComponentsMock) HeaderSigVerifier added in v1.2.0

HeaderSigVerifier -

func (*ProcessComponentsMock) HistoryRepository added in v1.2.0

func (pcm *ProcessComponentsMock) HistoryRepository() dblookupext.HistoryRepository

HistoryRepository -

func (*ProcessComponentsMock) ImportStartHandler added in v1.2.0

func (pcm *ProcessComponentsMock) ImportStartHandler() update.ImportStartHandler

ImportStartHandler -

func (*ProcessComponentsMock) InterceptorsContainer added in v1.2.0

func (pcm *ProcessComponentsMock) InterceptorsContainer() process.InterceptorsContainer

InterceptorsContainer -

func (*ProcessComponentsMock) IsInterfaceNil added in v1.2.0

func (pcm *ProcessComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*ProcessComponentsMock) NodeRedundancyHandler added in v1.2.0

func (pcm *ProcessComponentsMock) NodeRedundancyHandler() consensus.NodeRedundancyHandler

NodeRedundancyHandler -

func (*ProcessComponentsMock) NodesCoordinator added in v1.2.0

func (pcm *ProcessComponentsMock) NodesCoordinator() sharding.NodesCoordinator

NodesCoordinator -

func (*ProcessComponentsMock) PeerShardMapper added in v1.2.0

PeerShardMapper -

func (*ProcessComponentsMock) PendingMiniBlocksHandler added in v1.2.0

func (pcm *ProcessComponentsMock) PendingMiniBlocksHandler() process.PendingMiniBlocksHandler

PendingMiniBlocksHandler -

func (*ProcessComponentsMock) RequestHandler added in v1.2.0

func (pcm *ProcessComponentsMock) RequestHandler() process.RequestHandler

RequestHandler -

func (*ProcessComponentsMock) RequestedItemsHandler added in v1.2.0

func (pcm *ProcessComponentsMock) RequestedItemsHandler() dataRetriever.RequestedItemsHandler

RequestedItemsHandler -

func (*ProcessComponentsMock) ResolversFinder added in v1.2.0

func (pcm *ProcessComponentsMock) ResolversFinder() dataRetriever.ResolversFinder

ResolversFinder -

func (*ProcessComponentsMock) RoundHandler added in v1.2.0

func (pcm *ProcessComponentsMock) RoundHandler() consensus.RoundHandler

RoundHandler -

func (*ProcessComponentsMock) ScheduledTxsExecutionHandler added in v1.3.0

func (pcm *ProcessComponentsMock) ScheduledTxsExecutionHandler() process.ScheduledTxsExecutionHandler

ScheduledTxsExecutionHandler -

func (*ProcessComponentsMock) ShardCoordinator added in v1.2.0

func (pcm *ProcessComponentsMock) ShardCoordinator() sharding.Coordinator

ShardCoordinator -

func (*ProcessComponentsMock) String added in v1.2.12

func (pcm *ProcessComponentsMock) String() string

String -

func (*ProcessComponentsMock) TransactionSimulatorProcessor added in v1.2.0

func (pcm *ProcessComponentsMock) TransactionSimulatorProcessor() factory.TransactionSimulatorProcessor

TransactionSimulatorProcessor -

func (*ProcessComponentsMock) TxLogsProcessor added in v1.2.0

TxLogsProcessor -

func (*ProcessComponentsMock) ValidatorsProvider added in v1.2.0

func (pcm *ProcessComponentsMock) ValidatorsProvider() process.ValidatorsProvider

ValidatorsProvider -

func (*ProcessComponentsMock) ValidatorsStatistics added in v1.2.0

func (pcm *ProcessComponentsMock) ValidatorsStatistics() process.ValidatorStatisticsProcessor

ValidatorsStatistics -

func (*ProcessComponentsMock) WhiteListHandler added in v1.2.0

func (pcm *ProcessComponentsMock) WhiteListHandler() process.WhiteListHandler

WhiteListHandler -

func (*ProcessComponentsMock) WhiteListerVerifiedTxs added in v1.2.0

func (pcm *ProcessComponentsMock) WhiteListerVerifiedTxs() process.WhiteListHandler

WhiteListerVerifiedTxs -

type PubkeyConverterStub

type PubkeyConverterStub struct {
	LenCalled    func() int
	DecodeCalled func(humanReadable string) ([]byte, error)
	EncodeCalled func(pkBytes []byte) string
}

PubkeyConverterStub -

func (*PubkeyConverterStub) Decode

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

Decode -

func (*PubkeyConverterStub) Encode

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

Encode -

func (*PubkeyConverterStub) IsInterfaceNil

func (pcs *PubkeyConverterStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterStub) Len

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

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

RedundancyHandlerStub -

func (*RedundancyHandlerStub) AdjustInactivityIfNeeded added in v1.2.0

func (rhs *RedundancyHandlerStub) AdjustInactivityIfNeeded(selfPubKey string, consensusPubKeys []string, roundIndex int64)

AdjustInactivityIfNeeded -

func (*RedundancyHandlerStub) IsInterfaceNil added in v1.2.0

func (rhs *RedundancyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RedundancyHandlerStub) IsMainMachineActive added in v1.2.0

func (rhs *RedundancyHandlerStub) IsMainMachineActive() bool

IsMainMachineActive -

func (*RedundancyHandlerStub) IsRedundancyNode added in v1.2.0

func (rhs *RedundancyHandlerStub) IsRedundancyNode() bool

IsRedundancyNode -

func (*RedundancyHandlerStub) ObserverPrivateKey added in v1.2.0

func (rhs *RedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey

ObserverPrivateKey -

func (*RedundancyHandlerStub) ResetInactivityIfNeeded added in v1.2.0

func (rhs *RedundancyHandlerStub) ResetInactivityIfNeeded(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID)

ResetInactivityIfNeeded -

type ResolversFinderStub added in v1.2.0

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

Add -

func (*ResolversFinderStub) AddMultiple added in v1.2.0

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

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

CrossShardResolver -

func (*ResolversFinderStub) Get added in v1.2.0

Get -

func (*ResolversFinderStub) IntraShardResolver added in v1.2.0

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

IntraShardResolver -

func (*ResolversFinderStub) IsInterfaceNil added in v1.2.0

func (rfs *ResolversFinderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ResolversFinderStub) Iterate added in v1.2.0

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

Iterate -

func (*ResolversFinderStub) Len added in v1.2.0

func (rfs *ResolversFinderStub) Len() int

Len -

func (*ResolversFinderStub) MetaChainResolver added in v1.2.0

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

MetaChainResolver -

func (*ResolversFinderStub) MetaCrossShardResolver added in v1.2.0

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

MetaCrossShardResolver -

func (*ResolversFinderStub) Remove added in v1.2.0

func (rfs *ResolversFinderStub) Remove(key string)

Remove -

func (*ResolversFinderStub) Replace added in v1.2.0

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

Replace -

func (*ResolversFinderStub) ResolverKeys added in v1.2.0

func (rfs *ResolversFinderStub) ResolverKeys() string

ResolverKeys -

type RoundHandlerMock added in v1.2.0

type RoundHandlerMock struct {
	RoundIndex        int64
	RoundTimeStamp    time.Time
	RoundTimeDuration time.Duration
	// 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(_ time.Time, _ 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 ScalarMock

type ScalarMock struct {
	X int

	MarshalBinaryStub    func(x int) ([]byte, error)
	UnmarshalBinaryStub  func([]byte) (int, error)
	GetUnderlyingObjStub func() interface{}
}

ScalarMock represents a mock implementation of a Scalar

func (*ScalarMock) Add

func (sm *ScalarMock) Add(_ crypto.Scalar) (crypto.Scalar, error)

Add returns the modular sum of receiver with scalar s given as parameter

func (*ScalarMock) Clone

func (sm *ScalarMock) Clone() crypto.Scalar

Clone creates a new Scalar with same value as receiver

func (*ScalarMock) Div

func (sm *ScalarMock) Div(_ crypto.Scalar) (crypto.Scalar, error)

Div returns the modular division between receiver and scalar s given as parameter

func (*ScalarMock) Equal

func (sm *ScalarMock) Equal(_ crypto.Scalar) (bool, error)

Equal tests if receiver is equal with the scalar s given as parameter. Both scalars need to be derived from the same Group

func (*ScalarMock) GetUnderlyingObj

func (sm *ScalarMock) GetUnderlyingObj() interface{}

GetUnderlyingObj returns the object the implementation wraps

func (*ScalarMock) Inv

func (sm *ScalarMock) Inv(_ crypto.Scalar) (crypto.Scalar, error)

Inv returns the modular inverse of scalar s given as parameter

func (*ScalarMock) IsInterfaceNil

func (sm *ScalarMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ScalarMock) MarshalBinary

func (sm *ScalarMock) MarshalBinary() ([]byte, error)

MarshalBinary transforms the Scalar into a byte array

func (*ScalarMock) Mul

func (sm *ScalarMock) Mul(_ crypto.Scalar) (crypto.Scalar, error)

Mul returns the modular product of receiver with scalar s given as parameter

func (*ScalarMock) Neg

func (sm *ScalarMock) Neg() crypto.Scalar

Neg returns the modular negation of receiver

func (*ScalarMock) One

func (sm *ScalarMock) One() crypto.Scalar

One returns the multiplicative identity (1)

func (*ScalarMock) Pick

func (sm *ScalarMock) Pick() (crypto.Scalar, error)

Pick returns a fresh random or pseudo-random scalar For the mock set X to the original scalar.X *2

func (*ScalarMock) Set

func (sm *ScalarMock) Set(_ crypto.Scalar) error

Set sets the receiver to Scalar s given as parameter

func (*ScalarMock) SetBytes

func (sm *ScalarMock) SetBytes([]byte) (crypto.Scalar, error)

SetBytes sets the scalar from a byte-slice, reducing if necessary to the appropriate modulus.

func (*ScalarMock) SetInt64

func (sm *ScalarMock) SetInt64(_ int64)

SetInt64 sets the receiver to a small integer value v given as parameter

func (*ScalarMock) Sub

func (sm *ScalarMock) Sub(_ crypto.Scalar) (crypto.Scalar, error)

Sub returns the modular difference between receiver and scalar s given as parameter

func (*ScalarMock) UnmarshalBinary

func (sm *ScalarMock) UnmarshalBinary(val []byte) error

UnmarshalBinary recreates the Scalar from a byte array

func (*ScalarMock) Zero

func (sm *ScalarMock) Zero() crypto.Scalar

Zero returns the the additive identity (0)

type SinglesignFailMock added in v1.2.0

type SinglesignFailMock struct {
}

SinglesignFailMock -

func (*SinglesignFailMock) IsInterfaceNil added in v1.2.0

func (s *SinglesignFailMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignFailMock) Sign added in v1.2.0

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

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignFailMock) Verify added in v1.2.0

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

Verify verifies a signature using a single signature schnorr scheme

type SinglesignMock added in v1.2.0

type SinglesignMock struct {
}

SinglesignMock -

func (*SinglesignMock) IsInterfaceNil added in v1.2.0

func (s *SinglesignMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignMock) Sign added in v1.2.0

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

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignMock) Verify added in v1.2.0

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

Verify verifies a signature using a single signature schnorr scheme

type SinglesignStub added in v1.2.0

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

func (s *SinglesignStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignStub) Sign added in v1.2.0

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

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

Verify verifies a signature using a single signature schnorr scheme

type SmartContractParserStub added in v1.2.0

type SmartContractParserStub struct {
	InitialSmartContractsSplitOnOwnersShardsCalled func(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialSmartContractHandler, error)
	InitialSmartContractsCalled                    func() []genesis.InitialSmartContractHandler
	GetDeployedSCAddressesCalled                   func(scType string) (map[string]struct{}, error)
}

SmartContractParserStub -

func (*SmartContractParserStub) GetDeployedSCAddresses added in v1.2.0

func (scps *SmartContractParserStub) GetDeployedSCAddresses(scType string) (map[string]struct{}, error)

GetDeployedSCAddresses -

func (*SmartContractParserStub) InitialSmartContracts added in v1.2.0

func (scps *SmartContractParserStub) InitialSmartContracts() []genesis.InitialSmartContractHandler

InitialSmartContracts -

func (*SmartContractParserStub) InitialSmartContractsSplitOnOwnersShards added in v1.2.0

func (scps *SmartContractParserStub) InitialSmartContractsSplitOnOwnersShards(shardCoordinator sharding.Coordinator) (map[uint32][]genesis.InitialSmartContractHandler, error)

InitialSmartContractsSplitOnOwnersShards -

func (*SmartContractParserStub) IsInterfaceNil added in v1.2.0

func (scps *SmartContractParserStub) IsInterfaceNil() bool

IsInterfaceNil -

type StateComponentsHolderStub added in v1.2.0

type StateComponentsHolderStub struct {
	PeerAccountsCalled        func() state.AccountsAdapter
	AccountsAdapterCalled     func() state.AccountsAdapter
	AccountsAdapterAPICalled  func() state.AccountsAdapter
	TriesContainerCalled      func() common.TriesHolder
	TrieStorageManagersCalled func() map[string]common.StorageManager
}

StateComponentsHolderStub -

func (*StateComponentsHolderStub) AccountsAdapter added in v1.2.0

func (s *StateComponentsHolderStub) AccountsAdapter() state.AccountsAdapter

AccountsAdapter -

func (*StateComponentsHolderStub) AccountsAdapterAPI added in v1.2.0

func (s *StateComponentsHolderStub) AccountsAdapterAPI() state.AccountsAdapter

AccountsAdapterAPI -

func (*StateComponentsHolderStub) IsInterfaceNil added in v1.2.0

func (s *StateComponentsHolderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StateComponentsHolderStub) PeerAccounts added in v1.2.0

PeerAccounts -

func (*StateComponentsHolderStub) TrieStorageManagers added in v1.2.0

func (s *StateComponentsHolderStub) TrieStorageManagers() map[string]common.StorageManager

TrieStorageManagers -

func (*StateComponentsHolderStub) TriesContainer added in v1.2.0

func (s *StateComponentsHolderStub) TriesContainer() common.TriesHolder

TriesContainer -

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 SuiteStub

type SuiteStub 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, error)
	RandomStreamStub         func() cipher.Stream
	CreateKeyPairStub        func() (crypto.Scalar, crypto.Point)
	IsPointValidStub         func([]byte) error
	GetUnderlyingSuiteStub   func() interface{}
}

SuiteStub -

func (*SuiteStub) CheckPointValid added in v1.0.120

func (s *SuiteStub) CheckPointValid(pointBytes []byte) error

CheckPointValid -

func (*SuiteStub) CreateKeyPair

func (s *SuiteStub) CreateKeyPair() (crypto.Scalar, crypto.Point)

CreateKeyPair -

func (*SuiteStub) CreatePoint

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

CreatePoint -

func (*SuiteStub) CreatePointForScalar

func (s *SuiteStub) CreatePointForScalar(scalar crypto.Scalar) (crypto.Point, error)

CreatePointForScalar -

func (*SuiteStub) CreateScalar

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

CreateScalar -

func (*SuiteStub) GetUnderlyingSuite

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

GetUnderlyingSuite -

func (*SuiteStub) IsInterfaceNil

func (s *SuiteStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SuiteStub) PointLen

func (s *SuiteStub) PointLen() int

PointLen -

func (*SuiteStub) RandomStream

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

RandomStream -

func (*SuiteStub) ScalarLen

func (s *SuiteStub) ScalarLen() int

ScalarLen -

func (*SuiteStub) String

func (s *SuiteStub) String() string

String -

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

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

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

Commit -

func (*ValidatorStatisticsProcessorStub) DisplayRatings added in v1.2.0

func (vsp *ValidatorStatisticsProcessorStub) DisplayRatings(_ uint32)

DisplayRatings -

func (*ValidatorStatisticsProcessorStub) GetPeerAccount added in v1.2.0

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

GetPeerAccount -

func (*ValidatorStatisticsProcessorStub) GetValidatorInfoForRootHash added in v1.2.0

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

GetValidatorInfoForRootHash -

func (*ValidatorStatisticsProcessorStub) IsInterfaceNil added in v1.2.0

func (vsp *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsProcessorStub) LastFinalizedRootHash added in v1.2.0

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

LastFinalizedRootHash -

func (*ValidatorStatisticsProcessorStub) PeerAccountToValidatorInfo added in v1.2.0

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

PeerAccountToValidatorInfo -

func (*ValidatorStatisticsProcessorStub) Process added in v1.2.0

Process -

func (*ValidatorStatisticsProcessorStub) ProcessRatingsEndOfEpoch added in v1.2.0

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

ProcessRatingsEndOfEpoch -

func (*ValidatorStatisticsProcessorStub) ResetValidatorStatisticsAtNewEpoch added in v1.2.0

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

ResetValidatorStatisticsAtNewEpoch -

func (*ValidatorStatisticsProcessorStub) RevertPeerState added in v1.2.0

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

RevertPeerState -

func (*ValidatorStatisticsProcessorStub) RootHash added in v1.2.0

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

RootHash -

func (*ValidatorStatisticsProcessorStub) SaveNodesCoordinatorUpdates added in v1.2.0

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

SaveNodesCoordinatorUpdates -

func (*ValidatorStatisticsProcessorStub) SetLastFinalizedRootHash added in v1.2.0

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

SetLastFinalizedRootHash -

func (*ValidatorStatisticsProcessorStub) UpdatePeerState added in v1.2.0

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

UpdatePeerState -

type ValidatorsProviderStub added in v1.2.0

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

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

GetLatestValidators -

func (*ValidatorsProviderStub) IsInterfaceNil added in v1.2.0

func (vp *ValidatorsProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

Jump to

Keyboard shortcuts

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