Documentation ¶
Index ¶
- Variables
- func InitChronologyHandlerMock() consensus.ChronologyHandler
- func InitKeys() (*KeyGenMock, *PrivateKeyMock, *PublicKeyMock)
- 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 BelNevMock
- func (bnm *BelNevMock) AggregateCommitments(bitmap []byte) error
- func (bnm *BelNevMock) AggregateSigs(bitmap []byte) ([]byte, error)
- func (bnm *BelNevMock) Commitment(index uint16) ([]byte, error)
- func (bnm *BelNevMock) CommitmentHash(index uint16) ([]byte, error)
- func (bnm *BelNevMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
- func (bnm *BelNevMock) CreateCommitment() (commSecret []byte, commitment []byte)
- func (bnm *BelNevMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
- func (bnm *BelNevMock) IsInterfaceNil() bool
- func (bnm *BelNevMock) Reset(pubKeys []string, index uint16) error
- func (bnm *BelNevMock) SetAggregatedSig(aggSig []byte) error
- func (bnm *BelNevMock) SignatureShare(index uint16) ([]byte, error)
- func (bnm *BelNevMock) StoreCommitment(index uint16, value []byte) error
- func (bnm *BelNevMock) StoreCommitmentHash(index uint16, commHash []byte) error
- func (bnm *BelNevMock) StoreSignatureShare(index uint16, sig []byte) error
- func (bnm *BelNevMock) Verify(msg []byte, bitmap []byte) error
- func (bnm *BelNevMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
- type BlockChainMock
- func (bc *BlockChainMock) CreateNewHeader() data.HeaderHandler
- func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
- 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) SetCurrentBlockBody(body data.BodyHandler) error
- 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) 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) RevertStateToBlock(header data.HeaderHandler) error
- func (bpm *BlockProcessorMock) SetNumProcessedObj(_ uint64)
- type BootstrapperMock
- func (boot *BootstrapperMock) AddSyncStateListener(syncStateNotifier func(isSyncing bool))
- func (boot *BootstrapperMock) CreateAndCommitEmptyBlock(shardForCurrentNode uint32) (data.BodyHandler, data.HeaderHandler, error)
- func (boot *BootstrapperMock) GetNodeState() core.NodeState
- func (boot *BootstrapperMock) IsInterfaceNil() bool
- func (boot *BootstrapperMock) SetStatusHandler(handler core.AppStatusHandler) error
- func (boot *BootstrapperMock) StartSync()
- func (boot *BootstrapperMock) StopSync()
- type BroadcastMessengerMock
- func (bmm *BroadcastMessengerMock) BroadcastBlock(bodyHandler data.BodyHandler, headerhandler data.HeaderHandler) 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
- type ChronologyHandlerMock
- func (chrm *ChronologyHandlerMock) AddSubround(subroundHandler consensus.SubroundHandler)
- 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) EpochStartSubscriber() epochStart.EpochStartSubscriber
- func (ccm *ConsensusCoreMock) GetAntiFloodHandler() consensus.P2PAntifloodHandler
- func (ccm *ConsensusCoreMock) Hasher() hashing.Hasher
- func (ccm *ConsensusCoreMock) IsInterfaceNil() bool
- func (ccm *ConsensusCoreMock) Marshalizer() marshal.Marshalizer
- func (ccm *ConsensusCoreMock) MultiSigner() crypto.MultiSigner
- func (ccm *ConsensusCoreMock) NodesCoordinator() sharding.NodesCoordinator
- func (ccm *ConsensusCoreMock) PrivateKey() crypto.PrivateKey
- func (ccm *ConsensusCoreMock) Rounder() consensus.Rounder
- 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) SetHasher(hasher hashing.Hasher)
- func (ccm *ConsensusCoreMock) SetMarshalizer(marshalizer marshal.Marshalizer)
- func (ccm *ConsensusCoreMock) SetMultiSigner(multiSigner crypto.MultiSigner)
- func (ccm *ConsensusCoreMock) SetRounder(rounder consensus.Rounder)
- 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(metaHeader data.HeaderHandler)
- func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.EpochStartHandler)
- func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.EpochStartHandler)
- 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) SetRollBackNonce(nonce uint64)
- type HasherMock
- type HasherStub
- type HeaderHandlerStub
- func (hhs *HeaderHandlerStub) CheckChainID(reference []byte) error
- func (hhs *HeaderHandlerStub) Clone() data.HeaderHandler
- func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
- func (hhs *HeaderHandlerStub) GetChainID() []byte
- func (hhs *HeaderHandlerStub) GetEpoch() uint32
- func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
- func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
- func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
- func (hhs *HeaderHandlerStub) GetMiniBlockProcessed(_ []byte) bool
- func (hhs *HeaderHandlerStub) GetNonce() uint64
- func (hhs *HeaderHandlerStub) GetPrevHash() []byte
- func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
- func (hhs *HeaderHandlerStub) GetRandSeed() []byte
- func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
- func (hhs *HeaderHandlerStub) GetRootHash() []byte
- func (hhs *HeaderHandlerStub) GetRound() uint64
- func (hhs *HeaderHandlerStub) GetShardID() uint32
- func (hhs *HeaderHandlerStub) GetSignature() []byte
- func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
- func (hhs *HeaderHandlerStub) GetTxCount() uint32
- func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
- func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
- func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
- func (hhs *HeaderHandlerStub) ItemsInBody() uint32
- func (hhs *HeaderHandlerStub) ItemsInHeader() uint32
- func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
- func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
- func (hhs *HeaderHandlerStub) SetEpoch(_ uint32)
- func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetMiniBlockProcessed(_ []byte, _ bool)
- func (hhs *HeaderHandlerStub) SetNonce(_ uint64)
- func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
- func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
- func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
- func (hhs *HeaderHandlerStub) SetRound(_ uint64)
- func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
- func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
- func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
- func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
- func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
- type HeaderSigVerifierStub
- type IndexerMock
- func (im *IndexerMock) IsInterfaceNil() bool
- func (im *IndexerMock) IsNilIndexer() bool
- func (im *IndexerMock) SaveBlock(_ data.BodyHandler, _ data.HeaderHandler, _ map[string]data.TransactionHandler, ...)
- func (im *IndexerMock) SaveRoundInfo(_ indexer.RoundInfo)
- func (im *IndexerMock) SaveValidatorsPubKeys(_ map[uint32][][]byte, _ uint32)
- func (im *IndexerMock) SaveValidatorsRating(_ string, _ []indexer.ValidatorRatingInfo)
- func (im *IndexerMock) UpdateTPS(_ statistics.TPSBenchmark)
- type KeyGenMock
- 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 state.AddressContainer) uint32
- func (scm *MultipleShardsCoordinatorMock) IsInterfaceNil() bool
- func (scm *MultipleShardsCoordinatorMock) NumberOfShards() uint32
- func (scm *MultipleShardsCoordinatorMock) SameShard(firstAddress, secondAddress state.AddressContainer) bool
- func (scm *MultipleShardsCoordinatorMock) SelfId() uint32
- func (scm *MultipleShardsCoordinatorMock) SetNoShards(noShards uint32)
- func (scm *MultipleShardsCoordinatorMock) SetSelfId(shardId uint32) error
- type NetworkShardingCollectorStub
- func (nscs *NetworkShardingCollectorStub) IsInterfaceNil() bool
- func (nscs *NetworkShardingCollectorStub) UpdatePeerIdPublicKey(pid p2p.PeerID, pk []byte)
- func (nscs *NetworkShardingCollectorStub) UpdatePeerIdShardId(pid p2p.PeerID, shardId uint32)
- func (nscs *NetworkShardingCollectorStub) UpdatePublicKeyShardId(pk []byte, shardId uint32)
- type NodesCoordinatorMock
- func (ncm *NodesCoordinatorMock) ComputeConsensusGroup(randomness []byte, round uint64, shardId uint32, epoch uint32) (validatorsGroup []sharding.Validator, err error)
- func (ncm *NodesCoordinatorMock) ComputeLeaving([]sharding.Validator) []sharding.Validator
- func (ncm *NodesCoordinatorMock) ConsensusGroupSize(uint32) int
- func (ncm *NodesCoordinatorMock) GetAllEligibleValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
- func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
- func (ncm *NodesCoordinatorMock) GetConsensusValidatorsRewardsAddresses(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, _ uint32) (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) ValidatorsWeights(validators []sharding.Validator) ([]uint32, error)
- type P2PAntifloodHandlerStub
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error
- func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessageOnTopic(peer p2p.PeerID, topic string) 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) Peer() p2p.PeerID
- func (msg *P2PMessageMock) SeqNo() []byte
- func (msg *P2PMessageMock) Signature() []byte
- func (msg *P2PMessageMock) Topics() []string
- type PrivateKeyMock
- type PublicKeyMock
- type RounderMock
- func (rndm *RounderMock) Index() int64
- func (rndm *RounderMock) IsInterfaceNil() bool
- func (rndm *RounderMock) RemainingTime(startTime time.Time, maxTime time.Duration) time.Duration
- func (rndm *RounderMock) TimeDuration() time.Duration
- func (rndm *RounderMock) TimeStamp() time.Time
- func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
- type ShardCoordinatorMock
- func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
- func (scm ShardCoordinatorMock) ComputeId(_ state.AddressContainer) uint32
- func (scm ShardCoordinatorMock) IsInterfaceNil() bool
- func (scm ShardCoordinatorMock) NumberOfShards() uint32
- func (scm ShardCoordinatorMock) SameShard(_, _ state.AddressContainer) 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) 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, _ p2p.PeerID) error
- func (sposWorkerMock *SposWorkerMock) ReceivedHeader(headerHandler data.HeaderHandler, headerHash []byte)
- func (sposWorkerMock *SposWorkerMock) RemoveAllReceivedMessagesCalls()
- func (sposWorkerMock *SposWorkerMock) SendConsensusMessage(cnsDta *consensus.Message) bool
- func (sposWorkerMock *SposWorkerMock) SetAppStatusHandler(ash core.AppStatusHandler) error
- type SubroundHandlerMock
- func (srm *SubroundHandlerMock) Current() int
- func (srm *SubroundHandlerMock) DoWork(rounder consensus.Rounder) 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 ValidatorMock
- type ValidatorStatisticsProcessorStub
Constants ¶
This section is empty.
Variables ¶
var ErrMockMarshalizer = errors.New("MarshalizerMock generic error")
ErrMockMarshalizer -
Functions ¶
func InitChronologyHandlerMock ¶
func InitChronologyHandlerMock() consensus.ChronologyHandler
InitChronologyHandlerMock -
Types ¶
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 BelNevMock ¶
type BelNevMock struct { VerifyMock func(msg []byte, bitmap []byte) error CommitmentHashMock func(index uint16) ([]byte, error) CreateCommitmentMock func() ([]byte, []byte) AggregateCommitmentsMock func(bitmap []byte) error AggregateSigsMock func(bitmap []byte) ([]byte, error) StoreCommitmentMock func(index uint16, value []byte) error StoreCommitmentHashMock func(uint16, []byte) error CommitmentMock func(uint16) ([]byte, error) CreateCalled func(pubKeys []string, index uint16) (crypto.MultiSigner, error) ResetCalled func(pubKeys []string, index uint16) error // contains filtered or unexported fields }
BelNevMock is used to mock belare neven multisignature scheme
func (*BelNevMock) AggregateCommitments ¶
func (bnm *BelNevMock) AggregateCommitments(bitmap []byte) error
AggregateCommitments aggregates the list of commitments
func (*BelNevMock) AggregateSigs ¶
func (bnm *BelNevMock) AggregateSigs(bitmap []byte) ([]byte, error)
AggregateSigs aggregates all collected partial signatures
func (*BelNevMock) Commitment ¶
func (bnm *BelNevMock) Commitment(index uint16) ([]byte, error)
Commitment returns the commitment from the list with the specified position
func (*BelNevMock) CommitmentHash ¶
func (bnm *BelNevMock) CommitmentHash(index uint16) ([]byte, error)
CommitmentHash returns the commitment hash from the list on the specified position
func (*BelNevMock) Create ¶
func (bnm *BelNevMock) Create(pubKeys []string, index uint16) (crypto.MultiSigner, error)
Create creates a multiSigner using receiver as template and initializes corresponding fields with the given params
func (*BelNevMock) CreateCommitment ¶
func (bnm *BelNevMock) CreateCommitment() (commSecret []byte, commitment []byte)
CreateCommitment creates a secret commitment and the corresponding public commitment point
func (*BelNevMock) CreateSignatureShare ¶
func (bnm *BelNevMock) CreateSignatureShare(msg []byte, bitmap []byte) ([]byte, error)
CreateSignatureShare creates a partial signature
func (*BelNevMock) IsInterfaceNil ¶
func (bnm *BelNevMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BelNevMock) Reset ¶
func (bnm *BelNevMock) Reset(pubKeys []string, index uint16) error
Reset -
func (*BelNevMock) SetAggregatedSig ¶
func (bnm *BelNevMock) SetAggregatedSig(aggSig []byte) error
SetAggregatedSig sets the aggregated signature according to the given byte array
func (*BelNevMock) SignatureShare ¶
func (bnm *BelNevMock) SignatureShare(index uint16) ([]byte, error)
SignatureShare -
func (*BelNevMock) StoreCommitment ¶
func (bnm *BelNevMock) StoreCommitment(index uint16, value []byte) error
StoreCommitment adds a commitment to the list on the specified position
func (*BelNevMock) StoreCommitmentHash ¶
func (bnm *BelNevMock) StoreCommitmentHash(index uint16, commHash []byte) error
StoreCommitmentHash adds a commitment hash to the list on the specified position
func (*BelNevMock) StoreSignatureShare ¶
func (bnm *BelNevMock) StoreSignatureShare(index uint16, sig []byte) error
StoreSignatureShare adds the partial signature of the signer with specified position
func (*BelNevMock) Verify ¶
func (bnm *BelNevMock) Verify(msg []byte, bitmap []byte) error
Verify returns nil if the aggregateed signature is verified for the given public keys
func (*BelNevMock) VerifySignatureShare ¶
func (bnm *BelNevMock) VerifySignatureShare(index uint16, sig []byte, msg []byte, bitmap []byte) error
VerifySignatureShare verifies the partial signature of the signer with specified position
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) GetCurrentBlockBodyCalled func() data.BodyHandler SetCurrentBlockBodyCalled func(data.BodyHandler) error 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) GetCurrentBlockBody ¶
func (bc *BlockChainMock) GetCurrentBlockBody() data.BodyHandler
GetCurrentBlockBody returns the tx block body pointer
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) SetCurrentBlockBody ¶
func (bc *BlockChainMock) SetCurrentBlockBody(body data.BodyHandler) error
SetCurrentBlockBody sets the tx block body pointer
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 }
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) 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) 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() core.NodeState StartSyncCalled func() StopSyncCalled func() SetStatusHandlerCalled func(handler core.AppStatusHandler) error }
BootstrapperMock mocks the implementation for a Bootstrapper
func (*BootstrapperMock) AddSyncStateListener ¶
func (boot *BootstrapperMock) AddSyncStateListener(syncStateNotifier func(isSyncing bool))
AddSyncStateListener -
func (*BootstrapperMock) CreateAndCommitEmptyBlock ¶
func (boot *BootstrapperMock) CreateAndCommitEmptyBlock(shardForCurrentNode uint32) (data.BodyHandler, data.HeaderHandler, error)
CreateAndCommitEmptyBlock -
func (*BootstrapperMock) GetNodeState ¶
func (boot *BootstrapperMock) GetNodeState() core.NodeState
GetNodeState -
func (*BootstrapperMock) IsInterfaceNil ¶
func (boot *BootstrapperMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*BootstrapperMock) SetStatusHandler ¶
func (boot *BootstrapperMock) SetStatusHandler(handler core.AppStatusHandler) error
SetStatusHandler -
type BroadcastMessengerMock ¶
type BroadcastMessengerMock struct { BroadcastBlockCalled func(data.BodyHandler, data.HeaderHandler) error BroadcastHeaderCalled func(data.HeaderHandler) error BroadcastMiniBlocksCalled func(map[uint32][]byte) error BroadcastTransactionsCalled func(map[string][][]byte) error BroadcastConsensusMessageCalled func(*consensus.Message) error }
BroadcastMessengerMock -
func (*BroadcastMessengerMock) BroadcastBlock ¶
func (bmm *BroadcastMessengerMock) BroadcastBlock(bodyHandler data.BodyHandler, headerhandler data.HeaderHandler) error
BroadcastBlock -
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
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) 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 (*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) EpochStartSubscriber ¶
func (ccm *ConsensusCoreMock) EpochStartSubscriber() epochStart.EpochStartSubscriber
EpochStartSubscriber -
func (*ConsensusCoreMock) GetAntiFloodHandler ¶
func (ccm *ConsensusCoreMock) GetAntiFloodHandler() consensus.P2PAntifloodHandler
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) NodesCoordinator ¶
func (ccm *ConsensusCoreMock) NodesCoordinator() sharding.NodesCoordinator
NodesCoordinator -
func (*ConsensusCoreMock) PrivateKey ¶
func (ccm *ConsensusCoreMock) PrivateKey() crypto.PrivateKey
PrivateKey -
func (*ConsensusCoreMock) Rounder ¶
func (ccm *ConsensusCoreMock) Rounder() consensus.Rounder
Rounder -
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) SetHasher ¶
func (ccm *ConsensusCoreMock) SetHasher(hasher hashing.Hasher)
SetHasher -
func (*ConsensusCoreMock) SetMarshalizer ¶
func (ccm *ConsensusCoreMock) SetMarshalizer(marshalizer marshal.Marshalizer)
SetMarshalizer -
func (*ConsensusCoreMock) SetMultiSigner ¶
func (ccm *ConsensusCoreMock) SetMultiSigner(multiSigner crypto.MultiSigner)
SetMultiSigner -
func (*ConsensusCoreMock) SetRounder ¶
func (ccm *ConsensusCoreMock) SetRounder(rounder consensus.Rounder)
SetRounder -
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.EpochStartHandler) UnregisterHandlerCalled func(handler epochStart.EpochStartHandler) NotifyAllCalled func(hdr data.HeaderHandler) NotifyAllPrepareCalled func(hdr data.HeaderHandler) // 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(metaHeader data.HeaderHandler)
NotifyAllPrepare -
func (*EpochStartNotifierStub) RegisterHandler ¶
func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.EpochStartHandler)
RegisterHandler -
func (*EpochStartNotifierStub) UnregisterHandler ¶
func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.EpochStartHandler)
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() }
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) 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 HeaderHandlerStub ¶
type HeaderHandlerStub struct { GetMiniBlockHeadersWithDstCalled func(destId uint32) map[string]uint32 GetPubKeysBitmapCalled func() []byte GetSignatureCalled func() []byte GetRootHashCalled func() []byte GetRandSeedCalled func() []byte GetPrevRandSeedCalled func() []byte GetPrevHashCalled func() []byte CloneCalled func() data.HeaderHandler GetChainIDCalled func() []byte CheckChainIDCalled func(reference []byte) error }
HeaderHandlerStub -
func (*HeaderHandlerStub) CheckChainID ¶
func (hhs *HeaderHandlerStub) CheckChainID(reference []byte) error
CheckChainID -
func (*HeaderHandlerStub) GetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) GetAccumulatedFees() *big.Int
GetAccumulatedFees -
func (*HeaderHandlerStub) GetChainID ¶
func (hhs *HeaderHandlerStub) GetChainID() []byte
GetChainID -
func (*HeaderHandlerStub) GetEpochStartMetaHash ¶
func (hhs *HeaderHandlerStub) GetEpochStartMetaHash() []byte
GetEpochStartMetaHash -
func (*HeaderHandlerStub) GetLeaderSignature ¶
func (hhs *HeaderHandlerStub) GetLeaderSignature() []byte
GetLeaderSignature -
func (*HeaderHandlerStub) GetMiniBlockHeadersWithDst ¶
func (hhs *HeaderHandlerStub) GetMiniBlockHeadersWithDst(destId uint32) map[string]uint32
GetMiniBlockHeadersWithDst -
func (*HeaderHandlerStub) GetMiniBlockProcessed ¶
func (hhs *HeaderHandlerStub) GetMiniBlockProcessed(_ []byte) bool
GetMiniBlockProcessed -
func (*HeaderHandlerStub) GetPrevHash ¶
func (hhs *HeaderHandlerStub) GetPrevHash() []byte
GetPrevHash -
func (*HeaderHandlerStub) GetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) GetPrevRandSeed() []byte
GetPrevRandSeed -
func (*HeaderHandlerStub) GetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) GetPubKeysBitmap() []byte
GetPubKeysBitmap -
func (*HeaderHandlerStub) GetRandSeed ¶
func (hhs *HeaderHandlerStub) GetRandSeed() []byte
GetRandSeed -
func (*HeaderHandlerStub) GetReceiptsHash ¶
func (hhs *HeaderHandlerStub) GetReceiptsHash() []byte
GetReceiptsHash -
func (*HeaderHandlerStub) GetRootHash ¶
func (hhs *HeaderHandlerStub) GetRootHash() []byte
GetRootHash -
func (*HeaderHandlerStub) GetShardID ¶
func (hhs *HeaderHandlerStub) GetShardID() uint32
GetShardID -
func (*HeaderHandlerStub) GetSignature ¶
func (hhs *HeaderHandlerStub) GetSignature() []byte
GetSignature -
func (*HeaderHandlerStub) GetTimeStamp ¶
func (hhs *HeaderHandlerStub) GetTimeStamp() uint64
GetTimeStamp -
func (*HeaderHandlerStub) GetTxCount ¶
func (hhs *HeaderHandlerStub) GetTxCount() uint32
GetTxCount -
func (*HeaderHandlerStub) GetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) GetValidatorStatsRootHash() []byte
GetValidatorStatsRootHash -
func (*HeaderHandlerStub) IsInterfaceNil ¶
func (hhs *HeaderHandlerStub) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*HeaderHandlerStub) IsStartOfEpochBlock ¶
func (hhs *HeaderHandlerStub) IsStartOfEpochBlock() bool
IsStartOfEpochBlock -
func (*HeaderHandlerStub) ItemsInBody ¶
func (hhs *HeaderHandlerStub) ItemsInBody() uint32
ItemsInBody -
func (*HeaderHandlerStub) ItemsInHeader ¶
func (hhs *HeaderHandlerStub) ItemsInHeader() uint32
ItemsInHeader -
func (*HeaderHandlerStub) SetAccumulatedFees ¶
func (hhs *HeaderHandlerStub) SetAccumulatedFees(_ *big.Int)
SetAccumulatedFees -
func (*HeaderHandlerStub) SetChainID ¶
func (hhs *HeaderHandlerStub) SetChainID(_ []byte)
SetChainID -
func (*HeaderHandlerStub) SetLeaderSignature ¶
func (hhs *HeaderHandlerStub) SetLeaderSignature(_ []byte)
SetLeaderSignature -
func (*HeaderHandlerStub) SetMiniBlockProcessed ¶
func (hhs *HeaderHandlerStub) SetMiniBlockProcessed(_ []byte, _ bool)
SetMiniBlockProcessed -
func (*HeaderHandlerStub) SetPrevHash ¶
func (hhs *HeaderHandlerStub) SetPrevHash(_ []byte)
SetPrevHash -
func (*HeaderHandlerStub) SetPrevRandSeed ¶
func (hhs *HeaderHandlerStub) SetPrevRandSeed(_ []byte)
SetPrevRandSeed -
func (*HeaderHandlerStub) SetPubKeysBitmap ¶
func (hhs *HeaderHandlerStub) SetPubKeysBitmap(_ []byte)
SetPubKeysBitmap -
func (*HeaderHandlerStub) SetRandSeed ¶
func (hhs *HeaderHandlerStub) SetRandSeed(_ []byte)
SetRandSeed -
func (*HeaderHandlerStub) SetRootHash ¶
func (hhs *HeaderHandlerStub) SetRootHash(_ []byte)
SetRootHash -
func (*HeaderHandlerStub) SetShardID ¶
func (hhs *HeaderHandlerStub) SetShardID(_ uint32)
SetShardID -
func (*HeaderHandlerStub) SetSignature ¶
func (hhs *HeaderHandlerStub) SetSignature(_ []byte)
SetSignature -
func (*HeaderHandlerStub) SetTimeStamp ¶
func (hhs *HeaderHandlerStub) SetTimeStamp(_ uint64)
SetTimeStamp -
func (*HeaderHandlerStub) SetTxCount ¶
func (hhs *HeaderHandlerStub) SetTxCount(_ uint32)
SetTxCount -
func (*HeaderHandlerStub) SetValidatorStatsRootHash ¶
func (hhs *HeaderHandlerStub) SetValidatorStatsRootHash(_ []byte)
SetValidatorStatsRootHash -
type HeaderSigVerifierStub ¶
type HeaderSigVerifierStub struct {
VerifyRandSeedCaller func(header data.HeaderHandler) error
}
HeaderSigVerifierStub -
func (*HeaderSigVerifierStub) IsInterfaceNil ¶
func (hsvm *HeaderSigVerifierStub) IsInterfaceNil() bool
IsInterfaceNil -
func (*HeaderSigVerifierStub) VerifyRandSeed ¶
func (hsvm *HeaderSigVerifierStub) VerifyRandSeed(header data.HeaderHandler) error
VerifyRandSeed -
type IndexerMock ¶
IndexerMock is a mock implementation fot the Indexer interface
func (*IndexerMock) IsInterfaceNil ¶
func (im *IndexerMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*IndexerMock) SaveBlock ¶
func (im *IndexerMock) SaveBlock(_ data.BodyHandler, _ data.HeaderHandler, _ map[string]data.TransactionHandler, _ []uint64, _ []string)
SaveBlock -
func (*IndexerMock) SaveRoundInfo ¶
func (im *IndexerMock) SaveRoundInfo(_ indexer.RoundInfo)
SaveRoundInfo -
func (*IndexerMock) SaveValidatorsPubKeys ¶
func (im *IndexerMock) SaveValidatorsPubKeys(_ map[uint32][][]byte, _ uint32)
SaveValidatorsPubKeys -
func (*IndexerMock) SaveValidatorsRating ¶ added in v0.0.5
func (im *IndexerMock) SaveValidatorsRating(_ string, _ []indexer.ValidatorRatingInfo)
SaveValidatorsRating --
func (*IndexerMock) UpdateTPS ¶
func (im *IndexerMock) UpdateTPS(_ statistics.TPSBenchmark)
UpdateTPS -
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 mocks a key generation implementation
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
func (MarshalizerMock) Version ¶
func (MarshalizerMock) Version() string
Version is deprecated and will be removed
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 ComputeIdCalled func(address state.AddressContainer) uint32 SelfIDCalled func() uint32 CurrentShard 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 state.AddressContainer) 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(firstAddress, secondAddress state.AddressContainer) 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(shardId uint32) error
SetSelfId -
type NetworkShardingCollectorStub ¶
type NetworkShardingCollectorStub struct { UpdatePeerIdPublicKeyCalled func(pid p2p.PeerID, pk []byte) UpdatePublicKeyShardIdCalled func(pk []byte, shardId uint32) UpdatePeerIdShardIdCalled func(pid p2p.PeerID, shardId uint32) }
func (*NetworkShardingCollectorStub) IsInterfaceNil ¶
func (nscs *NetworkShardingCollectorStub) IsInterfaceNil() bool
func (*NetworkShardingCollectorStub) UpdatePeerIdPublicKey ¶
func (nscs *NetworkShardingCollectorStub) UpdatePeerIdPublicKey(pid p2p.PeerID, pk []byte)
func (*NetworkShardingCollectorStub) UpdatePeerIdShardId ¶
func (nscs *NetworkShardingCollectorStub) UpdatePeerIdShardId(pid p2p.PeerID, shardId uint32)
func (*NetworkShardingCollectorStub) UpdatePublicKeyShardId ¶
func (nscs *NetworkShardingCollectorStub) UpdatePublicKeyShardId(pk []byte, shardId uint32)
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) 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([]sharding.Validator) []sharding.Validator
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) GetAllWaitingValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetAllWaitingValidatorsPublicKeys(_ uint32) (map[uint32][][]byte, error)
GetAllWaitingValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetConsensusValidatorsPublicKeys ¶
func (ncm *NodesCoordinatorMock) GetConsensusValidatorsPublicKeys(randomness []byte, round uint64, shardId uint32, epoch uint32) ([]string, error)
GetConsensusValidatorsPublicKeys -
func (*NodesCoordinatorMock) GetConsensusValidatorsRewardsAddresses ¶
func (ncm *NodesCoordinatorMock) GetConsensusValidatorsRewardsAddresses( randomness []byte, round uint64, shardId uint32, epoch uint32, ) ([]string, error)
GetConsensusValidatorsRewardsAddresses -
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, _ uint32) (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) 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 p2p.PeerID) error CanProcessMessageOnTopicCalled func(peer p2p.PeerID, topic string) error }
P2PAntifloodHandlerStub -
func (*P2PAntifloodHandlerStub) CanProcessMessage ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer p2p.PeerID) error
CanProcessMessage -
func (*P2PAntifloodHandlerStub) CanProcessMessageOnTopic ¶
func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessageOnTopic(peer p2p.PeerID, topic string) error
CanProcessMessageOnTopic -
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 TopicsField []string SignatureField []byte KeyField []byte PeerField p2p.PeerID }
P2PMessageMock -
func (*P2PMessageMock) IsInterfaceNil ¶
func (msg *P2PMessageMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
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 RounderMock ¶
type RounderMock 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 }
RounderMock -
func (*RounderMock) IsInterfaceNil ¶
func (rndm *RounderMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*RounderMock) RemainingTime ¶
RemainingTime -
func (*RounderMock) TimeDuration ¶
func (rndm *RounderMock) TimeDuration() time.Duration
TimeDuration -
func (*RounderMock) UpdateRound ¶
func (rndm *RounderMock) UpdateRound(genesisRoundTimeStamp time.Time, timeStamp time.Time)
UpdateRound -
type ShardCoordinatorMock ¶
type ShardCoordinatorMock struct { }
ShardCoordinatorMock -
func (ShardCoordinatorMock) CommunicationIdentifier ¶
func (scm ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string
CommunicationIdentifier -
func (ShardCoordinatorMock) ComputeId ¶
func (scm ShardCoordinatorMock) ComputeId(_ state.AddressContainer) 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(_, _ state.AddressContainer) 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
func (*SingleSignerMock) Sign ¶
func (s *SingleSignerMock) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)
Sign -
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 }
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) 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, _ p2p.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) SendConsensusMessage ¶
func (sposWorkerMock *SposWorkerMock) SendConsensusMessage(cnsDta *consensus.Message) bool
SendConsensusMessage -
func (*SposWorkerMock) SetAppStatusHandler ¶
func (sposWorkerMock *SposWorkerMock) SetAppStatusHandler(ash core.AppStatusHandler) error
SetAppStatusHandler -
type SubroundHandlerMock ¶
type SubroundHandlerMock struct { DoWorkCalled func(rounder consensus.Rounder) 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 }
SubroundHandlerMock -
func (*SubroundHandlerMock) DoWork ¶
func (srm *SubroundHandlerMock) DoWork(rounder consensus.Rounder) 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) StartSync ¶
func (stm *SyncTimerMock) StartSync()
StartSync method does the time synchronization at every syncPeriod time elapsed. This should be started as a go routine
type ValidatorMock ¶
type ValidatorMock struct {
// contains filtered or unexported fields
}
ValidatorMock -
func NewValidatorMock ¶
func NewValidatorMock(pubKey []byte, address []byte, chances uint32) *ValidatorMock
NewValidatorMock -
func (*ValidatorMock) Clone ¶ added in v0.0.5
func (vm *ValidatorMock) Clone() (interface{}, error)
Clone clones the validator
func (*ValidatorMock) IsInterfaceNil ¶
func (vm *ValidatorMock) IsInterfaceNil() bool
IsInterfaceNil returns true if there is no value under the interface
func (*ValidatorMock) SetChances ¶ added in v0.0.5
func (vm *ValidatorMock) SetChances(chances uint32)
SetChances -
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 -
Source Files ¶
- appStatusHandlerStub.go
- blockChainMock.go
- blockProcessorMock.go
- bootstrapMock.go
- broadcastMessangerMock.go
- chronologyHandlerMock.go
- consensusDataContainerMock.go
- consensusStateMock.go
- epochStartNotifierStub.go
- forkDetectorMock.go
- hasherMock.go
- hasherStub.go
- headerHandlerStub.go
- headerSigVerifierStub.go
- indexer.go
- keyGenMock.go
- marshalizerMock.go
- messengerStub.go
- mockTestInitializer.go
- multiShardCoordinatorMock.go
- multiSigMock.go
- networkShardingCollectorStub.go
- nodesCoordinatorMock.go
- p2pAntifloodHandlerStub.go
- p2pMessageMock.go
- peerProcessorStub.go
- rounderMock.go
- shardCoordinatorMock.go
- singleSigMock.go
- sposWorkerMock.go
- statusHandlerMock.go
- subroundHandlerMock.go
- syncTimerMock.go
- validatorMock.go