Documentation ¶
Index ¶
- Variables
- func NewPersisterMock() *persisterMock
- type AccountsStub
- func (as *AccountsStub) CancelPrune(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) Commit() ([]byte, error)
- func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
- func (as *AccountsStub) GetCode(codeHash []byte) []byte
- func (as *AccountsStub) GetExistingAccount(addressContainer []byte) (state.AccountHandler, error)
- func (as *AccountsStub) GetNumCheckpoints() uint32
- func (as *AccountsStub) IsInterfaceNil() bool
- func (as *AccountsStub) IsPruningEnabled() bool
- func (as *AccountsStub) JournalLen() int
- func (as *AccountsStub) LoadAccount(address []byte) (state.AccountHandler, error)
- func (as *AccountsStub) PruneTrie(rootHash []byte, identifier data.TriePruningIdentifier)
- func (as *AccountsStub) RecreateAllTries(rootHash []byte, _ context.Context) (map[string]data.Trie, error)
- func (as *AccountsStub) RecreateTrie(rootHash []byte) error
- func (as *AccountsStub) RemoveAccount(addressContainer []byte) error
- func (as *AccountsStub) RevertToSnapshot(snapshot int) error
- func (as *AccountsStub) RootHash() ([]byte, error)
- func (as *AccountsStub) SaveAccount(account state.AccountHandler) error
- func (as *AccountsStub) SetStateCheckpoint(rootHash []byte, _ context.Context)
- func (as *AccountsStub) SnapshotState(rootHash []byte, _ context.Context)
- type DataReplayerStub
- type DatabaseReaderStub
- func (d *DatabaseReaderStub) GetDatabaseInfo() ([]*databasereader.DatabaseInfo, error)
- func (d *DatabaseReaderStub) GetHeaders(dbInfo *databasereader.DatabaseInfo) ([]data.HeaderHandler, error)
- func (d *DatabaseReaderStub) GetStaticDatabaseInfo() ([]*databasereader.DatabaseInfo, error)
- func (d *DatabaseReaderStub) IsInterfaceNil() bool
- func (d *DatabaseReaderStub) LoadPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
- func (d *DatabaseReaderStub) LoadStaticPersister(dbInfo *databasereader.DatabaseInfo, unit string) (storage.Persister, error)
- type DirectoryReaderStub
- func (d *DirectoryReaderStub) IsInterfaceNil() bool
- func (d *DirectoryReaderStub) ListAllAsString(directoryPath string) ([]string, error)
- func (d *DirectoryReaderStub) ListDirectoriesAsString(directoryPath string) ([]string, error)
- func (d *DirectoryReaderStub) ListFilesAsString(directoryPath string) ([]string, error)
- type ElasticIndexerStub
- func (e *ElasticIndexerStub) Close() error
- func (e *ElasticIndexerStub) IsInterfaceNil() bool
- func (e *ElasticIndexerStub) IsNilIndexer() bool
- func (e *ElasticIndexerStub) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler)
- func (e *ElasticIndexerStub) SaveAccounts(_ uint64, _ []state.UserAccountHandler)
- func (e *ElasticIndexerStub) SaveBlock(args *indexer.ArgsSaveBlockData)
- func (e *ElasticIndexerStub) SaveRoundsInfo(roundsInfos []*indexer.RoundInfo)
- func (e *ElasticIndexerStub) SaveValidatorsPubKeys(validatorsPubKeys map[uint32][][]byte, epoch uint32)
- func (e *ElasticIndexerStub) SaveValidatorsRating(indexID string, infoRating []*indexer.ValidatorRatingInfo)
- func (e *ElasticIndexerStub) SetTxLogsProcessor(txLogsProc process.TransactionLogProcessorDatabase)
- func (e *ElasticIndexerStub) UpdateTPS(tpsBenchmark statistics.TPSBenchmark)
- type GenesisNodesSetupHandlerStub
- func (g *GenesisNodesSetupHandlerStub) GetAdaptivity() bool
- func (g *GenesisNodesSetupHandlerStub) GetChainId() string
- func (g *GenesisNodesSetupHandlerStub) GetHysteresis() float32
- func (g *GenesisNodesSetupHandlerStub) GetMetaConsensusGroupSize() uint32
- func (g *GenesisNodesSetupHandlerStub) GetMinTransactionVersion() uint32
- func (g *GenesisNodesSetupHandlerStub) GetRoundDuration() uint64
- func (g *GenesisNodesSetupHandlerStub) GetShardConsensusGroupSize() uint32
- func (g *GenesisNodesSetupHandlerStub) GetStartTime() int64
- func (g *GenesisNodesSetupHandlerStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, ...)
- func (g *GenesisNodesSetupHandlerStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
- func (g *GenesisNodesSetupHandlerStub) IsInterfaceNil() bool
- func (g *GenesisNodesSetupHandlerStub) MinNumberOfMetaNodes() uint32
- func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodes() uint32
- func (g *GenesisNodesSetupHandlerStub) MinNumberOfNodesWithHysteresis() uint32
- func (g *GenesisNodesSetupHandlerStub) MinNumberOfShardNodes() uint32
- func (g *GenesisNodesSetupHandlerStub) NumberOfShards() uint32
- type HasherMock
- type HeaderMarshalizerStub
- type MarshalizerMock
- type NodeInfoMock
- type NodesCoordinatorStub
- func (ncm *NodesCoordinatorStub) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
- func (ncm *NodesCoordinatorStub) ComputeConsensusGroup(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int
- func (ncm *NodesCoordinatorStub) EpochStartPrepare(_ data.HeaderHandler, _ data.BodyHandler)
- func (ncm *NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32
- func (ncm *NodesCoordinatorStub) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
- func (ncm *NodesCoordinatorStub) GetConsensusWhitelistedNodes(_ uint32) (map[string]struct{}, error)
- func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64
- func (ncm *NodesCoordinatorStub) GetOwnPublicKey() []byte
- func (ncm *NodesCoordinatorStub) GetSavedStateKey() []byte
- func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)
- func (ncm *NodesCoordinatorStub) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
- func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(p []string, e uint32) ([]uint64, error)
- func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool
- func (ncm *NodesCoordinatorStub) LoadState(_ []byte) error
- func (ncm *NodesCoordinatorStub) SetConfig(_ *sharding.NodesCoordinatorRegistry) error
- func (ncm *NodesCoordinatorStub) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, ...) error
- func (ncm *NodesCoordinatorStub) ShardIdForEpoch(_ uint32) (uint32, error)
- func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)
- func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)
- type NodesSetupStub
- func (n *NodesSetupStub) GetChainId() string
- func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32
- func (n *NodesSetupStub) GetMinTransactionVersion() uint32
- func (n *NodesSetupStub) GetRoundDuration() uint64
- func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32
- func (n *NodesSetupStub) GetStartTime() int64
- func (n *NodesSetupStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, ...)
- func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
- func (n *NodesSetupStub) IsInterfaceNil() bool
- func (n *NodesSetupStub) MinNumberOfNodes() uint32
- func (n *NodesSetupStub) MinNumberOfNodesWithHysteresis() uint32
- func (n *NodesSetupStub) NumberOfShards() uint32
- type PersisterFactoryStub
- type PubkeyConverterMock
- type RatingsProcessorStub
- type ShardCoordinatorMock
- func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm ShardCoordinatorMock) ComputeId(_ []byte) uint32
- func (scm ShardCoordinatorMock) IsInterfaceNil() bool
- func (scm ShardCoordinatorMock) NumberOfShards() uint32
- func (scm ShardCoordinatorMock) SameShard(_, _ []byte) bool
- func (scm ShardCoordinatorMock) SelfId() uint32
- func (scm ShardCoordinatorMock) SetSelfId(_ uint32) error
- type TPSBenchmarkUpdaterStub
- type Uint64ByteSliceConverterMock
Constants ¶
This section is empty.
Variables ¶
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")
ErrMockMarshalizer -
Functions ¶
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) GetAllLeaves ¶
func (as *AccountsStub) GetAllLeaves(rootHash []byte, _ context.Context) (chan core.KeyValueHolder, error)
GetAllLeaves -
func (*AccountsStub) GetCode ¶ added in v1.1.22
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) 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) 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 ¶
func (d *DatabaseReaderStub) GetHeaders(dbInfo *databasereader.DatabaseInfo) ([]data.HeaderHandler, error)
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 ¶ added in v1.1.6
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 ¶ added in v1.1.6
func (e *ElasticIndexerStub) RevertIndexedBlock(_ data.HeaderHandler, _ data.BodyHandler)
RevertIndexedBlock -
func (*ElasticIndexerStub) SaveAccounts ¶ added in v1.1.6
func (e *ElasticIndexerStub) SaveAccounts(_ uint64, _ []state.UserAccountHandler)
SaveAccounts -
func (*ElasticIndexerStub) SaveBlock ¶
func (e *ElasticIndexerStub) SaveBlock(args *indexer.ArgsSaveBlockData)
SaveBlock -
func (*ElasticIndexerStub) SaveRoundsInfo ¶ added in v1.1.6
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 ¶
func (g *GenesisNodesSetupHandlerStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
InitialNodesInfo -
func (*GenesisNodesSetupHandlerStub) InitialNodesInfoForShard ¶
func (g *GenesisNodesSetupHandlerStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
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 ¶ added in v1.1.3
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
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) GetInitialRating ¶
func (n *NodeInfoMock) GetInitialRating() uint32
GetInitialRating -
type NodesCoordinatorStub ¶ added in v1.1.38
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 ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
ComputeAdditionalLeaving -
func (*NodesCoordinatorStub) ComputeConsensusGroup ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) ComputeConsensusGroup( randomness []byte, round uint64, shardId uint32, epoch uint32, ) (validatorsGroup []sharding.Validator, err error)
ComputeConsensusGroup -
func (*NodesCoordinatorStub) ConsensusGroupSize ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) ConsensusGroupSize(shardID uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorStub) EpochStartPrepare ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) EpochStartPrepare(_ data.HeaderHandler, _ data.BodyHandler)
EpochStartPrepare -
func (*NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllEligibleValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllLeavingValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllValidatorsPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetAllValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllWaitingValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetChance ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetChance(uint32) uint32
GetChance -
func (*NodesCoordinatorStub) GetConsensusValidatorsPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetConsensusValidatorsPublicKeys( randomness []byte, round uint64, shardId uint32, epoch uint32, ) ([]string, error)
GetConsensusValidatorsPublicKeys -
func (*NodesCoordinatorStub) GetConsensusWhitelistedNodes ¶ added in v1.1.38
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 ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetNumTotalEligible() uint64
GetNumTotalEligible -
func (*NodesCoordinatorStub) GetOwnPublicKey ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetOwnPublicKey() []byte
GetOwnPublicKey -
func (*NodesCoordinatorStub) GetSavedStateKey ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetSavedStateKey() []byte
GetSavedStateKey -
func (*NodesCoordinatorStub) GetSelectedPublicKeys ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) ([]string, error)
GetSelectedPublicKeys -
func (*NodesCoordinatorStub) GetValidatorWithPublicKey ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
GetValidatorWithPublicKey -
func (*NodesCoordinatorStub) GetValidatorsIndexes ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) GetValidatorsIndexes(p []string, e uint32) ([]uint64, error)
GetValidatorsIndexes -
func (*NodesCoordinatorStub) IsInterfaceNil ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NodesCoordinatorStub) LoadState ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) LoadState(_ []byte) error
LoadState -
func (*NodesCoordinatorStub) SetConfig ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) SetConfig(_ *sharding.NodesCoordinatorRegistry) error
SetConfig -
func (*NodesCoordinatorStub) SetNodesPerShards ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, _ []sharding.Validator, _ uint32) error
SetNodesPerShards -
func (*NodesCoordinatorStub) ShardIdForEpoch ¶ added in v1.1.38
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 ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) ShuffleOutForEpoch(_ uint32)
ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler
func (*NodesCoordinatorStub) ValidatorsWeights ¶ added in v1.1.38
func (ncm *NodesCoordinatorStub) ValidatorsWeights(_ []sharding.Validator) ([]uint32, error)
ValidatorsWeights -
type NodesSetupStub ¶ added in v1.1.29
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 ¶ added in v1.1.29
func (n *NodesSetupStub) GetChainId() string
GetChainId -
func (*NodesSetupStub) GetMetaConsensusGroupSize ¶ added in v1.1.29
func (n *NodesSetupStub) GetMetaConsensusGroupSize() uint32
GetMetaConsensusGroupSize -
func (*NodesSetupStub) GetMinTransactionVersion ¶ added in v1.1.29
func (n *NodesSetupStub) GetMinTransactionVersion() uint32
GetMinTransactionVersion -
func (*NodesSetupStub) GetRoundDuration ¶ added in v1.1.29
func (n *NodesSetupStub) GetRoundDuration() uint64
GetRoundDuration -
func (*NodesSetupStub) GetShardConsensusGroupSize ¶ added in v1.1.29
func (n *NodesSetupStub) GetShardConsensusGroupSize() uint32
GetShardConsensusGroupSize -
func (*NodesSetupStub) GetStartTime ¶ added in v1.1.29
func (n *NodesSetupStub) GetStartTime() int64
GetStartTime -
func (*NodesSetupStub) InitialNodesInfo ¶ added in v1.1.29
func (n *NodesSetupStub) InitialNodesInfo() (map[uint32][]sharding.GenesisNodeInfoHandler, map[uint32][]sharding.GenesisNodeInfoHandler)
InitialNodesInfo -
func (*NodesSetupStub) InitialNodesInfoForShard ¶ added in v1.1.29
func (n *NodesSetupStub) InitialNodesInfoForShard(shardId uint32) ([]sharding.GenesisNodeInfoHandler, []sharding.GenesisNodeInfoHandler, error)
InitialNodesInfoForShard -
func (*NodesSetupStub) IsInterfaceNil ¶ added in v1.1.29
func (n *NodesSetupStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*NodesSetupStub) MinNumberOfNodes ¶ added in v1.1.29
func (n *NodesSetupStub) MinNumberOfNodes() uint32
MinNumberOfNodes -
func (*NodesSetupStub) MinNumberOfNodesWithHysteresis ¶ added in v1.1.29
func (n *NodesSetupStub) MinNumberOfNodesWithHysteresis() uint32
MinNumberOfNodesWithHysteresis -
func (*NodesSetupStub) NumberOfShards ¶ added in v1.1.29
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 -
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 ¶
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) SetSelfId ¶
func (scm ShardCoordinatorMock) SetSelfId(_ uint32) error
SetSelfId -
type TPSBenchmarkUpdaterStub ¶
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
Source Files ¶
- accountsAdapterStub.go
- dataReplayerStub.go
- databaseReaderStub.go
- directoryReaderStub.go
- elasticIndexerStub.go
- genesisNodesSetupHandlerStub.go
- hasherMock.go
- headerMarshalizerStub.go
- marshalizerMock.go
- nodeInfoMock.go
- nodesCoordinatorStub.go
- nodesSetupStub.go
- persisterFactoryStub.go
- persisterStub.go
- pubKeyConverterMock.go
- ratingsProcessorStub.go
- shardCoordinatorMock.go
- tpsBenchmarkUpdaterStub.go
- uint64ByteSliceConverterMock.go