Documentation ¶
Index ¶
- func NewMultipleShardsCoordinatorFake(numOfShards uint32, currentShard uint32) *multipleShardsCoordinatorFake
- type AddressConverterFake
- func (acf *AddressConverterFake) AddressLen() int
- func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
- func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
- func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
- func (acf *AddressConverterFake) IsInterfaceNil() bool
- func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
- type AddressMock
- 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{}) (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{}) (evicted bool)
- func (cm *CacherMock) RegisterHandler(func(key []byte))
- func (cm *CacherMock) Remove(key []byte)
- func (cm *CacherMock) RemoveOldest()
- type HasherMock
- type HasherStub
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeValidatorsGroup(randomness []byte, round uint64, shardId uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorMock) ConsensusGroupSize() int
- func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte
- func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
- func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32) (publicKeys []string, err error)
- func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(publicKey []byte) (sharding.Validator, uint32, error)
- func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64
- func (ncm *NodesCoordinatorMock) GetValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) GetValidatorsRewardsAddresses(randomness []byte, round uint64, shardId uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
- func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(int) error
- func (ncm *NodesCoordinatorMock) SetNodesPerShards(map[uint32][]sharding.Validator) error
- type RaterMock
- type ValidatorMock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AddressConverterFake ¶
type AddressConverterFake struct {
// contains filtered or unexported fields
}
func NewAddressConverterFake ¶
func NewAddressConverterFake(addressLen int, prefix string) *AddressConverterFake
func (*AddressConverterFake) AddressLen ¶
func (acf *AddressConverterFake) AddressLen() int
func (*AddressConverterFake) ConvertToHex ¶
func (acf *AddressConverterFake) ConvertToHex(addressContainer state.AddressContainer) (string, error)
func (*AddressConverterFake) CreateAddressFromHex ¶
func (acf *AddressConverterFake) CreateAddressFromHex(hexAddress string) (state.AddressContainer, error)
func (*AddressConverterFake) CreateAddressFromPublicKeyBytes ¶
func (acf *AddressConverterFake) CreateAddressFromPublicKeyBytes(pubKey []byte) (state.AddressContainer, error)
func (*AddressConverterFake) IsInterfaceNil ¶
func (acf *AddressConverterFake) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*AddressConverterFake) PrepareAddressBytes ¶
func (acf *AddressConverterFake) PrepareAddressBytes(addressBytes []byte) ([]byte, error)
type AddressMock ¶
type AddressMock struct {
Bts []byte
}
func (*AddressMock) Bytes ¶
func (address *AddressMock) Bytes() []byte
func (*AddressMock) IsInterfaceNil ¶
func (address *AddressMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type CacherMock ¶
type CacherMock struct {
// contains filtered or unexported fields
}
func NewCacherMock ¶
func NewCacherMock() *CacherMock
func (*CacherMock) Clear ¶
func (cm *CacherMock) Clear()
func (*CacherMock) Get ¶
func (cm *CacherMock) Get(key []byte) (value interface{}, ok bool)
func (*CacherMock) Has ¶
func (cm *CacherMock) Has(key []byte) bool
func (*CacherMock) HasOrAdd ¶
func (cm *CacherMock) HasOrAdd(key []byte, value interface{}) (bool, bool)
func (*CacherMock) IsInterfaceNil ¶
func (cm *CacherMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*CacherMock) Keys ¶
func (cm *CacherMock) Keys() [][]byte
func (*CacherMock) Len ¶
func (cm *CacherMock) Len() int
func (*CacherMock) MaxSize ¶
func (cm *CacherMock) MaxSize() int
func (*CacherMock) Peek ¶
func (cm *CacherMock) Peek(key []byte) (value interface{}, ok bool)
func (*CacherMock) Put ¶
func (cm *CacherMock) Put(key []byte, value interface{}) (evicted bool)
func (*CacherMock) RegisterHandler ¶
func (cm *CacherMock) RegisterHandler(func(key []byte))
func (*CacherMock) Remove ¶
func (cm *CacherMock) Remove(key []byte)
func (*CacherMock) RemoveOldest ¶
func (cm *CacherMock) RemoveOldest()
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 }
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 NodesCoordinatorMock ¶ added in v1.0.20
type NodesCoordinatorMock struct { ComputeValidatorsGroupCalled func([]byte) ([]sharding.Validator, error) GetValidatorsPublicKeysCalled func(randomness []byte) ([]string, error) GetValidatorWithPublicKeyCalled func(publicKey []byte) (sharding.Validator, uint32, error) }
func (*NodesCoordinatorMock) ComputeValidatorsGroup ¶ added in v1.0.20
func (*NodesCoordinatorMock) ConsensusGroupSize ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) ConsensusGroupSize() int
func (*NodesCoordinatorMock) GetAllValidatorsPublicKeys ¶ added in v1.0.71
func (ncm *NodesCoordinatorMock) GetAllValidatorsPublicKeys() map[uint32][][]byte
func (*NodesCoordinatorMock) GetOwnPublicKey ¶ added in v1.0.71
func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
func (*NodesCoordinatorMock) GetSelectedPublicKeys ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(selection []byte, shardId uint32) (publicKeys []string, err error)
func (*NodesCoordinatorMock) GetValidatorWithPublicKey ¶ added in v1.0.20
func (*NodesCoordinatorMock) GetValidatorsIndexes ¶ added in v1.0.71
func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(publicKeys []string) []uint64
func (*NodesCoordinatorMock) GetValidatorsPublicKeys ¶ added in v1.0.20
func (*NodesCoordinatorMock) GetValidatorsRewardsAddresses ¶ added in v1.0.71
func (*NodesCoordinatorMock) IsInterfaceNil ¶ added in v1.0.71
func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
func (*NodesCoordinatorMock) SetConsensusGroupSize ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(int) error
func (*NodesCoordinatorMock) SetNodesPerShards ¶ added in v1.0.20
func (ncm *NodesCoordinatorMock) SetNodesPerShards(map[uint32][]sharding.Validator) error
type RaterMock ¶
type RaterMock struct { ComputeRatingCalled func(string, uint32) uint32 GetRatingCalled func(string) uint32 GetRatingsCalled func([]string) map[string]uint32 GetStartRatingCalled func() uint32 }
func (*RaterMock) ComputeRating ¶
func (*RaterMock) GetRatings ¶ added in v1.0.67
func (*RaterMock) GetStartRating ¶
func (*RaterMock) IsInterfaceNil ¶
type ValidatorMock ¶
type ValidatorMock struct {
// contains filtered or unexported fields
}
func NewValidatorMock ¶
func (*ValidatorMock) Address ¶
func (vm *ValidatorMock) Address() []byte
func (*ValidatorMock) PubKey ¶
func (vm *ValidatorMock) PubKey() []byte
func (*ValidatorMock) Rating ¶ added in v1.0.20
func (vm *ValidatorMock) Rating() int32
func (*ValidatorMock) Stake ¶ added in v1.0.20
func (vm *ValidatorMock) Stake() *big.Int
Click to show internal directories.
Click to hide internal directories.