Documentation ¶
Index ¶
- Variables
- func InitChronologyHandlerMock() consensus.ChronologyHandler
- func InitKeys() (*KeyGenMock, *PrivateKeyMock, *PublicKeyMock)
- func InitMultiSignerMock() *cryptoMocks.MultisignerMock
- func NewValidator(pubKey []byte, chances uint32, index uint32) *validator
- type AlarmSchedulerStub
- type AppStatusHandlerMock
- func (ashs *AppStatusHandlerMock) AddUint64(_ string, _ uint64)
- func (ashs *AppStatusHandlerMock) Close()
- func (ashs *AppStatusHandlerMock) Decrement(_ string)
- func (ashs *AppStatusHandlerMock) Increment(_ string)
- func (ashs *AppStatusHandlerMock) IsInterfaceNil() bool
- func (ashs *AppStatusHandlerMock) SetInt64Value(_ string, _ int64)
- func (ashs *AppStatusHandlerMock) SetStringValue(_ string, _ string)
- func (ashs *AppStatusHandlerMock) SetUInt64Value(_ string, _ uint64)
- type AppStatusHandlerStub
- 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 BlockChainMock
- func (bc *BlockChainMock) CreateNewHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
- func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
- func (bc *BlockChainMock) IsInterfaceNil() bool
- func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
- func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
- func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
- func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
- type BlockProcessorMock
- func (bpm *BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
- func (bpm *BlockProcessorMock) ApplyProcessedMiniBlocks(_ *processedMb.ProcessedMiniBlockTracker)
- func (bpm *BlockProcessorMock) Close() error
- func (bpm *BlockProcessorMock) CommitBlock(header data.HeaderHandler, body data.BodyHandler) error
- func (bpm *BlockProcessorMock) CreateBlock(initialHdrData data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, data.BodyHandler, error)
- func (bpm *BlockProcessorMock) CreateNewHeader(round uint64, nonce uint64) data.HeaderHandler
- func (bpm *BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
- func (bpm *BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
- func (bpm *BlockProcessorMock) IsInterfaceNil() bool
- func (bpm *BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
- func (bpm *BlockProcessorMock) ProcessBlock(header data.HeaderHandler, body data.BodyHandler, ...) error
- func (bpm *BlockProcessorMock) PruneStateOnRollback(currHeader data.HeaderHandler, prevHeader data.HeaderHandler)
- func (bpm *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
- func (bpm *BlockProcessorMock) RestoreLastNotarizedHrdsToGenesis()
- func (bpm *BlockProcessorMock) RevertAccountState(header data.HeaderHandler)
- func (bpm *BlockProcessorMock) RevertIndexedBlock(header data.HeaderHandler)
- func (bpm *BlockProcessorMock) RevertStateToBlock(header data.HeaderHandler) error
- func (bpm *BlockProcessorMock) SetNumProcessedObj(_ uint64)
- type BootstrapperMock
- func (boot *BootstrapperMock) AddSyncStateListener(syncStateNotifier func(isSyncing bool))
- func (boot *BootstrapperMock) Close() error
- func (boot *BootstrapperMock) CreateAndCommitEmptyBlock(shardForCurrentNode uint32) (data.BodyHandler, data.HeaderHandler, error)
- func (boot *BootstrapperMock) GetNodeState() common.NodeState
- func (boot *BootstrapperMock) IsInterfaceNil() bool
- func (boot *BootstrapperMock) StartSyncingBlocks()
- type BroadcastMessengerMock
- func (bmm *BroadcastMessengerMock) BroadcastBlock(bodyHandler data.BodyHandler, headerhandler data.HeaderHandler) error
- func (bmm *BroadcastMessengerMock) BroadcastBlockDataLeader(header data.HeaderHandler, miniBlocks map[uint32][]byte, ...) error
- func (bmm *BroadcastMessengerMock) BroadcastConsensusMessage(message *consensus.Message) error
- func (bmm *BroadcastMessengerMock) BroadcastHeader(headerhandler data.HeaderHandler) error
- func (bmm *BroadcastMessengerMock) BroadcastMiniBlocks(miniBlocks map[uint32][]byte) error
- func (bmm *BroadcastMessengerMock) BroadcastTransactions(transactions map[string][][]byte) error
- func (bmm *BroadcastMessengerMock) IsInterfaceNil() bool
- func (bmm *BroadcastMessengerMock) PrepareBroadcastBlockDataValidator(header data.HeaderHandler, miniBlocks map[uint32][]byte, ...)
- func (bmm *BroadcastMessengerMock) PrepareBroadcastHeaderValidator(header data.HeaderHandler, miniBlocks map[uint32][]byte, ...)
- type ChronologyHandlerMock
- func (chrm *ChronologyHandlerMock) AddSubround(subroundHandler consensus.SubroundHandler)
- func (chrm *ChronologyHandlerMock) Close() error
- func (chrm *ChronologyHandlerMock) Epoch() uint32
- func (chrm *ChronologyHandlerMock) IsInterfaceNil() bool
- func (chrm *ChronologyHandlerMock) RemoveAllSubrounds()
- func (chrm *ChronologyHandlerMock) StartRounds()
- type ConsensusCoreMock
- func (ccm *ConsensusCoreMock) BlockProcessor() process.BlockProcessor
- func (ccm *ConsensusCoreMock) Blockchain() data.ChainHandler
- func (ccm *ConsensusCoreMock) BootStrapper() process.Bootstrapper
- func (ccm *ConsensusCoreMock) BroadcastMessenger() consensus.BroadcastMessenger
- func (ccm *ConsensusCoreMock) Chronology() consensus.ChronologyHandler
- func (ccm *ConsensusCoreMock) EpochStartRegistrationHandler() epochStart.RegistrationHandler
- func (ccm *ConsensusCoreMock) FallbackHeaderValidator() consensus.FallbackHeaderValidator
- func (ccm *ConsensusCoreMock) GetAntiFloodHandler() consensus.P2PAntifloodHandler
- func (ccm *ConsensusCoreMock) Hasher() hashing.Hasher
- func (ccm *ConsensusCoreMock) HeaderSigVerifier() consensus.HeaderSigVerifier
- func (ccm *ConsensusCoreMock) HeadersPoolSubscriber() consensus.HeadersPoolSubscriber
- func (ccm *ConsensusCoreMock) IsInterfaceNil() bool
- func (ccm *ConsensusCoreMock) Marshalizer() marshal.Marshalizer
- func (ccm *ConsensusCoreMock) MultiSigner() crypto.MultiSigner
- func (ccm *ConsensusCoreMock) NodeRedundancyHandler() consensus.NodeRedundancyHandler
- func (ccm *ConsensusCoreMock) NodesCoordinator() sharding.NodesCoordinator
- func (ccm *ConsensusCoreMock) PeerHonestyHandler() consensus.PeerHonestyHandler
- func (ccm *ConsensusCoreMock) PrivateKey() crypto.PrivateKey
- func (ccm *ConsensusCoreMock) RoundHandler() consensus.RoundHandler
- func (ccm *ConsensusCoreMock) SetBlockProcessor(blockProcessor process.BlockProcessor)
- func (ccm *ConsensusCoreMock) SetBlockchain(blockChain data.ChainHandler)
- func (ccm *ConsensusCoreMock) SetBootStrapper(bootstrapper process.Bootstrapper)
- func (ccm *ConsensusCoreMock) SetBroadcastMessenger(broadcastMessenger consensus.BroadcastMessenger)
- func (ccm *ConsensusCoreMock) SetChronology(chronologyHandler consensus.ChronologyHandler)
- func (ccm *ConsensusCoreMock) SetFallbackHeaderValidator(fallbackHeaderValidator consensus.FallbackHeaderValidator)
- func (ccm *ConsensusCoreMock) SetHasher(hasher hashing.Hasher)
- func (ccm *ConsensusCoreMock) SetHeaderSigVerifier(headerSigVerifier consensus.HeaderSigVerifier)
- func (ccm *ConsensusCoreMock) SetMarshalizer(marshalizer marshal.Marshalizer)
- func (ccm *ConsensusCoreMock) SetMultiSigner(multiSigner crypto.MultiSigner)
- func (ccm *ConsensusCoreMock) SetNodeRedundancyHandler(nodeRedundancyHandler consensus.NodeRedundancyHandler)
- func (ccm *ConsensusCoreMock) SetRoundHandler(roundHandler consensus.RoundHandler)
- func (ccm *ConsensusCoreMock) SetShardCoordinator(shardCoordinator sharding.Coordinator)
- func (ccm *ConsensusCoreMock) SetSingleSigner(signer crypto.SingleSigner)
- func (ccm *ConsensusCoreMock) SetSyncTimer(syncTimer ntp.SyncTimer)
- func (ccm *ConsensusCoreMock) SetValidatorGroupSelector(validatorGroupSelector sharding.NodesCoordinator)
- func (ccm *ConsensusCoreMock) ShardCoordinator() sharding.Coordinator
- func (ccm *ConsensusCoreMock) SingleSigner() crypto.SingleSigner
- func (ccm *ConsensusCoreMock) SyncTimer() ntp.SyncTimer
- type ConsensusStateMock
- func (cnsm *ConsensusStateMock) CanDoSubroundJob(currentSubroundId int) bool
- func (cnsm *ConsensusStateMock) CanProcessReceivedMessage(cnsDta consensus.Message, currentRoundIndex int32, currentSubroundId int) bool
- func (cnsm *ConsensusStateMock) ConsensusGroupSize() int
- func (cnsm *ConsensusStateMock) GenerateBitmap(subroundId int) []byte
- func (cnsm *ConsensusStateMock) GetLeader() (string, error)
- func (cnsm *ConsensusStateMock) GetNextConsensusGroup(randomSource string, vgs sharding.NodesCoordinator) ([]string, error)
- func (cnsm *ConsensusStateMock) IsBlockBodyAlreadyReceived() bool
- func (cnsm *ConsensusStateMock) IsConsensusDataEqual(data []byte) bool
- func (cnsm *ConsensusStateMock) IsConsensusDataSet() bool
- func (cnsm *ConsensusStateMock) IsCurrentSubroundFinished(currentSubroundId int) bool
- func (cnsm *ConsensusStateMock) IsHeaderAlreadyReceived() bool
- func (cnsm *ConsensusStateMock) IsJobDone(node string, currentSubroundId int) bool
- func (cnsm *ConsensusStateMock) IsNodeLeaderInCurrentRound(node string) bool
- func (cnsm *ConsensusStateMock) IsNodeSelf(node string) bool
- func (cnsm *ConsensusStateMock) IsSelfJobDone(currentSubroundId int) bool
- func (cnsm *ConsensusStateMock) IsSelfLeaderInCurrentRound() bool
- func (cnsm *ConsensusStateMock) ProcessingBlock() bool
- func (cnsm *ConsensusStateMock) ResetConsensusState()
- func (cnsm *ConsensusStateMock) SetProcessingBlock(processingBlock bool)
- func (cnsm *ConsensusStateMock) SetThreshold(subroundId int, threshold int)
- 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 ForkDetectorMock
- func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, ...) error
- func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
- func (fdm *ForkDetectorMock) GetHighestFinalBlockHash() []byte
- func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
- func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte
- func (fdm *ForkDetectorMock) IsInterfaceNil() bool
- func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64
- func (fdm *ForkDetectorMock) RemoveHeader(nonce uint64, hash []byte)
- func (fdm *ForkDetectorMock) ResetFork()
- func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
- func (fdm *ForkDetectorMock) RestoreToGenesis()
- func (fdm *ForkDetectorMock) SetFinalToLastCheckpoint()
- func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)
- type HasherMock
- type HasherStub
- type HeaderIntegrityVerifierStub
- type HeaderSigVerifierStub
- func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool
- func (hsvm *HeaderSigVerifierStub) VerifyLeaderSignature(header data.HeaderHandler) error
- func (hsvm *HeaderSigVerifierStub) VerifyRandSeed(header data.HeaderHandler) error
- func (hsvm *HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error
- func (hsvm *HeaderSigVerifierStub) VerifySignature(header data.HeaderHandler) error
- type HeadersCacherStub
- func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
- func (hcs *HeadersCacherStub) Clear()
- func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
- func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
- func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int
- func (hcs *HeadersCacherStub) IsInterfaceNil() bool
- func (hcs *HeadersCacherStub) Len() int
- func (hcs *HeadersCacherStub) MaxSize() int
- func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
- func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
- func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
- func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
- type IndexerMock
- type KeyGenMock
- func (keyGen *KeyGenMock) CheckPublicKeyValid(b []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 MessengerStub
- type MultipleShardsCoordinatorMock
- func (scm *MultipleShardsCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm *MultipleShardsCoordinatorMock) ComputeId(address []byte) uint32
- func (scm *MultipleShardsCoordinatorMock) IsInterfaceNil() bool
- func (scm *MultipleShardsCoordinatorMock) NumberOfShards() uint32
- func (scm *MultipleShardsCoordinatorMock) SameShard(_, _ []byte) bool
- func (scm *MultipleShardsCoordinatorMock) SelfId() uint32
- func (scm *MultipleShardsCoordinatorMock) SetNoShards(noShards uint32)
- func (scm *MultipleShardsCoordinatorMock) SetSelfId(_ uint32) error
- type NodeRedundancyHandlerStub
- func (nrhs *NodeRedundancyHandlerStub) AdjustInactivityIfNeeded(selfPubKey string, consensusPubKeys []string, roundIndex int64)
- func (nrhs *NodeRedundancyHandlerStub) IsInterfaceNil() bool
- func (nrhs *NodeRedundancyHandlerStub) IsMainMachineActive() bool
- func (nrhs *NodeRedundancyHandlerStub) IsRedundancyNode() bool
- func (nrhs *NodeRedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey
- func (nrhs *NodeRedundancyHandlerStub) ResetInactivityIfNeeded(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID)
- 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) 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) 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) 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 P2PMessageMock
- func (msg *P2PMessageMock) Data() []byte
- func (msg *P2PMessageMock) From() []byte
- func (msg *P2PMessageMock) IsInterfaceNil() bool
- func (msg *P2PMessageMock) Key() []byte
- func (msg *P2PMessageMock) Payload() []byte
- func (msg *P2PMessageMock) Peer() core.PeerID
- func (msg *P2PMessageMock) SeqNo() []byte
- func (msg *P2PMessageMock) Signature() []byte
- func (msg *P2PMessageMock) Timestamp() int64
- func (msg *P2PMessageMock) Topic() string
- type PeerSignatureHandler
- type PrivateKeyMock
- type PublicKeyMock
- type RoundHandlerMock
- func (rndm *RoundHandlerMock) BeforeGenesis() bool
- func (rndm *RoundHandlerMock) Index() int64
- func (rndm *RoundHandlerMock) IsInterfaceNil() bool
- func (rndm *RoundHandlerMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rndm *RoundHandlerMock) TimeDuration() time.Duration
- func (rndm *RoundHandlerMock) TimeStamp() time.Time
- func (rndm *RoundHandlerMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- 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 SingleSignerMock
- type SposWorkerMock
- func (sposWorkerMock *SposWorkerMock) AddReceivedHeaderHandler(handler func(data.HeaderHandler))
- func (sposWorkerMock *SposWorkerMock) AddReceivedMessageCall(messageType consensus.MessageType, ...)
- func (sposWorkerMock *SposWorkerMock) BroadcastBlock(body data.BodyHandler, header data.HeaderHandler) error
- func (sposWorkerMock *SposWorkerMock) Close() error
- func (sposWorkerMock *SposWorkerMock) DisplayStatistics()
- func (sposWorkerMock *SposWorkerMock) ExecuteStoredMessages()
- func (sposWorkerMock *SposWorkerMock) Extend(subroundId int)
- func (sposWorkerMock *SposWorkerMock) GetConsensusStateChangedChannel() chan bool
- func (sposWorkerMock *SposWorkerMock) IsInterfaceNil() bool
- func (sposWorkerMock *SposWorkerMock) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
- func (sposWorkerMock *SposWorkerMock) ReceivedHeader(headerHandler data.HeaderHandler, headerHash []byte)
- func (sposWorkerMock *SposWorkerMock) RemoveAllReceivedMessagesCalls()
- func (sposWorkerMock *SposWorkerMock) ResetConsensusMessages()
- func (sposWorkerMock *SposWorkerMock) SendConsensusMessage(cnsDta *consensus.Message) bool
- func (sposWorkerMock *SposWorkerMock) StartWorking()
- type SubroundHandlerMock
- func (srm *SubroundHandlerMock) ConsensusChannel() chan bool
- func (srm *SubroundHandlerMock) Current() int
- func (srm *SubroundHandlerMock) DoWork(roundHandler consensus.RoundHandler) bool
- func (srm *SubroundHandlerMock) EndTime() int64
- func (srm *SubroundHandlerMock) IsInterfaceNil() bool
- func (srm *SubroundHandlerMock) Name() string
- func (srm *SubroundHandlerMock) Next() int
- func (srm *SubroundHandlerMock) Previous() int
- func (srm *SubroundHandlerMock) StartTime() int64
- type SyncTimerMock
- type ValidatorStatisticsProcessorStub
- type WatchdogMock
- func (w *WatchdogMock) IsInterfaceNil() bool
- func (w *WatchdogMock) Reset(alarmID string)
- func (w *WatchdogMock) Set(callback func(alarmID string), duration time.Duration, alarmID string)
- func (w *WatchdogMock) SetDefault(duration time.Duration, alarmID string)
- func (w *WatchdogMock) Stop(alarmID string)
Constants ¶
This section is empty.
Variables ¶
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")
ErrMockMarshalizer -
Functions ¶
func InitChronologyHandlerMock ¶
func InitChronologyHandlerMock() consensus.ChronologyHandler
InitChronologyHandlerMock -
func InitMultiSignerMock ¶
func InitMultiSignerMock() *cryptoMocks.MultisignerMock
InitMultiSignerMock -
func NewValidator ¶ added in v1.0.102
NewValidator creates a new instance of a validator
Types ¶
type AlarmSchedulerStub ¶ added in v1.2.0
type AlarmSchedulerStub struct { AddCalled func(func(alarmID string), time.Duration, string) CancelCalled func(string) CloseCalled func() ResetCalled func(string) }
func (*AlarmSchedulerStub) Add ¶ added in v1.2.0
func (a *AlarmSchedulerStub) Add(callback func(alarmID string), duration time.Duration, alarmID string)
Add -
func (*AlarmSchedulerStub) Cancel ¶ added in v1.2.0
func (a *AlarmSchedulerStub) Cancel(alarmID string)
Cancel -
func (*AlarmSchedulerStub) IsInterfaceNil ¶ added in v1.2.0
func (a *AlarmSchedulerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AlarmSchedulerStub) Reset ¶ added in v1.2.0
func (a *AlarmSchedulerStub) Reset(alarmID string)
Reset -
type AppStatusHandlerMock ¶
type AppStatusHandlerMock struct { }
AppStatusHandlerMock is an empty implementation of AppStatusHandler in order to be used in constructors
func (*AppStatusHandlerMock) AddUint64 ¶
func (ashs *AppStatusHandlerMock) AddUint64(_ string, _ uint64)
AddUint64 -
func (*AppStatusHandlerMock) Close ¶
func (ashs *AppStatusHandlerMock) Close()
Close won't do anything
func (*AppStatusHandlerMock) Decrement ¶
func (ashs *AppStatusHandlerMock) Decrement(_ string)
Decrement method won't do anything
func (*AppStatusHandlerMock) Increment ¶
func (ashs *AppStatusHandlerMock) Increment(_ string)
Increment method won't do anything
func (*AppStatusHandlerMock) IsInterfaceNil ¶
func (ashs *AppStatusHandlerMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*AppStatusHandlerMock) SetInt64Value ¶
func (ashs *AppStatusHandlerMock) SetInt64Value(_ string, _ int64)
SetInt64Value method won't do anything
func (*AppStatusHandlerMock) SetStringValue ¶
func (ashs *AppStatusHandlerMock) SetStringValue(_ string, _ string)
SetStringValue method won't do anything
func (*AppStatusHandlerMock) SetUInt64Value ¶
func (ashs *AppStatusHandlerMock) SetUInt64Value(_ string, _ uint64)
SetUInt64Value method won't do anything
type AppStatusHandlerStub ¶
type AppStatusHandlerStub struct { AddUint64Handler func(key string, value uint64) IncrementHandler func(key string) DecrementHandler func(key string) SetUInt64ValueHandler func(key string, value uint64) SetInt64ValueHandler func(key string, value int64) SetStringValueHandler func(key string, value string) CloseHandler func() }
AppStatusHandlerStub is a stub implementation of AppStatusHandler
func (*AppStatusHandlerStub) AddUint64 ¶
func (ashs *AppStatusHandlerStub) AddUint64(key string, value uint64)
AddUint64 will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) Close ¶
func (ashs *AppStatusHandlerStub) Close()
Close will call the handler of the stub for closing
func (*AppStatusHandlerStub) Decrement ¶
func (ashs *AppStatusHandlerStub) Decrement(key string)
Decrement will call the handler of the stub for decrementing
func (*AppStatusHandlerStub) Increment ¶
func (ashs *AppStatusHandlerStub) Increment(key string)
Increment will call the handler of the stub for incrementing
func (*AppStatusHandlerStub) IsInterfaceNil ¶
func (ashs *AppStatusHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*AppStatusHandlerStub) SetInt64Value ¶
func (ashs *AppStatusHandlerStub) SetInt64Value(key string, value int64)
SetInt64Value will call the handler of the stub for setting an int64 value
func (*AppStatusHandlerStub) SetStringValue ¶
func (ashs *AppStatusHandlerStub) SetStringValue(key string, value string)
SetStringValue will call the handler of the stub for setting an uint64 value
func (*AppStatusHandlerStub) SetUInt64Value ¶
func (ashs *AppStatusHandlerStub) SetUInt64Value(key string, value uint64)
SetUInt64Value will call the handler of the stub for setting an uint64 value
type BlockChainMock ¶
type BlockChainMock struct { GetGenesisHeaderCalled func() data.HeaderHandler SetGenesisHeaderCalled func(handler data.HeaderHandler) error GetGenesisHeaderHashCalled func() []byte SetGenesisHeaderHashCalled func([]byte) GetCurrentBlockHeaderCalled func() data.HeaderHandler SetCurrentBlockHeaderCalled func(data.HeaderHandler) error GetCurrentBlockHeaderHashCalled func() []byte SetCurrentBlockHeaderHashCalled func([]byte) GetLocalHeightCalled func() int64 SetLocalHeightCalled func(int64) GetNetworkHeightCalled func() int64 SetNetworkHeightCalled func(int64) HasBadBlockCalled func([]byte) bool PutBadBlockCalled func([]byte) CreateNewHeaderCalled func() data.HeaderHandler }
BlockChainMock is a mock implementation of the blockchain interface
func (*BlockChainMock) CreateNewHeader ¶
func (bc *BlockChainMock) CreateNewHeader() data.HeaderHandler
CreateNewHeader -
func (*BlockChainMock) GetCurrentBlockHeader ¶
func (bc *BlockChainMock) GetCurrentBlockHeader() data.HeaderHandler
GetCurrentBlockHeader returns current block header pointer
func (*BlockChainMock) GetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) GetCurrentBlockHeaderHash() []byte
GetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) GetGenesisHeader ¶
func (bc *BlockChainMock) GetGenesisHeader() data.HeaderHandler
GetGenesisHeader returns the genesis block header pointer
func (*BlockChainMock) GetGenesisHeaderHash ¶
func (bc *BlockChainMock) GetGenesisHeaderHash() []byte
GetGenesisHeaderHash returns the genesis block header hash
func (*BlockChainMock) IsInterfaceNil ¶
func (bc *BlockChainMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockChainMock) SetCurrentBlockHeader ¶
func (bc *BlockChainMock) SetCurrentBlockHeader(header data.HeaderHandler) error
SetCurrentBlockHeader sets current block header pointer
func (*BlockChainMock) SetCurrentBlockHeaderHash ¶
func (bc *BlockChainMock) SetCurrentBlockHeaderHash(hash []byte)
SetCurrentBlockHeaderHash returns the current block header hash
func (*BlockChainMock) SetGenesisHeader ¶
func (bc *BlockChainMock) SetGenesisHeader(genesisBlock data.HeaderHandler) error
SetGenesisHeader sets the genesis block header pointer
func (*BlockChainMock) SetGenesisHeaderHash ¶
func (bc *BlockChainMock) SetGenesisHeaderHash(hash []byte)
SetGenesisHeaderHash sets the genesis block header hash
type BlockProcessorMock ¶
type BlockProcessorMock struct { ProcessBlockCalled func(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error CommitBlockCalled func(header data.HeaderHandler, body data.BodyHandler) error RevertAccountStateCalled func(header data.HeaderHandler) PruneStateOnRollbackCalled func(currHeader data.HeaderHandler, prevHeader data.HeaderHandler) CreateGenesisBlockCalled func(balances map[string]*big.Int) (data.HeaderHandler, error) CreateBlockCalled func(initialHdrData data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, data.BodyHandler, error) RestoreBlockIntoPoolsCalled func(header data.HeaderHandler, body data.BodyHandler) error SetOnRequestTransactionCalled func(f func(destShardID uint32, txHash []byte)) MarshalizedDataToBroadcastCalled func(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error) DecodeBlockBodyCalled func(dta []byte) data.BodyHandler DecodeBlockHeaderCalled func(dta []byte) data.HeaderHandler AddLastNotarizedHdrCalled func(shardId uint32, processedHdr data.HeaderHandler) CreateNewHeaderCalled func(round uint64, nonce uint64) data.HeaderHandler RevertStateToBlockCalled func(header data.HeaderHandler) error RevertIndexedBlockCalled func(header data.HeaderHandler) }
BlockProcessorMock mocks the implementation for a blockProcessor
func InitBlockProcessorMock ¶
func InitBlockProcessorMock() *BlockProcessorMock
InitBlockProcessorMock -
func (*BlockProcessorMock) AddLastNotarizedHdr ¶
func (bpm *BlockProcessorMock) AddLastNotarizedHdr(shardId uint32, processedHdr data.HeaderHandler)
AddLastNotarizedHdr -
func (*BlockProcessorMock) ApplyProcessedMiniBlocks ¶
func (bpm *BlockProcessorMock) ApplyProcessedMiniBlocks(_ *processedMb.ProcessedMiniBlockTracker)
ApplyProcessedMiniBlocks -
func (*BlockProcessorMock) Close ¶ added in v1.2.0
func (bpm *BlockProcessorMock) Close() error
Close -
func (*BlockProcessorMock) CommitBlock ¶
func (bpm *BlockProcessorMock) CommitBlock(header data.HeaderHandler, body data.BodyHandler) error
CommitBlock mocks the commit of a block
func (*BlockProcessorMock) CreateBlock ¶
func (bpm *BlockProcessorMock) CreateBlock(initialHdrData data.HeaderHandler, haveTime func() bool) (data.HeaderHandler, data.BodyHandler, error)
CreateBlock mocks the creation of a new block with header and body
func (*BlockProcessorMock) CreateNewHeader ¶
func (bpm *BlockProcessorMock) CreateNewHeader(round uint64, nonce uint64) data.HeaderHandler
CreateNewHeader -
func (*BlockProcessorMock) DecodeBlockBody ¶
func (bpm *BlockProcessorMock) DecodeBlockBody(dta []byte) data.BodyHandler
DecodeBlockBody -
func (*BlockProcessorMock) DecodeBlockHeader ¶
func (bpm *BlockProcessorMock) DecodeBlockHeader(dta []byte) data.HeaderHandler
DecodeBlockHeader -
func (*BlockProcessorMock) IsInterfaceNil ¶
func (bpm *BlockProcessorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BlockProcessorMock) MarshalizedDataToBroadcast ¶
func (bpm *BlockProcessorMock) MarshalizedDataToBroadcast(header data.HeaderHandler, body data.BodyHandler) (map[uint32][]byte, map[string][][]byte, error)
MarshalizedDataToBroadcast -
func (*BlockProcessorMock) ProcessBlock ¶
func (bpm *BlockProcessorMock) ProcessBlock(header data.HeaderHandler, body data.BodyHandler, haveTime func() time.Duration) error
ProcessBlock mocks pocessing a block
func (*BlockProcessorMock) PruneStateOnRollback ¶
func (bpm *BlockProcessorMock) PruneStateOnRollback(currHeader data.HeaderHandler, prevHeader data.HeaderHandler)
PruneStateOnRollback recreates the state tries to the root hashes indicated by the provided header
func (*BlockProcessorMock) RestoreBlockIntoPools ¶
func (bpm *BlockProcessorMock) RestoreBlockIntoPools(header data.HeaderHandler, body data.BodyHandler) error
RestoreBlockIntoPools -
func (*BlockProcessorMock) RestoreLastNotarizedHrdsToGenesis ¶
func (bpm *BlockProcessorMock) RestoreLastNotarizedHrdsToGenesis()
RestoreLastNotarizedHrdsToGenesis -
func (*BlockProcessorMock) RevertAccountState ¶
func (bpm *BlockProcessorMock) RevertAccountState(header data.HeaderHandler)
RevertAccountState mocks revert of the accounts state
func (*BlockProcessorMock) RevertIndexedBlock ¶ added in v1.1.6
func (bpm *BlockProcessorMock) RevertIndexedBlock(header data.HeaderHandler)
RevertIndexedBlock -
func (*BlockProcessorMock) RevertStateToBlock ¶
func (bpm *BlockProcessorMock) RevertStateToBlock(header data.HeaderHandler) error
RevertStateToBlock recreates the state tries to the root hashes indicated by the provided header
func (*BlockProcessorMock) SetNumProcessedObj ¶
func (bpm *BlockProcessorMock) SetNumProcessedObj(_ uint64)
SetNumProcessedObj -
type BootstrapperMock ¶
type BootstrapperMock struct { CreateAndCommitEmptyBlockCalled func(uint32) (data.BodyHandler, data.HeaderHandler, error) AddSyncStateListenerCalled func(func(bool)) GetNodeStateCalled func() common.NodeState StartSyncingBlocksCalled func() }
BootstrapperMock mocks the implementation for a Bootstrapper
func (*BootstrapperMock) AddSyncStateListener ¶
func (boot *BootstrapperMock) AddSyncStateListener(syncStateNotifier func(isSyncing bool))
AddSyncStateListener -
func (*BootstrapperMock) Close ¶ added in v1.0.116
func (boot *BootstrapperMock) Close() error
Close -
func (*BootstrapperMock) CreateAndCommitEmptyBlock ¶
func (boot *BootstrapperMock) CreateAndCommitEmptyBlock(shardForCurrentNode uint32) (data.BodyHandler, data.HeaderHandler, error)
CreateAndCommitEmptyBlock -
func (*BootstrapperMock) GetNodeState ¶
func (boot *BootstrapperMock) GetNodeState() common.NodeState
GetNodeState -
func (*BootstrapperMock) IsInterfaceNil ¶
func (boot *BootstrapperMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BootstrapperMock) StartSyncingBlocks ¶ added in v1.0.116
func (boot *BootstrapperMock) StartSyncingBlocks()
StartSyncingBlocks -
type BroadcastMessengerMock ¶
type BroadcastMessengerMock struct { BroadcastBlockCalled func(data.BodyHandler, data.HeaderHandler) error BroadcastHeaderCalled func(data.HeaderHandler) error PrepareBroadcastBlockDataValidatorCalled func(h data.HeaderHandler, mbs map[uint32][]byte, txs map[string][][]byte, idx int) error PrepareBroadcastHeaderValidatorCalled func(h data.HeaderHandler, mbs map[uint32][]byte, txs map[string][][]byte, idx int) BroadcastMiniBlocksCalled func(map[uint32][]byte) error BroadcastTransactionsCalled func(map[string][][]byte) error BroadcastConsensusMessageCalled func(*consensus.Message) error BroadcastBlockDataLeaderCalled func(h data.HeaderHandler, mbs map[uint32][]byte, txs map[string][][]byte) error }
BroadcastMessengerMock -
func (*BroadcastMessengerMock) BroadcastBlock ¶
func (bmm *BroadcastMessengerMock) BroadcastBlock(bodyHandler data.BodyHandler, headerhandler data.HeaderHandler) error
BroadcastBlock -
func (*BroadcastMessengerMock) BroadcastBlockDataLeader ¶ added in v1.0.133
func (bmm *BroadcastMessengerMock) BroadcastBlockDataLeader( header data.HeaderHandler, miniBlocks map[uint32][]byte, transactions map[string][][]byte, ) error
BroadcastBlockDataLeader -
func (*BroadcastMessengerMock) BroadcastConsensusMessage ¶
func (bmm *BroadcastMessengerMock) BroadcastConsensusMessage(message *consensus.Message) error
BroadcastConsensusMessage -
func (*BroadcastMessengerMock) BroadcastHeader ¶
func (bmm *BroadcastMessengerMock) BroadcastHeader(headerhandler data.HeaderHandler) error
BroadcastHeader -
func (*BroadcastMessengerMock) BroadcastMiniBlocks ¶
func (bmm *BroadcastMessengerMock) BroadcastMiniBlocks(miniBlocks map[uint32][]byte) error
BroadcastMiniBlocks -
func (*BroadcastMessengerMock) BroadcastTransactions ¶
func (bmm *BroadcastMessengerMock) BroadcastTransactions(transactions map[string][][]byte) error
BroadcastTransactions -
func (*BroadcastMessengerMock) IsInterfaceNil ¶
func (bmm *BroadcastMessengerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BroadcastMessengerMock) PrepareBroadcastBlockDataValidator ¶ added in v1.0.133
func (bmm *BroadcastMessengerMock) PrepareBroadcastBlockDataValidator( header data.HeaderHandler, miniBlocks map[uint32][]byte, transactions map[string][][]byte, idx int, )
PrepareBroadcastBlockDataValidator -
func (*BroadcastMessengerMock) PrepareBroadcastHeaderValidator ¶ added in v1.0.133
func (bmm *BroadcastMessengerMock) PrepareBroadcastHeaderValidator( header data.HeaderHandler, miniBlocks map[uint32][]byte, transactions map[string][][]byte, order int, )
PrepareBroadcastHeaderValidator -
type ChronologyHandlerMock ¶
type ChronologyHandlerMock struct { AddSubroundCalled func(consensus.SubroundHandler) RemoveAllSubroundsCalled func() StartRoundCalled func() EpochCalled func() uint32 }
ChronologyHandlerMock -
func (*ChronologyHandlerMock) AddSubround ¶
func (chrm *ChronologyHandlerMock) AddSubround(subroundHandler consensus.SubroundHandler)
AddSubround -
func (*ChronologyHandlerMock) Close ¶ added in v1.0.116
func (chrm *ChronologyHandlerMock) Close() error
Close -
func (*ChronologyHandlerMock) IsInterfaceNil ¶
func (chrm *ChronologyHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ChronologyHandlerMock) RemoveAllSubrounds ¶
func (chrm *ChronologyHandlerMock) RemoveAllSubrounds()
RemoveAllSubrounds -
func (*ChronologyHandlerMock) StartRounds ¶
func (chrm *ChronologyHandlerMock) StartRounds()
StartRounds -
type ConsensusCoreMock ¶
type ConsensusCoreMock struct {
// contains filtered or unexported fields
}
ConsensusCoreMock -
func InitConsensusCoreWithMultiSigner ¶ added in v1.2.14
func InitConsensusCoreWithMultiSigner(multiSigner crypto.MultiSigner) *ConsensusCoreMock
InitConsensusCoreWithMultiSigner -
func (*ConsensusCoreMock) BlockProcessor ¶
func (ccm *ConsensusCoreMock) BlockProcessor() process.BlockProcessor
BlockProcessor -
func (*ConsensusCoreMock) Blockchain ¶
func (ccm *ConsensusCoreMock) Blockchain() data.ChainHandler
Blockchain -
func (*ConsensusCoreMock) BootStrapper ¶
func (ccm *ConsensusCoreMock) BootStrapper() process.Bootstrapper
BootStrapper -
func (*ConsensusCoreMock) BroadcastMessenger ¶
func (ccm *ConsensusCoreMock) BroadcastMessenger() consensus.BroadcastMessenger
BroadcastMessenger -
func (*ConsensusCoreMock) Chronology ¶
func (ccm *ConsensusCoreMock) Chronology() consensus.ChronologyHandler
Chronology -
func (*ConsensusCoreMock) EpochStartRegistrationHandler ¶ added in v1.0.102
func (ccm *ConsensusCoreMock) EpochStartRegistrationHandler() epochStart.RegistrationHandler
EpochStartRegistrationHandler -
func (*ConsensusCoreMock) FallbackHeaderValidator ¶ added in v1.1.3
func (ccm *ConsensusCoreMock) FallbackHeaderValidator() consensus.FallbackHeaderValidator
FallbackHeaderValidator -
func (*ConsensusCoreMock) GetAntiFloodHandler ¶
func (ccm *ConsensusCoreMock) GetAntiFloodHandler() consensus.P2PAntifloodHandler
GetAntiFloodHandler -
func (*ConsensusCoreMock) HeaderSigVerifier ¶ added in v1.1.2
func (ccm *ConsensusCoreMock) HeaderSigVerifier() consensus.HeaderSigVerifier
HeaderSigVerifier -
func (*ConsensusCoreMock) HeadersPoolSubscriber ¶ added in v1.0.106
func (ccm *ConsensusCoreMock) HeadersPoolSubscriber() consensus.HeadersPoolSubscriber
HeadersPoolSubscriber -
func (*ConsensusCoreMock) IsInterfaceNil ¶
func (ccm *ConsensusCoreMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ConsensusCoreMock) Marshalizer ¶
func (ccm *ConsensusCoreMock) Marshalizer() marshal.Marshalizer
Marshalizer -
func (*ConsensusCoreMock) MultiSigner ¶
func (ccm *ConsensusCoreMock) MultiSigner() crypto.MultiSigner
MultiSigner -
func (*ConsensusCoreMock) NodeRedundancyHandler ¶ added in v1.1.31
func (ccm *ConsensusCoreMock) NodeRedundancyHandler() consensus.NodeRedundancyHandler
NodeRedundancyHandler -
func (*ConsensusCoreMock) NodesCoordinator ¶
func (ccm *ConsensusCoreMock) NodesCoordinator() sharding.NodesCoordinator
NodesCoordinator -
func (*ConsensusCoreMock) PeerHonestyHandler ¶ added in v1.0.133
func (ccm *ConsensusCoreMock) PeerHonestyHandler() consensus.PeerHonestyHandler
PeerHonestyHandler -
func (*ConsensusCoreMock) PrivateKey ¶
func (ccm *ConsensusCoreMock) PrivateKey() crypto.PrivateKey
PrivateKey -
func (*ConsensusCoreMock) RoundHandler ¶ added in v1.2.0
func (ccm *ConsensusCoreMock) RoundHandler() consensus.RoundHandler
RoundHandler -
func (*ConsensusCoreMock) SetBlockProcessor ¶
func (ccm *ConsensusCoreMock) SetBlockProcessor(blockProcessor process.BlockProcessor)
SetBlockProcessor -
func (*ConsensusCoreMock) SetBlockchain ¶
func (ccm *ConsensusCoreMock) SetBlockchain(blockChain data.ChainHandler)
SetBlockchain -
func (*ConsensusCoreMock) SetBootStrapper ¶
func (ccm *ConsensusCoreMock) SetBootStrapper(bootstrapper process.Bootstrapper)
SetBootStrapper -
func (*ConsensusCoreMock) SetBroadcastMessenger ¶
func (ccm *ConsensusCoreMock) SetBroadcastMessenger(broadcastMessenger consensus.BroadcastMessenger)
SetBroadcastMessenger -
func (*ConsensusCoreMock) SetChronology ¶
func (ccm *ConsensusCoreMock) SetChronology(chronologyHandler consensus.ChronologyHandler)
SetChronology -
func (*ConsensusCoreMock) SetFallbackHeaderValidator ¶ added in v1.1.3
func (ccm *ConsensusCoreMock) SetFallbackHeaderValidator(fallbackHeaderValidator consensus.FallbackHeaderValidator)
SetFallbackHeaderValidator -
func (*ConsensusCoreMock) SetHasher ¶
func (ccm *ConsensusCoreMock) SetHasher(hasher hashing.Hasher)
SetHasher -
func (*ConsensusCoreMock) SetHeaderSigVerifier ¶ added in v1.1.2
func (ccm *ConsensusCoreMock) SetHeaderSigVerifier(headerSigVerifier consensus.HeaderSigVerifier)
SetHeaderSigVerifier -
func (*ConsensusCoreMock) SetMarshalizer ¶
func (ccm *ConsensusCoreMock) SetMarshalizer(marshalizer marshal.Marshalizer)
SetMarshalizer -
func (*ConsensusCoreMock) SetMultiSigner ¶
func (ccm *ConsensusCoreMock) SetMultiSigner(multiSigner crypto.MultiSigner)
SetMultiSigner -
func (*ConsensusCoreMock) SetNodeRedundancyHandler ¶ added in v1.1.31
func (ccm *ConsensusCoreMock) SetNodeRedundancyHandler(nodeRedundancyHandler consensus.NodeRedundancyHandler)
SetNodeRedundancyHandler -
func (*ConsensusCoreMock) SetRoundHandler ¶ added in v1.2.0
func (ccm *ConsensusCoreMock) SetRoundHandler(roundHandler consensus.RoundHandler)
SetRoundHandler -
func (*ConsensusCoreMock) SetShardCoordinator ¶
func (ccm *ConsensusCoreMock) SetShardCoordinator(shardCoordinator sharding.Coordinator)
SetShardCoordinator -
func (*ConsensusCoreMock) SetSingleSigner ¶
func (ccm *ConsensusCoreMock) SetSingleSigner(signer crypto.SingleSigner)
SetSingleSigner -
func (*ConsensusCoreMock) SetSyncTimer ¶
func (ccm *ConsensusCoreMock) SetSyncTimer(syncTimer ntp.SyncTimer)
SetSyncTimer -
func (*ConsensusCoreMock) SetValidatorGroupSelector ¶
func (ccm *ConsensusCoreMock) SetValidatorGroupSelector(validatorGroupSelector sharding.NodesCoordinator)
SetValidatorGroupSelector -
func (*ConsensusCoreMock) ShardCoordinator ¶
func (ccm *ConsensusCoreMock) ShardCoordinator() sharding.Coordinator
ShardCoordinator -
func (*ConsensusCoreMock) SingleSigner ¶
func (ccm *ConsensusCoreMock) SingleSigner() crypto.SingleSigner
SingleSigner returns the bls single signer stored in the ConsensusStore
func (*ConsensusCoreMock) SyncTimer ¶
func (ccm *ConsensusCoreMock) SyncTimer() ntp.SyncTimer
SyncTimer -
type ConsensusStateMock ¶
type ConsensusStateMock struct { ResetConsensusStateCalled func() IsNodeLeaderInCurrentRoundCalled func(node string) bool IsSelfLeaderInCurrentRoundCalled func() bool GetLeaderCalled func() (string, error) GetNextConsensusGroupCalled func(randomSource string, vgs sharding.NodesCoordinator) ([]string, error) IsConsensusDataSetCalled func() bool IsConsensusDataEqualCalled func(data []byte) bool IsJobDoneCalled func(node string, currentSubroundId int) bool IsSelfJobDoneCalled func(currentSubroundId int) bool IsCurrentSubroundFinishedCalled func(currentSubroundId int) bool IsNodeSelfCalled func(node string) bool IsBlockBodyAlreadyReceivedCalled func() bool IsHeaderAlreadyReceivedCalled func() bool CanDoSubroundJobCalled func(currentSubroundId int) bool CanProcessReceivedMessageCalled func(cnsDta consensus.Message, currentRoundIndex int32, currentSubroundId int) bool GenerateBitmapCalled func(subroundId int) []byte ProcessingBlockCalled func() bool SetProcessingBlockCalled func(processingBlock bool) ConsensusGroupSizeCalled func() int SetThresholdCalled func(subroundId int, threshold int) }
ConsensusStateMock -
func (*ConsensusStateMock) CanDoSubroundJob ¶
func (cnsm *ConsensusStateMock) CanDoSubroundJob(currentSubroundId int) bool
CanDoSubroundJob -
func (*ConsensusStateMock) CanProcessReceivedMessage ¶
func (cnsm *ConsensusStateMock) CanProcessReceivedMessage( cnsDta consensus.Message, currentRoundIndex int32, currentSubroundId int, ) bool
CanProcessReceivedMessage -
func (*ConsensusStateMock) ConsensusGroupSize ¶
func (cnsm *ConsensusStateMock) ConsensusGroupSize() int
ConsensusGroupSize -
func (*ConsensusStateMock) GenerateBitmap ¶
func (cnsm *ConsensusStateMock) GenerateBitmap(subroundId int) []byte
GenerateBitmap -
func (*ConsensusStateMock) GetLeader ¶
func (cnsm *ConsensusStateMock) GetLeader() (string, error)
GetLeader -
func (*ConsensusStateMock) GetNextConsensusGroup ¶
func (cnsm *ConsensusStateMock) GetNextConsensusGroup( randomSource string, vgs sharding.NodesCoordinator, ) ([]string, error)
GetNextConsensusGroup -
func (*ConsensusStateMock) IsBlockBodyAlreadyReceived ¶
func (cnsm *ConsensusStateMock) IsBlockBodyAlreadyReceived() bool
IsBlockBodyAlreadyReceived -
func (*ConsensusStateMock) IsConsensusDataEqual ¶
func (cnsm *ConsensusStateMock) IsConsensusDataEqual(data []byte) bool
IsConsensusDataEqual -
func (*ConsensusStateMock) IsConsensusDataSet ¶
func (cnsm *ConsensusStateMock) IsConsensusDataSet() bool
IsConsensusDataSet -
func (*ConsensusStateMock) IsCurrentSubroundFinished ¶
func (cnsm *ConsensusStateMock) IsCurrentSubroundFinished(currentSubroundId int) bool
IsCurrentSubroundFinished -
func (*ConsensusStateMock) IsHeaderAlreadyReceived ¶
func (cnsm *ConsensusStateMock) IsHeaderAlreadyReceived() bool
IsHeaderAlreadyReceived -
func (*ConsensusStateMock) IsJobDone ¶
func (cnsm *ConsensusStateMock) IsJobDone(node string, currentSubroundId int) bool
IsJobDone -
func (*ConsensusStateMock) IsNodeLeaderInCurrentRound ¶
func (cnsm *ConsensusStateMock) IsNodeLeaderInCurrentRound(node string) bool
IsNodeLeaderInCurrentRound -
func (*ConsensusStateMock) IsNodeSelf ¶
func (cnsm *ConsensusStateMock) IsNodeSelf(node string) bool
IsNodeSelf -
func (*ConsensusStateMock) IsSelfJobDone ¶
func (cnsm *ConsensusStateMock) IsSelfJobDone(currentSubroundId int) bool
IsSelfJobDone -
func (*ConsensusStateMock) IsSelfLeaderInCurrentRound ¶
func (cnsm *ConsensusStateMock) IsSelfLeaderInCurrentRound() bool
IsSelfLeaderInCurrentRound -
func (*ConsensusStateMock) ProcessingBlock ¶
func (cnsm *ConsensusStateMock) ProcessingBlock() bool
ProcessingBlock -
func (*ConsensusStateMock) ResetConsensusState ¶
func (cnsm *ConsensusStateMock) ResetConsensusState()
ResetConsensusState -
func (*ConsensusStateMock) SetProcessingBlock ¶
func (cnsm *ConsensusStateMock) SetProcessingBlock(processingBlock bool)
SetProcessingBlock -
func (*ConsensusStateMock) SetThreshold ¶
func (cnsm *ConsensusStateMock) SetThreshold(subroundId int, threshold int)
SetThreshold -
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 ForkDetectorMock ¶
type ForkDetectorMock struct { AddHeaderCalled func(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error RemoveHeaderCalled func(nonce uint64, hash []byte) CheckForkCalled func() *process.ForkInfo GetHighestFinalBlockNonceCalled func() uint64 GetHighestFinalBlockHashCalled func() []byte ProbableHighestNonceCalled func() uint64 ResetForkCalled func() GetNotarizedHeaderHashCalled func(nonce uint64) []byte SetRollBackNonceCalled func(nonce uint64) RestoreToGenesisCalled func() ResetProbableHighestNonceCalled func() SetFinalToLastCheckpointCalled func() }
ForkDetectorMock -
func (*ForkDetectorMock) AddHeader ¶
func (fdm *ForkDetectorMock) AddHeader(header data.HeaderHandler, hash []byte, state process.BlockHeaderState, selfNotarizedHeaders []data.HeaderHandler, selfNotarizedHeadersHashes [][]byte) error
AddHeader -
func (*ForkDetectorMock) CheckFork ¶
func (fdm *ForkDetectorMock) CheckFork() *process.ForkInfo
CheckFork -
func (*ForkDetectorMock) GetHighestFinalBlockHash ¶
func (fdm *ForkDetectorMock) GetHighestFinalBlockHash() []byte
GetHighestFinalBlockHash -
func (*ForkDetectorMock) GetHighestFinalBlockNonce ¶
func (fdm *ForkDetectorMock) GetHighestFinalBlockNonce() uint64
GetHighestFinalBlockNonce -
func (*ForkDetectorMock) GetNotarizedHeaderHash ¶
func (fdm *ForkDetectorMock) GetNotarizedHeaderHash(nonce uint64) []byte
GetNotarizedHeaderHash -
func (*ForkDetectorMock) IsInterfaceNil ¶
func (fdm *ForkDetectorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ForkDetectorMock) ProbableHighestNonce ¶
func (fdm *ForkDetectorMock) ProbableHighestNonce() uint64
ProbableHighestNonce -
func (*ForkDetectorMock) RemoveHeader ¶
func (fdm *ForkDetectorMock) RemoveHeader(nonce uint64, hash []byte)
RemoveHeader -
func (*ForkDetectorMock) ResetProbableHighestNonce ¶
func (fdm *ForkDetectorMock) ResetProbableHighestNonce()
ResetProbableHighestNonce -
func (*ForkDetectorMock) RestoreToGenesis ¶
func (fdm *ForkDetectorMock) RestoreToGenesis()
RestoreToGenesis -
func (*ForkDetectorMock) SetFinalToLastCheckpoint ¶ added in v1.1.1
func (fdm *ForkDetectorMock) SetFinalToLastCheckpoint()
SetFinalToLastCheckpoint -
func (*ForkDetectorMock) SetRollBackNonce ¶
func (fdm *ForkDetectorMock) SetRollBackNonce(nonce uint64)
SetRollBackNonce -
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 HeaderIntegrityVerifierStub ¶ added in v1.0.117
type HeaderIntegrityVerifierStub struct { VerifyCalled func(header data.HeaderHandler) error GetVersionCalled func(epoch uint32) string }
HeaderIntegrityVerifierStub -
func (*HeaderIntegrityVerifierStub) GetVersion ¶ added in v1.1.1
func (h *HeaderIntegrityVerifierStub) GetVersion(epoch uint32) string
GetVersion -
func (*HeaderIntegrityVerifierStub) IsInterfaceNil ¶ added in v1.0.117
func (h *HeaderIntegrityVerifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeaderIntegrityVerifierStub) Verify ¶ added in v1.0.117
func (h *HeaderIntegrityVerifierStub) Verify(header data.HeaderHandler) error
Verify -
type HeaderSigVerifierStub ¶
type HeaderSigVerifierStub struct { VerifyRandSeedAndLeaderSignatureCalled func(header data.HeaderHandler) error VerifySignatureCalled func(header data.HeaderHandler) error VerifyRandSeedCalled func(header data.HeaderHandler) error VerifyLeaderSignatureCalled func(header data.HeaderHandler) error }
HeaderSigVerifierStub -
func (*HeaderSigVerifierStub) IsInterfaceNil ¶
func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeaderSigVerifierStub) VerifyLeaderSignature ¶ added in v1.1.2
func (hsvm *HeaderSigVerifierStub) VerifyLeaderSignature(header data.HeaderHandler) error
VerifyLeaderSignature -
func (*HeaderSigVerifierStub) VerifyRandSeed ¶
func (hsvm *HeaderSigVerifierStub) VerifyRandSeed(header data.HeaderHandler) error
VerifyRandSeed -
func (*HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature ¶ added in v1.1.2
func (hsvm *HeaderSigVerifierStub) VerifyRandSeedAndLeaderSignature(header data.HeaderHandler) error
VerifyRandSeedAndLeaderSignature -
func (*HeaderSigVerifierStub) VerifySignature ¶ added in v1.1.2
func (hsvm *HeaderSigVerifierStub) VerifySignature(header data.HeaderHandler) error
VerifySignature -
type HeadersCacherStub ¶ added in v1.0.106
type HeadersCacherStub struct { AddCalled func(headerHash []byte, header data.HeaderHandler) RemoveHeaderByHashCalled func(headerHash []byte) RemoveHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32) GetHeaderByNonceAndShardIdCalled func(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error) GetHeaderByHashCalled func(hash []byte) (data.HeaderHandler, error) ClearCalled func() RegisterHandlerCalled func(handler func(header data.HeaderHandler, shardHeaderHash []byte)) NoncesCalled func(shardId uint32) []uint64 LenCalled func() int MaxSizeCalled func() int GetNumHeadersCalled func(shardId uint32) int }
HeadersCacherStub -
func (*HeadersCacherStub) AddHeader ¶ added in v1.0.106
func (hcs *HeadersCacherStub) AddHeader(headerHash []byte, header data.HeaderHandler)
AddHeader -
func (*HeadersCacherStub) GetHeaderByHash ¶ added in v1.0.106
func (hcs *HeadersCacherStub) GetHeaderByHash(hash []byte) (data.HeaderHandler, error)
GetHeaderByHash -
func (*HeadersCacherStub) GetHeadersByNonceAndShardId ¶ added in v1.0.106
func (hcs *HeadersCacherStub) GetHeadersByNonceAndShardId(hdrNonce uint64, shardId uint32) ([]data.HeaderHandler, [][]byte, error)
GetHeadersByNonceAndShardId -
func (*HeadersCacherStub) GetNumHeaders ¶ added in v1.0.106
func (hcs *HeadersCacherStub) GetNumHeaders(shardId uint32) int
GetNumHeaders -
func (*HeadersCacherStub) IsInterfaceNil ¶ added in v1.0.106
func (hcs *HeadersCacherStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeadersCacherStub) MaxSize ¶ added in v1.0.106
func (hcs *HeadersCacherStub) MaxSize() int
MaxSize -
func (*HeadersCacherStub) Nonces ¶ added in v1.0.106
func (hcs *HeadersCacherStub) Nonces(shardId uint32) []uint64
Nonces -
func (*HeadersCacherStub) RegisterHandler ¶ added in v1.0.106
func (hcs *HeadersCacherStub) RegisterHandler(handler func(header data.HeaderHandler, shardHeaderHash []byte))
RegisterHandler -
func (*HeadersCacherStub) RemoveHeaderByHash ¶ added in v1.0.106
func (hcs *HeadersCacherStub) RemoveHeaderByHash(headerHash []byte)
RemoveHeaderByHash -
func (*HeadersCacherStub) RemoveHeaderByNonceAndShardId ¶ added in v1.0.106
func (hcs *HeadersCacherStub) RemoveHeaderByNonceAndShardId(hdrNonce uint64, shardId uint32)
RemoveHeaderByNonceAndShardId -
type IndexerMock ¶
type IndexerMock struct{}
IndexerMock is a mock implementation fot the Indexer interface
func (*IndexerMock) SaveRoundsInfo ¶ added in v1.1.6
func (im *IndexerMock) SaveRoundsInfo(_ []*indexer.RoundInfo)
SaveRoundsInfo -
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) CheckPublicKeyValidMock func(b []byte) error SuiteMock func() crypto.Suite }
KeyGenMock mocks a key generation implementation
func (*KeyGenMock) CheckPublicKeyValid ¶ added in v1.0.120
func (keyGen *KeyGenMock) CheckPublicKeyValid(b []byte) error
CheckPublicKeyValid verifies the validity of the public key
func (*KeyGenMock) GeneratePair ¶
func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)
GeneratePair generates a pair of private and public keys
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 generates the private key from it's byte array representation
func (*KeyGenMock) PublicKeyFromByteArray ¶
func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)
PublicKeyFromByteArray generates a public key from it's byte array representation
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 MessengerStub ¶
MessengerStub -
func (*MessengerStub) Broadcast ¶
func (ms *MessengerStub) Broadcast(topic string, buff []byte)
Broadcast -
func (*MessengerStub) IsInterfaceNil ¶
func (ms *MessengerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type MultipleShardsCoordinatorMock ¶
type MultipleShardsCoordinatorMock struct { NoShards uint32 CurrentShard uint32 ComputeIdCalled func(address []byte) uint32 SelfIDCalled func() uint32 }
MultipleShardsCoordinatorMock -
func NewMultiShardsCoordinatorMock ¶
func NewMultiShardsCoordinatorMock(nrShard uint32) *MultipleShardsCoordinatorMock
NewMultiShardsCoordinatorMock -
func (*MultipleShardsCoordinatorMock) CommunicationIdentifier ¶
func (scm *MultipleShardsCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier returns the identifier between current shard ID and destination shard ID identifier is generated such as the first shard from identifier is always smaller than the last
func (*MultipleShardsCoordinatorMock) ComputeId ¶
func (scm *MultipleShardsCoordinatorMock) ComputeId(address []byte) uint32
ComputeId -
func (*MultipleShardsCoordinatorMock) IsInterfaceNil ¶
func (scm *MultipleShardsCoordinatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*MultipleShardsCoordinatorMock) NumberOfShards ¶
func (scm *MultipleShardsCoordinatorMock) NumberOfShards() uint32
NumberOfShards -
func (*MultipleShardsCoordinatorMock) SameShard ¶
func (scm *MultipleShardsCoordinatorMock) SameShard(_, _ []byte) bool
SameShard -
func (*MultipleShardsCoordinatorMock) SelfId ¶
func (scm *MultipleShardsCoordinatorMock) SelfId() uint32
SelfId -
func (*MultipleShardsCoordinatorMock) SetNoShards ¶
func (scm *MultipleShardsCoordinatorMock) SetNoShards(noShards uint32)
SetNoShards -
func (*MultipleShardsCoordinatorMock) SetSelfId ¶
func (scm *MultipleShardsCoordinatorMock) SetSelfId(_ uint32) error
SetSelfId -
type NodeRedundancyHandlerStub ¶ added in v1.1.31
type NodeRedundancyHandlerStub struct { IsRedundancyNodeCalled func() bool IsMainMachineActiveCalled func() bool AdjustInactivityIfNeededCalled func(selfPubKey string, consensusPubKeys []string, roundIndex int64) ResetInactivityIfNeededCalled func(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID) ObserverPrivateKeyCalled func() crypto.PrivateKey }
NodeRedundancyHandlerStub -
func (*NodeRedundancyHandlerStub) AdjustInactivityIfNeeded ¶ added in v1.1.31
func (nrhs *NodeRedundancyHandlerStub) AdjustInactivityIfNeeded(selfPubKey string, consensusPubKeys []string, roundIndex int64)
AdjustInactivityIfNeeded -
func (*NodeRedundancyHandlerStub) IsInterfaceNil ¶ added in v1.1.31
func (nrhs *NodeRedundancyHandlerStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*NodeRedundancyHandlerStub) IsMainMachineActive ¶ added in v1.1.31
func (nrhs *NodeRedundancyHandlerStub) IsMainMachineActive() bool
IsMainMachineActive -
func (*NodeRedundancyHandlerStub) IsRedundancyNode ¶ added in v1.1.31
func (nrhs *NodeRedundancyHandlerStub) IsRedundancyNode() bool
IsRedundancyNode -
func (*NodeRedundancyHandlerStub) ObserverPrivateKey ¶ added in v1.1.32
func (nrhs *NodeRedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey
ObserverPrivateKey -
func (*NodeRedundancyHandlerStub) ResetInactivityIfNeeded ¶ added in v1.1.31
func (nrhs *NodeRedundancyHandlerStub) ResetInactivityIfNeeded(selfPubKey string, consensusMsgPubKey string, consensusMsgPeerID core.PeerID)
ResetInactivityIfNeeded -
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) }
NodesCoordinatorMock -
func (*NodesCoordinatorMock) ComputeAdditionalLeaving ¶ added in v1.0.115
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) ConsensusGroupSize ¶
func (ncm *NodesCoordinatorMock) ConsensusGroupSize(uint32) int
ConsensusGroupSize -
func (*NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllEligibleValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetAllLeavingValidatorsPublicKeys ¶ added in v1.0.102
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 ¶ added in v1.0.102
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) 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) 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 ¶ added in v1.0.111
func (ncm *NodesCoordinatorMock) ShuffleOutForEpoch(_ uint32)
ShuffleOutForEpoch verifies if the shards changed in the new epoch and calls the shuffleOutHandler
func (*NodesCoordinatorMock) ValidatorsWeights ¶ added in v0.0.5
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 ¶ added in v1.0.106
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 P2PMessageMock ¶
type P2PMessageMock struct { FromField []byte DataField []byte SeqNoField []byte TopicField string SignatureField []byte KeyField []byte PeerField core.PeerID PayloadField []byte TimestampField int64 }
P2PMessageMock -
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*P2PMessageMock) Payload ¶ added in v1.0.133
func (msg *P2PMessageMock) Payload() []byte
Payload -
func (*P2PMessageMock) Timestamp ¶ added in v1.0.133
func (msg *P2PMessageMock) Timestamp() int64
Timestamp -
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 PrivateKeyMock ¶
type PrivateKeyMock struct { GeneratePublicMock func() crypto.PublicKey ToByteArrayMock func() ([]byte, error) SuiteMock func() crypto.Suite ScalarMock func() crypto.Scalar }
PrivateKeyMock mocks a private key implementation
func (*PrivateKeyMock) GeneratePublic ¶
func (privKey *PrivateKeyMock) GeneratePublic() crypto.PublicKey
GeneratePublic mocks generating a public key from the private key
func (*PrivateKeyMock) IsInterfaceNil ¶
func (privKey *PrivateKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PrivateKeyMock) ToByteArray ¶
func (privKey *PrivateKeyMock) ToByteArray() ([]byte, error)
ToByteArray mocks converting the private key to a byte array
type PublicKeyMock ¶
type PublicKeyMock struct { ToByteArrayMock func() ([]byte, error) SuiteMock func() crypto.Suite PointMock func() crypto.Point }
PublicKeyMock mocks a public key implementation
func (*PublicKeyMock) IsInterfaceNil ¶
func (pubKey *PublicKeyMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*PublicKeyMock) ToByteArray ¶
func (pubKey *PublicKeyMock) ToByteArray() ([]byte, error)
ToByteArray mocks converting a public key to a byte array
type RoundHandlerMock ¶ added in v1.2.0
type RoundHandlerMock struct { RoundIndex int64 IndexCalled func() int64 TimeDurationCalled func() time.Duration TimeStampCalled func() time.Time UpdateRoundCalled func(time.Time, time.Time) RemainingTimeCalled func(startTime time.Time, maxTime time.Duration) time.Duration BeforeGenesisCalled func() bool }
RoundHandlerMock -
func (*RoundHandlerMock) BeforeGenesis ¶ added in v1.2.0
func (rndm *RoundHandlerMock) BeforeGenesis() bool
BeforeGenesis -
func (*RoundHandlerMock) Index ¶ added in v1.2.0
func (rndm *RoundHandlerMock) Index() int64
Index -
func (*RoundHandlerMock) IsInterfaceNil ¶ added in v1.2.0
func (rndm *RoundHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RoundHandlerMock) RemainingTime ¶ added in v1.2.0
func (rndm *RoundHandlerMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
RemainingTime -
func (*RoundHandlerMock) TimeDuration ¶ added in v1.2.0
func (rndm *RoundHandlerMock) TimeDuration() time.Duration
TimeDuration -
func (*RoundHandlerMock) TimeStamp ¶ added in v1.2.0
func (rndm *RoundHandlerMock) TimeStamp() time.Time
TimeStamp -
func (*RoundHandlerMock) UpdateRound ¶ added in v1.2.0
func (rndm *RoundHandlerMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
UpdateRound -
type ShardCoordinatorMock ¶
type ShardCoordinatorMock struct {
ShardID 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) SetSelfId ¶
func (scm ShardCoordinatorMock) SetSelfId(_ uint32) error
SetSelfId -
type SingleSignerMock ¶
type SingleSignerMock struct { SignStub func(private crypto.PrivateKey, msg []byte) ([]byte, error) VerifyStub func(public crypto.PublicKey, msg []byte, sig []byte) error }
SingleSignerMock -
func (*SingleSignerMock) IsInterfaceNil ¶
func (s *SingleSignerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
type SposWorkerMock ¶
type SposWorkerMock struct { AddReceivedMessageCallCalled func( messageType consensus.MessageType, receivedMessageCall func(cnsDta *consensus.Message) bool, ) AddReceivedHeaderHandlerCalled func(handler func(data.HeaderHandler)) RemoveAllReceivedMessagesCallsCalled func() ProcessReceivedMessageCalled func(message p2p.MessageP2P) error SendConsensusMessageCalled func(cnsDta *consensus.Message) bool ExtendCalled func(subroundId int) GetConsensusStateChangedChannelsCalled func() chan bool GetBroadcastBlockCalled func(data.BodyHandler, data.HeaderHandler) error GetBroadcastHeaderCalled func(data.HeaderHandler) error ExecuteStoredMessagesCalled func() DisplayStatisticsCalled func() ReceivedHeaderCalled func(headerHandler data.HeaderHandler, headerHash []byte) SetAppStatusHandlerCalled func(ash core.AppStatusHandler) error ResetConsensusMessagesCalled func() }
SposWorkerMock -
func (*SposWorkerMock) AddReceivedHeaderHandler ¶
func (sposWorkerMock *SposWorkerMock) AddReceivedHeaderHandler(handler func(data.HeaderHandler))
AddReceivedHeaderHandler -
func (*SposWorkerMock) AddReceivedMessageCall ¶
func (sposWorkerMock *SposWorkerMock) AddReceivedMessageCall(messageType consensus.MessageType, receivedMessageCall func(cnsDta *consensus.Message) bool)
AddReceivedMessageCall -
func (*SposWorkerMock) BroadcastBlock ¶
func (sposWorkerMock *SposWorkerMock) BroadcastBlock(body data.BodyHandler, header data.HeaderHandler) error
BroadcastBlock -
func (*SposWorkerMock) Close ¶ added in v1.0.116
func (sposWorkerMock *SposWorkerMock) Close() error
Close -
func (*SposWorkerMock) DisplayStatistics ¶
func (sposWorkerMock *SposWorkerMock) DisplayStatistics()
DisplayStatistics -
func (*SposWorkerMock) ExecuteStoredMessages ¶
func (sposWorkerMock *SposWorkerMock) ExecuteStoredMessages()
ExecuteStoredMessages -
func (*SposWorkerMock) Extend ¶
func (sposWorkerMock *SposWorkerMock) Extend(subroundId int)
Extend -
func (*SposWorkerMock) GetConsensusStateChangedChannel ¶
func (sposWorkerMock *SposWorkerMock) GetConsensusStateChangedChannel() chan bool
GetConsensusStateChangedChannel -
func (*SposWorkerMock) IsInterfaceNil ¶
func (sposWorkerMock *SposWorkerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SposWorkerMock) ProcessReceivedMessage ¶
func (sposWorkerMock *SposWorkerMock) ProcessReceivedMessage(message p2p.MessageP2P, _ core.PeerID) error
ProcessReceivedMessage -
func (*SposWorkerMock) ReceivedHeader ¶
func (sposWorkerMock *SposWorkerMock) ReceivedHeader(headerHandler data.HeaderHandler, headerHash []byte)
ReceivedHeader -
func (*SposWorkerMock) RemoveAllReceivedMessagesCalls ¶
func (sposWorkerMock *SposWorkerMock) RemoveAllReceivedMessagesCalls()
RemoveAllReceivedMessagesCalls -
func (*SposWorkerMock) ResetConsensusMessages ¶ added in v1.1.2
func (sposWorkerMock *SposWorkerMock) ResetConsensusMessages()
ResetConsensusMessages -
func (*SposWorkerMock) SendConsensusMessage ¶
func (sposWorkerMock *SposWorkerMock) SendConsensusMessage(cnsDta *consensus.Message) bool
SendConsensusMessage -
func (*SposWorkerMock) StartWorking ¶ added in v1.0.116
func (sposWorkerMock *SposWorkerMock) StartWorking()
StartWorking -
type SubroundHandlerMock ¶
type SubroundHandlerMock struct { DoWorkCalled func(roundHandler consensus.RoundHandler) bool PreviousCalled func() int NextCalled func() int CurrentCalled func() int StartTimeCalled func() int64 EndTimeCalled func() int64 NameCalled func() string JobCalled func() bool CheckCalled func() bool ConsensusChannelCalled func() chan bool }
SubroundHandlerMock -
func (*SubroundHandlerMock) ConsensusChannel ¶ added in v1.0.111
func (srm *SubroundHandlerMock) ConsensusChannel() chan bool
ConsensusChannel -
func (*SubroundHandlerMock) DoWork ¶
func (srm *SubroundHandlerMock) DoWork(roundHandler consensus.RoundHandler) bool
DoWork -
func (*SubroundHandlerMock) IsInterfaceNil ¶
func (srm *SubroundHandlerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SubroundHandlerMock) StartTime ¶
func (srm *SubroundHandlerMock) StartTime() int64
StartTime -
type SyncTimerMock ¶
type SyncTimerMock struct { ClockOffsetCalled func() time.Duration CurrentTimeCalled func() time.Time }
SyncTimerMock mocks the implementation for a SyncTimer
func (*SyncTimerMock) ClockOffset ¶
func (stm *SyncTimerMock) ClockOffset() time.Duration
ClockOffset method gets the current time offset
func (*SyncTimerMock) CurrentTime ¶
func (stm *SyncTimerMock) CurrentTime() time.Time
CurrentTime method gets the current time on which is added the current offset
func (*SyncTimerMock) FormattedCurrentTime ¶
func (stm *SyncTimerMock) FormattedCurrentTime() string
FormattedCurrentTime method gets the formatted current time on which is added a given offset
func (*SyncTimerMock) IsInterfaceNil ¶
func (stm *SyncTimerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*SyncTimerMock) StartSyncingTime ¶ added in v1.0.116
func (stm *SyncTimerMock) StartSyncingTime()
StartSyncingTime method does the time synchronization at every syncPeriod time elapsed. This should be started as a go routine
type ValidatorStatisticsProcessorStub ¶
type ValidatorStatisticsProcessorStub struct { LoadInitialStateCalled func(in []*sharding.InitialNode) error UpdatePeerStateCalled func(header, previousHeader data.HeaderHandler) error IsInterfaceNilCalled func() bool }
ValidatorStatisticsProcessorStub -
func (*ValidatorStatisticsProcessorStub) IsInterfaceNil ¶
func (pm *ValidatorStatisticsProcessorStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*ValidatorStatisticsProcessorStub) LoadInitialState ¶
func (pm *ValidatorStatisticsProcessorStub) LoadInitialState(in []*sharding.InitialNode) error
LoadInitialState -
func (*ValidatorStatisticsProcessorStub) UpdatePeerState ¶
func (pm *ValidatorStatisticsProcessorStub) UpdatePeerState(header, previousHeader data.HeaderHandler) error
UpdatePeerState -
type WatchdogMock ¶ added in v1.0.133
type WatchdogMock struct { }
WatchdogMock -
func (*WatchdogMock) IsInterfaceNil ¶ added in v1.0.133
func (w *WatchdogMock) IsInterfaceNil() bool
IsInterfaceNil -
func (*WatchdogMock) Set ¶ added in v1.0.133
func (w *WatchdogMock) Set(callback func(alarmID string), duration time.Duration, alarmID string)
Set -
func (*WatchdogMock) SetDefault ¶ added in v1.0.133
func (w *WatchdogMock) SetDefault(duration time.Duration, alarmID string)
SetDefault -
Source Files ¶
- alarmSchedulerStub.go
- appStatusHandlerStub.go
- blockChainMock.go
- blockProcessorMock.go
- bootstrapMock.go
- broadcastMessangerMock.go
- chronologyHandlerMock.go
- consensusDataContainerMock.go
- consensusStateMock.go
- epochStartNotifierStub.go
- forkDetectorMock.go
- hasherMock.go
- hasherStub.go
- headerIntegrityVerifierStub.go
- headerSigVerifierStub.go
- headersCacherStub.go
- indexer.go
- keyGenMock.go
- marshalizerMock.go
- messengerStub.go
- mockTestInitializer.go
- multiShardCoordinatorMock.go
- nodeRedundancyHandlerStub.go
- nodesCoordinatorMock.go
- p2pAntifloodHandlerStub.go
- p2pMessageMock.go
- peerProcessorStub.go
- peerSignatureHandlerMock.go
- rounderMock.go
- shardCoordinatorMock.go
- singleSigMock.go
- sposWorkerMock.go
- statusHandlerMock.go
- subroundHandlerMock.go
- syncTimerMock.go
- validatorMock.go
- watchdogMock.go