mock

package
v1.1.66 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2021 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

ErrMockMarshalizer -

Functions

func NewPersisterMock

func NewPersisterMock() *persisterMock

NewPersisterMock -

Types

type AccountsStub

type AccountsStub struct {
	GetExistingAccountCalled func(addressContainer []byte) (state.AccountHandler, error)
	LoadAccountCalled        func(container []byte) (state.AccountHandler, error)
	SaveAccountCalled        func(account state.AccountHandler) error
	RemoveAccountCalled      func(addressContainer []byte) error
	CommitCalled             func() ([]byte, error)
	JournalLenCalled         func() int
	RevertToSnapshotCalled   func(snapshot int) error
	RootHashCalled           func() ([]byte, error)
	RecreateTrieCalled       func(rootHash []byte) error
	PruneTrieCalled          func(rootHash []byte, identifier data.TriePruningIdentifier)
	CancelPruneCalled        func(rootHash []byte, identifier data.TriePruningIdentifier)
	SnapshotStateCalled      func(rootHash []byte)
	SetStateCheckpointCalled func(rootHash []byte)
	IsPruningEnabledCalled   func() bool
	GetAllLeavesCalled       func(rootHash []byte) (chan core.KeyValueHolder, error)
	RecreateAllTriesCalled   func(rootHash []byte) (map[string]data.Trie, error)
	GetNumCheckpointsCalled  func() uint32
	GetCodeCalled            func([]byte) []byte
}

AccountsStub -

func (*AccountsStub) CancelPrune

func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)

CancelPrune -

func (*AccountsStub) Commit

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

Commit -

func (*AccountsStub) GetAllLeaves

func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)

GetAllLeaves -

func (*AccountsStub) GetCode

func (as *AccountsStub) GetCode(codeHash []byte) []byte

GetCode -

func (*AccountsStub) GetExistingAccount

func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)

GetExistingAccount -

func (*AccountsStub) GetNumCheckpoints

func (as *AccountsStub) GetNumCheckpoints() uint32

GetNumCheckpoints -

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

IsPruningEnabled -

func (*AccountsStub) JournalLen

func (as *AccountsStub) JournalLen() int

JournalLen -

func (*AccountsStub) LoadAccount

func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)

LoadAccount -

func (*AccountsStub) PruneTrie

func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)

PruneTrie -

func (*AccountsStub) RecreateAllTries

func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)

RecreateAllTries -

func (*AccountsStub) RecreateTrie

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

RecreateTrie -

func (*AccountsStub) RemoveAccount

func (as *AccountsStub) RemoveAccount(addressContainer []byte) error

RemoveAccount -

func (*AccountsStub) RevertToSnapshot

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

RevertToSnapshot -

func (*AccountsStub) RootHash

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

RootHash -

func (*AccountsStub) SaveAccount

func (as *AccountsStub) SaveAccount(account state.AccountHandler) error

SaveAccount -

func (*AccountsStub) SetStateCheckpoint

func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)

SetStateCheckpoint -

func (*AccountsStub) SnapshotState

func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)

SnapshotState -

type DataReplayerStub

type DataReplayerStub struct {
	RangeCalled func(handler func(persistedData storer2ElasticData.RoundPersistedData) bool) error
}

DataReplayerStub -

func (*DataReplayerStub) IsInterfaceNil

func (d *DataReplayerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*DataReplayerStub) Range

func (d *DataReplayerStub) Range(handler func(persistedData storer2ElasticData.RoundPersistedData) bool) error

Range -

type DatabaseReaderStub

type DatabaseReaderStub struct {
	GetDatabaseInfoCalled       func() ([]*databasereader.DatabaseInfo, error)
	GetStaticDatabaseInfoCalled func() ([]*databasereader.DatabaseInfo, error)
	GetHeadersCalled            func(dbInfo *databasereader.DatabaseInfo) ([]data.HeaderHandler, error)
	LoadPersisterCalled         func(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
	LoadStaticPersisterCalled   func(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
}

DatabaseReaderStub -

func (*DatabaseReaderStub) GetDatabaseInfo

func (d *DatabaseReaderStub) GetDatabaseInfo() ([]*databasereader.DatabaseInfo, error)

GetDatabaseInfo -

func (*DatabaseReaderStub) GetHeaders

GetHeaders -

func (*DatabaseReaderStub) GetStaticDatabaseInfo

func (d *DatabaseReaderStub) GetStaticDatabaseInfo() ([]*databasereader.DatabaseInfo, error)

GetStaticDatabaseInfo -

func (*DatabaseReaderStub) IsInterfaceNil

func (d *DatabaseReaderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*DatabaseReaderStub) LoadPersister

func (d *DatabaseReaderStub) LoadPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)

LoadPersister -

func (*DatabaseReaderStub) LoadStaticPersister

func (d *DatabaseReaderStub) LoadStaticPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)

LoadStaticPersister -

type DirectoryReaderStub

type DirectoryReaderStub struct {
	ListFilesAsStringCalled       func(directoryPath string) ([]string, error)
	ListDirectoriesAsStringCalled func(directoryPath string) ([]string, error)
	ListAllAsStringCalled         func(directoryPath string) ([]string, error)
}

DirectoryReaderStub -

func (*DirectoryReaderStub) IsInterfaceNil

func (d *DirectoryReaderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*DirectoryReaderStub) ListAllAsString

func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error)

ListAllAsString -

func (*DirectoryReaderStub) ListDirectoriesAsString

func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error)

ListDirectoriesAsString -

func (*DirectoryReaderStub) ListFilesAsString

func (d *DirectoryReaderStub) ListFilesAsString(directoryPath string) ([]string, error)

ListFilesAsString -

type ElasticIndexerStub

type ElasticIndexerStub struct {
	SetTxLogsProcessorCalled    func(txLogsProc process.TransactionLogProcessorDatabase)
	SaveBlockCalled             func(args *indexer.ArgsSaveBlockData)
	SaveRoundsInfosCalled       func(roundsInfos []*indexer.RoundInfo)
	UpdateTPSCalled             func(tpsBenchmark statistics.TPSBenchmark)
	SaveValidatorsPubKeysCalled func(validatorsPubKeys map[uint32][][]byte, epoch uint32)
	SaveValidatorsRatingCalled  func(indexID string, infoRating []*indexer.ValidatorRatingInfo)
}

ElasticIndexerStub -

func (*ElasticIndexerStub) Close

func (e *ElasticIndexerStub) Close() error

Close -

func (*ElasticIndexerStub) IsInterfaceNil

func (e *ElasticIndexerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ElasticIndexerStub) IsNilIndexer

func (e *ElasticIndexerStub) IsNilIndexer() bool

IsNilIndexer -

func (*ElasticIndexerStub) RevertIndexedBlock

func (e *ElasticIndexerStub) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler)

RevertIndexedBlock -

func (*ElasticIndexerStub) SaveAccounts

func (e *ElasticIndexerStub) SaveAccounts(_ uint64, _ []state.UserAccountHandler)

SaveAccounts -

func (*ElasticIndexerStub) SaveBlock

func (e *ElasticIndexerStub) SaveBlock(args *indexer.ArgsSaveBlockData)

SaveBlock -

func (*ElasticIndexerStub) SaveRoundsInfo

func (e *ElasticIndexerStub) SaveRoundsInfo(roundsInfos []*indexer.RoundInfo)

SaveRoundsInfo -

func (*ElasticIndexerStub) SaveValidatorsPubKeys

func (e *ElasticIndexerStub) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte, epoch uint32)

SaveValidatorsPubKeys -

func (*ElasticIndexerStub) SaveValidatorsRating

func (e *ElasticIndexerStub) SaveValidatorsRating(indexID string, infoRating []*indexer.ValidatorRatingInfo)

SaveValidatorsRating -

func (*ElasticIndexerStub) SetTxLogsProcessor

func (e *ElasticIndexerStub) SetTxLogsProcessor(txLogsProc process.TransactionLogProcessorDatabase)

SetTxLogsProcessor -

func (*ElasticIndexerStub) UpdateTPS

func (e *ElasticIndexerStub) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)

UpdateTPS -

type GenesisNodesSetupHandlerStub

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

GenesisNodesSetupHandlerStub -

func (*GenesisNodesSetupHandlerStub) GetAdaptivity

func (g *GenesisNodesSetupHandlerStub) GetAdaptivity() bool

GetAdaptivity -

func (*GenesisNodesSetupHandlerStub) GetChainId

func (g *GenesisNodesSetupHandlerStub) GetChainId() string

GetChainId -

func (*GenesisNodesSetupHandlerStub) GetHysteresis

func (g *GenesisNodesSetupHandlerStub) GetHysteresis() float32

GetHysteresis -

func (*GenesisNodesSetupHandlerStub) GetMetaConsensusGroupSize

func (g *GenesisNodesSetupHandlerStub) GetMetaConsensusGroupSize() uint32

GetMetaConsensusGroupSize -

func (*GenesisNodesSetupHandlerStub) GetMinTransactionVersion

func (g *GenesisNodesSetupHandlerStub) GetMinTransactionVersion() uint32

GetMinTransactionVersion -

func (*GenesisNodesSetupHandlerStub) GetRoundDuration

func (g *GenesisNodesSetupHandlerStub) GetRoundDuration() uint64

GetRoundDuration -

func (*GenesisNodesSetupHandlerStub) GetShardConsensusGroupSize

func (g *GenesisNodesSetupHandlerStub) GetShardConsensusGroupSize() uint32

GetShardConsensusGroupSize -

func (*GenesisNodesSetupHandlerStub) GetStartTime

func (g *GenesisNodesSetupHandlerStub) GetStartTime() int64

GetStartTime -

func (*GenesisNodesSetupHandlerStub) InitialNodesInfo

InitialNodesInfo -

func (*GenesisNodesSetupHandlerStub) InitialNodesInfoForShard

InitialNodesInfoForShard -

func (*GenesisNodesSetupHandlerStub) IsInterfaceNil

func (g *GenesisNodesSetupHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*GenesisNodesSetupHandlerStub) MinNumberOfMetaNodes

func (g *GenesisNodesSetupHandlerStub) MinNumberOfMetaNodes() uint32

MinNumberOfMetaNodes -

func (*GenesisNodesSetupHandlerStub) MinNumberOfNodes

func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*GenesisNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis

func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

func (*GenesisNodesSetupHandlerStub) MinNumberOfShardNodes

func (g *GenesisNodesSetupHandlerStub) MinNumberOfShardNodes() uint32

MinNumberOfShardNodes -

func (*GenesisNodesSetupHandlerStub) NumberOfShards

func (g *GenesisNodesSetupHandlerStub) NumberOfShards() uint32

NumberOfShards -

type HasherMock

type HasherMock struct {
}

HasherMock that will be used for testing

func (HasherMock) Compute

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

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

func (HasherMock) EmptyHash

func (sha HasherMock) EmptyHash() []byte

EmptyHash will return the equivalent of empty string SHA's

func (HasherMock) IsInterfaceNil

func (sha HasherMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (HasherMock) Size

func (HasherMock) Size() int

Size return the required size in bytes

type HeaderMarshalizerStub

type HeaderMarshalizerStub struct {
	UnmarshalShardHeaderCalled func(headerBytes []byte) (*block.Header, error)
	UnmarshalMetaBlockCalled   func(headerBytes []byte) (*block.MetaBlock, error)
}

HeaderMarshalizerStub -

func (*HeaderMarshalizerStub) IsInterfaceNil

func (h *HeaderMarshalizerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeaderMarshalizerStub) UnmarshalMetaBlock

func (h *HeaderMarshalizerStub) UnmarshalMetaBlock(headerBytes []byte) (*block.MetaBlock, error)

UnmarshalMetaBlock -

func (*HeaderMarshalizerStub) UnmarshalShardHeader

func (h *HeaderMarshalizerStub) UnmarshalShardHeader(headerBytes []byte) (*block.Header, error)

UnmarshalShardHeader -

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 NodeInfoMock

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

NodeInfoMock -

func NewNodeInfo

func NewNodeInfo(address []byte, pubKey []byte, shardId uint32, initialRating uint32) *NodeInfoMock

NewNodeInfo -

func (*NodeInfoMock) AddressBytes

func (n *NodeInfoMock) AddressBytes() []byte

AddressBytes -

func (*NodeInfoMock) AssignedShard

func (n *NodeInfoMock) AssignedShard() uint32

AssignedShard -

func (*NodeInfoMock) GetInitialRating

func (n *NodeInfoMock) GetInitialRating() uint32

GetInitialRating -

func (*NodeInfoMock) IsInterfaceNil

func (n *NodeInfoMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodeInfoMock) PubKeyBytes

func (n *NodeInfoMock) PubKeyBytes() []byte

PubKeyBytes -

type NodesCoordinatorStub

type NodesCoordinatorStub struct {
	ComputeValidatorsGroupCalled           func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]sharding.Validator, error)
	GetValidatorsPublicKeysCalled          func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorsRewardsAddressesCalled    func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorWithPublicKeyCalled        func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error)
	GetConsensusValidatorsPublicKeysCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
	GetValidatorsIndexesCalled             func(publicKeys []string, epoch uint32) ([]uint64, error)
	GetAllValidatorsPublicKeysCalled       func() (map[uint32][][]byte, error)
	ConsensusGroupSizeCalled               func(shardID uint32) int
}

NodesCoordinatorStub -

func (*NodesCoordinatorStub) ComputeAdditionalLeaving

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

ComputeAdditionalLeaving -

func (*NodesCoordinatorStub) ComputeConsensusGroup

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

ComputeConsensusGroup -

func (*NodesCoordinatorStub) ConsensusGroupSize

func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int

ConsensusGroupSize -

func (*NodesCoordinatorStub) EpochStartPrepare

func (ncm *NodesCoordinatorStub) EpochStartPrepare(_ data.HeaderHandler, _ data.BodyHandler)

EpochStartPrepare -

func (*NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys

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

GetAllEligibleValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys

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

GetAllLeavingValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllValidatorsPublicKeys

func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)

GetAllValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys

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

GetAllWaitingValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetChance

func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32

GetChance -

func (*NodesCoordinatorStub) GetConsensusValidatorsPublicKeys

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

GetConsensusValidatorsPublicKeys -

func (*NodesCoordinatorStub) GetConsensusWhitelistedNodes

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

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

func (*NodesCoordinatorStub) GetNumTotalEligible

func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64

GetNumTotalEligible -

func (*NodesCoordinatorStub) GetOwnPublicKey

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

GetOwnPublicKey -

func (*NodesCoordinatorStub) GetSavedStateKey

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

GetSavedStateKey -

func (*NodesCoordinatorStub) GetSelectedPublicKeys

func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)

GetSelectedPublicKeys -

func (*NodesCoordinatorStub) GetValidatorWithPublicKey

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

GetValidatorWithPublicKey -

func (*NodesCoordinatorStub) GetValidatorsIndexes

func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(p []string, e uint32) ([]uint64, error)

GetValidatorsIndexes -

func (*NodesCoordinatorStub) IsInterfaceNil

func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*NodesCoordinatorStub) LoadState

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

LoadState -

func (*NodesCoordinatorStub) SetConfig

SetConfig -

func (*NodesCoordinatorStub) SetNodesPerShards

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

SetNodesPerShards -

func (*NodesCoordinatorStub) ShardIdForEpoch

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

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

func (*NodesCoordinatorStub) ShuffleOutForEpoch

func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)

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

func (*NodesCoordinatorStub) ValidatorsWeights

func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)

ValidatorsWeights -

type NodesSetupStub

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

NodesSetupStub -

func (*NodesSetupStub) GetChainId

func (n *NodesSetupStub) GetChainId() string

GetChainId -

func (*NodesSetupStub) GetMetaConsensusGroupSize

func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32

GetMetaConsensusGroupSize -

func (*NodesSetupStub) GetMinTransactionVersion

func (n *NodesSetupStub) GetMinTransactionVersion() uint32

GetMinTransactionVersion -

func (*NodesSetupStub) GetRoundDuration

func (n *NodesSetupStub) GetRoundDuration() uint64

GetRoundDuration -

func (*NodesSetupStub) GetShardConsensusGroupSize

func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32

GetShardConsensusGroupSize -

func (*NodesSetupStub) GetStartTime

func (n *NodesSetupStub) GetStartTime() int64

GetStartTime -

func (*NodesSetupStub) InitialNodesInfo

InitialNodesInfo -

func (*NodesSetupStub) InitialNodesInfoForShard

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

InitialNodesInfoForShard -

func (*NodesSetupStub) IsInterfaceNil

func (n *NodesSetupStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*NodesSetupStub) MinNumberOfNodes

func (n *NodesSetupStub) MinNumberOfNodes() uint32

MinNumberOfNodes -

func (*NodesSetupStub) MinNumberOfNodesWithHysteresis

func (n *NodesSetupStub) MinNumberOfNodesWithHysteresis() uint32

MinNumberOfNodesWithHysteresis -

func (*NodesSetupStub) NumberOfShards

func (n *NodesSetupStub) NumberOfShards() uint32

NumberOfShards -

type PersisterFactoryStub

type PersisterFactoryStub struct {
	CreateCalled         func(path string) (storage.Persister, error)
	CreateDisabledCalled func() storage.Persister
}

PersisterFactoryStub -

func (*PersisterFactoryStub) Create

func (pfs *PersisterFactoryStub) Create(path string) (storage.Persister, error)

Create -

func (*PersisterFactoryStub) CreateDisabled

func (pfs *PersisterFactoryStub) CreateDisabled() storage.Persister

CreateDisabled -

func (*PersisterFactoryStub) IsInterfaceNil

func (pfs *PersisterFactoryStub) IsInterfaceNil() bool

IsInterfaceNil -

type PubkeyConverterMock

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

PubkeyConverterMock -

func NewPubkeyConverterMock

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode

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

Decode -

func (*PubkeyConverterMock) Encode

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

Encode -

func (*PubkeyConverterMock) IsInterfaceNil

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len

func (pcm *PubkeyConverterMock) Len() int

Len -

type RatingsProcessorStub

type RatingsProcessorStub struct {
	IndexRatingsForEpochStartMetaBlockCalled func(metaBlock *block.MetaBlock) error
}

RatingsProcessorStub -

func (*RatingsProcessorStub) IndexRatingsForEpochStartMetaBlock

func (r *RatingsProcessorStub) IndexRatingsForEpochStartMetaBlock(metaBlock *block.MetaBlock) error

IndexRatingsForEpochStartMetaBlock -

func (*RatingsProcessorStub) IsInterfaceNil

func (r *RatingsProcessorStub) IsInterfaceNil() bool

IsInterfaceNil -

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	ShardID     uint32
	NumOfShards uint32
}

ShardCoordinatorMock -

func (ShardCoordinatorMock) CommunicationIdentifier

func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (ShardCoordinatorMock) ComputeId

func (scm ShardCoordinatorMock) ComputeId(_ []byte) uint32

ComputeId -

func (ShardCoordinatorMock) IsInterfaceNil

func (scm ShardCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (ShardCoordinatorMock) NumberOfShards

func (scm ShardCoordinatorMock) NumberOfShards() uint32

NumberOfShards -

func (ShardCoordinatorMock) SameShard

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

SameShard -

func (ShardCoordinatorMock) SelfId

func (scm ShardCoordinatorMock) SelfId() uint32

SelfId -

func (ShardCoordinatorMock) SetSelfId

func (scm ShardCoordinatorMock) SetSelfId(_ uint32) error

SetSelfId -

type TPSBenchmarkUpdaterStub

type TPSBenchmarkUpdaterStub struct {
	IndexTPSForMetaBlockCalled func(metaBlock *block.MetaBlock)
}

TPSBenchmarkUpdaterStub -

func (*TPSBenchmarkUpdaterStub) IndexTPSForMetaBlock

func (t *TPSBenchmarkUpdaterStub) IndexTPSForMetaBlock(metaBlock *block.MetaBlock)

IndexTPSForMetaBlock -

func (*TPSBenchmarkUpdaterStub) IsInterfaceNil

func (t *TPSBenchmarkUpdaterStub) IsInterfaceNil() bool

IsInterfaceNil -

type Uint64ByteSliceConverterMock

type Uint64ByteSliceConverterMock struct {
}

Uint64ByteSliceConverterMock converts byte slice to/from uint64

func (*Uint64ByteSliceConverterMock) IsInterfaceNil

func (u *Uint64ByteSliceConverterMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*Uint64ByteSliceConverterMock) ToByteSlice

func (u *Uint64ByteSliceConverterMock) ToByteSlice(p uint64) []byte

ToByteSlice is a mock implementation for Uint64ByteSliceConverter

func (*Uint64ByteSliceConverterMock) ToUint64

func (u *Uint64ByteSliceConverterMock) ToUint64(p []byte) (uint64, error)

ToUint64 is a mock implementation for Uint64ByteSliceConverter

Jump to

Keyboard shortcuts

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