Documentation ¶
Index ¶
- type CurrentBlockProviderStub
- 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 EpochStartTriggerStub
- type HardforkTriggerStub
- func (hts *HardforkTriggerStub) AddCloser(closer update.Closer) error
- func (hts *HardforkTriggerStub) CreateData() []byte
- func (hts *HardforkTriggerStub) IsInterfaceNil() bool
- func (hts *HardforkTriggerStub) IsSelfTrigger() bool
- func (hts *HardforkTriggerStub) NotifyTriggerReceived() <-chan struct{}
- func (hts *HardforkTriggerStub) RecordedTriggerMessage() ([]byte, bool)
- func (hts *HardforkTriggerStub) Trigger(epoch uint32, withEarlyEndOfEpoch bool) error
- func (hts *HardforkTriggerStub) TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error)
- type HeartbeatStorerStub
- func (hss *HeartbeatStorerStub) IsInterfaceNil() bool
- func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)
- func (hss *HeartbeatStorerStub) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)
- func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)
- func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error
- func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error
- func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error
- type KeyGenMock
- func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error
- func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
- func (keyGen *KeyGenMock) IsInterfaceNil() bool
- func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
- func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
- func (keyGen *KeyGenMock) Suite() crypto.Suite
- type MarshalizerMock
- type MarshalizerStub
- type MessageHandlerStub
- type MessengerStub
- func (ms *MessengerStub) Bootstrap() error
- func (ms *MessengerStub) Broadcast(topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
- func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error
- func (ms *MessengerStub) Close() error
- func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
- func (ms *MessengerStub) HasTopic(name string) bool
- func (ms *MessengerStub) ID() core.PeerID
- func (ms *MessengerStub) IsConnectedToTheNetwork() bool
- func (ms *MessengerStub) IsInterfaceNil() bool
- func (ms *MessengerStub) PeerAddresses(pid core.PeerID) []string
- func (ms *MessengerStub) RegisterMessageProcessor(topic string, identifier string, handler p2p.MessageProcessor) error
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
- func (ncm *NodesCoordinatorMock) ComputeConsensusGroup(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorMock) ComputeLeaving(_ []*state.ShardValidatorInfo) ([]sharding.Validator, error)
- func (ncm *NodesCoordinatorMock) ConsensusGroupSize(uint32) int
- func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(_ 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(_ []byte, _ uint32, _ uint32) (publicKeys []string, err error)
- func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(_ []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) SetConsensusGroupSize(_ int) error
- func (ncm *NodesCoordinatorMock) SetNodesPerShards(_ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, _ uint32) error
- func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error)
- func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)
- func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)
- type P2PAntifloodHandlerStub
- func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, ...) error
- func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool
- func (p2pahs *P2PAntifloodHandlerStub) ResetForTopic(_ string)
- func (p2pahs *P2PAntifloodHandlerStub) SetMaxMessagesForTopic(_ string, _ uint32)
- type P2PMessageStub
- func (msg *P2PMessageStub) Data() []byte
- func (msg *P2PMessageStub) From() []byte
- func (msg *P2PMessageStub) IsInterfaceNil() bool
- func (msg *P2PMessageStub) Key() []byte
- func (msg *P2PMessageStub) Payload() []byte
- func (msg *P2PMessageStub) Peer() core.PeerID
- func (msg *P2PMessageStub) SeqNo() []byte
- func (msg *P2PMessageStub) Signature() []byte
- func (msg *P2PMessageStub) Timestamp() int64
- func (msg *P2PMessageStub) Topic() string
- type PeerBlackListHandlerStub
- type PeerSignatureHandler
- type PeerTypeProviderStub
- type PrivateKeyStub
- type PubkeyConverterMock
- type PublicKeyMock
- type RedundancyHandlerStub
- 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) SetSelfShardId(shardId uint32) error
- type SinglesignFailMock
- type SinglesignMock
- type SinglesignStub
- 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) GetBulkFromEpoch(keys [][]byte, _ uint32) (map[string][]byte, error)
- func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
- func (sm *StorerMock) GetOldestEpoch() (uint32, error)
- func (sm *StorerMock) Has(_ []byte) error
- func (sm *StorerMock) IsInterfaceNil() bool
- func (sm *StorerMock) Put(key, data []byte) error
- func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error
- func (sm *StorerMock) RangeKeys(_ func(key []byte, val []byte) bool)
- func (sm *StorerMock) Remove(_ []byte) error
- func (sm *StorerMock) SearchFirst(_ []byte) ([]byte, error)
- type TimerMock
- type ValidatorMock
- type ValidatorStatisticsStub
- type ValidatorsProviderStub
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentBlockProviderStub ¶ added in v1.1.1
type CurrentBlockProviderStub struct {
GetCurrentBlockHeaderCalled func() data.HeaderHandler
}
CurrentBlockProviderStub -
func (*CurrentBlockProviderStub) GetCurrentBlockHeader ¶ added in v1.1.1
func (cbps *CurrentBlockProviderStub) GetCurrentBlockHeader() data.HeaderHandler
GetCurrentBlockHeader -
func (*CurrentBlockProviderStub) IsInterfaceNil ¶ added in v1.1.1
func (cbps *CurrentBlockProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
type EpochStartNotifierStub ¶
type EpochStartNotifierStub struct { RegisterHandlerCalled func(handler epochStart.ActionHandler) UnregisterHandlerCalled func(handler epochStart.ActionHandler) NotifyAllCalled func(hdr data.HeaderHandler) NotifyAllPrepareCalled func(hdr data.HeaderHandler, body data.BodyHandler) // contains filtered or unexported fields }
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 EpochStartTriggerStub ¶
type EpochStartTriggerStub struct {
MetaEpochCalled func() uint32
}
EpochStartTriggerStub -
func (*EpochStartTriggerStub) IsInterfaceNil ¶
func (e *EpochStartTriggerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*EpochStartTriggerStub) MetaEpoch ¶
func (e *EpochStartTriggerStub) MetaEpoch() uint32
MetaEpoch -
type HardforkTriggerStub ¶
type HardforkTriggerStub struct { TriggerCalled func(epoch uint32, withEarlyEndOfEpoch bool) error IsSelfTriggerCalled func() bool TriggerReceivedCalled func(payload []byte, data []byte, pkBytes []byte) (bool, error) RecordedTriggerMessageCalled func() ([]byte, bool) CreateDataCalled func() []byte AddCloserCalled func(closer update.Closer) error NotifyTriggerReceivedCalled func() <-chan struct{} }
HardforkTriggerStub -
func (*HardforkTriggerStub) AddCloser ¶ added in v1.0.133
func (hts *HardforkTriggerStub) AddCloser(closer update.Closer) error
AddCloser -
func (*HardforkTriggerStub) CreateData ¶
func (hts *HardforkTriggerStub) CreateData() []byte
CreateData -
func (*HardforkTriggerStub) IsInterfaceNil ¶
func (hts *HardforkTriggerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HardforkTriggerStub) IsSelfTrigger ¶
func (hts *HardforkTriggerStub) IsSelfTrigger() bool
IsSelfTrigger -
func (*HardforkTriggerStub) NotifyTriggerReceived ¶ added in v1.0.133
func (hts *HardforkTriggerStub) NotifyTriggerReceived() <-chan struct{}
NotifyTriggerReceived -
func (*HardforkTriggerStub) RecordedTriggerMessage ¶
func (hts *HardforkTriggerStub) RecordedTriggerMessage() ([]byte, bool)
RecordedTriggerMessage -
func (*HardforkTriggerStub) Trigger ¶
func (hts *HardforkTriggerStub) Trigger(epoch uint32, withEarlyEndOfEpoch bool) error
Trigger -
func (*HardforkTriggerStub) TriggerReceived ¶
func (hts *HardforkTriggerStub) TriggerReceived(payload []byte, data []byte, pkBytes []byte) (bool, error)
TriggerReceived -
type HeartbeatStorerStub ¶
type HeartbeatStorerStub struct { LoadGenesisTimeCalled func() (time.Time, error) UpdateGenesisTimeCalled func(genesisTime time.Time) error LoadHeartBeatDTOCalled func(pubKey string) (*data.HeartbeatDTO, error) SavePubkeyDataCalled func(pubkey []byte, heartbeat *data.HeartbeatDTO) error LoadKeysCalled func() ([][]byte, error) SaveKeysCalled func(peersSlice [][]byte) error }
HeartbeatStorerStub -
func (*HeartbeatStorerStub) IsInterfaceNil ¶
func (hss *HeartbeatStorerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeartbeatStorerStub) LoadGenesisTime ¶
func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)
LoadGenesisTime -
func (*HeartbeatStorerStub) LoadHeartBeatDTO ¶
func (hss *HeartbeatStorerStub) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)
LoadHeartBeatDTO -
func (*HeartbeatStorerStub) LoadKeys ¶
func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)
LoadKeys -
func (*HeartbeatStorerStub) SaveKeys ¶
func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error
SaveKeys -
func (*HeartbeatStorerStub) SavePubkeyData ¶
func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error
SavePubkeyData -
func (*HeartbeatStorerStub) UpdateGenesisTime ¶
func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error
UpdateGenesisTime -
type KeyGenMock ¶
type KeyGenMock struct { GeneratePairMock func() (crypto.PrivateKey, crypto.PublicKey) PrivateKeyFromByteArrayMock func(b []byte) (crypto.PrivateKey, error) PublicKeyFromByteArrayMock func(b []byte) (crypto.PublicKey, error) SuiteMock func() crypto.Suite }
KeyGenMock -
func (*KeyGenMock) CheckPublicKeyValid ¶ added in v1.0.120
func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error
CheckPublicKeyValid -
func (*KeyGenMock) GeneratePair ¶
func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
GeneratePair -
func (*KeyGenMock) IsInterfaceNil ¶
func (keyGen *KeyGenMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*KeyGenMock) PrivateKeyFromByteArray ¶
func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)
PrivateKeyFromByteArray -
func (*KeyGenMock) PublicKeyFromByteArray ¶
func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
PublicKeyFromByteArray -
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 MarshalizerStub ¶
type MarshalizerStub struct { MarshalHandler func(obj interface{}) ([]byte, error) UnmarshalHandler func(obj interface{}, buff []byte) error }
MarshalizerStub -
func (*MarshalizerStub) IsInterfaceNil ¶
func (ms *MarshalizerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (MarshalizerStub) Marshal ¶
func (ms MarshalizerStub) Marshal(obj interface{}) ([]byte, error)
Marshal -
func (MarshalizerStub) Unmarshal ¶
func (ms MarshalizerStub) Unmarshal(obj interface{}, buff []byte) error
Unmarshal -
type MessageHandlerStub ¶
type MessageHandlerStub struct {
CreateHeartbeatFromP2PMessageCalled func(message p2p.MessageP2P) (*data.Heartbeat, error)
}
MessageHandlerStub -
func (*MessageHandlerStub) CreateHeartbeatFromP2PMessage ¶
func (mhs *MessageHandlerStub) CreateHeartbeatFromP2PMessage(message p2p.MessageP2P) (*data.Heartbeat, error)
CreateHeartbeatFromP2PMessage -
func (*MessageHandlerStub) IsInterfaceNil ¶
func (mhs *MessageHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
type MessengerStub ¶
type MessengerStub struct { IDCalled func() core.PeerID CloseCalled func() error CreateTopicCalled func(name string, createChannelForTopic bool) error HasTopicCalled func(name string) bool BroadcastOnChannelCalled func(channel string, topic string, buff []byte) BroadcastCalled func(topic string, buff []byte) RegisterMessageProcessorCalled func(topic string, identifier string, handler p2p.MessageProcessor) error BootstrapCalled func() error PeerAddressesCalled func(pid core.PeerID) []string BroadcastOnChannelBlockingCalled func(channel string, topic string, buff []byte) error IsConnectedToTheNetworkCalled func() bool }
MessengerStub -
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
Broadcast -
func (*MessengerStub) BroadcastOnChannel ¶
func (ms *MessengerStub) BroadcastOnChannel(channel string, topic string, buff []byte)
BroadcastOnChannel -
func (*MessengerStub) BroadcastOnChannelBlocking ¶
func (ms *MessengerStub) BroadcastOnChannelBlocking(channel string, topic string, buff []byte) error
BroadcastOnChannelBlocking -
func (*MessengerStub) CreateTopic ¶
func (ms *MessengerStub) CreateTopic(name string, createChannelForTopic bool) error
CreateTopic -
func (*MessengerStub) IsConnectedToTheNetwork ¶
func (ms *MessengerStub) IsConnectedToTheNetwork() bool
IsConnectedToTheNetwork -
func (*MessengerStub) IsInterfaceNil ¶
func (ms *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MessengerStub) PeerAddresses ¶ added in v1.0.130
func (ms *MessengerStub) PeerAddresses(pid core.PeerID) []string
PeerAddresses -
func (*MessengerStub) RegisterMessageProcessor ¶
func (ms *MessengerStub) RegisterMessageProcessor(topic string, identifier string, handler p2p.MessageProcessor) error
RegisterMessageProcessor -
type NodesCoordinatorMock ¶
type NodesCoordinatorMock 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) GetAllEligibleValidatorsPublicKeysCalled func() (map[uint32][][]byte, error) }
NodesCoordinatorMock -
func (*NodesCoordinatorMock) ComputeAdditionalLeaving ¶
func (ncm *NodesCoordinatorMock) ComputeAdditionalLeaving(_ []*state.ShardValidatorInfo) (map[uint32][]sharding.Validator, error)
ComputeAdditionalLeaving -
func (*NodesCoordinatorMock) ComputeConsensusGroup ¶
func (ncm *NodesCoordinatorMock) ComputeConsensusGroup( randomness []byte, round uint64, shardId uint32, epoch uint32, ) (validatorsGroup []sharding.Validator, err error)
ComputeConsensusGroup -
func (*NodesCoordinatorMock) ComputeLeaving ¶
func (ncm *NodesCoordinatorMock) ComputeLeaving(_ []*state.ShardValidatorInfo) ([]sharding.Validator, error)
ComputeLeaving -
func (*NodesCoordinatorMock) ConsensusGroupSize ¶
func (ncm *NodesCoordinatorMock) ConsensusGroupSize(uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllEligibleValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllLeavingValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllWaitingValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetChance ¶
func (ncm *NodesCoordinatorMock) GetChance(uint32) uint32
GetChance -
func (*NodesCoordinatorMock) GetConsensusValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys( randomness []byte, round uint64, shardId uint32, epoch uint32, ) ([]string, error)
GetConsensusValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetConsensusWhitelistedNodes ¶
func (ncm *NodesCoordinatorMock) GetConsensusWhitelistedNodes( _ uint32, ) (map[string]struct{}, error)
GetConsensusWhitelistedNodes return the whitelisted nodes allowed to send consensus messages, for each of the shards
func (*NodesCoordinatorMock) GetNumTotalEligible ¶
func (ncm *NodesCoordinatorMock) GetNumTotalEligible() uint64
GetNumTotalEligible -
func (*NodesCoordinatorMock) GetOwnPublicKey ¶
func (ncm *NodesCoordinatorMock) GetOwnPublicKey() []byte
GetOwnPublicKey -
func (*NodesCoordinatorMock) GetSavedStateKey ¶
func (ncm *NodesCoordinatorMock) GetSavedStateKey() []byte
GetSavedStateKey -
func (*NodesCoordinatorMock) GetSelectedPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetSelectedPublicKeys(_ []byte, _ uint32, _ uint32) (publicKeys []string, err error)
GetSelectedPublicKeys -
func (*NodesCoordinatorMock) GetValidatorWithPublicKey ¶
func (ncm *NodesCoordinatorMock) GetValidatorWithPublicKey(_ []byte) (sharding.Validator, uint32, error)
GetValidatorWithPublicKey -
func (*NodesCoordinatorMock) GetValidatorsIndexes ¶
func (ncm *NodesCoordinatorMock) GetValidatorsIndexes(_ []string, _ uint32) ([]uint64, error)
GetValidatorsIndexes -
func (*NodesCoordinatorMock) IsInterfaceNil ¶
func (ncm *NodesCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*NodesCoordinatorMock) LoadState ¶
func (ncm *NodesCoordinatorMock) LoadState(_ []byte) error
LoadState -
func (*NodesCoordinatorMock) SetConsensusGroupSize ¶
func (ncm *NodesCoordinatorMock) SetConsensusGroupSize(_ int) error
SetConsensusGroupSize -
func (*NodesCoordinatorMock) SetNodesPerShards ¶
func (ncm *NodesCoordinatorMock) SetNodesPerShards( _ map[uint32][]sharding.Validator, _ map[uint32][]sharding.Validator, _ uint32, ) error
SetNodesPerShards -
func (*NodesCoordinatorMock) ShardIdForEpoch ¶
func (ncm *NodesCoordinatorMock) ShardIdForEpoch(_ uint32) (uint32, error)
ShardIdForEpoch returns the nodesCoordinator configured ShardId for specified epoch if epoch configuration exists, otherwise error
func (*NodesCoordinatorMock) ShuffleOutForEpoch ¶
func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)
ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler
func (*NodesCoordinatorMock) ValidatorsWeights ¶
func (ncm *NodesCoordinatorMock) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)
ValidatorsWeights -
type P2PAntifloodHandlerStub ¶
type P2PAntifloodHandlerStub struct { CanProcessMessageCalled func(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error CanProcessMessagesOnTopicCalled func(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error BlacklistPeerCalled func(peer core.PeerID, reason string, duration time.Duration) }
P2PAntifloodHandlerStub -
func (*P2PAntifloodHandlerStub) BlacklistPeer ¶ added in v1.0.132
func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)
BlacklistPeer -
func (*P2PAntifloodHandlerStub) CanProcessMessage ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error
CanProcessMessage -
func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error
CanProcessMessagesOnTopic -
func (*P2PAntifloodHandlerStub) IsInterfaceNil ¶
func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*P2PAntifloodHandlerStub) ResetForTopic ¶
func (p2pahs *P2PAntifloodHandlerStub) ResetForTopic(_ string)
ResetForTopic -
func (*P2PAntifloodHandlerStub) SetMaxMessagesForTopic ¶
func (p2pahs *P2PAntifloodHandlerStub) SetMaxMessagesForTopic(_ string, _ uint32)
SetMaxMessagesForTopic -
type P2PMessageStub ¶
type P2PMessageStub struct { FromField []byte DataField []byte SeqNoField []byte TopicField string SignatureField []byte KeyField []byte PeerField core.PeerID PayloadField []byte TimestampField int64 }
P2PMessageStub -
func (*P2PMessageStub) IsInterfaceNil ¶
func (msg *P2PMessageStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageStub) Payload ¶ added in v1.0.133
func (msg *P2PMessageStub) Payload() []byte
Payload -
func (*P2PMessageStub) Timestamp ¶ added in v1.0.133
func (msg *P2PMessageStub) Timestamp() int64
Timestamp -
type PeerBlackListHandlerStub ¶ added in v1.0.127
type PeerBlackListHandlerStub struct { AddCalled func(pid core.PeerID) error HasCalled func(pid core.PeerID) bool SweepCalled func() }
PeerBlackListHandlerStub -
func (*PeerBlackListHandlerStub) Add ¶ added in v1.0.127
func (pblhs *PeerBlackListHandlerStub) Add(pid core.PeerID) error
Add -
func (*PeerBlackListHandlerStub) Has ¶ added in v1.0.127
func (pblhs *PeerBlackListHandlerStub) Has(pid core.PeerID) bool
Has -
func (*PeerBlackListHandlerStub) IsInterfaceNil ¶ added in v1.0.127
func (pblhs *PeerBlackListHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeerBlackListHandlerStub) Sweep ¶ added in v1.0.127
func (pblhs *PeerBlackListHandlerStub) Sweep()
Sweep -
type PeerSignatureHandler ¶ added in v1.0.138
type PeerSignatureHandler struct { Signer crypto.SingleSigner KeyGen crypto.KeyGenerator }
PeerSignatureHandler -
func (*PeerSignatureHandler) GetPeerSignature ¶ added in v1.0.138
func (p *PeerSignatureHandler) GetPeerSignature(privateKey crypto.PrivateKey, msg []byte) ([]byte, error)
GetPeerSignature -
func (*PeerSignatureHandler) IsInterfaceNil ¶ added in v1.0.138
func (p *PeerSignatureHandler) IsInterfaceNil() bool
IsInterfaceNil -
func (*PeerSignatureHandler) VerifyPeerSignature ¶ added in v1.0.138
VerifyPeerSignature -
type PeerTypeProviderStub ¶
type PeerTypeProviderStub struct {
ComputeForPubKeyCalled func(pubKey []byte) (common.PeerType, uint32, error)
}
PeerTypeProviderStub -
func (*PeerTypeProviderStub) Close ¶ added in v1.0.117
func (p *PeerTypeProviderStub) Close() error
Close -
func (*PeerTypeProviderStub) ComputeForPubKey ¶
ComputeForPubKey -
func (*PeerTypeProviderStub) GetAllPeerTypeInfos ¶ added in v1.0.117
func (p *PeerTypeProviderStub) GetAllPeerTypeInfos() []*state.PeerTypeInfo
GetAllPeerTypeInfos -
func (*PeerTypeProviderStub) IsInterfaceNil ¶
func (p *PeerTypeProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
type PrivateKeyStub ¶
type PrivateKeyStub struct { ToByteArrayHandler func() ([]byte, error) GeneratePublicHandler func() crypto.PublicKey SuiteHandler func() crypto.Suite ScalarHandler func() crypto.Scalar }
PrivateKeyStub -
func (*PrivateKeyStub) GeneratePublic ¶
func (sk *PrivateKeyStub) GeneratePublic() crypto.PublicKey
GeneratePublic -
func (*PrivateKeyStub) IsInterfaceNil ¶
func (sk *PrivateKeyStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyStub) ToByteArray ¶
func (sk *PrivateKeyStub) ToByteArray() ([]byte, error)
ToByteArray -
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 PublicKeyMock ¶
type PublicKeyMock struct { ToByteArrayHandler func() ([]byte, error) SuiteCalled func() crypto.Suite PointCalled func() crypto.Point }
PublicKeyMock -
func (*PublicKeyMock) IsInterfaceNil ¶
func (sspk *PublicKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyMock) ToByteArray ¶
func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)
ToByteArray -
type RedundancyHandlerStub ¶ added in v1.1.32
type RedundancyHandlerStub struct { IsRedundancyNodeCalled func() bool IsMainMachineActiveCalled func() bool ObserverPrivateKeyCalled func() crypto.PrivateKey }
RedundancyHandlerStub -
func (*RedundancyHandlerStub) IsInterfaceNil ¶ added in v1.1.32
func (rhs *RedundancyHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*RedundancyHandlerStub) IsMainMachineActive ¶ added in v1.1.32
func (rhs *RedundancyHandlerStub) IsMainMachineActive() bool
IsMainMachineActive -
func (*RedundancyHandlerStub) IsRedundancyNode ¶ added in v1.1.32
func (rhs *RedundancyHandlerStub) IsRedundancyNode() bool
IsRedundancyNode -
func (*RedundancyHandlerStub) ObserverPrivateKey ¶ added in v1.1.32
func (rhs *RedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey
ObserverPrivateKey -
type ShardCoordinatorMock ¶
type ShardCoordinatorMock struct {
SelfShardId 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) SetSelfShardId ¶
func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error
SetSelfShardId -
type SinglesignFailMock ¶
type SinglesignFailMock struct { }
SinglesignFailMock -
func (*SinglesignFailMock) IsInterfaceNil ¶
func (s *SinglesignFailMock) IsInterfaceNil() bool
IsInterfaceNil -
type SinglesignMock ¶
type SinglesignMock struct { }
SinglesignMock -
func (*SinglesignMock) IsInterfaceNil ¶
func (s *SinglesignMock) IsInterfaceNil() bool
IsInterfaceNil -
type SinglesignStub ¶
type SinglesignStub struct { SignCalled func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error }
SinglesignStub -
func (*SinglesignStub) IsInterfaceNil ¶
func (s *SinglesignStub) IsInterfaceNil() bool
IsInterfaceNil -
type StorerMock ¶
type StorerMock struct {
// contains filtered or unexported fields
}
StorerMock -
func (*StorerMock) GetBulkFromEpoch ¶ added in v1.0.147
GetBulkFromEpoch -
func (*StorerMock) GetFromEpoch ¶
func (sm *StorerMock) GetFromEpoch(key []byte, _ uint32) ([]byte, error)
GetFromEpoch -
func (*StorerMock) GetOldestEpoch ¶ added in v1.2.4
func (sm *StorerMock) GetOldestEpoch() (uint32, error)
GetOldestEpoch -
func (*StorerMock) IsInterfaceNil ¶
func (sm *StorerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*StorerMock) PutInEpoch ¶ added in v1.1.1
func (sm *StorerMock) PutInEpoch(key, data []byte, _ uint32) error
PutInEpoch -
func (*StorerMock) RangeKeys ¶ added in v1.0.138
func (sm *StorerMock) RangeKeys(_ func(key []byte, val []byte) bool)
RangeKeys -
func (*StorerMock) SearchFirst ¶
func (sm *StorerMock) SearchFirst(_ []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 -
type ValidatorStatisticsStub ¶
type ValidatorStatisticsStub struct { RootHashCalled func() ([]byte, error) GetValidatorInfoForRootHashCalled func(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error) }
ValidatorStatisticsStub -
func (*ValidatorStatisticsStub) GetValidatorInfoForRootHash ¶
func (vss *ValidatorStatisticsStub) GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
GetValidatorInfoForRootHash -
func (*ValidatorStatisticsStub) IsInterfaceNil ¶
func (vss *ValidatorStatisticsStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorStatisticsStub) RootHash ¶
func (vss *ValidatorStatisticsStub) RootHash() ([]byte, error)
RootHash -
type ValidatorsProviderStub ¶ added in v1.0.117
type ValidatorsProviderStub struct {
GetLatestValidatorsCalled func() map[string]*state.ValidatorApiResponse
}
ValidatorsProviderStub -
func (*ValidatorsProviderStub) Close ¶ added in v1.2.0
func (vp *ValidatorsProviderStub) Close() error
Close -
func (*ValidatorsProviderStub) GetLatestValidators ¶ added in v1.0.117
func (vp *ValidatorsProviderStub) GetLatestValidators() map[string]*state.ValidatorApiResponse
GetLatestValidators -
func (*ValidatorsProviderStub) IsInterfaceNil ¶ added in v1.0.117
func (vp *ValidatorsProviderStub) IsInterfaceNil() bool
IsInterfaceNil -
Source Files ¶
- currentBlockProviderStub.go
- endOfEpochTriggerStub.go
- epochStartNotifier.go
- hardforkTriggerStub.go
- heartbeatStorerStub.go
- keyMock.go
- marshalizerMock.go
- marshalizerStub.go
- messageHandlerStub.go
- messengerStub.go
- nodesCoordinatorMock.go
- p2pAntifloodHandlerStub.go
- p2pMessageStub.go
- peerBlackListHandlerStub.go
- peerSignatureHandlerMock.go
- peerTypeProviderStub.go
- pubkeyConverterMock.go
- redundancyHandlerStub.go
- shardCoordinatorMock.go
- singlesignerMock.go
- storerMock.go
- timerMock.go
- validatorMock.go
- validatorStatisticsStub.go
- validatorsProviderStub.go