mock

package
v1.0.85 Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2020 License: GPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMultiShardsCoordinatorMock

func NewMultiShardsCoordinatorMock(nrShard uint32) *multipleShardsCoordinatorMock

func NewNonceHashConverterMock

func NewNonceHashConverterMock() *nonceHashConverterMock

func NewOneShardCoordinatorMock

func NewOneShardCoordinatorMock() *oneShardCoordinatorMock

Types

type AccountTrackerStub added in v1.0.84

type AccountTrackerStub struct {
	SaveAccountCalled func(accountHandler state.AccountHandler) error
	JournalizeCalled  func(entry state.JournalEntry)
}

func (*AccountTrackerStub) IsInterfaceNil added in v1.0.84

func (ats *AccountTrackerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountTrackerStub) Journalize added in v1.0.84

func (ats *AccountTrackerStub) Journalize(entry state.JournalEntry)

func (*AccountTrackerStub) SaveAccount added in v1.0.84

func (ats *AccountTrackerStub) SaveAccount(accountHandler state.AccountHandler) error

type AccountsFactoryStub

type AccountsFactoryStub struct {
	CreateAccountCalled func(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, error)
}

func (*AccountsFactoryStub) CreateAccount

func (afs *AccountsFactoryStub) CreateAccount(address state.AddressContainer, tracker state.AccountTracker) (state.AccountHandler, error)

func (*AccountsFactoryStub) IsInterfaceNil

func (afs *AccountsFactoryStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type AccountsStub

type AccountsStub struct {
	AddJournalEntryCalled       func(je state.JournalEntry)
	CommitCalled                func() ([]byte, error)
	GetAccountWithJournalCalled func(addressContainer state.AddressContainer) (state.AccountHandler, error)
	GetExistingAccountCalled    func(addressContainer state.AddressContainer) (state.AccountHandler, error)
	HasAccountStateCalled       func(addressContainer state.AddressContainer) (bool, error)
	JournalLenCalled            func() int
	PutCodeCalled               func(accountHandler state.AccountHandler, code []byte) error
	RemoveAccountCalled         func(addressContainer state.AddressContainer) error
	RemoveCodeCalled            func(codeHash []byte) error
	RevertToSnapshotCalled      func(snapshot int) error
	SaveAccountStateCalled      func(acountWrapper state.AccountHandler) error
	SaveDataTrieCalled          func(acountWrapper state.AccountHandler) error
	RootHashCalled              func() ([]byte, error)
	RecreateTrieCalled          func(rootHash []byte) error
	PruneTrieCalled             func(rootHash []byte) error
	SnapshotStateCalled         func(rootHash []byte)
	SetStateCheckpointCalled    func(rootHash []byte)
	CancelPruneCalled           func(rootHash []byte)
	IsPruningEnabledCalled      func() bool
}

func (*AccountsStub) AddJournalEntry added in v1.0.3

func (as *AccountsStub) AddJournalEntry(je state.JournalEntry)

func (*AccountsStub) CancelPrune

func (as *AccountsStub) CancelPrune(rootHash []byte)

func (*AccountsStub) ClosePersister added in v1.0.78

func (as *AccountsStub) ClosePersister() error

func (*AccountsStub) Commit

func (as *AccountsStub) Commit() ([]byte, error)

func (*AccountsStub) GetAccountWithJournal added in v1.0.3

func (as *AccountsStub) GetAccountWithJournal(addressContainer state.AddressContainer) (state.AccountHandler, error)

func (*AccountsStub) GetExistingAccount

func (as *AccountsStub) GetExistingAccount(addressContainer state.AddressContainer) (state.AccountHandler, error)

func (*AccountsStub) HasAccount added in v1.0.3

func (as *AccountsStub) HasAccount(addressContainer state.AddressContainer) (bool, error)

func (*AccountsStub) IsInterfaceNil

func (as *AccountsStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AccountsStub) IsPruningEnabled

func (as *AccountsStub) IsPruningEnabled() bool

func (*AccountsStub) JournalLen

func (as *AccountsStub) JournalLen() int

func (*AccountsStub) PruneTrie

func (as *AccountsStub) PruneTrie(rootHash []byte) error

func (*AccountsStub) PutCode added in v1.0.3

func (as *AccountsStub) PutCode(accountHandler state.AccountHandler, code []byte) error

func (*AccountsStub) RecreateTrie

func (as *AccountsStub) RecreateTrie(rootHash []byte) error

func (*AccountsStub) RemoveAccount

func (as *AccountsStub) RemoveAccount(addressContainer state.AddressContainer) error

func (*AccountsStub) RemoveCode added in v1.0.3

func (as *AccountsStub) RemoveCode(codeHash []byte) error

func (*AccountsStub) RevertToSnapshot

func (as *AccountsStub) RevertToSnapshot(snapshot int) error

func (*AccountsStub) RootHash

func (as *AccountsStub) RootHash() ([]byte, error)

func (*AccountsStub) SaveDataTrie added in v1.0.3

func (as *AccountsStub) SaveDataTrie(journalizedAccountHandler state.AccountHandler) error

func (*AccountsStub) SaveJournalizedAccount added in v1.0.3

func (as *AccountsStub) SaveJournalizedAccount(journalizedAccountHandler state.AccountHandler) error

func (*AccountsStub) SetStateCheckpoint

func (as *AccountsStub) SetStateCheckpoint(rootHash []byte)

func (*AccountsStub) SnapshotState

func (as *AccountsStub) SnapshotState(rootHash []byte)

type AddressConverterFake

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

func NewAddressConverterFake

func NewAddressConverterFake(addressLen int, prefix string) *AddressConverterFake

func (*AddressConverterFake) AddressLen

func (acf *AddressConverterFake) AddressLen() int

func (*AddressConverterFake) ConvertToHex

func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)

func (*AddressConverterFake) CreateAddressFromHex

func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)

func (*AddressConverterFake) CreateAddressFromPublicKeyBytes

func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)

func (*AddressConverterFake) IsInterfaceNil

func (acf *AddressConverterFake) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*AddressConverterFake) PrepareAddressBytes

func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)

type AddressConverterStub

type AddressConverterStub struct {
	CreateAddressFromPublicKeyBytesHandler func(pubKey []byte) (state.AddressContainer, error)
	ConvertToHexHandler                    func(addressContainer state.AddressContainer) (string, error)
	CreateAddressFromHexHandler            func(hexAddress string) (state.AddressContainer, error)
	PrepareAddressBytesHandler             func(addressBytes []byte) ([]byte, error)
	AddressLenHandler                      func() int
}

func (AddressConverterStub) AddressLen

func (ac AddressConverterStub) AddressLen() int

func (AddressConverterStub) ConvertToHex

func (ac AddressConverterStub) ConvertToHex(addressContainer state.AddressContainer) (string, error)

func (AddressConverterStub) CreateAddressFromHex

func (ac AddressConverterStub) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)

func (AddressConverterStub) CreateAddressFromPublicKeyBytes

func (ac AddressConverterStub) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)

func (*AddressConverterStub) IsInterfaceNil

func (ac *AddressConverterStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (AddressConverterStub) PrepareAddressBytes

func (ac AddressConverterStub) PrepareAddressBytes(addressBytes []byte) ([]byte, error)

type AddressMock

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

AddressMock implements a mock address generator used in testing

func NewAddressMock

func NewAddressMock() *AddressMock

NewAddressMock generates a new address

func (*AddressMock) Bytes

func (address *AddressMock) Bytes() []byte

Bytes returns the address' bytes

func (*AddressMock) IsInterfaceNil

func (address *AddressMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type AppStatusHandlerStub

type AppStatusHandlerStub struct {
	AddUint64Handler      func(key string, value uint64)
	IncrementHandler      func(key string)
	DecrementHandler      func(key string)
	SetUInt64ValueHandler func(key string, value uint64)
	SetInt64ValueHandler  func(key string, value int64)
	SetStringValueHandler func(key string, value string)
	CloseHandler          func()
}

AppStatusHandlerStub is a stub implementation of AppStatusHandler

func (*AppStatusHandlerStub) AddUint64

func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)

AddUint64 will call the handler of the stub for incrementing

func (*AppStatusHandlerStub) Close

func (ashs *AppStatusHandlerStub) Close()

Close will call the handler of the stub for closing

func (*AppStatusHandlerStub) Decrement

func (ashs *AppStatusHandlerStub) Decrement(key string)

Decrement will call the handler of the stub for decrementing

func (*AppStatusHandlerStub) Increment

func (ashs *AppStatusHandlerStub) Increment(key string)

Increment will call the handler of the stub for incrementing

func (*AppStatusHandlerStub) IsInterfaceNil

func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool

func (*AppStatusHandlerStub) SetInt64Value

func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)

SetInt64Value will call the handler of the stub for setting an int64 value

func (*AppStatusHandlerStub) SetStringValue

func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)

SetStringValue will call the handler of the stub for setting an string value

func (*AppStatusHandlerStub) SetUInt64Value

func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)

SetUInt64Value will call the handler of the stub for setting an uint64 value

type BlockChainMock

type BlockChainMock struct {
	GetGenesisHeaderCalled          func() data.HeaderHandler
	SetGenesisHeaderCalled          func(handler data.HeaderHandler) error
	GetGenesisHeaderHashCalled      func() []byte
	SetGenesisHeaderHashCalled      func([]byte)
	GetCurrentBlockHeaderCalled     func() data.HeaderHandler
	SetCurrentBlockHeaderCalled     func(data.HeaderHandler) error
	GetCurrentBlockHeaderHashCalled func() []byte
	SetCurrentBlockHeaderHashCalled func([]byte)
	GetCurrentBlockBodyCalled       func() data.BodyHandler
	SetCurrentBlockBodyCalled       func(data.BodyHandler) error
	GetLocalHeightCalled            func() int64
	SetLocalHeightCalled            func(int64)
	GetNetworkHeightCalled          func() int64
	SetNetworkHeightCalled          func(int64)
	HasBadBlockCalled               func([]byte) bool
	PutBadBlockCalled               func([]byte)
}

BlockChainMock is a mock implementation of the blockchain interface

func (*BlockChainMock) GetCurrentBlockBody

func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler

GetCurrentBlockBody returns the tx block body pointer

func (*BlockChainMock) GetCurrentBlockHeader

func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler

GetCurrentBlockHeader returns current block header pointer

func (*BlockChainMock) GetCurrentBlockHeaderHash

func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte

GetCurrentBlockHeaderHash returns the current block header hash

func (*BlockChainMock) GetGenesisHeader

func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler

GetGenesisHeader returns the genesis block header pointer

func (*BlockChainMock) GetGenesisHeaderHash

func (bc *BlockChainMock) GetGenesisHeaderHash() []byte

GetGenesisHeaderHash returns the genesis block header hash

func (*BlockChainMock) GetLocalHeight added in v1.0.3

func (bc *BlockChainMock) GetLocalHeight() int64

GetLocalHeight returns the height of the local chain

func (*BlockChainMock) GetNetworkHeight added in v1.0.3

func (bc *BlockChainMock) GetNetworkHeight() int64

GetNetworkHeight sets the perceived height of the network chain

func (*BlockChainMock) HasBadBlock added in v1.0.3

func (bc *BlockChainMock) HasBadBlock(blockHash []byte) bool

HasBadBlock returns true if the provided hash is blacklisted as a bad block, or false otherwise

func (*BlockChainMock) IsInterfaceNil

func (bc *BlockChainMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*BlockChainMock) PutBadBlock added in v1.0.3

func (bc *BlockChainMock) PutBadBlock(blockHash []byte)

PutBadBlock adds the given serialized block to the bad block cache, blacklisting it

func (*BlockChainMock) SetCurrentBlockBody

func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error

SetCurrentBlockBody sets the tx block body pointer

func (*BlockChainMock) SetCurrentBlockHeader

func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error

SetCurrentBlockHeader sets current block header pointer

func (*BlockChainMock) SetCurrentBlockHeaderHash

func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)

SetCurrentBlockHeaderHash returns the current block header hash

func (*BlockChainMock) SetGenesisHeader

func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error

SetGenesisHeader sets the genesis block header pointer

func (*BlockChainMock) SetGenesisHeaderHash

func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)

SetGenesisHeaderHash sets the genesis block header hash

func (*BlockChainMock) SetLocalHeight added in v1.0.3

func (bc *BlockChainMock) SetLocalHeight(height int64)

SetLocalHeight sets the height of the local chain

func (*BlockChainMock) SetNetworkHeight added in v1.0.3

func (bc *BlockChainMock) SetNetworkHeight(height int64)

SetNetworkHeight sets the perceived height of the network chain

type BlockProcessorStub

type BlockProcessorStub struct {
	ProcessBlockCalled               func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
	CommitBlockCalled                func(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error
	RevertAccountStateCalled         func()
	CreateGenesisBlockCalled         func(balances map[string]*big.Int) (data.HeaderHandler, error)
	CreateBlockBodyCalled            func(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)
	RestoreBlockIntoPoolsCalled      func(header data.HeaderHandler, body data.BodyHandler) error
	SetOnRequestTransactionCalled    func(f func(destShardID uint32, txHash []byte))
	ApplyBodyToHeaderCalled          func(header data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error)
	MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
	DecodeBlockBodyCalled            func(dta []byte) data.BodyHandler
	DecodeBlockHeaderCalled          func(dta []byte) data.HeaderHandler
	AddLastNotarizedHdrCalled        func(shardId uint32, processedHdr data.HeaderHandler)
	CreateNewHeaderCalled            func() data.HeaderHandler
	RevertStateToBlockCalled         func(header data.HeaderHandler) error
}

BlockProcessorStub mocks the implementation for a blockProcessor

func (BlockProcessorStub) AddLastNotarizedHdr

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

func (BlockProcessorStub) ApplyBodyToHeader added in v1.0.39

func (blProcMock BlockProcessorStub) ApplyBodyToHeader(header data.HeaderHandler, body data.BodyHandler) (data.BodyHandler, error)

func (*BlockProcessorStub) ApplyProcessedMiniBlocks

func (blProcMock *BlockProcessorStub) ApplyProcessedMiniBlocks(miniBlocks *processedMb.ProcessedMiniBlockTracker)

func (*BlockProcessorStub) CommitBlock

func (blProcMock *BlockProcessorStub) CommitBlock(blockChain data.ChainHandler, header data.HeaderHandler, body data.BodyHandler) error

CommitBlock mocks the commit of a block

func (*BlockProcessorStub) CreateBlockBody added in v1.0.3

func (blProcMock *BlockProcessorStub) CreateBlockBody(initialHdrData data.HeaderHandler, haveTime func() bool) (data.BodyHandler, error)

CreateBlockBody mocks the creation of a transaction block body

func (*BlockProcessorStub) CreateGenesisBlock

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

CreateGenesisBlock mocks the creation of a genesis block body

func (BlockProcessorStub) CreateNewHeader

func (blProcMock BlockProcessorStub) CreateNewHeader() data.HeaderHandler

CreateNewHeader creates a new header

func (BlockProcessorStub) DecodeBlockBody

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

func (BlockProcessorStub) DecodeBlockHeader

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

func (*BlockProcessorStub) IsInterfaceNil

func (blProcMock *BlockProcessorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (BlockProcessorStub) MarshalizedDataToBroadcast

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

func (*BlockProcessorStub) ProcessBlock

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

ProcessBlock mocks pocessing a block

func (*BlockProcessorStub) RestoreBlockIntoPools

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

func (*BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis

func (blProcMock *BlockProcessorStub) RestoreLastNotarizedHrdsToGenesis()

func (*BlockProcessorStub) RevertAccountState

func (blProcMock *BlockProcessorStub) RevertAccountState()

RevertAccountState mocks revert of the accounts state

func (*BlockProcessorStub) RevertStateToBlock

func (blProcMock *BlockProcessorStub) RevertStateToBlock(header data.HeaderHandler) error

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

func (BlockProcessorStub) SetConsensusData added in v1.0.20

func (blProcMock BlockProcessorStub) SetConsensusData(randomness []byte, round uint64, epoch uint32, shardId uint32)

func (*BlockProcessorStub) SetNumProcessedObj

func (blProcMock *BlockProcessorStub) SetNumProcessedObj(numObj uint64)

type BlockTrackerStub

type BlockTrackerStub struct {
	AddTrackedHeaderCalled                            func(header data.HeaderHandler, hash []byte)
	AddCrossNotarizedHeaderCalled                     func(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte)
	AddSelfNotarizedHeaderCalled                      func(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte)
	CheckBlockAgainstRounderCalled                    func(headerHandler data.HeaderHandler) error
	CheckBlockAgainstFinalCalled                      func(headerHandler data.HeaderHandler) error
	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)
	GetFinalHeaderCalled                              func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeaderCalled                 func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeadersForAllShardsCalled    func() (map[uint32]data.HeaderHandler, error)
	GetTrackedHeadersCalled                           func(shardID uint32) ([]data.HeaderHandler, [][]byte)
	GetTrackedHeadersForAllShardsCalled               func() map[uint32][]data.HeaderHandler
	GetTrackedHeadersWithNonceCalled                  func(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)
	IsShardStuckCalled                                func(shardId uint32) bool
	RegisterCrossNotarizedHeadersHandlerCalled        func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RegisterSelfNotarizedHeadersHandlerCalled         func(handler func(shardID uint32, headers []data.HeaderHandler, headersHashes [][]byte))
	RemoveLastNotarizedHeadersCalled                  func()
	RestoreToGenesisCalled                            func()
}

func (*BlockTrackerStub) AddCrossNotarizedHeader

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

func (*BlockTrackerStub) AddSelfNotarizedHeader

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

func (*BlockTrackerStub) AddTrackedHeader

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

func (*BlockTrackerStub) CheckBlockAgainstFinal

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

func (*BlockTrackerStub) CheckBlockAgainstRounder

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

func (*BlockTrackerStub) CleanupHeadersBehindNonce

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

func (*BlockTrackerStub) ComputeLongestChain

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

func (*BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized

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

func (*BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized

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

func (*BlockTrackerStub) DisplayTrackedHeaders

func (bts *BlockTrackerStub) DisplayTrackedHeaders()

func (*BlockTrackerStub) GetCrossNotarizedHeader

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

func (*BlockTrackerStub) GetFinalHeader

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

func (*BlockTrackerStub) GetLastCrossNotarizedHeader

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

func (*BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards

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

func (*BlockTrackerStub) GetTrackedHeaders

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

func (*BlockTrackerStub) GetTrackedHeadersForAllShards

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

func (*BlockTrackerStub) GetTrackedHeadersWithNonce

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

func (*BlockTrackerStub) IsInterfaceNil

func (bts *BlockTrackerStub) IsInterfaceNil() bool

func (*BlockTrackerStub) IsShardStuck

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

func (*BlockTrackerStub) RegisterCrossNotarizedHeadersHandler

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

func (*BlockTrackerStub) RegisterSelfNotarizedHeadersHandler

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

func (*BlockTrackerStub) RemoveLastNotarizedHeaders

func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()

func (*BlockTrackerStub) RestoreToGenesis

func (bts *BlockTrackerStub) RestoreToGenesis()

type BoostrapStorerMock

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

func (*BoostrapStorerMock) Get

func (*BoostrapStorerMock) GetHighestRound

func (bsm *BoostrapStorerMock) GetHighestRound() int64

func (*BoostrapStorerMock) IsInterfaceNil

func (bsm *BoostrapStorerMock) IsInterfaceNil() bool

func (*BoostrapStorerMock) Put

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

func (*BoostrapStorerMock) SaveLastRound

func (bsm *BoostrapStorerMock) SaveLastRound(round int64) error

type CacherStub

type CacherStub struct {
	ClearCalled           func()
	PutCalled             func(key []byte, value interface{}) (evicted bool)
	GetCalled             func(key []byte) (value interface{}, ok bool)
	HasCalled             func(key []byte) bool
	PeekCalled            func(key []byte) (value interface{}, ok bool)
	HasOrAddCalled        func(key []byte, value interface{}) (ok, evicted bool)
	RemoveCalled          func(key []byte)
	RemoveOldestCalled    func()
	KeysCalled            func() [][]byte
	LenCalled             func() int
	MaxSizeCalled         func() int
	RegisterHandlerCalled func(func(key []byte))
}

func (*CacherStub) Clear

func (cs *CacherStub) Clear()

func (*CacherStub) Get

func (cs *CacherStub) Get(key []byte) (value interface{}, ok bool)

func (*CacherStub) Has

func (cs *CacherStub) Has(key []byte) bool

func (*CacherStub) HasOrAdd

func (cs *CacherStub) HasOrAdd(key []byte, value interface{}) (ok, evicted bool)

func (*CacherStub) IsInterfaceNil

func (cs *CacherStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*CacherStub) Keys

func (cs *CacherStub) Keys() [][]byte

func (*CacherStub) Len

func (cs *CacherStub) Len() int

func (*CacherStub) MaxSize

func (cs *CacherStub) MaxSize() int

func (*CacherStub) Peek

func (cs *CacherStub) Peek(key []byte) (value interface{}, ok bool)

func (*CacherStub) Put

func (cs *CacherStub) Put(key []byte, value interface{}) (evicted bool)

func (*CacherStub) RegisterHandler

func (cs *CacherStub) RegisterHandler(handler func(key []byte))

func (*CacherStub) Remove

func (cs *CacherStub) Remove(key []byte)

func (*CacherStub) RemoveOldest

func (cs *CacherStub) RemoveOldest()

type ChainHandlerStub

type ChainHandlerStub struct {
	GetGenesisHeaderCalled      func() data.HeaderHandler
	GetGenesisHeaderHashCalled  func() []byte
	SetGenesisHeaderCalled      func(gb data.HeaderHandler) error
	SetGenesisHeaderHashCalled  func(hash []byte)
	SetCurrentBlockHeaderCalled func(bh data.HeaderHandler) error
	SetCurrentBlockBodyCalled   func(body data.BodyHandler) error
}

func (*ChainHandlerStub) GetCurrentBlockBody

func (chs *ChainHandlerStub) GetCurrentBlockBody() data.BodyHandler

func (*ChainHandlerStub) GetCurrentBlockHeader

func (chs *ChainHandlerStub) GetCurrentBlockHeader() data.HeaderHandler

func (*ChainHandlerStub) GetCurrentBlockHeaderHash

func (chs *ChainHandlerStub) GetCurrentBlockHeaderHash() []byte

func (*ChainHandlerStub) GetGenesisHeader

func (chs *ChainHandlerStub) GetGenesisHeader() data.HeaderHandler

func (*ChainHandlerStub) GetGenesisHeaderHash

func (chs *ChainHandlerStub) GetGenesisHeaderHash() []byte

func (*ChainHandlerStub) GetLocalHeight added in v1.0.3

func (chs *ChainHandlerStub) GetLocalHeight() int64

func (*ChainHandlerStub) GetNetworkHeight added in v1.0.3

func (chs *ChainHandlerStub) GetNetworkHeight() int64

func (*ChainHandlerStub) HasBadBlock added in v1.0.3

func (chs *ChainHandlerStub) HasBadBlock(blockHash []byte) bool

func (*ChainHandlerStub) IsInterfaceNil

func (chs *ChainHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChainHandlerStub) PutBadBlock added in v1.0.3

func (chs *ChainHandlerStub) PutBadBlock(blockHash []byte)

func (*ChainHandlerStub) SetCurrentBlockBody

func (chs *ChainHandlerStub) SetCurrentBlockBody(body data.BodyHandler) error

func (*ChainHandlerStub) SetCurrentBlockHeader

func (chs *ChainHandlerStub) SetCurrentBlockHeader(bh data.HeaderHandler) error

func (*ChainHandlerStub) SetCurrentBlockHeaderHash

func (chs *ChainHandlerStub) SetCurrentBlockHeaderHash(hash []byte)

func (*ChainHandlerStub) SetGenesisHeader

func (chs *ChainHandlerStub) SetGenesisHeader(gb data.HeaderHandler) error

func (*ChainHandlerStub) SetGenesisHeaderHash

func (chs *ChainHandlerStub) SetGenesisHeaderHash(hash []byte)

func (*ChainHandlerStub) SetLocalHeight added in v1.0.3

func (chs *ChainHandlerStub) SetLocalHeight(height int64)

func (*ChainHandlerStub) SetNetworkHeight added in v1.0.3

func (chs *ChainHandlerStub) SetNetworkHeight(height int64)

type ChainStorerMock

type ChainStorerMock struct {
	AddStorerCalled func(key dataRetriever.UnitType, s storage.Storer)
	GetStorerCalled func(unitType dataRetriever.UnitType) storage.Storer
	HasCalled       func(unitType dataRetriever.UnitType, key []byte) error
	GetCalled       func(unitType dataRetriever.UnitType, key []byte) ([]byte, error)
	PutCalled       func(unitType dataRetriever.UnitType, key []byte, value []byte) error
	GetAllCalled    func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error)
	DestroyCalled   func() error
	CloseAllCalled  func() error
}

ChainStorerMock is a mock implementation of the ChianStorer interface

func (*ChainStorerMock) AddStorer

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

AddStorer will add a new storer to the chain map

func (*ChainStorerMock) CloseAll

func (bc *ChainStorerMock) CloseAll() error

func (*ChainStorerMock) Destroy

func (bc *ChainStorerMock) Destroy() error

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

func (*ChainStorerMock) Get

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

Get returns the value for the given key if found in the selected storage unit, nil otherwise. It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error

func (*ChainStorerMock) GetAll

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

GetAll gets all the elements with keys in the keys array, from the selected storage unit It can report an error if the provided unit type is not supported, if there is a missing key in the unit, or if the underlying implementation of the storage unit reports an error.

func (*ChainStorerMock) GetStorer

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

GetStorer returns the storer from the chain map or nil if the storer was not found

func (*ChainStorerMock) Has

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

Has returns true if the key is found in the selected Unit or false otherwise It can return an error if the provided unit type is not supported or if the underlying implementation of the storage unit reports an error.

func (*ChainStorerMock) IsInterfaceNil

func (bc *ChainStorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ChainStorerMock) Put

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

Put stores the key, value pair in the selected storage unit It can return an error if the provided unit type is not supported or if the storage unit underlying implementation reports an error

type EpochStartTriggerStub

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

func (*EpochStartTriggerStub) Epoch

func (e *EpochStartTriggerStub) Epoch() uint32

func (*EpochStartTriggerStub) EpochFinalityAttestingRound

func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64

func (*EpochStartTriggerStub) EpochStartMetaHdrHash

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

func (*EpochStartTriggerStub) EpochStartRound

func (e *EpochStartTriggerStub) EpochStartRound() uint64

func (*EpochStartTriggerStub) ForceEpochStart

func (e *EpochStartTriggerStub) ForceEpochStart(round uint64) error

func (*EpochStartTriggerStub) IsEpochStart

func (e *EpochStartTriggerStub) IsEpochStart() bool

func (*EpochStartTriggerStub) IsInterfaceNil

func (e *EpochStartTriggerStub) IsInterfaceNil() bool

func (*EpochStartTriggerStub) NotifyAll

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

func (*EpochStartTriggerStub) ReceivedHeader

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

func (*EpochStartTriggerStub) Revert

func (e *EpochStartTriggerStub) Revert(_ uint64)

func (*EpochStartTriggerStub) SetCurrentEpochStartRound

func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)

func (*EpochStartTriggerStub) SetFinalityAttestingRound

func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)

func (*EpochStartTriggerStub) SetProcessed

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

func (*EpochStartTriggerStub) Update

func (e *EpochStartTriggerStub) Update(round uint64)

type FeeHandlerStub

type FeeHandlerStub struct {
	MaxGasLimitPerBlockCalled   func() uint64
	SetMinGasPriceCalled        func(minasPrice uint64)
	SetMinGasLimitCalled        func(minGasLimit uint64)
	ComputeGasLimitCalled       func(tx process.TransactionWithFeeHandler) uint64
	ComputeFeeCalled            func(tx process.TransactionWithFeeHandler) *big.Int
	CheckValidityTxValuesCalled func(tx process.TransactionWithFeeHandler) error
}

func (*FeeHandlerStub) CheckValidityTxValues

func (fhs *FeeHandlerStub) CheckValidityTxValues(tx process.TransactionWithFeeHandler) error

func (*FeeHandlerStub) ComputeFee

func (*FeeHandlerStub) ComputeGasLimit

func (fhs *FeeHandlerStub) ComputeGasLimit(tx process.TransactionWithFeeHandler) uint64

func (*FeeHandlerStub) IsInterfaceNil

func (fhs *FeeHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*FeeHandlerStub) MaxGasLimitPerBlock

func (fhs *FeeHandlerStub) MaxGasLimitPerBlock() uint64

type ForkDetectorMock

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

ForkDetectorMock is a mock implementation for the ForkDetector interface

func (*ForkDetectorMock) AddHeader

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

AddHeader is a mock implementation for AddHeader

func (*ForkDetectorMock) CheckFork

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

CheckFork is a mock implementation for CheckFork

func (*ForkDetectorMock) GetHighestFinalBlockHash

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

func (*ForkDetectorMock) GetHighestFinalBlockNonce

func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64

GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce

func (*ForkDetectorMock) GetNotarizedHeaderHash

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

func (*ForkDetectorMock) IsInterfaceNil

func (fdm *ForkDetectorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ForkDetectorMock) ProbableHighestNonce

func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64

ProbableHighestNonce is a mock implementation for GetProbableHighestNonce

func (*ForkDetectorMock) RemoveHeader

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

RemoveHeader is a mock implementation for RemoveHeader

func (*ForkDetectorMock) ResetFork

func (fdm *ForkDetectorMock) ResetFork()

func (*ForkDetectorMock) ResetProbableHighestNonce

func (fdm *ForkDetectorMock) ResetProbableHighestNonce()

func (*ForkDetectorMock) RestoreToGenesis

func (fdm *ForkDetectorMock) RestoreToGenesis()

func (*ForkDetectorMock) SetRollBackNonce

func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)

type GeneratorSuite

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

func (*GeneratorSuite) CreateKey

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

type HasherFake

type HasherFake struct {
}

HasherFake that will be used for testing

func (HasherFake) Compute

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

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

func (HasherFake) EmptyHash

func (sha HasherFake) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (*HasherFake) IsInterfaceNil

func (sha *HasherFake) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherFake) Size

func (HasherFake) Size() int

Size return the required size in bytes

type HasherMock

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

func (HasherMock) Compute

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

func (HasherMock) EmptyHash

func (hash HasherMock) EmptyHash() []byte

func (HasherMock) IsInterfaceNil

func (hash HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size

func (HasherMock) Size() int

type HeaderResolverStub

type HeaderResolverStub struct {
	RequestDataFromHashCalled    func(hash []byte, epoch uint32) error
	ProcessReceivedMessageCalled func(message p2p.MessageP2P) error
	RequestDataFromNonceCalled   func(nonce uint64, epoch uint32) error
	RequestDataFromEpochCalled   func(identifier []byte) error
	SetEpochHandlerCalled        func(epochHandler dataRetriever.EpochHandler) error
}

func (*HeaderResolverStub) IsInterfaceNil

func (hrm *HeaderResolverStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*HeaderResolverStub) ProcessReceivedMessage

func (hrm *HeaderResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error

func (*HeaderResolverStub) RequestDataFromEpoch

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

func (*HeaderResolverStub) RequestDataFromHash

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

func (*HeaderResolverStub) RequestDataFromNonce

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

func (*HeaderResolverStub) SetEpochHandler

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

type HeaderSigVerifierStub

type HeaderSigVerifierStub struct {
	VerifyRandSeedCaller func(header data.HeaderHandler) error
}

func (*HeaderSigVerifierStub) IsInterfaceNil

func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool

func (*HeaderSigVerifierStub) VerifyRandSeed

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

type HeadersCacherStub

type HeadersCacherStub struct {
	AddCalled                           func(headerHash []byte, header data.HeaderHandler)
	RemoveHeaderByHashCalled            func(headerHash []byte)
	RemoveHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32)
	GetHeaderByNonceAndShardIdCalled    func(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
	GetHeaderByHashCalled               func(hash []byte) (data.HeaderHandler, error)
	ClearCalled                         func()
	RegisterHandlerCalled               func(handler func(header data.HeaderHandler, shardHeaderHash []byte))
	NoncesCalled                        func(shardId uint32) []uint64
	LenCalled                           func() int
	MaxSizeCalled                       func() int
}

func (*HeadersCacherStub) AddHeader

func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)

func (*HeadersCacherStub) Clear

func (hcs *HeadersCacherStub) Clear()

func (*HeadersCacherStub) GetHeaderByHash

func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)

func (*HeadersCacherStub) GetHeadersByNonceAndShardId

func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)

func (*HeadersCacherStub) IsInterfaceNil

func (hcs *HeadersCacherStub) IsInterfaceNil() bool

func (*HeadersCacherStub) Len

func (hcs *HeadersCacherStub) Len() int

func (*HeadersCacherStub) MaxSize

func (hcs *HeadersCacherStub) MaxSize() int

func (*HeadersCacherStub) Nonces

func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64

func (*HeadersCacherStub) RegisterHandler

func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))

func (*HeadersCacherStub) RemoveHeaderByHash

func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)

func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId

func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)

type HeartbeatStorerStub

type HeartbeatStorerStub struct {
	LoadGenesisTimeCalled   func() (time.Time, error)
	UpdateGenesisTimeCalled func(genesisTime time.Time) error
	LoadHbmiDTOCalled       func(pubKey string) (*heartbeat.HeartbeatDTO, error)
	SavePubkeyDataCalled    func(pubkey []byte, heartbeat *heartbeat.HeartbeatDTO) error
	LoadKeysCalled          func() ([][]byte, error)
	SaveKeysCalled          func(peersSlice [][]byte) error
}

func (*HeartbeatStorerStub) IsInterfaceNil

func (hss *HeartbeatStorerStub) IsInterfaceNil() bool

func (*HeartbeatStorerStub) LoadGenesisTime

func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)

func (*HeartbeatStorerStub) LoadHbmiDTO

func (hss *HeartbeatStorerStub) LoadHbmiDTO(pubKey string) (*heartbeat.HeartbeatDTO, error)

func (*HeartbeatStorerStub) LoadKeys

func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)

func (*HeartbeatStorerStub) SaveKeys

func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error

func (*HeartbeatStorerStub) SavePubkeyData

func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *heartbeat.HeartbeatDTO) error

func (*HeartbeatStorerStub) UpdateGenesisTime

func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error

type IndexerMock

type IndexerMock struct {
	SaveBlockCalled func(body block.Body, header *block.Header)
}

IndexerMock is a mock implementation fot the Indexer interface

func (*IndexerMock) IsInterfaceNil

func (im *IndexerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*IndexerMock) IsNilIndexer

func (im *IndexerMock) IsNilIndexer() bool

func (*IndexerMock) SaveBlock

func (im *IndexerMock) SaveBlock(body data.BodyHandler, header data.HeaderHandler, txPool map[string]data.TransactionHandler, signersIndexes []uint64)

func (*IndexerMock) SaveMetaBlock

func (im *IndexerMock) SaveMetaBlock(header data.HeaderHandler, signersIndexes []uint64)

func (*IndexerMock) SaveRoundInfo

func (im *IndexerMock) SaveRoundInfo(roundInfo indexer.RoundInfo)

func (*IndexerMock) SaveValidatorsPubKeys

func (im *IndexerMock) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte)

func (*IndexerMock) UpdateTPS

func (im *IndexerMock) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)

type InterceptorsContainerStub

type InterceptorsContainerStub struct {
}

func (*InterceptorsContainerStub) Add

func (*InterceptorsContainerStub) AddMultiple

func (ics *InterceptorsContainerStub) AddMultiple(_ []string, _ []process.Interceptor) error

func (*InterceptorsContainerStub) Get

func (*InterceptorsContainerStub) IsInterfaceNil

func (ics *InterceptorsContainerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*InterceptorsContainerStub) Len

func (ics *InterceptorsContainerStub) Len() int

func (*InterceptorsContainerStub) Remove

func (ics *InterceptorsContainerStub) Remove(_ string)

func (*InterceptorsContainerStub) Replace

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
}

func (*KeyGenMock) GeneratePair

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

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)

func (*KeyGenMock) PublicKeyFromByteArray

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

func (*KeyGenMock) Suite

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

type MarshalizerFake

type MarshalizerFake struct {
	Fail bool
}

MarshalizerFake that will be used for testing

func (*MarshalizerFake) IsInterfaceNil

func (mm *MarshalizerFake) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshalizerFake) Marshal

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

Marshal converts the input object in a slice of bytes

func (*MarshalizerFake) Unmarshal

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

Unmarshal applies the serialized values over an instantiated object

type MarshalizerMock

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

func (*MarshalizerMock) IsInterfaceNil

func (j *MarshalizerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (MarshalizerMock) Marshal

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

func (MarshalizerMock) Unmarshal

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

type MessageHandlerStub

type MessageHandlerStub struct {
	CreateHeartbeatFromP2pMessageCalled func(message p2p.MessageP2P) (*heartbeat.Heartbeat, error)
}

func (*MessageHandlerStub) CreateHeartbeatFromP2pMessage added in v1.0.23

func (mhs *MessageHandlerStub) CreateHeartbeatFromP2pMessage(message p2p.MessageP2P) (*heartbeat.Heartbeat, error)

func (*MessageHandlerStub) IsInterfaceNil

func (mhs *MessageHandlerStub) IsInterfaceNil() bool

type MessengerStub

type MessengerStub struct {
	CloseCalled                      func() error
	CreateTopicCalled                func(name string, createChannelForTopic bool) error
	HasTopicCalled                   func(name string) bool
	HasTopicValidatorCalled          func(name string) bool
	BroadcastOnChannelCalled         func(channel string, topic string, buff []byte)
	BroadcastCalled                  func(topic string, buff []byte)
	RegisterMessageProcessorCalled   func(topic string, handler p2p.MessageProcessor) error
	BootstrapCalled                  func() error
	PeerAddressCalled                func(pid p2p.PeerID) string
	BroadcastOnChannelBlockingCalled func(channel string, topic string, buff []byte) error
	IsConnectedToTheNetworkCalled    func() bool
}

func (*MessengerStub) Bootstrap

func (ms *MessengerStub) Bootstrap() error

func (*MessengerStub) Broadcast

func (ms *MessengerStub) Broadcast(topic string, buff []byte)

func (*MessengerStub) BroadcastOnChannel

func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)

func (*MessengerStub) BroadcastOnChannelBlocking

func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error

func (*MessengerStub) Close

func (ms *MessengerStub) Close() error

func (*MessengerStub) CreateTopic

func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error

func (*MessengerStub) HasTopic

func (ms *MessengerStub) HasTopic(name string) bool

func (*MessengerStub) HasTopicValidator

func (ms *MessengerStub) HasTopicValidator(name string) bool

func (*MessengerStub) IsConnectedToTheNetwork

func (ms *MessengerStub) IsConnectedToTheNetwork() bool

func (*MessengerStub) IsInterfaceNil

func (ms *MessengerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MessengerStub) PeerAddress

func (ms *MessengerStub) PeerAddress(pid p2p.PeerID) string

func (*MessengerStub) RegisterMessageProcessor

func (ms *MessengerStub) RegisterMessageProcessor(topic string, handler p2p.MessageProcessor) error

type MiniBlocksResolverStub

type MiniBlocksResolverStub struct {
	RequestDataFromHashCalled      func(hash []byte, epoch uint32) error
	RequestDataFromHashArrayCalled func(hashes [][]byte, epoch uint32) error
	ProcessReceivedMessageCalled   func(message p2p.MessageP2P) error
	GetMiniBlocksCalled            func(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
	GetMiniBlocksFromPoolCalled    func(hashes [][]byte) (block.MiniBlockSlice, [][]byte)
}

func (*MiniBlocksResolverStub) GetMiniBlocks

func (hrm *MiniBlocksResolverStub) GetMiniBlocks(hashes [][]byte) (block.MiniBlockSlice, [][]byte)

func (*MiniBlocksResolverStub) GetMiniBlocksFromPool

func (hrm *MiniBlocksResolverStub) GetMiniBlocksFromPool(hashes [][]byte) (block.MiniBlockSlice, [][]byte)

func (*MiniBlocksResolverStub) IsInterfaceNil

func (hrm *MiniBlocksResolverStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MiniBlocksResolverStub) ProcessReceivedMessage

func (hrm *MiniBlocksResolverStub) ProcessReceivedMessage(message p2p.MessageP2P, _ func(buffToSend []byte)) error

func (*MiniBlocksResolverStub) RequestDataFromHash

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

func (*MiniBlocksResolverStub) RequestDataFromHashArray

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

type MockTimer

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

func NewMockTimer

func NewMockTimer() *MockTimer

func (*MockTimer) IncrementSeconds

func (m *MockTimer) IncrementSeconds(value int)

func (*MockTimer) IsInterfaceNil

func (m *MockTimer) IsInterfaceNil() bool

func (*MockTimer) Now

func (m *MockTimer) Now() time.Time

func (*MockTimer) SetSeconds

func (m *MockTimer) SetSeconds(value int)

type MultisignMock

type MultisignMock struct {
}

func (*MultisignMock) AggregateCommitments

func (mm *MultisignMock) AggregateCommitments(bitmap []byte) error

func (*MultisignMock) AggregateSigs

func (mm *MultisignMock) AggregateSigs(bitmap []byte) ([]byte, error)

func (*MultisignMock) Commitment

func (mm *MultisignMock) Commitment(index uint16) ([]byte, error)

func (*MultisignMock) CommitmentHash

func (mm *MultisignMock) CommitmentHash(index uint16) ([]byte, error)

func (*MultisignMock) Create

func (mm *MultisignMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)

func (*MultisignMock) CreateCommitment

func (mm *MultisignMock) CreateCommitment() (commSecret []byte, commitment []byte)

func (*MultisignMock) CreateSignatureShare

func (mm *MultisignMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)

func (*MultisignMock) IsInterfaceNil

func (mm *MultisignMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MultisignMock) Reset

func (mm *MultisignMock) Reset(pubKeys []string, index uint16) error

func (*MultisignMock) SetAggregatedSig

func (mm *MultisignMock) SetAggregatedSig([]byte) error

func (*MultisignMock) SignatureShare

func (mm *MultisignMock) SignatureShare(index uint16) ([]byte, error)

func (*MultisignMock) StoreCommitment

func (mm *MultisignMock) StoreCommitment(index uint16, value []byte) error

func (*MultisignMock) StoreCommitmentHash

func (mm *MultisignMock) StoreCommitmentHash(index uint16, commHash []byte) error

func (*MultisignMock) StoreSignatureShare

func (mm *MultisignMock) StoreSignatureShare(index uint16, sig []byte) error

func (*MultisignMock) Verify

func (mm *MultisignMock) Verify(msg []byte, bitmap []byte) error

func (*MultisignMock) VerifySignatureShare

func (mm *MultisignMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error

type NodesCoordinatorMock

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

func (*NodesCoordinatorMock) ComputeValidatorsGroup added in v1.0.20

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

func (*NodesCoordinatorMock) ConsensusGroupSize

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

func (*NodesCoordinatorMock) GetAllValidatorsPublicKeys added in v1.0.20

func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte

func (*NodesCoordinatorMock) GetOwnPublicKey

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

func (*NodesCoordinatorMock) GetSelectedPublicKeys

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

func (*NodesCoordinatorMock) GetValidatorWithPublicKey

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

func (*NodesCoordinatorMock) GetValidatorsIndexes

func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64

func (*NodesCoordinatorMock) GetValidatorsPublicKeys added in v1.0.20

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

func (*NodesCoordinatorMock) GetValidatorsRewardsAddresses added in v1.0.20

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

func (*NodesCoordinatorMock) IsInterfaceNil

func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*NodesCoordinatorMock) SetConsensusGroupSize

func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(int) error

func (*NodesCoordinatorMock) SetNodesPerShards

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

type P2PMessageMock

type P2PMessageMock struct {
	FromField      []byte
	DataField      []byte
	SeqNoField     []byte
	TopicIDsField  []string
	SignatureField []byte
	KeyField       []byte
	PeerField      p2p.PeerID
}

func (*P2PMessageMock) Data

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

func (*P2PMessageMock) From

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

func (*P2PMessageMock) IsInterfaceNil

func (msg *P2PMessageMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*P2PMessageMock) Key

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

func (*P2PMessageMock) Peer

func (msg *P2PMessageMock) Peer() p2p.PeerID

func (*P2PMessageMock) SeqNo

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

func (*P2PMessageMock) Signature

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

func (*P2PMessageMock) TopicIDs added in v1.0.38

func (msg *P2PMessageMock) TopicIDs() []string

type P2PMessageStub

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

func (*P2PMessageStub) Data

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

func (*P2PMessageStub) From

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

func (*P2PMessageStub) IsInterfaceNil

func (msg *P2PMessageStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*P2PMessageStub) Key

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

func (*P2PMessageStub) Peer

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

func (*P2PMessageStub) SeqNo

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

func (*P2PMessageStub) Signature

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

func (*P2PMessageStub) TopicIDs added in v1.0.3

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

type PeerAccountHandlerMock added in v1.0.84

type PeerAccountHandlerMock struct {
	MockValue int

	SetNonceWithJournalCalled      func(nonce uint64) error
	SetCodeHashWithJournalCalled   func(codeHash []byte) error
	SetRootHashWithJournalCalled   func([]byte) error
	RatingCalled                   func() uint32
	SetCodeWithJournalCalled       func(codeHash []byte) error
	SetRatingWithJournalCalled     func(rating uint32) error
	TempRatingCalled               func() uint32
	SetTempRatingWithJournalCalled func(rating uint32) error

	IncreaseLeaderSuccessRateWithJournalCalled    func() error
	DecreaseLeaderSuccessRateWithJournalCalled    func() error
	IncreaseValidatorSuccessRateWithJournalCalled func() error
	DecreaseValidatorSuccessRateWithJournalCalled func() error
	// contains filtered or unexported fields
}

func (*PeerAccountHandlerMock) AddressContainer added in v1.0.84

func (pahm *PeerAccountHandlerMock) AddressContainer() state.AddressContainer

func (*PeerAccountHandlerMock) DataTrie added in v1.0.84

func (pahm *PeerAccountHandlerMock) DataTrie() data.Trie

func (*PeerAccountHandlerMock) DataTrieTracker added in v1.0.84

func (pahm *PeerAccountHandlerMock) DataTrieTracker() state.DataTrieTracker

func (*PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) DecreaseLeaderSuccessRateWithJournal() error

func (*PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) DecreaseValidatorSuccessRateWithJournal() error

func (*PeerAccountHandlerMock) GetCode added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetCode() []byte

func (*PeerAccountHandlerMock) GetCodeHash added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetCodeHash() []byte

func (*PeerAccountHandlerMock) GetNonce added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetNonce() uint64

func (*PeerAccountHandlerMock) GetRating added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetRating() uint32

func (*PeerAccountHandlerMock) GetRootHash added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetRootHash() []byte

func (*PeerAccountHandlerMock) GetTempRating added in v1.0.84

func (pahm *PeerAccountHandlerMock) GetTempRating() uint32

func (*PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) IncreaseLeaderSuccessRateWithJournal() error

func (*PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) IncreaseValidatorSuccessRateWithJournal() error

func (*PeerAccountHandlerMock) IsInterfaceNil added in v1.0.84

func (pahm *PeerAccountHandlerMock) IsInterfaceNil() bool

func (*PeerAccountHandlerMock) SetCode added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetCode(code []byte)

func (*PeerAccountHandlerMock) SetCodeHash added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetCodeHash(codeHash []byte)

func (*PeerAccountHandlerMock) SetCodeHashWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetCodeHashWithJournal(codeHash []byte) error

func (*PeerAccountHandlerMock) SetDataTrie added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetDataTrie(trie data.Trie)

func (*PeerAccountHandlerMock) SetDataTrieTracker added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetDataTrieTracker(tracker state.DataTrieTracker)

func (*PeerAccountHandlerMock) SetNonce added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetNonce(nonce uint64)

func (*PeerAccountHandlerMock) SetNonceWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetNonceWithJournal(nonce uint64) error

func (*PeerAccountHandlerMock) SetRatingWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetRatingWithJournal(rating uint32) error

func (*PeerAccountHandlerMock) SetRootHash added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetRootHash(rootHash []byte)

func (*PeerAccountHandlerMock) SetTempRatingWithJournal added in v1.0.84

func (pahm *PeerAccountHandlerMock) SetTempRatingWithJournal(rating uint32) error

type PendingMiniBlocksHandlerStub

type PendingMiniBlocksHandlerStub struct {
	PendingMiniBlockHeadersCalled func(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error)
	AddProcessedHeaderCalled      func(handler data.HeaderHandler) error
	RevertHeaderCalled            func(handler data.HeaderHandler) error
	GetNumPendingMiniBlocksCalled func(shardID uint32) uint32
	SetNumPendingMiniBlocksCalled func(shardID uint32, numPendingMiniBlocks uint32)
}

func (*PendingMiniBlocksHandlerStub) AddProcessedHeader

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

func (*PendingMiniBlocksHandlerStub) GetNumPendingMiniBlocks added in v1.0.82

func (p *PendingMiniBlocksHandlerStub) GetNumPendingMiniBlocks(shardID uint32) uint32

func (*PendingMiniBlocksHandlerStub) IsInterfaceNil

func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool

func (*PendingMiniBlocksHandlerStub) PendingMiniBlockHeaders added in v1.0.82

func (p *PendingMiniBlocksHandlerStub) PendingMiniBlockHeaders(lastNotarizedHeaders []data.HeaderHandler) ([]block.ShardMiniBlockHeader, error)

func (*PendingMiniBlocksHandlerStub) RevertHeader

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

func (*PendingMiniBlocksHandlerStub) SetNumPendingMiniBlocks added in v1.0.82

func (p *PendingMiniBlocksHandlerStub) SetNumPendingMiniBlocks(shardID uint32, numPendingMiniBlocks uint32)

type PoolsHolderStub

type PoolsHolderStub struct {
	HeadersCalled              func() dataRetriever.HeadersPool
	PeerChangesBlocksCalled    func() storage.Cacher
	TransactionsCalled         func() dataRetriever.ShardedDataCacherNotifier
	UnsignedTransactionsCalled func() dataRetriever.ShardedDataCacherNotifier
	RewardTransactionsCalled   func() dataRetriever.ShardedDataCacherNotifier
	MiniBlocksCalled           func() storage.Cacher
	CurrBlockTxsCalled         func() dataRetriever.TransactionCacher
	TrieNodesCalled            func() storage.Cacher
}

func (*PoolsHolderStub) CurrentBlockTxs

func (phs *PoolsHolderStub) CurrentBlockTxs() dataRetriever.TransactionCacher

func (*PoolsHolderStub) Headers

func (phs *PoolsHolderStub) Headers() dataRetriever.HeadersPool

func (*PoolsHolderStub) IsInterfaceNil

func (phs *PoolsHolderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PoolsHolderStub) MiniBlocks

func (phs *PoolsHolderStub) MiniBlocks() storage.Cacher

func (*PoolsHolderStub) PeerChangesBlocks

func (phs *PoolsHolderStub) PeerChangesBlocks() storage.Cacher

func (*PoolsHolderStub) RewardTransactions

func (phs *PoolsHolderStub) RewardTransactions() dataRetriever.ShardedDataCacherNotifier

func (*PoolsHolderStub) Transactions

func (*PoolsHolderStub) TrieNodes

func (phs *PoolsHolderStub) TrieNodes() storage.Cacher

func (*PoolsHolderStub) UnsignedTransactions

func (phs *PoolsHolderStub) UnsignedTransactions() dataRetriever.ShardedDataCacherNotifier

type PrivateKeyStub

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

func (*PrivateKeyStub) GeneratePublic

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

func (*PrivateKeyStub) IsInterfaceNil

func (sk *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar

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

func (*PrivateKeyStub) Suite

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

func (*PrivateKeyStub) ToByteArray

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

type PublicKeyMock

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

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

func (*PublicKeyMock) Suite

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

func (*PublicKeyMock) ToByteArray

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

type RequestHandlerStub

type RequestHandlerStub struct {
	RequestShardHeaderCalled        func(shardID uint32, hash []byte)
	RequestMetaHeaderCalled         func(hash []byte)
	RequestMetaHeaderByNonceCalled  func(nonce uint64)
	RequestShardHeaderByNonceCalled func(shardID uint32, nonce uint64)
	RequestTransactionHandlerCalled func(destShardID uint32, txHashes [][]byte)
	RequestScrHandlerCalled         func(destShardID uint32, txHashes [][]byte)
	RequestRewardTxHandlerCalled    func(destShardID uint32, txHashes [][]byte)
	RequestMiniBlockHandlerCalled   func(destShardID uint32, miniblockHash []byte)
	RequestMiniBlocksHandlerCalled  func(destShardID uint32, miniblocksHashes [][]byte)
	RequestTrieNodesCalled          func(destShardID uint32, hash []byte, topic string)
}

func (*RequestHandlerStub) IsInterfaceNil

func (rhs *RequestHandlerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RequestHandlerStub) RequestMetaHeader

func (rhs *RequestHandlerStub) RequestMetaHeader(hash []byte)

func (*RequestHandlerStub) RequestMetaHeaderByNonce

func (rhs *RequestHandlerStub) RequestMetaHeaderByNonce(nonce uint64)

func (*RequestHandlerStub) RequestMiniBlock

func (rhs *RequestHandlerStub) RequestMiniBlock(destShardID uint32, miniblockHash []byte)

func (*RequestHandlerStub) RequestMiniBlocks

func (rhs *RequestHandlerStub) RequestMiniBlocks(destShardID uint32, miniblocksHashes [][]byte)

func (*RequestHandlerStub) RequestRewardTransactions

func (rhs *RequestHandlerStub) RequestRewardTransactions(destShardID uint32, txHashes [][]byte)

func (*RequestHandlerStub) RequestShardHeader

func (rhs *RequestHandlerStub) RequestShardHeader(shardID uint32, hash []byte)

func (*RequestHandlerStub) RequestShardHeaderByNonce

func (rhs *RequestHandlerStub) RequestShardHeaderByNonce(shardID uint32, nonce uint64)

func (*RequestHandlerStub) RequestTransaction

func (rhs *RequestHandlerStub) RequestTransaction(destShardID uint32, txHashes [][]byte)

func (*RequestHandlerStub) RequestTrieNodes

func (rhs *RequestHandlerStub) RequestTrieNodes(destShardID uint32, miniblockHash []byte, topic string)

func (*RequestHandlerStub) RequestUnsignedTransactions

func (rhs *RequestHandlerStub) RequestUnsignedTransactions(destShardID uint32, txHashes [][]byte)

func (*RequestHandlerStub) SetEpoch

func (rhs *RequestHandlerStub) SetEpoch(epoch uint32)

type RequestedItemsHandlerStub

type RequestedItemsHandlerStub struct {
	AddCalled   func(key string) error
	HasCalled   func(key string) bool
	SweepCalled func()
}

func (*RequestedItemsHandlerStub) Add

func (rihs *RequestedItemsHandlerStub) Add(key string) error

func (*RequestedItemsHandlerStub) Has

func (rihs *RequestedItemsHandlerStub) Has(key string) bool

func (*RequestedItemsHandlerStub) IsInterfaceNil

func (rihs *RequestedItemsHandlerStub) IsInterfaceNil() bool

func (*RequestedItemsHandlerStub) Sweep

func (rihs *RequestedItemsHandlerStub) Sweep()

type ResolversFinderStub

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

func (*ResolversFinderStub) Add

func (*ResolversFinderStub) AddMultiple

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

func (*ResolversFinderStub) CrossShardResolver

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

func (*ResolversFinderStub) Get

func (*ResolversFinderStub) IntraShardResolver

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

func (*ResolversFinderStub) IsInterfaceNil

func (rfs *ResolversFinderStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ResolversFinderStub) Len

func (rfs *ResolversFinderStub) Len() int

func (*ResolversFinderStub) MetaChainResolver

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

func (*ResolversFinderStub) Remove

func (rfs *ResolversFinderStub) Remove(key string)

func (*ResolversFinderStub) Replace

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

type RounderMock

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

func (*RounderMock) Index

func (rndm *RounderMock) Index() int64

func (*RounderMock) IsInterfaceNil

func (rndm *RounderMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RounderMock) RemainingTime

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

func (*RounderMock) TimeDuration

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

func (*RounderMock) TimeStamp

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

func (*RounderMock) UpdateRound

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

type SCQueryServiceStub

type SCQueryServiceStub struct {
	ExecuteQueryCalled func(*process.SCQuery) (*vmcommon.VMOutput, error)
}

func (*SCQueryServiceStub) ExecuteQuery

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

func (*SCQueryServiceStub) IsInterfaceNil

func (serviceStub *SCQueryServiceStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	SelfShardId uint32
}

func (ShardCoordinatorMock) CommunicationIdentifier

func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string

func (ShardCoordinatorMock) ComputeId

func (scm ShardCoordinatorMock) ComputeId(address state.AddressContainer) uint32

func (*ShardCoordinatorMock) IsInterfaceNil

func (scm *ShardCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (ShardCoordinatorMock) NumberOfShards

func (scm ShardCoordinatorMock) NumberOfShards() uint32

func (ShardCoordinatorMock) SameShard

func (scm ShardCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool

func (ShardCoordinatorMock) SelfId

func (scm ShardCoordinatorMock) SelfId() uint32

func (ShardCoordinatorMock) SetSelfShardId

func (scm ShardCoordinatorMock) SetSelfShardId(shardId uint32) error

type ShardedDataStub

type ShardedDataStub struct {
	RegisterHandlerCalled         func(func(key []byte))
	ShardDataStoreCalled          func(cacheId string) (c storage.Cacher)
	AddDataCalled                 func(key []byte, data interface{}, cacheId string)
	SearchFirstDataCalled         func(key []byte) (value interface{}, ok bool)
	RemoveDataCalled              func(key []byte, cacheId string)
	RemoveDataFromAllShardsCalled func(key []byte)
	MergeShardStoresCalled        func(sourceCacheId, destCacheId string)
	MoveDataCalled                func(sourceCacheId, destCacheId string, key [][]byte)
	ClearCalled                   func()
	ClearShardStoreCalled         func(cacheId string)
	RemoveSetOfDataFromPoolCalled func(keys [][]byte, destCacheId string)
	CreateShardStoreCalled        func(destCacheId string)
}

func (*ShardedDataStub) AddData

func (sd *ShardedDataStub) AddData(key []byte, data interface{}, cacheId string)

func (*ShardedDataStub) Clear

func (sd *ShardedDataStub) Clear()

func (*ShardedDataStub) ClearShardStore

func (sd *ShardedDataStub) ClearShardStore(cacheId string)

func (*ShardedDataStub) CreateShardStore

func (sd *ShardedDataStub) CreateShardStore(cacheId string)

func (*ShardedDataStub) IsInterfaceNil

func (sd *ShardedDataStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardedDataStub) MergeShardStores

func (sd *ShardedDataStub) MergeShardStores(sourceCacheId, destCacheId string)

func (*ShardedDataStub) RegisterHandler

func (sd *ShardedDataStub) RegisterHandler(handler func(key []byte))

func (*ShardedDataStub) RemoveData

func (sd *ShardedDataStub) RemoveData(key []byte, cacheId string)

func (*ShardedDataStub) RemoveDataFromAllShards

func (sd *ShardedDataStub) RemoveDataFromAllShards(key []byte)

func (*ShardedDataStub) RemoveSetOfDataFromPool

func (sd *ShardedDataStub) RemoveSetOfDataFromPool(keys [][]byte, cacheId string)

func (*ShardedDataStub) SearchFirstData

func (sd *ShardedDataStub) SearchFirstData(key []byte) (value interface{}, ok bool)

func (*ShardedDataStub) ShardDataStore

func (sd *ShardedDataStub) ShardDataStore(cacheId string) (c storage.Cacher)

type SingleSignerMock

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

func (*SingleSignerMock) IsInterfaceNil

func (s *SingleSignerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SingleSignerMock) Sign

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

func (*SingleSignerMock) Verify

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

type SinglesignFailMock

type SinglesignFailMock struct {
}

func (*SinglesignFailMock) IsInterfaceNil

func (s *SinglesignFailMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignFailMock) Sign

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

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignFailMock) Verify

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

Verify verifies a signature using a single signature schnorr scheme

type SinglesignMock

type SinglesignMock struct {
}

func (*SinglesignMock) IsInterfaceNil

func (s *SinglesignMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignMock) Sign

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

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignMock) Verify

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

Verify verifies a signature using a single signature schnorr scheme

type SinglesignStub

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

func (*SinglesignStub) IsInterfaceNil

func (s *SinglesignStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignStub) Sign

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

Sign Signs a message with using a single signature schnorr scheme

func (*SinglesignStub) Verify

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

Verify verifies a signature using a single signature schnorr scheme

type StatusMetricsStub

type StatusMetricsStub struct {
	StatusMetricsMapCalled func() (map[string]interface{}, error)
	IsInterfaceNilCalled   func() bool
}

func (*StatusMetricsStub) IsInterfaceNil

func (nds *StatusMetricsStub) IsInterfaceNil() bool

func (*StatusMetricsStub) StatusMetricsMap added in v1.0.17

func (nds *StatusMetricsStub) StatusMetricsMap() (map[string]interface{}, error)

type StorerMock

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

func NewStorerMock

func NewStorerMock() *StorerMock

func (*StorerMock) ClearCache

func (sm *StorerMock) ClearCache()

func (*StorerMock) Close

func (sm *StorerMock) Close() error

func (*StorerMock) DestroyUnit

func (sm *StorerMock) DestroyUnit() error

func (*StorerMock) Get

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

func (*StorerMock) GetFromEpoch

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

func (*StorerMock) Has

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

func (*StorerMock) HasInEpoch

func (sm *StorerMock) HasInEpoch(key []byte, epoch uint32) error

func (*StorerMock) IsInterfaceNil

func (sm *StorerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerMock) Put

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

func (*StorerMock) Remove

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

func (*StorerMock) SearchFirst

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

type StorerStub

type StorerStub struct {
	PutCalled          func(key, data []byte) error
	GetCalled          func(key []byte) ([]byte, error)
	GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error)
	HasCalled          func(key []byte) error
	HasInEpochCalled   func(key []byte, epoch uint32) error
	SearchFirstCalled  func(key []byte) ([]byte, error)
	RemoveCalled       func(key []byte) error
	ClearCacheCalled   func()
	DestroyUnitCalled  func() error
}

func (*StorerStub) ClearCache

func (ss *StorerStub) ClearCache()

func (*StorerStub) Close

func (ss *StorerStub) Close() error

func (*StorerStub) DestroyUnit

func (ss *StorerStub) DestroyUnit() error

func (*StorerStub) Get

func (ss *StorerStub) Get(key []byte) ([]byte, error)

func (*StorerStub) GetFromEpoch

func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error)

func (*StorerStub) Has

func (ss *StorerStub) Has(key []byte) error

func (*StorerStub) HasInEpoch

func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error

func (*StorerStub) IsInterfaceNil

func (ss *StorerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*StorerStub) Put

func (ss *StorerStub) Put(key, data []byte) error

func (*StorerStub) Remove

func (ss *StorerStub) Remove(key []byte) error

func (*StorerStub) SearchFirst

func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error)

type Streamer

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

func NewStreamer

func NewStreamer() *Streamer

func (*Streamer) XORKeyStream

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

type SuiteMock

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

func (*SuiteMock) CreatePoint

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

func (*SuiteMock) CreateScalar

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

func (*SuiteMock) GetUnderlyingSuite

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

func (*SuiteMock) IsInterfaceNil

func (s *SuiteMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SuiteMock) PointLen

func (s *SuiteMock) PointLen() int

func (*SuiteMock) RandomStream

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

func (*SuiteMock) ScalarLen

func (s *SuiteMock) ScalarLen() int

func (*SuiteMock) String

func (s *SuiteMock) String() string

type SyncStub

type SyncStub struct {
}

func (*SyncStub) ClockOffset

func (ss *SyncStub) ClockOffset() time.Duration

func (*SyncStub) CurrentTime

func (ss *SyncStub) CurrentTime() time.Time

func (*SyncStub) FormattedCurrentTime

func (ss *SyncStub) FormattedCurrentTime() string

func (*SyncStub) IsInterfaceNil

func (ss *SyncStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SyncStub) StartSync

func (ss *SyncStub) StartSync()

type TrieStub

type TrieStub struct {
	GetCalled                func(key []byte) ([]byte, error)
	UpdateCalled             func(key, value []byte) error
	DeleteCalled             func(key []byte) error
	RootCalled               func() ([]byte, error)
	ProveCalled              func(key []byte) ([][]byte, error)
	VerifyProofCalled        func(proofs [][]byte, key []byte) (bool, error)
	CommitCalled             func() error
	RecreateCalled           func(root []byte) (data.Trie, error)
	DeepCloneCalled          func() (data.Trie, error)
	CancelPruneCalled        func(rootHash []byte, identifier data.TriePruningIdentifier)
	PruneCalled              func(rootHash []byte, identifier data.TriePruningIdentifier) error
	ResetOldHashesCalled     func() [][]byte
	AppendToOldHashesCalled  func([][]byte)
	GetSerializedNodesCalled func([]byte, uint64) ([][]byte, error)
	DatabaseCalled           func() data.DBWriteCacher
}

func (*TrieStub) AppendToOldHashes

func (ts *TrieStub) AppendToOldHashes(hashes [][]byte)

AppendToOldHashes appends the given hashes to the trie's oldHashes variable

func (*TrieStub) CancelPrune

func (ts *TrieStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)

CancelPrune invalidates the hashes that correspond to the given root hash from the eviction waiting list

func (*TrieStub) ClosePersister

func (ts *TrieStub) ClosePersister() error

func (*TrieStub) Commit

func (ts *TrieStub) Commit() error

func (*TrieStub) Database

func (ts *TrieStub) Database() data.DBWriteCacher

func (*TrieStub) DeepClone added in v1.0.84

func (ts *TrieStub) DeepClone() (data.Trie, error)

func (*TrieStub) Delete

func (ts *TrieStub) Delete(key []byte) error

func (*TrieStub) Get

func (ts *TrieStub) Get(key []byte) ([]byte, error)

func (*TrieStub) GetAllLeaves

func (ts *TrieStub) GetAllLeaves() (map[string][]byte, error)

func (*TrieStub) GetSerializedNodes

func (ts *TrieStub) GetSerializedNodes(hash []byte, maxBuffToSend uint64) ([][]byte, error)

func (*TrieStub) IsInterfaceNil

func (ts *TrieStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*TrieStub) IsPruningEnabled

func (ts *TrieStub) IsPruningEnabled() bool

func (*TrieStub) Prove added in v1.0.84

func (ts *TrieStub) Prove(key []byte) ([][]byte, error)

func (*TrieStub) Prune

func (ts *TrieStub) Prune(rootHash []byte, identifier data.TriePruningIdentifier) error

Prune removes from the database all the old hashes that correspond to the given root hash

func (*TrieStub) Recreate

func (ts *TrieStub) Recreate(root []byte) (data.Trie, error)

func (*TrieStub) ResetOldHashes

func (ts *TrieStub) ResetOldHashes() [][]byte

ResetOldHashes resets the oldHashes and oldRoot variables and returns the old hashes

func (*TrieStub) Root

func (ts *TrieStub) Root() ([]byte, error)

func (*TrieStub) SetCheckpoint

func (ts *TrieStub) SetCheckpoint(_ []byte)

func (*TrieStub) String

func (ts *TrieStub) String() string

func (*TrieStub) TakeSnapshot

func (ts *TrieStub) TakeSnapshot(_ []byte)

func (*TrieStub) Update

func (ts *TrieStub) Update(key, value []byte) error

func (*TrieStub) VerifyProof added in v1.0.84

func (ts *TrieStub) VerifyProof(proofs [][]byte, key []byte) (bool, error)

type Uint64CacherStub

type Uint64CacherStub struct {
	ClearCalled           func()
	PutCalled             func(uint64, []byte) bool
	GetCalled             func(uint64) ([]byte, bool)
	HasCalled             func(uint64) bool
	PeekCalled            func(uint64) ([]byte, bool)
	HasOrAddCalled        func(uint64, []byte) (bool, bool)
	RemoveCalled          func(uint64)
	RemoveOldestCalled    func()
	KeysCalled            func() []uint64
	LenCalled             func() int
	RegisterHandlerCalled func(handler func(nonce uint64))
}

func (*Uint64CacherStub) Clear

func (ucs *Uint64CacherStub) Clear()

func (*Uint64CacherStub) Get

func (ucs *Uint64CacherStub) Get(nonce uint64) ([]byte, bool)

func (*Uint64CacherStub) Has

func (ucs *Uint64CacherStub) Has(nonce uint64) bool

func (*Uint64CacherStub) HasOrAdd

func (ucs *Uint64CacherStub) HasOrAdd(nonce uint64, value []byte) (bool, bool)

func (*Uint64CacherStub) Keys

func (ucs *Uint64CacherStub) Keys() []uint64

func (*Uint64CacherStub) Len

func (ucs *Uint64CacherStub) Len() int

func (*Uint64CacherStub) Peek

func (ucs *Uint64CacherStub) Peek(nonce uint64) ([]byte, bool)

func (*Uint64CacherStub) Put

func (ucs *Uint64CacherStub) Put(nonce uint64, value []byte) bool

func (*Uint64CacherStub) RegisterHandler

func (ucs *Uint64CacherStub) RegisterHandler(handler func(nonce uint64))

func (*Uint64CacherStub) Remove

func (ucs *Uint64CacherStub) Remove(nonce uint64)

func (*Uint64CacherStub) RemoveOldest

func (ucs *Uint64CacherStub) RemoveOldest()

type ValidatorMock

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

func NewValidatorMock

func NewValidatorMock(stake *big.Int, rating int32, pubKey []byte, address []byte) *ValidatorMock

func (*ValidatorMock) Address

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

func (*ValidatorMock) PubKey

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

func (*ValidatorMock) Rating added in v1.0.20

func (vm *ValidatorMock) Rating() int32

func (*ValidatorMock) Stake added in v1.0.20

func (vm *ValidatorMock) Stake() *big.Int

type ValidatorStatisticsProcessorMock

type ValidatorStatisticsProcessorMock struct {
	UpdatePeerStateCalled           func(header data.HeaderHandler) ([]byte, error)
	RevertPeerStateCalled           func(header data.HeaderHandler) error
	IsInterfaceNilCalled            func() bool
	RevertPeerStateToSnapshotCalled func(snapshot int) error
	GetPeerAccountCalled            func(address []byte) (state.PeerAccountHandler, error)
	CommitCalled                    func() ([]byte, error)
	RootHashCalled                  func() ([]byte, error)
}

func (*ValidatorStatisticsProcessorMock) Commit added in v0.0.5

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

func (*ValidatorStatisticsProcessorMock) GetPeerAccount

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

func (*ValidatorStatisticsProcessorMock) IsInterfaceNil

func (vsp *ValidatorStatisticsProcessorMock) IsInterfaceNil() bool

func (*ValidatorStatisticsProcessorMock) RevertPeerState

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

func (*ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot added in v1.0.63

func (vsp *ValidatorStatisticsProcessorMock) RevertPeerStateToSnapshot(snapshot int) error

func (*ValidatorStatisticsProcessorMock) RootHash

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

func (*ValidatorStatisticsProcessorMock) UpdatePeerState

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

Jump to

Keyboard shortcuts

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