mock

package
v1.7.11 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: GPL-3.0 Imports: 40 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrMockMarshalizer -

Functions

func ShardIdToString

func ShardIdToString(shardId uint32) string

ShardIdToString returns the string according to the shard id

Types

type AccountsParserStub

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]*outport.TransactionPool, error)
	GenesisMintingAddressCalled                           func() string
}

AccountsParserStub -

func (*AccountsParserStub) GenerateInitialTransactions

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

GenerateInitialTransactions -

func (*AccountsParserStub) GenesisMintingAddress

func (aps *AccountsParserStub) GenesisMintingAddress() string

GenesisMintingAddress -

func (*AccountsParserStub) GetInitialAccountsForDelegated

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

GetInitialAccountsForDelegated -

func (*AccountsParserStub) GetTotalStakedForDelegationAddress

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

GetTotalStakedForDelegationAddress -

func (*AccountsParserStub) InitialAccounts

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

InitialAccounts -

func (*AccountsParserStub) InitialAccountsSplitOnAddressesShards

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

InitialAccountsSplitOnAddressesShards -

func (*AccountsParserStub) InitialAccountsSplitOnDelegationAddressesShards

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

InitialAccountsSplitOnDelegationAddressesShards -

func (*AccountsParserStub) IsInterfaceNil

func (aps *AccountsParserStub) IsInterfaceNil() bool

IsInterfaceNil -

type BlockTrackerStub

type BlockTrackerStub struct {
	AddTrackedHeaderCalled                             func(header data.HeaderHandler, hash []byte)
	AddCrossNotarizedHeaderCalled                      func(shardID uint32, crossNotarizedHeader data.HeaderHandler, crossNotarizedHeaderHash []byte)
	AddSelfNotarizedHeaderCalled                       func(shardID uint32, selfNotarizedHeader data.HeaderHandler, selfNotarizedHeaderHash []byte)
	CheckBlockAgainstRoundHandlerCalled                func(headerHandler data.HeaderHandler) error
	CheckBlockAgainstFinalCalled                       func(headerHandler data.HeaderHandler) error
	CheckBlockAgainstWhitelistCalled                   func(interceptedData process.InterceptedData) bool
	CleanupHeadersBehindNonceCalled                    func(shardID uint32, selfNotarizedNonce uint64, crossNotarizedNonce uint64)
	ComputeLongestChainCalled                          func(shardID uint32, header data.HeaderHandler) ([]data.HeaderHandler, [][]byte)
	ComputeLongestMetaChainFromLastNotarizedCalled     func() ([]data.HeaderHandler, [][]byte, error)
	ComputeLongestShardsChainsFromLastNotarizedCalled  func() ([]data.HeaderHandler, [][]byte, map[uint32][]data.HeaderHandler, error)
	DisplayTrackedHeadersCalled                        func()
	GetCrossNotarizedHeaderCalled                      func(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeaderCalled                  func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetLastCrossNotarizedHeadersForAllShardsCalled     func() (map[uint32]data.HeaderHandler, error)
	GetLastSelfNotarizedHeaderCalled                   func(shardID uint32) (data.HeaderHandler, []byte, error)
	GetSelfNotarizedHeaderCalled                       func(shardID uint32, offset uint64) (data.HeaderHandler, []byte, error)
	GetTrackedHeadersCalled                            func(shardID uint32) ([]data.HeaderHandler, [][]byte)
	GetTrackedHeadersForAllShardsCalled                func() map[uint32][]data.HeaderHandler
	GetTrackedHeadersWithNonceCalled                   func(shardID uint32, nonce uint64) ([]data.HeaderHandler, [][]byte)
	IsShardStuckCalled                                 func(shardId uint32) bool
	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

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

AddCrossNotarizedHeader -

func (*BlockTrackerStub) AddSelfNotarizedHeader

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

AddSelfNotarizedHeader -

func (*BlockTrackerStub) AddTrackedHeader

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

AddTrackedHeader -

func (*BlockTrackerStub) CheckBlockAgainstFinal

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

CheckBlockAgainstFinal -

func (*BlockTrackerStub) CheckBlockAgainstRoundHandler

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

CheckBlockAgainstRoundHandler -

func (*BlockTrackerStub) CheckBlockAgainstWhitelist

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

CheckBlockAgainstWhitelist -

func (*BlockTrackerStub) CleanupHeadersBehindNonce

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

CleanupHeadersBehindNonce -

func (*BlockTrackerStub) CleanupInvalidCrossHeaders

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

CleanupInvalidCrossHeaders -

func (*BlockTrackerStub) ComputeLongestChain

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

ComputeLongestChain -

func (*BlockTrackerStub) ComputeLongestMetaChainFromLastNotarized

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

ComputeLongestMetaChainFromLastNotarized -

func (*BlockTrackerStub) ComputeLongestShardsChainsFromLastNotarized

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

ComputeLongestShardsChainsFromLastNotarized -

func (*BlockTrackerStub) DisplayTrackedHeaders

func (bts *BlockTrackerStub) DisplayTrackedHeaders()

DisplayTrackedHeaders -

func (*BlockTrackerStub) GetCrossNotarizedHeader

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

GetCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeader

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

GetLastCrossNotarizedHeader -

func (*BlockTrackerStub) GetLastCrossNotarizedHeadersForAllShards

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

GetLastCrossNotarizedHeadersForAllShards -

func (*BlockTrackerStub) GetLastSelfNotarizedHeader

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

GetLastSelfNotarizedHeader -

func (*BlockTrackerStub) GetSelfNotarizedHeader

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

GetSelfNotarizedHeader -

func (*BlockTrackerStub) GetTrackedHeaders

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

GetTrackedHeaders -

func (*BlockTrackerStub) GetTrackedHeadersForAllShards

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

GetTrackedHeadersForAllShards -

func (*BlockTrackerStub) GetTrackedHeadersWithNonce

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

GetTrackedHeadersWithNonce -

func (*BlockTrackerStub) IsInterfaceNil

func (bts *BlockTrackerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BlockTrackerStub) IsShardStuck

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

IsShardStuck -

func (*BlockTrackerStub) RegisterCrossNotarizedHeadersHandler

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

RegisterCrossNotarizedHeadersHandler -

func (*BlockTrackerStub) RegisterFinalMetachainHeadersHandler

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

RegisterFinalMetachainHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedFromCrossHeadersHandler

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

RegisterSelfNotarizedFromCrossHeadersHandler -

func (*BlockTrackerStub) RegisterSelfNotarizedHeadersHandler

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

RegisterSelfNotarizedHeadersHandler -

func (*BlockTrackerStub) RemoveLastNotarizedHeaders

func (bts *BlockTrackerStub) RemoveLastNotarizedHeaders()

RemoveLastNotarizedHeaders -

func (*BlockTrackerStub) RestoreToGenesis

func (bts *BlockTrackerStub) RestoreToGenesis()

RestoreToGenesis -

func (*BlockTrackerStub) ShouldAddHeader

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

ShouldAddHeader -

func (*BlockTrackerStub) ShouldSkipMiniBlocksCreationFromSelf

func (bts *BlockTrackerStub) ShouldSkipMiniBlocksCreationFromSelf() bool

ShouldSkipMiniBlocksCreationFromSelf -

type BoostrapStorerStub

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

Get -

func (*BoostrapStorerStub) GetHighestRound

func (bsm *BoostrapStorerStub) GetHighestRound() int64

GetHighestRound -

func (*BoostrapStorerStub) IsInterfaceNil

func (bsm *BoostrapStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*BoostrapStorerStub) Put

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

Put -

func (*BoostrapStorerStub) SaveLastRound

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

SaveLastRound -

type BootstrapStorerMock

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

Get -

func (*BootstrapStorerMock) GetHighestRound

func (bsm *BootstrapStorerMock) GetHighestRound() int64

GetHighestRound -

func (*BootstrapStorerMock) IsInterfaceNil

func (bsm *BootstrapStorerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*BootstrapStorerMock) Put

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

Put -

func (*BootstrapStorerMock) SaveLastRound

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

SaveLastRound -

type CoreComponentsMock

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
	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                     nodesCoordinator.NodesShuffler
	EpochChangeNotifier          process.EpochNotifier
	RoundChangeNotifier          process.RoundNotifier
	EnableRoundsHandlerField     process.EnableRoundsHandler
	EpochNotifierWithConfirm     factory.EpochStartNotifierWithConfirm
	TxVersionCheckHandler        process.TxVersionCheckerHandler
	ChanStopProcess              chan endProcess.ArgEndProcess
	StartTime                    time.Time
	NodeTypeProviderField        core.NodeTypeProviderHandler
	WasmVMChangeLockerInternal   common.Locker
	ProcessStatusHandlerInternal common.ProcessStatusHandler
	HardforkTriggerPubKeyField   []byte
	EnableEpochsHandlerField     common.EnableEpochsHandler
	// contains filtered or unexported fields
}

CoreComponentsMock -

func (*CoreComponentsMock) APIEconomicsData

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

APIEconomicsData -

func (*CoreComponentsMock) AddressPubKeyConverter

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

AddressPubKeyConverter -

func (*CoreComponentsMock) AlarmScheduler

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

AlarmScheduler -

func (*CoreComponentsMock) ChainID

func (ccm *CoreComponentsMock) ChainID() string

ChainID -

func (*CoreComponentsMock) ChanStopNodeProcess

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

ChanStopNodeProcess -

func (*CoreComponentsMock) EconomicsData

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

EconomicsData -

func (*CoreComponentsMock) EnableEpochsHandler

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

EnableEpochsHandler -

func (*CoreComponentsMock) EnableRoundsHandler

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

EnableRoundsHandler -

func (*CoreComponentsMock) EncodedAddressLen

func (ccm *CoreComponentsMock) EncodedAddressLen() uint32

EncodedAddressLen -

func (*CoreComponentsMock) EpochNotifier

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

EpochNotifier -

func (*CoreComponentsMock) EpochStartNotifierWithConfirm

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

EpochStartNotifierWithConfirm -

func (*CoreComponentsMock) GenesisNodesSetup

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

GenesisNodesSetup -

func (*CoreComponentsMock) GenesisTime

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

GenesisTime -

func (*CoreComponentsMock) HardforkTriggerPubKey

func (ccm *CoreComponentsMock) HardforkTriggerPubKey() []byte

HardforkTriggerPubKey -

func (*CoreComponentsMock) Hasher

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

Hasher -

func (*CoreComponentsMock) InternalMarshalizer

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

InternalMarshalizer -

func (*CoreComponentsMock) IsInterfaceNil

func (ccm *CoreComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CoreComponentsMock) MinTransactionVersion

func (ccm *CoreComponentsMock) MinTransactionVersion() uint32

MinTransactionVersion -

func (*CoreComponentsMock) NodeTypeProvider

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

NodeTypeProvider -

func (*CoreComponentsMock) NodesShuffler

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

NodesShuffler -

func (*CoreComponentsMock) PathHandler

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

PathHandler -

func (*CoreComponentsMock) ProcessStatusHandler

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

ProcessStatusHandler -

func (*CoreComponentsMock) Rater

Rater -

func (*CoreComponentsMock) RatingsData

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

RatingsData -

func (*CoreComponentsMock) RoundHandler

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

RoundHandler -

func (*CoreComponentsMock) RoundNotifier added in v1.6.0

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

RoundNotifier -

func (*CoreComponentsMock) SetInternalMarshalizer

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

SetInternalMarshalizer -

func (*CoreComponentsMock) SyncTimer

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

SyncTimer -

func (*CoreComponentsMock) TxMarshalizer

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

TxMarshalizer -

func (*CoreComponentsMock) TxSignHasher

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

TxSignHasher -

func (*CoreComponentsMock) TxVersionChecker

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

TxVersionChecker -

func (*CoreComponentsMock) Uint64ByteSliceConverter

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

Uint64ByteSliceConverter -

func (*CoreComponentsMock) ValidatorPubKeyConverter

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

ValidatorPubKeyConverter -

func (*CoreComponentsMock) VmMarshalizer

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

VmMarshalizer -

func (*CoreComponentsMock) WasmVMChangeLocker

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

WasmVMChangeLocker -

func (*CoreComponentsMock) Watchdog

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

Watchdog -

type CryptoComponentsMock

type CryptoComponentsMock struct {
	PubKey                  crypto.PublicKey
	PrivKey                 crypto.PrivateKey
	P2pPubKey               crypto.PublicKey
	P2pPrivKey              crypto.PrivateKey
	P2pSig                  crypto.SingleSigner
	PubKeyString            string
	PubKeyBytes             []byte
	BlockSig                crypto.SingleSigner
	TxSig                   crypto.SingleSigner
	MultiSigContainer       cryptoCommon.MultiSignerContainer
	PeerSignHandler         crypto.PeerSignatureHandler
	BlKeyGen                crypto.KeyGenerator
	TxKeyGen                crypto.KeyGenerator
	P2PKeyGen               crypto.KeyGenerator
	MsgSigVerifier          vm.MessageSignVerifier
	SigHandler              consensus.SigningHandler
	ManagedPeersHolderField common.ManagedPeersHolder
	KeysHandlerField        consensus.KeysHandler
	// contains filtered or unexported fields
}

CryptoComponentsMock -

func (*CryptoComponentsMock) BlockSignKeyGen

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

BlockSignKeyGen -

func (*CryptoComponentsMock) BlockSigner

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

BlockSigner -

func (*CryptoComponentsMock) Clone

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

Clone -

func (*CryptoComponentsMock) ConsensusSigningHandler added in v1.6.0

func (ccm *CryptoComponentsMock) ConsensusSigningHandler() consensus.SigningHandler

ConsensusSigningHandler -

func (*CryptoComponentsMock) GetMultiSigner

func (ccm *CryptoComponentsMock) GetMultiSigner(epoch uint32) (crypto.MultiSigner, error)

GetMultiSigner -

func (*CryptoComponentsMock) IsInterfaceNil

func (ccm *CryptoComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*CryptoComponentsMock) KeysHandler added in v1.6.0

func (ccm *CryptoComponentsMock) KeysHandler() consensus.KeysHandler

KeysHandler -

func (*CryptoComponentsMock) ManagedPeersHolder added in v1.6.0

func (ccm *CryptoComponentsMock) ManagedPeersHolder() common.ManagedPeersHolder

ManagedPeersHolder -

func (*CryptoComponentsMock) MessageSignVerifier

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

MessageSignVerifier -

func (*CryptoComponentsMock) MultiSignerContainer

func (ccm *CryptoComponentsMock) MultiSignerContainer() cryptoCommon.MultiSignerContainer

MultiSignerContainer -

func (*CryptoComponentsMock) P2pKeyGen

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

P2pKeyGen -

func (*CryptoComponentsMock) P2pPrivateKey

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

P2pPrivateKey -

func (*CryptoComponentsMock) P2pPublicKey

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

P2pPublicKey -

func (*CryptoComponentsMock) P2pSingleSigner

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

P2pSingleSigner -

func (*CryptoComponentsMock) PeerSignatureHandler

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

PeerSignatureHandler -

func (*CryptoComponentsMock) PrivateKey

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

PrivateKey -

func (*CryptoComponentsMock) PublicKey

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

PublicKey -

func (*CryptoComponentsMock) PublicKeyBytes

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

PublicKeyBytes -

func (*CryptoComponentsMock) PublicKeyString

func (ccm *CryptoComponentsMock) PublicKeyString() string

PublicKeyString -

func (*CryptoComponentsMock) SetMultiSignerContainer

func (ccm *CryptoComponentsMock) SetMultiSignerContainer(ms cryptoCommon.MultiSignerContainer) error

SetMultiSignerContainer -

func (*CryptoComponentsMock) TxSignKeyGen

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

TxSignKeyGen -

func (*CryptoComponentsMock) TxSingleSigner

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

TxSingleSigner -

type DataComponentsMock

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

DataComponentsMock -

func (*DataComponentsMock) Blockchain

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

Blockchain -

func (*DataComponentsMock) Clone

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

Clone -

func (*DataComponentsMock) Datapool

Datapool -

func (*DataComponentsMock) EconomicsHandler

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

EconomicsHandler -

func (*DataComponentsMock) IsInterfaceNil

func (dcm *DataComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*DataComponentsMock) MiniBlocksProvider

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

MiniBlocksProvider -

func (*DataComponentsMock) SetBlockchain

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

SetBlockchain -

func (*DataComponentsMock) StorageService

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

func (esnm *EpochStartNotifierStub) NotifyEpochChangeConfirmed(epoch uint32)

NotifyEpochChangeConfirmed -

func (*EpochStartNotifierStub) RegisterHandler

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

RegisterHandler -

func (*EpochStartNotifierStub) UnregisterHandler

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

UnregisterHandler -

type EpochStartTriggerStub

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

EpochStartTriggerStub -

func (*EpochStartTriggerStub) Close

func (e *EpochStartTriggerStub) Close() error

Close -

func (*EpochStartTriggerStub) Epoch

func (e *EpochStartTriggerStub) Epoch() uint32

Epoch -

func (*EpochStartTriggerStub) EpochFinalityAttestingRound

func (e *EpochStartTriggerStub) EpochFinalityAttestingRound() uint64

EpochFinalityAttestingRound -

func (*EpochStartTriggerStub) EpochStartMetaHdrHash

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

EpochStartMetaHdrHash -

func (*EpochStartTriggerStub) EpochStartRound

func (e *EpochStartTriggerStub) EpochStartRound() uint64

EpochStartRound -

func (*EpochStartTriggerStub) ForceEpochStart

func (e *EpochStartTriggerStub) ForceEpochStart(round uint64)

ForceEpochStart -

func (*EpochStartTriggerStub) GetRoundsPerEpoch

func (e *EpochStartTriggerStub) GetRoundsPerEpoch() uint64

GetRoundsPerEpoch -

func (*EpochStartTriggerStub) GetSavedStateKey

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

GetSavedStateKey -

func (*EpochStartTriggerStub) IsEpochStart

func (e *EpochStartTriggerStub) IsEpochStart() bool

IsEpochStart -

func (*EpochStartTriggerStub) IsInterfaceNil

func (e *EpochStartTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartTriggerStub) LoadState

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

LoadState -

func (*EpochStartTriggerStub) MetaEpoch

func (e *EpochStartTriggerStub) MetaEpoch() uint32

MetaEpoch -

func (*EpochStartTriggerStub) NotifyAll

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

NotifyAll -

func (*EpochStartTriggerStub) ReceivedHeader

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

ReceivedHeader -

func (*EpochStartTriggerStub) RequestEpochStartIfNeeded

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

RequestEpochStartIfNeeded -

func (*EpochStartTriggerStub) Revert

Revert -

func (*EpochStartTriggerStub) RevertStateToBlock

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

RevertStateToBlock -

func (*EpochStartTriggerStub) SetAppStatusHandler

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

SetAppStatusHandler -

func (*EpochStartTriggerStub) SetCurrentEpochStartRound

func (e *EpochStartTriggerStub) SetCurrentEpochStartRound(_ uint64)

SetCurrentEpochStartRound -

func (*EpochStartTriggerStub) SetEpoch

func (e *EpochStartTriggerStub) SetEpoch(_ uint32)

SetEpoch -

func (*EpochStartTriggerStub) SetFinalityAttestingRound

func (e *EpochStartTriggerStub) SetFinalityAttestingRound(_ uint64)

SetFinalityAttestingRound -

func (*EpochStartTriggerStub) SetProcessed

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

SetProcessed -

func (*EpochStartTriggerStub) SetRoundsPerEpoch

func (e *EpochStartTriggerStub) SetRoundsPerEpoch(_ uint64)

SetRoundsPerEpoch -

func (*EpochStartTriggerStub) SetTrigger

SetTrigger -

func (*EpochStartTriggerStub) Update

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

Update -

type ForkDetectorMock

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

ForkDetectorMock is a mock implementation for the ForkDetector interface

func (*ForkDetectorMock) AddHeader

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

AddHeader is a mock implementation for AddHeader

func (*ForkDetectorMock) CheckFork

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

CheckFork is a mock implementation for CheckFork

func (*ForkDetectorMock) GetHighestFinalBlockHash

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

GetHighestFinalBlockHash -

func (*ForkDetectorMock) GetHighestFinalBlockNonce

func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64

GetHighestFinalBlockNonce is a mock implementation for GetHighestFinalBlockNonce

func (*ForkDetectorMock) GetNotarizedHeaderHash

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

GetNotarizedHeaderHash -

func (*ForkDetectorMock) IsInterfaceNil

func (fdm *ForkDetectorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ForkDetectorMock) ProbableHighestNonce

func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64

ProbableHighestNonce is a mock implementation for GetProbableHighestNonce

func (*ForkDetectorMock) RemoveHeader

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

RemoveHeader is a mock implementation for RemoveHeader

func (*ForkDetectorMock) ResetFork

func (fdm *ForkDetectorMock) ResetFork()

ResetFork -

func (*ForkDetectorMock) ResetProbableHighestNonce

func (fdm *ForkDetectorMock) ResetProbableHighestNonce()

ResetProbableHighestNonce -

func (*ForkDetectorMock) RestoreToGenesis

func (fdm *ForkDetectorMock) RestoreToGenesis()

RestoreToGenesis -

func (*ForkDetectorMock) SetFinalToLastCheckpoint

func (fdm *ForkDetectorMock) SetFinalToLastCheckpoint()

SetFinalToLastCheckpoint -

func (*ForkDetectorMock) SetRollBackNonce

func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)

SetRollBackNonce -

type HeaderIntegrityVerifierStub

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

HeaderIntegrityVerifierStub -

func (*HeaderIntegrityVerifierStub) GetVersion

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

GetVersion -

func (*HeaderIntegrityVerifierStub) IsInterfaceNil

func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderIntegrityVerifierStub) Verify

Verify -

type HeaderSigVerifierStub

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

func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderSigVerifierStub) VerifyLeaderSignature

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

VerifyLeaderSignature -

func (*HeaderSigVerifierStub) VerifyRandSeed

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

VerifyRandSeed -

func (*HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature

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

VerifyRandSeedAndLeaderSignature -

func (*HeaderSigVerifierStub) VerifySignature

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

VerifySignature -

type HeaderValidatorStub

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

HeaderValidatorStub -

func (*HeaderValidatorStub) IsHeaderConstructionValid

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

IsHeaderConstructionValid -

func (*HeaderValidatorStub) IsInterfaceNil

func (hvs *HeaderValidatorStub) IsInterfaceNil() bool

IsInterfaceNil returns if underlying object is true

type HeartbeatV2ComponentsStub

type HeartbeatV2ComponentsStub struct {
	MonitorField factory.HeartbeatV2Monitor
}

HeartbeatV2ComponentsStub -

func (*HeartbeatV2ComponentsStub) CheckSubcomponents

func (hbc *HeartbeatV2ComponentsStub) CheckSubcomponents() error

CheckSubcomponents -

func (*HeartbeatV2ComponentsStub) Close

func (hbc *HeartbeatV2ComponentsStub) Close() error

Close -

func (*HeartbeatV2ComponentsStub) Create

func (hbc *HeartbeatV2ComponentsStub) Create() error

Create -

func (*HeartbeatV2ComponentsStub) IsInterfaceNil

func (hbc *HeartbeatV2ComponentsStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeartbeatV2ComponentsStub) Monitor

Monitor -

func (*HeartbeatV2ComponentsStub) String

func (hbc *HeartbeatV2ComponentsStub) String() string

String -

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

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

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

KeyLoaderStub -

func (*KeyLoaderStub) IsInterfaceNil added in v1.6.0

func (kl *KeyLoaderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*KeyLoaderStub) LoadAllKeys added in v1.6.0

func (kl *KeyLoaderStub) LoadAllKeys(path string) ([][]byte, []string, error)

LoadAllKeys -

func (*KeyLoaderStub) LoadKey

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

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

func NewMemDbMock() *MemDbMock

NewMemDbMock creates a new memorydb object

func (*MemDbMock) Close

func (s *MemDbMock) Close() error

Close closes the files/resources associated to the storage medium

func (*MemDbMock) Destroy

func (s *MemDbMock) Destroy() error

Destroy removes the storage medium stored data

func (*MemDbMock) DestroyClosed

func (s *MemDbMock) DestroyClosed() error

DestroyClosed removes the already closed storage medium stored data

func (*MemDbMock) Get

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

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

func (*MemDbMock) Has

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

func (s *MemDbMock) Init() error

Init initializes the storage medium and prepares it for usage

func (*MemDbMock) IsInterfaceNil

func (s *MemDbMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MemDbMock) Put

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

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

func (*MemDbMock) Remove

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

Remove removes the data associated to the given key

type MiniBlocksProviderStub

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

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

GetMiniBlocks -

func (*MiniBlocksProviderStub) GetMiniBlocksFromPool

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

GetMiniBlocksFromPool -

func (*MiniBlocksProviderStub) GetMiniBlocksFromStorer

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

GetMiniBlocksFromStorer -

func (*MiniBlocksProviderStub) IsInterfaceNil

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

type NetworkComponentsMock struct {
	Messenger                        p2p.Messenger
	InputAntiFlood                   factory.P2PAntifloodHandler
	OutputAntiFlood                  factory.P2PAntifloodHandler
	PeerBlackList                    process.PeerBlackListCacher
	PreferredPeersHolder             factory.PreferredPeersHolderHandler
	PeersRatingHandlerField          p2p.PeersRatingHandler
	PeersRatingMonitorField          p2p.PeersRatingMonitor
	FullArchiveNetworkMessengerField p2p.Messenger
	FullArchivePreferredPeersHolder  factory.PreferredPeersHolderHandler
}

NetworkComponentsMock -

func (*NetworkComponentsMock) CheckSubcomponents

func (ncm *NetworkComponentsMock) CheckSubcomponents() error

CheckSubcomponents -

func (*NetworkComponentsMock) Close

func (ncm *NetworkComponentsMock) Close() error

Close -

func (*NetworkComponentsMock) Create

func (ncm *NetworkComponentsMock) Create() error

Create -

func (*NetworkComponentsMock) FullArchiveNetworkMessenger added in v1.6.0

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

FullArchiveNetworkMessenger -

func (*NetworkComponentsMock) FullArchivePreferredPeersHolderHandler added in v1.6.0

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

FullArchivePreferredPeersHolderHandler -

func (*NetworkComponentsMock) InputAntiFloodHandler

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

InputAntiFloodHandler -

func (*NetworkComponentsMock) IsInterfaceNil

func (ncm *NetworkComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NetworkComponentsMock) NetworkMessenger

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

NetworkMessenger -

func (*NetworkComponentsMock) OutputAntiFloodHandler

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

OutputAntiFloodHandler -

func (*NetworkComponentsMock) PeerBlackListHandler

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

PeerBlackListHandler -

func (*NetworkComponentsMock) PeerHonestyHandler

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

PeerHonestyHandler -

func (*NetworkComponentsMock) PeersRatingHandler

func (ncm *NetworkComponentsMock) PeersRatingHandler() p2p.PeersRatingHandler

PeersRatingHandler -

func (*NetworkComponentsMock) PeersRatingMonitor added in v1.6.0

func (ncm *NetworkComponentsMock) PeersRatingMonitor() p2p.PeersRatingMonitor

PeersRatingMonitor -

func (*NetworkComponentsMock) PreferredPeersHolderHandler

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

PreferredPeersHolderHandler -

func (*NetworkComponentsMock) PubKeyCacher

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

PubKeyCacher -

type P2PAntifloodHandlerStub

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

P2PAntifloodHandlerStub -

func (*P2PAntifloodHandlerStub) ApplyConsensusSize

func (p2pahs *P2PAntifloodHandlerStub) ApplyConsensusSize(size int)

ApplyConsensusSize -

func (*P2PAntifloodHandlerStub) BlacklistPeer

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

BlacklistPeer -

func (*P2PAntifloodHandlerStub) CanProcessMessage

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

CanProcessMessage -

func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic

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

CanProcessMessagesOnTopic -

func (*P2PAntifloodHandlerStub) Close

func (p2pahs *P2PAntifloodHandlerStub) Close() error

Close -

func (*P2PAntifloodHandlerStub) IsInterfaceNil

func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*P2PAntifloodHandlerStub) IsOriginatorEligibleForTopic

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

IsOriginatorEligibleForTopic -

func (*P2PAntifloodHandlerStub) ResetForTopic

func (p2pahs *P2PAntifloodHandlerStub) ResetForTopic(_ string)

ResetForTopic -

func (*P2PAntifloodHandlerStub) SetDebugger

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

SetDebugger -

func (*P2PAntifloodHandlerStub) SetMaxMessagesForTopic

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

SetMaxMessagesForTopic -

func (*P2PAntifloodHandlerStub) SetPeerValidatorMapper

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

SetPeerValidatorMapper -

func (*P2PAntifloodHandlerStub) SetTopicsForAll

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

SetTopicsForAll -

type P2pPrivateKeyMock

type P2pPrivateKeyMock struct {
	*PrivateKeyStub
}

P2pPrivateKeyMock -

func NewP2pPrivateKeyMock

func NewP2pPrivateKeyMock() *P2pPrivateKeyMock

NewP2pPrivateKeyMock -

func (*P2pPrivateKeyMock) ToByteArray

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

ToByteArray -

type PeerBlackListHandlerStub

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

PeerBlackListHandlerStub -

func (*PeerBlackListHandlerStub) Has

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

Has -

func (*PeerBlackListHandlerStub) IsInterfaceNil

func (pblhs *PeerBlackListHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerBlackListHandlerStub) Sweep

func (pblhs *PeerBlackListHandlerStub) Sweep()

Sweep -

func (*PeerBlackListHandlerStub) Upsert

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

Upsert -

type PeerHonestyHandlerStub

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

PeerHonestyHandlerStub -

func (*PeerHonestyHandlerStub) ChangeScore

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

ChangeScore -

func (*PeerHonestyHandlerStub) Close

func (phhs *PeerHonestyHandlerStub) Close() error

Close -

func (*PeerHonestyHandlerStub) IsInterfaceNil

func (phhs *PeerHonestyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type PeerSignatureHandler

type PeerSignatureHandler struct{}

PeerSignatureHandler -

func (*PeerSignatureHandler) GetPeerSignature

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

GetPeerSignature -

func (*PeerSignatureHandler) IsInterfaceNil

func (p *PeerSignatureHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerSignatureHandler) VerifyPeerSignature

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

VerifyPeerSignature -

type PendingMiniBlocksHandlerStub

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

PendingMiniBlocksHandlerStub -

func (*PendingMiniBlocksHandlerStub) AddProcessedHeader

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

AddProcessedHeader -

func (*PendingMiniBlocksHandlerStub) GetPendingMiniBlocks

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

GetPendingMiniBlocks -

func (*PendingMiniBlocksHandlerStub) IsInterfaceNil

func (p *PendingMiniBlocksHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PendingMiniBlocksHandlerStub) RevertHeader

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

RevertHeader -

func (*PendingMiniBlocksHandlerStub) SetPendingMiniBlocks

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

SetPendingMiniBlocks -

type 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

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

PrivateKeyStub -

func (*PrivateKeyStub) GeneratePublic

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

GeneratePublic -

func (*PrivateKeyStub) IsInterfaceNil

func (sk *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar

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

Scalar -

func (*PrivateKeyStub) Suite

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

Suite -

func (*PrivateKeyStub) ToByteArray

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

ToByteArray -

type ProcessComponentsMock

type ProcessComponentsMock struct {
	NodesCoord                           nodesCoordinator.NodesCoordinator
	ShardCoord                           sharding.Coordinator
	IntContainer                         process.InterceptorsContainer
	FullArchiveIntContainer              process.InterceptorsContainer
	ResContainer                         dataRetriever.ResolversContainer
	ReqFinder                            dataRetriever.RequestersFinder
	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
	MainPeerMapper                       process.NetworkShardingCollector
	FullArchivePeerMapper                process.NetworkShardingCollector
	TransactionEvaluator                 factory.TransactionEvaluator
	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
	TxsSenderHandlerField                process.TxsSenderHandler
	HardforkTriggerField                 factory.HardforkTrigger
	ProcessedMiniBlocksTrackerInternal   process.ProcessedMiniBlocksTracker
	ESDTDataStorageHandlerForAPIInternal vmcommon.ESDTNFTStorageHandler
	AccountsParserInternal               genesis.AccountsParser
	ReceiptsRepositoryInternal           factory.ReceiptsRepository
	SentSignaturesTrackerInternal        process.SentSignaturesTracker
	EpochSystemSCProcessorInternal       process.EpochStartSystemSCProcessor
}

ProcessComponentsMock -

func (*ProcessComponentsMock) APITransactionEvaluator added in v1.6.0

func (pcm *ProcessComponentsMock) APITransactionEvaluator() factory.TransactionEvaluator

APITransactionEvaluator -

func (*ProcessComponentsMock) AccountsParser

func (pcm *ProcessComponentsMock) AccountsParser() genesis.AccountsParser

AccountsParser -

func (*ProcessComponentsMock) BlackListHandler

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

BlackListHandler -

func (*ProcessComponentsMock) BlockProcessor

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

BlockProcessor -

func (*ProcessComponentsMock) BlockTracker

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

BlockTracker -

func (*ProcessComponentsMock) BootStorer

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

BootStorer -

func (*ProcessComponentsMock) CheckSubcomponents

func (pcm *ProcessComponentsMock) CheckSubcomponents() error

CheckSubcomponents -

func (*ProcessComponentsMock) Close

func (pcm *ProcessComponentsMock) Close() error

Close -

func (*ProcessComponentsMock) Create

func (pcm *ProcessComponentsMock) Create() error

Create -

func (*ProcessComponentsMock) CurrentEpochProvider

CurrentEpochProvider -

func (*ProcessComponentsMock) ESDTDataStorageHandlerForAPI

func (pcm *ProcessComponentsMock) ESDTDataStorageHandlerForAPI() vmcommon.ESDTNFTStorageHandler

ESDTDataStorageHandlerForAPI -

func (*ProcessComponentsMock) EpochStartNotifier

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

EpochStartNotifier -

func (*ProcessComponentsMock) EpochStartTrigger

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

EpochStartTrigger -

func (*ProcessComponentsMock) EpochSystemSCProcessor added in v1.7.9

func (pcm *ProcessComponentsMock) EpochSystemSCProcessor() process.EpochStartSystemSCProcessor

EpochSystemSCProcessor -

func (*ProcessComponentsMock) FallbackHeaderValidator

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

FallbackHeaderValidator -

func (*ProcessComponentsMock) ForkDetector

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

ForkDetector -

func (*ProcessComponentsMock) FullArchiveInterceptorsContainer added in v1.6.0

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

FullArchiveInterceptorsContainer -

func (*ProcessComponentsMock) FullArchivePeerShardMapper added in v1.6.0

func (pcm *ProcessComponentsMock) FullArchivePeerShardMapper() process.NetworkShardingCollector

FullArchivePeerShardMapper -

func (*ProcessComponentsMock) HardforkTrigger

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

HardforkTrigger -

func (*ProcessComponentsMock) HeaderConstructionValidator

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

HeaderConstructionValidator -

func (*ProcessComponentsMock) HeaderIntegrityVerifier

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

HeaderIntegrityVerifier -

func (*ProcessComponentsMock) HeaderSigVerifier

HeaderSigVerifier -

func (*ProcessComponentsMock) HistoryRepository

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

HistoryRepository -

func (*ProcessComponentsMock) ImportStartHandler

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

ImportStartHandler -

func (*ProcessComponentsMock) InterceptorsContainer

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

InterceptorsContainer -

func (*ProcessComponentsMock) IsInterfaceNil

func (pcm *ProcessComponentsMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*ProcessComponentsMock) NodeRedundancyHandler

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

NodeRedundancyHandler -

func (*ProcessComponentsMock) NodesCoordinator

NodesCoordinator -

func (*ProcessComponentsMock) PeerShardMapper

PeerShardMapper -

func (*ProcessComponentsMock) PendingMiniBlocksHandler

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

PendingMiniBlocksHandler -

func (*ProcessComponentsMock) ProcessedMiniBlocksTracker

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

ProcessedMiniBlocksTracker -

func (*ProcessComponentsMock) ReceiptsRepository

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

ReceiptsRepository -

func (*ProcessComponentsMock) RequestHandler

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

RequestHandler -

func (*ProcessComponentsMock) RequestedItemsHandler

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

RequestedItemsHandler -

func (*ProcessComponentsMock) RequestersFinder added in v1.6.0

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

RequestersFinder -

func (*ProcessComponentsMock) ResolversContainer added in v1.6.0

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

ResolversContainer -

func (*ProcessComponentsMock) RoundHandler

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

RoundHandler -

func (*ProcessComponentsMock) ScheduledTxsExecutionHandler

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

ScheduledTxsExecutionHandler -

func (*ProcessComponentsMock) SentSignaturesTracker added in v1.6.14

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

SentSignaturesTracker -

func (*ProcessComponentsMock) ShardCoordinator

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

ShardCoordinator -

func (*ProcessComponentsMock) String

func (pcm *ProcessComponentsMock) String() string

String -

func (*ProcessComponentsMock) TxLogsProcessor

TxLogsProcessor -

func (*ProcessComponentsMock) TxsSenderHandler

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

TxsSenderHandler -

func (*ProcessComponentsMock) ValidatorsProvider

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

ValidatorsProvider -

func (*ProcessComponentsMock) ValidatorsStatistics

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

ValidatorsStatistics -

func (*ProcessComponentsMock) WhiteListHandler

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

WhiteListHandler -

func (*ProcessComponentsMock) WhiteListerVerifiedTxs

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

WhiteListerVerifiedTxs -

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

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

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

AdjustInactivityIfNeeded -

func (*RedundancyHandlerStub) IsInterfaceNil

func (rhs *RedundancyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RedundancyHandlerStub) IsMainMachineActive

func (rhs *RedundancyHandlerStub) IsMainMachineActive() bool

IsMainMachineActive -

func (*RedundancyHandlerStub) IsRedundancyNode

func (rhs *RedundancyHandlerStub) IsRedundancyNode() bool

IsRedundancyNode -

func (*RedundancyHandlerStub) ObserverPrivateKey

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

ObserverPrivateKey -

func (*RedundancyHandlerStub) ResetInactivityIfNeeded

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

ResetInactivityIfNeeded -

type RoundHandlerMock

type RoundHandlerMock struct {
	RoundIndex        int64
	RoundTimeStamp    time.Time
	RoundTimeDuration time.Duration
	// contains filtered or unexported fields
}

RoundHandlerMock -

func (*RoundHandlerMock) BeforeGenesis

func (rndm *RoundHandlerMock) BeforeGenesis() bool

BeforeGenesis -

func (*RoundHandlerMock) Index

func (rndm *RoundHandlerMock) Index() int64

Index -

func (*RoundHandlerMock) IsInterfaceNil

func (rndm *RoundHandlerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*RoundHandlerMock) RemainingTime

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

RemainingTime -

func (*RoundHandlerMock) TimeDuration

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

TimeDuration -

func (*RoundHandlerMock) TimeStamp

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

TimeStamp -

func (*RoundHandlerMock) UpdateRound

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 additive identity (0)

type SinglesignFailMock

type SinglesignFailMock struct {
}

SinglesignFailMock -

func (*SinglesignFailMock) IsInterfaceNil

func (s *SinglesignFailMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignFailMock) Sign

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

Sign signs a message using a single signature

func (*SinglesignFailMock) Verify

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

Verify verifies a signature using a single signature

type SinglesignMock

type SinglesignMock struct {
}

SinglesignMock -

func (*SinglesignMock) IsInterfaceNil

func (s *SinglesignMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignMock) Sign

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

Sign signs a message using a single signature

func (*SinglesignMock) Verify

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

Verify verifies a signature using a single signature

type SinglesignStub

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

SinglesignStub -

func (*SinglesignStub) IsInterfaceNil

func (s *SinglesignStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*SinglesignStub) Sign

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

Sign signs a message using a single signature

func (*SinglesignStub) Verify

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

Verify verifies a signature using a single signature

type SmartContractParserStub

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

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

GetDeployedSCAddresses -

func (*SmartContractParserStub) InitialSmartContracts

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

InitialSmartContracts -

func (*SmartContractParserStub) InitialSmartContractsSplitOnOwnersShards

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

InitialSmartContractsSplitOnOwnersShards -

func (*SmartContractParserStub) IsInterfaceNil

func (scps *SmartContractParserStub) IsInterfaceNil() bool

IsInterfaceNil -

type StateComponentsHolderStub

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

StateComponentsHolderStub -

func (*StateComponentsHolderStub) AccountsAdapter

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

AccountsAdapter -

func (*StateComponentsHolderStub) AccountsAdapterAPI

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

AccountsAdapterAPI -

func (*StateComponentsHolderStub) AccountsRepository

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

AccountsRepository -

func (*StateComponentsHolderStub) Close added in v1.6.0

func (s *StateComponentsHolderStub) Close() error

Close -

func (*StateComponentsHolderStub) IsInterfaceNil

func (s *StateComponentsHolderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*StateComponentsHolderStub) MissingTrieNodesNotifier added in v1.6.0

func (s *StateComponentsHolderStub) MissingTrieNodesNotifier() common.MissingTrieNodesNotifier

MissingTrieNodesNotifier -

func (*StateComponentsHolderStub) PeerAccounts

PeerAccounts -

func (*StateComponentsHolderStub) TrieStorageManagers

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

TrieStorageManagers -

func (*StateComponentsHolderStub) TriesContainer

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

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 TxLogProcessorMock

type TxLogProcessorMock struct {
}

TxLogProcessorMock -

func (*TxLogProcessorMock) Clean

func (t *TxLogProcessorMock) Clean()

Clean -

func (*TxLogProcessorMock) EnableLogToBeSavedInCache

func (t *TxLogProcessorMock) EnableLogToBeSavedInCache()

EnableLogToBeSavedInCache -

func (*TxLogProcessorMock) GetLogFromCache

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

GetLogFromCache -

func (*TxLogProcessorMock) IsInterfaceNil

func (t *TxLogProcessorMock) IsInterfaceNil() bool

IsInterfaceNil -

Jump to

Keyboard shortcuts

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