mock

package
v1.7.13-patch2 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2024 License: GPL-3.0 Imports: 8 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
	SetCurrentBlockHeaderAndRootHashCalled func(bh data.HeaderHandler, rootHash []byte) error
}

CurrentBlockProviderStub -

func (*CurrentBlockProviderStub) GetCurrentBlockHeader

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

GetCurrentBlockHeader -

func (*CurrentBlockProviderStub) IsInterfaceNil

func (cbps *CurrentBlockProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

func (*CurrentBlockProviderStub) SetCurrentBlockHeaderAndRootHash

func (cbps *CurrentBlockProviderStub) SetCurrentBlockHeaderAndRootHash(bh data.HeaderHandler, rootHash []byte) error

SetCurrentBlockHeaderAndRootHash -

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 {
	GetCurrentNodeTypeCalled func() (string, core.P2PPeerSubType, error)
}

HeartbeatSenderInfoProviderStub -

func (*HeartbeatSenderInfoProviderStub) GetCurrentNodeType added in v1.6.0

func (stub *HeartbeatSenderInfoProviderStub) GetCurrentNodeType() (string, core.P2PPeerSubType, error)

GetCurrentNodeType -

func (*HeartbeatSenderInfoProviderStub) IsInterfaceNil

func (stub *HeartbeatSenderInfoProviderStub) IsInterfaceNil() bool

IsInterfaceNil -

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 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 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 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 -

Jump to

Keyboard shortcuts

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