Versions in this module Expand all Collapse all v0 v0.0.2 Oct 31, 2023 Changes in this version + type StorerStub struct + ClearCacheCalled func() + DestroyUnitCalled func() error + GetBulkFromEpochCalled func(keys [][]byte, epoch uint32) (map[string][]byte, error) + GetCalled func(key []byte) ([]byte, error) + GetFromEpochCalled func(key []byte, epoch uint32) ([]byte, error) + HasCalled func(key []byte) error + HasInEpochCalled func(key []byte, epoch uint32) error + PutCalled func(key, data []byte) error + RangeKeysCalled func(handler func(key []byte, val []byte) bool) + RemoveCalled func(key []byte) error + SearchFirstCalled func(key []byte) ([]byte, error) + func (ss *StorerStub) ClearCache() + func (ss *StorerStub) Close() error + func (ss *StorerStub) DestroyUnit() error + func (ss *StorerStub) Get(key []byte) ([]byte, error) + func (ss *StorerStub) GetBulkFromEpoch(keys [][]byte, epoch uint32) (map[string][]byte, error) + func (ss *StorerStub) GetFromEpoch(key []byte, epoch uint32) ([]byte, error) + func (ss *StorerStub) Has(key []byte) error + func (ss *StorerStub) HasInEpoch(key []byte, epoch uint32) error + func (ss *StorerStub) IsInterfaceNil() bool + func (ss *StorerStub) Put(key, data []byte) error + func (ss *StorerStub) RangeKeys(handler func(key []byte, val []byte) bool) + func (ss *StorerStub) Remove(key []byte) error + func (ss *StorerStub) SearchFirst(key []byte) ([]byte, error) v0.0.1 Oct 30, 2023 Changes in this version + var ErrMockMarshalizer = errors.New("MarshalizerMock generic error") + var ErrNilObjectToMarshal = errors.New("nil object to serialize from") + type AlarmSchedulerStub struct + AddCalled func(func(alarmID string), time.Duration, string) + CancelCalled func(string) + CloseCalled func() + ResetCalled func(string) + func (a *AlarmSchedulerStub) Add(callback func(alarmID string), duration time.Duration, alarmID string) + func (a *AlarmSchedulerStub) Cancel(alarmID string) + func (a *AlarmSchedulerStub) Close() + func (a *AlarmSchedulerStub) IsInterfaceNil() bool + func (a *AlarmSchedulerStub) Reset(alarmID string) + type AppStatusHandlerStub struct + AddUint64Handler func(key string, value uint64) + CloseHandler func() + DecrementHandler func(key string) + IncrementHandler func(key string) + SetInt64ValueHandler func(key string, value int64) + SetStringValueHandler func(key string, value string) + SetUInt64ValueHandler func(key string, value uint64) + func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64) + func (ashs *AppStatusHandlerStub) Close() + func (ashs *AppStatusHandlerStub) Decrement(key string) + func (ashs *AppStatusHandlerStub) Increment(key string) + func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool + func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64) + func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string) + func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64) + type ChainStorerMock struct + AddStorerCalled func(key dataRetriever.UnitType, s storage.Storer) + DestroyCalled func() error + GetAllCalled func(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error) + GetCalled func(unitType dataRetriever.UnitType, key []byte) ([]byte, error) + GetStorerCalled func(unitType dataRetriever.UnitType) storage.Storer + HasCalled func(unitType dataRetriever.UnitType, key []byte) (bool, error) + PutCalled func(unitType dataRetriever.UnitType, key []byte, value []byte) error + func (bc *ChainStorerMock) AddStorer(key dataRetriever.UnitType, s storage.Storer) + func (bc *ChainStorerMock) Destroy() error + func (bc *ChainStorerMock) Get(unitType dataRetriever.UnitType, key []byte) ([]byte, error) + func (bc *ChainStorerMock) GetAll(unitType dataRetriever.UnitType, keys [][]byte) (map[string][]byte, error) + func (bc *ChainStorerMock) GetStorer(unitType dataRetriever.UnitType) storage.Storer + func (bc *ChainStorerMock) Has(unitType dataRetriever.UnitType, key []byte) (bool, error) + func (bc *ChainStorerMock) Put(unitType dataRetriever.UnitType, key []byte, value []byte) error + type ConnectedAddressesMock struct + func (cam *ConnectedAddressesMock) ConnectedAddresses() []string + type DatabaseWriterStub struct + DoBulkRequestCalled func(buff *bytes.Buffer, index string) error + DoRequestCalled func(req *esapi.IndexRequest) error + func (dwm *DatabaseWriterStub) CheckAndCreateIndex(_ string, _ io.Reader) error + func (dwm *DatabaseWriterStub) DoBulkRequest(buff *bytes.Buffer, index string) error + func (dwm *DatabaseWriterStub) DoMultiGet(_ map[string]interface{}, _ string) (map[string]interface{}, error) + func (dwm *DatabaseWriterStub) DoRequest(req *esapi.IndexRequest) error + type EpochStartNotifierStub struct + NotifyAllCalled func(hdr data.HeaderHandler) + NotifyAllPrepareCalled func(hdr data.HeaderHandler) + RegisterHandlerCalled func(handler epochStart.ActionHandler) + UnregisterHandlerCalled func(handler epochStart.ActionHandler) + func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool + func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler) + func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHeader data.HeaderHandler, body data.BodyHandler) + func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler) + func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler) + type HasherMock struct + func (HasherMock) Size() int + func (sha HasherMock) Compute(s string) []byte + func (sha HasherMock) EmptyHash() []byte + func (sha HasherMock) IsInterfaceNil() bool + type IntRandomizerStub struct + IntnCalled func(n int) int + func (irs *IntRandomizerStub) Intn(n int) int + func (irs *IntRandomizerStub) IsInterfaceNil() bool + type MarshalizerMock struct + Fail bool + func (mm *MarshalizerMock) IsInterfaceNil() bool + func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error) + func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error + type NodesCoordinatorMock struct + ComputeValidatorsGroupCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error) + ConsensusGroupSizeCalled func(uint32) int + GetAllEligibleValidatorsPublicKeysCalled func(epoch uint32) (map[uint32][][]byte, error) + GetAllWaitingValidatorsPublicKeysCalled func() (map[uint32][][]byte, error) + GetSelectedPublicKeysCalled func(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err error) + GetValidatorWithPublicKeyCalled func(publicKey []byte) (validator sharding.Validator, shardId uint32, err error) + GetValidatorsPublicKeysCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error) + GetValidatorsRewardsAddressesCalled func(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error) + MetaConsensusSize uint32 + NbShards uint32 + SetNodesPerShardsCalled func(nodes map[uint32][]sharding.Validator, epoch uint32) error + ShardConsensusSize uint32 + ShardId uint32 + Validators map[uint32][]sharding.Validator + func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error) + func (ncm *NodesCoordinatorMock) ComputeConsensusGroup(randomess []byte, round uint64, shardId uint32, epoch uint32) ([]sharding.Validator, error) + func (ncm *NodesCoordinatorMock) ConsensusGroupSize(shardId uint32) int + func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(epoch uint32) (map[uint32][][]byte, error) + func (ncm *NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error) + func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error) + func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32 + func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error) + func (ncm *NodesCoordinatorMock) GetConsensusWhitelistedNodes(_ uint32) (map[string]struct{}, error) + func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64 + func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte + func (ncm *NodesCoordinatorMock) GetSavedStateKey() []byte + func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32, epoch uint32) (publicKeys []string, err error) + func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error) + func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error) + func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool + func (ncm *NodesCoordinatorMock) LoadState(_ []byte) error + func (ncm *NodesCoordinatorMock) SetNodesPerShards(eligible map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, ...) error + func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error) + func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32) + func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error) + type PubkeyConverterMock struct + func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock + func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error) + func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string + func (pcm *PubkeyConverterMock) IsInterfaceNil() bool + func (pcm *PubkeyConverterMock) Len() int + type ShardCoordinatorMock struct + 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 ShardStatisticsMock struct + func (ss *ShardStatisticsMock) AverageBlockTxCount() uint32 + func (ss *ShardStatisticsMock) AverageTPS() *big.Int + func (ss *ShardStatisticsMock) CurrentBlockNonce() uint64 + func (ss *ShardStatisticsMock) IsInterfaceNil() bool + func (ss *ShardStatisticsMock) LastBlockTxCount() uint32 + func (ss *ShardStatisticsMock) LiveTPS() float64 + func (ss *ShardStatisticsMock) PeakTPS() float64 + func (ss *ShardStatisticsMock) ShardID() uint32 + func (ss *ShardStatisticsMock) TotalProcessedTxCount() *big.Int + type StableTagProviderStub struct + FetchTagVersionCalled func() (string, error) + func (s *StableTagProviderStub) FetchTagVersion() (string, error) + func (s *StableTagProviderStub) IsInterfaceNil() bool + type TpsBenchmarkMock struct + func (s *TpsBenchmarkMock) ActiveNodes() uint32 + func (s *TpsBenchmarkMock) AverageBlockTxCount() *big.Int + func (s *TpsBenchmarkMock) BlockNumber() uint64 + func (s *TpsBenchmarkMock) IsInterfaceNil() bool + func (s *TpsBenchmarkMock) LastBlockTxCount() uint32 + func (s *TpsBenchmarkMock) LiveTPS() float64 + func (s *TpsBenchmarkMock) NrOfShards() uint32 + func (s *TpsBenchmarkMock) PeakTPS() float64 + func (s *TpsBenchmarkMock) RoundNumber() uint64 + func (s *TpsBenchmarkMock) RoundTime() uint64 + func (s *TpsBenchmarkMock) ShardStatistic(shardID uint32) statistics.ShardStatistic + func (s *TpsBenchmarkMock) ShardStatistics() map[uint32]statistics.ShardStatistic + func (s *TpsBenchmarkMock) TotalProcessedTxCount() *big.Int + func (s *TpsBenchmarkMock) Update(mb data.HeaderHandler) + func (s *TpsBenchmarkMock) UpdateWithShardStats(mb *block.MetaBlock)