Documentation ¶
Index ¶
- func NewMultipleShardsCoordinatorFake(numOfShards uint32, currentShard uint32) *multipleShardsCoordinatorFake
- type CacherMock
- func (cm *CacherMock) Clear()
- func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Has(key []byte) bool
- func (cm *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (bool, bool)
- func (cm *CacherMock) IsInterfaceNil() bool
- func (cm *CacherMock) Keys() [][]byte
- func (cm *CacherMock) Len() int
- func (cm *CacherMock) MaxSize() int
- func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
- func (cm *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
- func (cm *CacherMock) RegisterHandler(func(key []byte, value interface{}))
- func (cm *CacherMock) Remove(key []byte)
- type EpochHandlerMock
- type EpochHandlerStub
- type EpochStartNotifierStub
- func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool
- func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)
- func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
- func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
- type HasherMock
- type HasherStub
- type HeaderHandlerStub
- func (hhs *HeaderHandlerStub) Clone() data.HeaderHandler
- func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
- func (hhs *HeaderHandlerStub) GetChainID() []byte
- func (hhs *HeaderHandlerStub) GetDeveloperFees() *big.Int
- func (hhs *HeaderHandlerStub) GetEpoch() uint32
- func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
- func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
- func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(_ uint32) map[string]uint32
- func (hhs *HeaderHandlerStub) GetNonce() uint64
- func (hhs *HeaderHandlerStub) GetPrevHash() []byte
- func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
- func (hhs *HeaderHandlerStub) GetRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
- func (hhs *HeaderHandlerStub) GetRootHash() []byte
- func (hhs *HeaderHandlerStub) GetRound() uint64
- func (hhs *HeaderHandlerStub) GetShardID() uint32
- func (hhs *HeaderHandlerStub) GetSignature() []byte
- func (hhs *HeaderHandlerStub) GetSoftwareVersion() []byte
- func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
- func (hhs *HeaderHandlerStub) GetTxCount() uint32
- func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
- func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
- func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
- func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
- func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
- func (hhs *HeaderHandlerStub) SetDeveloperFees(_ *big.Int)
- func (hhs *HeaderHandlerStub) SetEpoch(_ uint32)
- func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetNonce(_ uint64)
- func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
- func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetRound(_ uint64)
- func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
- func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetSoftwareVersion(version []byte)
- func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
- func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
- func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
- type ListIndexUpdaterStub
- type MarshalizerMock
- type NodeInfoMock
- type NodesCoordinatorCacheMock
- type PubkeyConverterMock
- type RaterMock
- type ShuffledOutHandlerStub
- type StorerMock
- func (sm *StorerMock) ClearCache()
- func (sm *StorerMock) Close() error
- func (sm *StorerMock) DestroyUnit() error
- func (sm *StorerMock) Get(key []byte) ([]byte, error)
- func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (sm *StorerMock) Has(_ []byte) error
- func (sm *StorerMock) HasInEpoch(_ []byte, _ uint32) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, data []byte) error
- func (sm *StorerMock) Remove(_ []byte) error
- func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
- type ValidatorMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMultipleShardsCoordinatorFake ¶
func NewMultipleShardsCoordinatorFake(numOfShards uint32, currentShard uint32) *multipleShardsCoordinatorFake
NewMultipleShardsCoordinatorFake -
Types ¶
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
CacherMock -
func (*CacherMock) HasOrAdd ¶
func (cm *CacherMock) HasOrAdd(key []byte, value interface{}, _ int) (bool, bool)
HasOrAdd -
func (*CacherMock) IsInterfaceNil ¶
func (cm *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Peek ¶
func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
Peek -
func (*CacherMock) Put ¶
func (cm *CacherMock) Put(key []byte, value interface{}, _ int) (evicted bool)
Put -
func (*CacherMock) RegisterHandler ¶
func (cm *CacherMock) RegisterHandler(func(key []byte, value interface{}))
RegisterHandler -
type EpochHandlerMock ¶
type EpochHandlerMock struct {
EpochValue uint32
}
EpochHandlerMock -
func (*EpochHandlerMock) IsInterfaceNil ¶
func (ehm *EpochHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
type EpochHandlerStub ¶ added in v1.0.102
type EpochHandlerStub struct {
EpochCalled func() uint32
}
EpochHandlerStub -
func (*EpochHandlerStub) Epoch ¶ added in v1.0.102
func (ehs *EpochHandlerStub) Epoch() uint32
Epoch -
func (*EpochHandlerStub) IsInterfaceNil ¶ added in v1.0.102
func (ehs *EpochHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
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) }
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) RegisterHandler ¶
func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)
RegisterHandler -
func (*EpochStartNotifierStub) UnregisterHandler ¶
func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)
UnregisterHandler -
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 HasherStub ¶
type HasherStub struct { ComputeCalled func(s string) []byte EmptyHashCalled func() []byte SizeCalled func() int }
HasherStub -
func (*HasherStub) Compute ¶
func (hs *HasherStub) Compute(s string) []byte
Compute will output the SHA's equivalent of the input string
func (*HasherStub) EmptyHash ¶
func (hs *HasherStub) EmptyHash() []byte
EmptyHash will return the equivalent of empty string SHA's
func (*HasherStub) IsInterfaceNil ¶
func (hs *HasherStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type HeaderHandlerStub ¶
type HeaderHandlerStub struct { GetPrevRandSeedCalled func() []byte GetRandSeedCalled func() []byte IsStartOfEpochBlockCalled func() bool GetEpochCaled func() uint32 }
HeaderHandlerStub --
func (*HeaderHandlerStub) GetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
GetAccumulatedFees --
func (*HeaderHandlerStub) GetChainID ¶
func (hhs *HeaderHandlerStub) GetChainID() []byte
GetChainID -
func (*HeaderHandlerStub) GetDeveloperFees ¶ added in v1.0.114
func (hhs *HeaderHandlerStub) GetDeveloperFees() *big.Int
GetDeveloperFees --
func (*HeaderHandlerStub) GetEpochStartMetaHash ¶
func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
GetEpochStartMetaHash -
func (*HeaderHandlerStub) GetLeaderSignature ¶
func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
GetLeaderSignature -
func (*HeaderHandlerStub) GetMiniBlockHeadersWithDst ¶
func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(_ uint32) map[string]uint32
GetMiniBlockHeadersWithDst -
func (*HeaderHandlerStub) GetPrevHash ¶
func (hhs *HeaderHandlerStub) GetPrevHash() []byte
GetPrevHash -
func (*HeaderHandlerStub) GetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
GetPrevRandSeed -
func (*HeaderHandlerStub) GetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
GetPubKeysBitmap -
func (*HeaderHandlerStub) GetRandSeed ¶
func (hhs *HeaderHandlerStub) GetRandSeed() []byte
GetRandSeed -
func (*HeaderHandlerStub) GetReceiptsHash ¶
func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
GetReceiptsHash --
func (*HeaderHandlerStub) GetRootHash ¶
func (hhs *HeaderHandlerStub) GetRootHash() []byte
GetRootHash -
func (*HeaderHandlerStub) GetShardID ¶
func (hhs *HeaderHandlerStub) GetShardID() uint32
GetShardID --
func (*HeaderHandlerStub) GetSignature ¶
func (hhs *HeaderHandlerStub) GetSignature() []byte
GetSignature -
func (*HeaderHandlerStub) GetSoftwareVersion ¶ added in v1.0.117
func (hhs *HeaderHandlerStub) GetSoftwareVersion() []byte
GetSoftwareVersion -
func (*HeaderHandlerStub) GetTimeStamp ¶
func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
GetTimeStamp -
func (*HeaderHandlerStub) GetTxCount ¶
func (hhs *HeaderHandlerStub) GetTxCount() uint32
GetTxCount -
func (*HeaderHandlerStub) GetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
GetValidatorStatsRootHash -
func (*HeaderHandlerStub) IsInterfaceNil ¶
func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderHandlerStub) IsStartOfEpochBlock ¶
func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
IsStartOfEpochBlock --
func (*HeaderHandlerStub) SetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
SetAccumulatedFees --
func (*HeaderHandlerStub) SetChainID ¶
func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
SetChainID -
func (*HeaderHandlerStub) SetDeveloperFees ¶ added in v1.0.114
func (hhs *HeaderHandlerStub) SetDeveloperFees(_ *big.Int)
SetDeveloperFees --
func (*HeaderHandlerStub) SetLeaderSignature ¶
func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
SetLeaderSignature -
func (*HeaderHandlerStub) SetPrevHash ¶
func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
SetPrevHash -
func (*HeaderHandlerStub) SetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
SetPrevRandSeed -
func (*HeaderHandlerStub) SetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
SetPubKeysBitmap -
func (*HeaderHandlerStub) SetRandSeed ¶
func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
SetRandSeed -
func (*HeaderHandlerStub) SetRootHash ¶
func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
SetRootHash -
func (*HeaderHandlerStub) SetShardID ¶
func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
SetShardID --
func (*HeaderHandlerStub) SetSignature ¶
func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
SetSignature -
func (*HeaderHandlerStub) SetSoftwareVersion ¶ added in v1.0.117
func (hhs *HeaderHandlerStub) SetSoftwareVersion(version []byte)
SetSoftwareVersion -
func (*HeaderHandlerStub) SetTimeStamp ¶
func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
SetTimeStamp -
func (*HeaderHandlerStub) SetTxCount ¶
func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
SetTxCount -
func (*HeaderHandlerStub) SetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
SetValidatorStatsRootHash -
type ListIndexUpdaterStub ¶ added in v1.0.102
type ListIndexUpdaterStub struct {
UpdateListAndIndexCalled func(pubKey string, shardID uint32, list string, index uint32) error
}
ListIndexUpdaterStub -
func (*ListIndexUpdaterStub) IsInterfaceNil ¶ added in v1.0.102
func (lius *ListIndexUpdaterStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ListIndexUpdaterStub) UpdateListAndIndex ¶ added in v1.0.102
func (lius *ListIndexUpdaterStub) UpdateListAndIndex(pubKey string, shardID uint32, list string, index uint32) error
UpdateListAndIndex -
type MarshalizerMock ¶ added in v1.0.102
type MarshalizerMock struct {
Fail bool
}
MarshalizerMock that will be used for testing
func (*MarshalizerMock) IsInterfaceNil ¶ added in v1.0.102
func (mm *MarshalizerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MarshalizerMock) Marshal ¶ added in v1.0.102
func (mm *MarshalizerMock) Marshal(obj interface{}) ([]byte, error)
Marshal converts the input object in a slice of bytes
func (*MarshalizerMock) Unmarshal ¶ added in v1.0.102
func (mm *MarshalizerMock) Unmarshal(obj interface{}, buff []byte) error
Unmarshal applies the serialized values over an instantiated object
type NodeInfoMock ¶ added in v1.0.102
type NodeInfoMock struct {
// contains filtered or unexported fields
}
func NewNodeInfo ¶ added in v1.0.102
func NewNodeInfo(address []byte, pubKey []byte, shardId uint32) *NodeInfoMock
NewNodeInfo -
func (*NodeInfoMock) AssignedShard ¶ added in v1.0.102
func (n *NodeInfoMock) AssignedShard() uint32
AssignedShard -
func (*NodeInfoMock) IsInterfaceNil ¶ added in v1.0.102
func (n *NodeInfoMock) IsInterfaceNil() bool
IsInterfaceNil -
type NodesCoordinatorCacheMock ¶
type NodesCoordinatorCacheMock struct { ClearCalled func() PutCalled func(key []byte, value interface{}, sieInBytes int) (evicted bool) GetCalled func(key []byte) (value interface{}, ok bool) }
NodesCoordinatorCacheMock -
func (*NodesCoordinatorCacheMock) Clear ¶ added in v1.0.111
func (rm *NodesCoordinatorCacheMock) Clear()
Clear -
func (*NodesCoordinatorCacheMock) Get ¶
func (rm *NodesCoordinatorCacheMock) Get(key []byte) (value interface{}, ok bool)
Get -
type PubkeyConverterMock ¶ added in v1.0.104
type PubkeyConverterMock struct {
// contains filtered or unexported fields
}
PubkeyConverterMock -
func NewPubkeyConverterMock ¶ added in v1.0.104
func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock
NewPubkeyConverterMock -
func (*PubkeyConverterMock) Decode ¶ added in v1.0.104
func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)
Decode -
func (*PubkeyConverterMock) Encode ¶ added in v1.0.104
func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string
Encode -
func (*PubkeyConverterMock) IsInterfaceNil ¶ added in v1.0.104
func (pcm *PubkeyConverterMock) IsInterfaceNil() bool
IsInterfaceNil -
type RaterMock ¶
type RaterMock struct { ComputeRatingCalled func(string, uint32) uint32 GetRatingCalled func(string) uint32 GetStartRatingCalled func() uint32 GetChancesCalled func(uint32) uint32 }
RaterMock -
func (*RaterMock) ComputeRating ¶
ComputeRating -
type ShuffledOutHandlerStub ¶ added in v1.0.103
type ShuffledOutHandlerStub struct { ProcessCalled func(newShardID uint32) error RegisterHandlerCalled func(handler func(newShardID uint32)) CurrentShardIDCalled func() uint32 }
ShuffledOutHandlerStub -
func (*ShuffledOutHandlerStub) CurrentShardID ¶ added in v1.0.103
func (s *ShuffledOutHandlerStub) CurrentShardID() uint32
CurrentShardID -
func (*ShuffledOutHandlerStub) IsInterfaceNil ¶ added in v1.0.103
func (s *ShuffledOutHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ShuffledOutHandlerStub) Process ¶ added in v1.0.103
func (s *ShuffledOutHandlerStub) Process(newShardID uint32) error
Process -
func (*ShuffledOutHandlerStub) RegisterHandler ¶ added in v1.0.103
func (s *ShuffledOutHandlerStub) RegisterHandler(handler func(newShardID uint32))
RegisterHandler -
type StorerMock ¶
type StorerMock struct {
// contains filtered or unexported fields
}
StorerMock -
func (*StorerMock) GetFromEpoch ¶
func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
GetFromEpoch -
func (*StorerMock) HasInEpoch ¶
func (sm *StorerMock) HasInEpoch(_ []byte, _ uint32) error
HasInEpoch -
func (*StorerMock) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerMock) SearchFirst ¶
func (sm *StorerMock) SearchFirst(key []byte) ([]byte, error)
SearchFirst -
type ValidatorMock ¶
type ValidatorMock struct {
// contains filtered or unexported fields
}
ValidatorMock -
func NewValidatorMock ¶
func NewValidatorMock(pubKey []byte, chances uint32, index uint32) *ValidatorMock
NewValidatorMock -
Source Files ¶
- cacherMock.go
- epochHandlerMock.go
- epochHandlerStub.go
- epochStartNotifierStub.go
- hasherMock.go
- hasherStub.go
- headerHandlerStub.go
- listIndexUpdaterStub.go
- marshalizerMock.go
- multipleShardsCoordinatorFake.go
- nodeInfoMock.go
- nodesCoordinatorCacheMock.go
- pubkeyConverterMock.go
- raterMock.go
- shuffledOutHandlerStub.go
- storerMock.go
- validatorMock.go