mock

package
v1.999.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CurrentBlockProviderStub

type CurrentBlockProviderStub struct {
	GetCurrentBlockHeaderCalled func() data.HeaderHandler
}

CurrentBlockProviderStub -

func (*CurrentBlockProviderStub) GetCurrentBlockHeader

func (cbps *CurrentBlockProviderStub) GetCurrentBlockHeader() data.HeaderHandler

GetCurrentBlockHeader -

func (*CurrentBlockProviderStub) IsInterfaceNil

func (cbps *CurrentBlockProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type EpochStartNotifierStub

type EpochStartNotifierStub struct {
	RegisterHandlerCalled   func(handler epochStart.ActionHandler)
	UnregisterHandlerCalled func(handler epochStart.ActionHandler)
	NotifyAllCalled         func(hdr data.HeaderHandler)
	NotifyAllPrepareCalled  func(hdr data.HeaderHandler, body data.BodyHandler)
	// contains filtered or unexported fields
}

EpochStartNotifierStub -

func (*EpochStartNotifierStub) IsInterfaceNil

func (esnm *EpochStartNotifierStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartNotifierStub) NotifyAll

func (esnm *EpochStartNotifierStub) NotifyAll(hdr data.HeaderHandler)

NotifyAll -

func (*EpochStartNotifierStub) NotifyAllPrepare

func (esnm *EpochStartNotifierStub) NotifyAllPrepare(metaHdr data.HeaderHandler, body data.BodyHandler)

NotifyAllPrepare -

func (*EpochStartNotifierStub) RegisterHandler

func (esnm *EpochStartNotifierStub) RegisterHandler(handler epochStart.ActionHandler)

RegisterHandler -

func (*EpochStartNotifierStub) UnregisterHandler

func (esnm *EpochStartNotifierStub) UnregisterHandler(handler epochStart.ActionHandler)

UnregisterHandler -

type EpochStartTriggerStub

type EpochStartTriggerStub struct {
	MetaEpochCalled func() uint32
}

EpochStartTriggerStub -

func (*EpochStartTriggerStub) IsInterfaceNil

func (e *EpochStartTriggerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*EpochStartTriggerStub) MetaEpoch

func (e *EpochStartTriggerStub) MetaEpoch() uint32

MetaEpoch -

type HardforkHandlerStub

type HardforkHandlerStub struct {
	ShouldTriggerHardforkCalled func() <-chan struct{}
	ExecuteCalled               func()
	CloseCalled                 func()
}

HardforkHandlerStub -

func (*HardforkHandlerStub) Close

func (stub *HardforkHandlerStub) Close()

Close -

func (*HardforkHandlerStub) Execute

func (stub *HardforkHandlerStub) Execute()

Execute -

func (*HardforkHandlerStub) ShouldTriggerHardfork

func (stub *HardforkHandlerStub) ShouldTriggerHardfork() <-chan struct{}

ShouldTriggerHardfork -

type HeartbeatMonitorStub

type HeartbeatMonitorStub struct {
	GetHeartbeatsCalled func() []data.PubKeyHeartbeat
}

HeartbeatMonitorStub -

func (*HeartbeatMonitorStub) GetHeartbeats

func (stub *HeartbeatMonitorStub) GetHeartbeats() []data.PubKeyHeartbeat

GetHeartbeats -

func (*HeartbeatMonitorStub) IsInterfaceNil

func (stub *HeartbeatMonitorStub) IsInterfaceNil() bool

IsInterfaceNil -

type HeartbeatSenderInfoProviderStub

type HeartbeatSenderInfoProviderStub struct {
	GetSenderInfoCalled func() (string, core.P2PPeerSubType, error)
}

HeartbeatSenderInfoProviderStub -

func (*HeartbeatSenderInfoProviderStub) GetSenderInfo

GetSenderInfo -

func (*HeartbeatSenderInfoProviderStub) IsInterfaceNil

func (stub *HeartbeatSenderInfoProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type HeartbeatStorerStub

type HeartbeatStorerStub struct {
	LoadGenesisTimeCalled   func() (time.Time, error)
	UpdateGenesisTimeCalled func(genesisTime time.Time) error
	LoadHeartBeatDTOCalled  func(pubKey string) (*data.HeartbeatDTO, error)
	SavePubkeyDataCalled    func(pubkey []byte, heartbeat *data.HeartbeatDTO) error
	LoadKeysCalled          func() ([][]byte, error)
	SaveKeysCalled          func(peersSlice [][]byte) error
}

HeartbeatStorerStub -

func (*HeartbeatStorerStub) IsInterfaceNil

func (hss *HeartbeatStorerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*HeartbeatStorerStub) LoadGenesisTime

func (hss *HeartbeatStorerStub) LoadGenesisTime() (time.Time, error)

LoadGenesisTime -

func (*HeartbeatStorerStub) LoadHeartBeatDTO

func (hss *HeartbeatStorerStub) LoadHeartBeatDTO(pubKey string) (*data.HeartbeatDTO, error)

LoadHeartBeatDTO -

func (*HeartbeatStorerStub) LoadKeys

func (hss *HeartbeatStorerStub) LoadKeys() ([][]byte, error)

LoadKeys -

func (*HeartbeatStorerStub) SaveKeys

func (hss *HeartbeatStorerStub) SaveKeys(peersSlice [][]byte) error

SaveKeys -

func (*HeartbeatStorerStub) SavePubkeyData

func (hss *HeartbeatStorerStub) SavePubkeyData(pubkey []byte, heartbeat *data.HeartbeatDTO) error

SavePubkeyData -

func (*HeartbeatStorerStub) UpdateGenesisTime

func (hss *HeartbeatStorerStub) UpdateGenesisTime(genesisTime time.Time) error

UpdateGenesisTime -

type KeyGenMock

type KeyGenMock struct {
	GeneratePairMock            func() (crypto.PrivateKey, crypto.PublicKey)
	PrivateKeyFromByteArrayMock func(b []byte) (crypto.PrivateKey, error)
	PublicKeyFromByteArrayMock  func(b []byte) (crypto.PublicKey, error)
	SuiteMock                   func() crypto.Suite
}

KeyGenMock -

func (*KeyGenMock) CheckPublicKeyValid

func (keyGen *KeyGenMock) CheckPublicKeyValid(_ []byte) error

CheckPublicKeyValid -

func (*KeyGenMock) GeneratePair

func (keyGen *KeyGenMock) GeneratePair() (crypto.PrivateKey, crypto.PublicKey)

GeneratePair -

func (*KeyGenMock) IsInterfaceNil

func (keyGen *KeyGenMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*KeyGenMock) PrivateKeyFromByteArray

func (keyGen *KeyGenMock) PrivateKeyFromByteArray(b []byte) (crypto.PrivateKey, error)

PrivateKeyFromByteArray -

func (*KeyGenMock) PublicKeyFromByteArray

func (keyGen *KeyGenMock) PublicKeyFromByteArray(b []byte) (crypto.PublicKey, error)

PublicKeyFromByteArray -

func (*KeyGenMock) Suite

func (keyGen *KeyGenMock) Suite() crypto.Suite

Suite -

type MarshallerMock

type MarshallerMock struct {
	Fail bool
}

MarshallerMock that will be used for testing

func (*MarshallerMock) IsInterfaceNil

func (mm *MarshallerMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*MarshallerMock) Marshal

func (mm *MarshallerMock) Marshal(obj interface{}) ([]byte, error)

Marshal converts the input object in a slice of bytes

func (*MarshallerMock) Unmarshal

func (mm *MarshallerMock) Unmarshal(obj interface{}, buff []byte) error

Unmarshal applies the serialized values over an instantiated object

type MarshallerStub

type MarshallerStub struct {
	MarshalHandler   func(obj interface{}) ([]byte, error)
	UnmarshalHandler func(obj interface{}, buff []byte) error
}

MarshallerStub -

func (*MarshallerStub) IsInterfaceNil

func (ms *MarshallerStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (MarshallerStub) Marshal

func (ms MarshallerStub) Marshal(obj interface{}) ([]byte, error)

Marshal -

func (MarshallerStub) Unmarshal

func (ms MarshallerStub) Unmarshal(obj interface{}, buff []byte) error

Unmarshal -

type MessageHandlerStub

type MessageHandlerStub struct {
	CreateHeartbeatFromP2PMessageCalled func(message p2p.MessageP2P) (*data.Heartbeat, error)
}

MessageHandlerStub -

func (*MessageHandlerStub) CreateHeartbeatFromP2PMessage

func (mhs *MessageHandlerStub) CreateHeartbeatFromP2PMessage(message p2p.MessageP2P) (*data.Heartbeat, error)

CreateHeartbeatFromP2PMessage -

func (*MessageHandlerStub) IsInterfaceNil

func (mhs *MessageHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type 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

func (p2pahs *P2PAntifloodHandlerStub) BlacklistPeer(peer core.PeerID, reason string, duration time.Duration)

BlacklistPeer -

func (*P2PAntifloodHandlerStub) CanProcessMessage

func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessage(message p2p.MessageP2P, fromConnectedPeer core.PeerID) error

CanProcessMessage -

func (*P2PAntifloodHandlerStub) CanProcessMessagesOnTopic

func (p2pahs *P2PAntifloodHandlerStub) CanProcessMessagesOnTopic(peer core.PeerID, topic string, numMessages uint32, totalSize uint64, sequence []byte) error

CanProcessMessagesOnTopic -

func (*P2PAntifloodHandlerStub) IsInterfaceNil

func (p2pahs *P2PAntifloodHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*P2PAntifloodHandlerStub) ResetForTopic

func (p2pahs *P2PAntifloodHandlerStub) ResetForTopic(_ string)

ResetForTopic -

func (*P2PAntifloodHandlerStub) SetMaxMessagesForTopic

func (p2pahs *P2PAntifloodHandlerStub) SetMaxMessagesForTopic(_ string, _ uint32)

SetMaxMessagesForTopic -

type P2PMessageStub

type P2PMessageStub struct {
	FromField      []byte
	DataField      []byte
	SeqNoField     []byte
	TopicField     string
	SignatureField []byte
	KeyField       []byte
	PeerField      core.PeerID
	PayloadField   []byte
	TimestampField int64
}

P2PMessageStub -

func (*P2PMessageStub) Data

func (msg *P2PMessageStub) Data() []byte

Data -

func (*P2PMessageStub) From

func (msg *P2PMessageStub) From() []byte

From -

func (*P2PMessageStub) IsInterfaceNil

func (msg *P2PMessageStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*P2PMessageStub) Key

func (msg *P2PMessageStub) Key() []byte

Key -

func (*P2PMessageStub) Payload

func (msg *P2PMessageStub) Payload() []byte

Payload -

func (*P2PMessageStub) Peer

func (msg *P2PMessageStub) Peer() core.PeerID

Peer -

func (*P2PMessageStub) SeqNo

func (msg *P2PMessageStub) SeqNo() []byte

SeqNo -

func (*P2PMessageStub) Signature

func (msg *P2PMessageStub) Signature() []byte

Signature -

func (*P2PMessageStub) Timestamp

func (msg *P2PMessageStub) Timestamp() int64

Timestamp -

func (*P2PMessageStub) Topic

func (msg *P2PMessageStub) Topic() string

Topic -

type PeerBlackListHandlerStub

type PeerBlackListHandlerStub struct {
	AddCalled   func(pid core.PeerID) error
	HasCalled   func(pid core.PeerID) bool
	SweepCalled func()
}

PeerBlackListHandlerStub -

func (*PeerBlackListHandlerStub) Add

func (pblhs *PeerBlackListHandlerStub) Add(pid core.PeerID) error

Add -

func (*PeerBlackListHandlerStub) Has

func (pblhs *PeerBlackListHandlerStub) Has(pid core.PeerID) bool

Has -

func (*PeerBlackListHandlerStub) IsInterfaceNil

func (pblhs *PeerBlackListHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerBlackListHandlerStub) Sweep

func (pblhs *PeerBlackListHandlerStub) Sweep()

Sweep -

type PeerSignatureHandler

type PeerSignatureHandler struct {
	Signer crypto.SingleSigner
	KeyGen crypto.KeyGenerator
}

PeerSignatureHandler -

func (*PeerSignatureHandler) GetPeerSignature

func (p *PeerSignatureHandler) GetPeerSignature(privateKey crypto.PrivateKey, msg []byte) ([]byte, error)

GetPeerSignature -

func (*PeerSignatureHandler) IsInterfaceNil

func (p *PeerSignatureHandler) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerSignatureHandler) VerifyPeerSignature

func (p *PeerSignatureHandler) VerifyPeerSignature(pk []byte, pid core.PeerID, sig []byte) error

VerifyPeerSignature -

type PeerSignatureHandlerStub

type PeerSignatureHandlerStub struct {
	VerifyPeerSignatureCalled func(pk []byte, pid core.PeerID, signature []byte) error
	GetPeerSignatureCalled    func(key crypto.PrivateKey, pid []byte) ([]byte, error)
}

PeerSignatureHandlerStub -

func (*PeerSignatureHandlerStub) GetPeerSignature

func (stub *PeerSignatureHandlerStub) GetPeerSignature(key crypto.PrivateKey, pid []byte) ([]byte, error)

GetPeerSignature -

func (*PeerSignatureHandlerStub) IsInterfaceNil

func (stub *PeerSignatureHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*PeerSignatureHandlerStub) VerifyPeerSignature

func (stub *PeerSignatureHandlerStub) VerifyPeerSignature(pk []byte, pid core.PeerID, signature []byte) error

VerifyPeerSignature -

type PeerTypeProviderStub

type PeerTypeProviderStub struct {
	ComputeForPubKeyCalled func(pubKey []byte) (common.PeerType, uint32, error)
}

PeerTypeProviderStub -

func (*PeerTypeProviderStub) Close

func (p *PeerTypeProviderStub) Close() error

Close -

func (*PeerTypeProviderStub) ComputeForPubKey

func (p *PeerTypeProviderStub) ComputeForPubKey(pubKey []byte) (common.PeerType, uint32, error)

ComputeForPubKey -

func (*PeerTypeProviderStub) GetAllPeerTypeInfos

func (p *PeerTypeProviderStub) GetAllPeerTypeInfos() []*state.PeerTypeInfo

GetAllPeerTypeInfos -

func (*PeerTypeProviderStub) IsInterfaceNil

func (p *PeerTypeProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

type PrivateKeyStub

type PrivateKeyStub struct {
	ToByteArrayHandler    func() ([]byte, error)
	GeneratePublicHandler func() crypto.PublicKey
	SuiteHandler          func() crypto.Suite
	ScalarHandler         func() crypto.Scalar
}

PrivateKeyStub -

func (*PrivateKeyStub) GeneratePublic

func (sk *PrivateKeyStub) GeneratePublic() crypto.PublicKey

GeneratePublic -

func (*PrivateKeyStub) IsInterfaceNil

func (sk *PrivateKeyStub) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PrivateKeyStub) Scalar

func (sk *PrivateKeyStub) Scalar() crypto.Scalar

Scalar -

func (*PrivateKeyStub) Suite

func (sk *PrivateKeyStub) Suite() crypto.Suite

Suite -

func (*PrivateKeyStub) ToByteArray

func (sk *PrivateKeyStub) ToByteArray() ([]byte, error)

ToByteArray -

type PubkeyConverterMock

type PubkeyConverterMock struct {
	// contains filtered or unexported fields
}

PubkeyConverterMock -

func NewPubkeyConverterMock

func NewPubkeyConverterMock(addressLen int) *PubkeyConverterMock

NewPubkeyConverterMock -

func (*PubkeyConverterMock) Decode

func (pcm *PubkeyConverterMock) Decode(humanReadable string) ([]byte, error)

Decode -

func (*PubkeyConverterMock) Encode

func (pcm *PubkeyConverterMock) Encode(pkBytes []byte) string

Encode -

func (*PubkeyConverterMock) IsInterfaceNil

func (pcm *PubkeyConverterMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*PubkeyConverterMock) Len

func (pcm *PubkeyConverterMock) Len() int

Len -

type PublicKeyMock

type PublicKeyMock struct {
	ToByteArrayHandler func() ([]byte, error)
	SuiteCalled        func() crypto.Suite
	PointCalled        func() crypto.Point
}

PublicKeyMock -

func (*PublicKeyMock) IsInterfaceNil

func (sspk *PublicKeyMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*PublicKeyMock) Point

func (sspk *PublicKeyMock) Point() crypto.Point

Point -

func (*PublicKeyMock) Suite

func (sspk *PublicKeyMock) Suite() crypto.Suite

Suite -

func (*PublicKeyMock) ToByteArray

func (sspk *PublicKeyMock) ToByteArray() ([]byte, error)

ToByteArray -

type RedundancyHandlerStub

type RedundancyHandlerStub struct {
	IsRedundancyNodeCalled    func() bool
	IsMainMachineActiveCalled func() bool
	ObserverPrivateKeyCalled  func() crypto.PrivateKey
}

RedundancyHandlerStub -

func (*RedundancyHandlerStub) IsInterfaceNil

func (rhs *RedundancyHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*RedundancyHandlerStub) IsMainMachineActive

func (rhs *RedundancyHandlerStub) IsMainMachineActive() bool

IsMainMachineActive -

func (*RedundancyHandlerStub) IsRedundancyNode

func (rhs *RedundancyHandlerStub) IsRedundancyNode() bool

IsRedundancyNode -

func (*RedundancyHandlerStub) ObserverPrivateKey

func (rhs *RedundancyHandlerStub) ObserverPrivateKey() crypto.PrivateKey

ObserverPrivateKey -

type SenderHandlerStub

type SenderHandlerStub struct {
	ExecutionReadyChannelCalled func() <-chan time.Time
	ExecuteCalled               func()
	CloseCalled                 func()
}

SenderHandlerStub -

func (*SenderHandlerStub) Close

func (stub *SenderHandlerStub) Close()

Close -

func (*SenderHandlerStub) Execute

func (stub *SenderHandlerStub) Execute()

Execute -

func (*SenderHandlerStub) ExecutionReadyChannel

func (stub *SenderHandlerStub) ExecutionReadyChannel() <-chan time.Time

ExecutionReadyChannel -

func (*SenderHandlerStub) IsInterfaceNil

func (stub *SenderHandlerStub) IsInterfaceNil() bool

IsInterfaceNil -

type ShardCoordinatorMock

type ShardCoordinatorMock struct {
	SelfShardId uint32
}

ShardCoordinatorMock -

func (*ShardCoordinatorMock) CommunicationIdentifier

func (scm *ShardCoordinatorMock) CommunicationIdentifier(destShardID uint32) string

CommunicationIdentifier -

func (*ShardCoordinatorMock) ComputeId

func (scm *ShardCoordinatorMock) ComputeId(_ []byte) uint32

ComputeId -

func (*ShardCoordinatorMock) IsInterfaceNil

func (scm *ShardCoordinatorMock) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*ShardCoordinatorMock) NumberOfShards

func (scm *ShardCoordinatorMock) NumberOfShards() uint32

NumberOfShards -

func (*ShardCoordinatorMock) SameShard

func (scm *ShardCoordinatorMock) SameShard(_, _ []byte) bool

SameShard -

func (*ShardCoordinatorMock) SelfId

func (scm *ShardCoordinatorMock) SelfId() uint32

SelfId -

func (*ShardCoordinatorMock) SetSelfShardId

func (scm *ShardCoordinatorMock) SetSelfShardId(shardId uint32) error

SetSelfShardId -

type SinglesignFailMock

type SinglesignFailMock struct {
}

SinglesignFailMock -

func (*SinglesignFailMock) IsInterfaceNil

func (s *SinglesignFailMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*SinglesignFailMock) Sign

func (s *SinglesignFailMock) Sign(_ crypto.PrivateKey, _ []byte) ([]byte, error)

Sign -

func (*SinglesignFailMock) Verify

func (s *SinglesignFailMock) Verify(_ crypto.PublicKey, _ []byte, _ []byte) error

Verify -

type SinglesignMock

type SinglesignMock struct {
}

SinglesignMock -

func (*SinglesignMock) IsInterfaceNil

func (s *SinglesignMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*SinglesignMock) Sign

func (s *SinglesignMock) Sign(_ crypto.PrivateKey, _ []byte) ([]byte, error)

Sign -

func (*SinglesignMock) Verify

func (s *SinglesignMock) Verify(_ crypto.PublicKey, _ []byte, sig []byte) error

Verify -

type SinglesignStub

type SinglesignStub struct {
	SignCalled   func(private crypto.PrivateKey, msg []byte) ([]byte, error)
	VerifyCalled func(public crypto.PublicKey, msg []byte, sig []byte) error
}

SinglesignStub -

func (*SinglesignStub) IsInterfaceNil

func (s *SinglesignStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*SinglesignStub) Sign

func (s *SinglesignStub) Sign(private crypto.PrivateKey, msg []byte) ([]byte, error)

Sign -

func (*SinglesignStub) Verify

func (s *SinglesignStub) Verify(public crypto.PublicKey, msg []byte, sig []byte) error

Verify -

type TimerHandlerStub

type TimerHandlerStub struct {
	CreateNewTimerCalled        func(duration time.Duration)
	ExecutionReadyChannelCalled func() <-chan time.Time
	CloseCalled                 func()
}

TimerHandlerStub -

func (*TimerHandlerStub) Close

func (stub *TimerHandlerStub) Close()

Close -

func (*TimerHandlerStub) CreateNewTimer

func (stub *TimerHandlerStub) CreateNewTimer(duration time.Duration)

CreateNewTimer -

func (*TimerHandlerStub) ExecutionReadyChannel

func (stub *TimerHandlerStub) ExecutionReadyChannel() <-chan time.Time

ExecutionReadyChannel -

type TimerMock

type TimerMock struct {
	NowCalled func() time.Time
	// contains filtered or unexported fields
}

TimerMock -

func NewTimerMock

func NewTimerMock() *TimerMock

NewTimerMock -

func (*TimerMock) IncrementSeconds

func (tm *TimerMock) IncrementSeconds(value int)

IncrementSeconds -

func (*TimerMock) IsInterfaceNil

func (tm *TimerMock) IsInterfaceNil() bool

IsInterfaceNil -

func (*TimerMock) Now

func (tm *TimerMock) Now() time.Time

Now -

func (*TimerMock) SetSeconds

func (tm *TimerMock) SetSeconds(value int)

SetSeconds -

type ValidatorMock

type ValidatorMock struct {
	// contains filtered or unexported fields
}

ValidatorMock -

func NewValidatorMock

func NewValidatorMock(pubKey []byte, chances uint32, index uint32) *ValidatorMock

NewValidatorMock -

func (*ValidatorMock) Chances

func (vm *ValidatorMock) Chances() uint32

Chances -

func (*ValidatorMock) Index

func (vm *ValidatorMock) Index() uint32

Index -

func (*ValidatorMock) PubKey

func (vm *ValidatorMock) PubKey() []byte

PubKey -

func (*ValidatorMock) Size

func (vm *ValidatorMock) Size() int

Size -

type ValidatorStatisticsStub

type ValidatorStatisticsStub struct {
	RootHashCalled                    func() ([]byte, error)
	GetValidatorInfoForRootHashCalled func(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)
}

ValidatorStatisticsStub -

func (*ValidatorStatisticsStub) GetValidatorInfoForRootHash

func (vss *ValidatorStatisticsStub) GetValidatorInfoForRootHash(rootHash []byte) (map[uint32][]*state.ValidatorInfo, error)

GetValidatorInfoForRootHash -

func (*ValidatorStatisticsStub) IsInterfaceNil

func (vss *ValidatorStatisticsStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*ValidatorStatisticsStub) RootHash

func (vss *ValidatorStatisticsStub) RootHash() ([]byte, error)

RootHash -

type ValidatorsProviderStub

type ValidatorsProviderStub struct {
	GetLatestValidatorsCalled func() map[string]*state.ValidatorApiResponse
}

ValidatorsProviderStub -

func (*ValidatorsProviderStub) Close

func (vp *ValidatorsProviderStub) Close() error

Close -

func (*ValidatorsProviderStub) GetLatestValidators

func (vp *ValidatorsProviderStub) GetLatestValidators() map[string]*state.ValidatorApiResponse

GetLatestValidators -

func (*ValidatorsProviderStub) IsInterfaceNil

func (vp *ValidatorsProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL