malfeasance

package
v1.2.12-rc2 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Code generated by MockGen. DO NOT EDIT. Source: ./interface.go

Generated by this command:

mockgen -typed -package=malfeasance -destination=./mocks.go -source=./interface.go

Package malfeasance is a generated GoMock package.

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKnownProof = errors.New("known proof")
)

Functions

func Validate

func Validate(
	ctx context.Context,
	logger log.Log,
	cdb *datastore.CachedDB,
	edVerifier SigVerifier,
	cp consensusProtocol,
	p *types.MalfeasanceGossip,
) (types.NodeID, error)

Types

type Handler

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

Handler processes MalfeasanceProof from gossip and, if deems it valid, propagates it to peers.

func NewHandler

func NewHandler(
	cdb *datastore.CachedDB,
	lg log.Log,
	self p2p.Peer,
	nodeID types.NodeID,
	cp consensusProtocol,
	edVerifier SigVerifier,
	tortoise tortoise,
) *Handler

func (*Handler) HandleMalfeasanceProof

func (h *Handler) HandleMalfeasanceProof(ctx context.Context, peer p2p.Peer, data []byte) error

HandleMalfeasanceProof is the gossip receiver for MalfeasanceGossip.

func (*Handler) HandleSyncedMalfeasanceProof

func (h *Handler) HandleSyncedMalfeasanceProof(ctx context.Context, expHash types.Hash32, _ p2p.Peer, data []byte) error

HandleSyncedMalfeasanceProof is the sync validator for MalfeasanceProof.

type MockSigVerifier

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

MockSigVerifier is a mock of SigVerifier interface.

func NewMockSigVerifier

func NewMockSigVerifier(ctrl *gomock.Controller) *MockSigVerifier

NewMockSigVerifier creates a new mock instance.

func (*MockSigVerifier) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockSigVerifier) Verify

func (m *MockSigVerifier) Verify(arg0 signing.Domain, arg1 types.NodeID, arg2 []byte, arg3 types.EdSignature) bool

Verify mocks base method.

type MockSigVerifierMockRecorder

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

MockSigVerifierMockRecorder is the mock recorder for MockSigVerifier.

func (*MockSigVerifierMockRecorder) Verify

func (mr *MockSigVerifierMockRecorder) Verify(arg0, arg1, arg2, arg3 any) *SigVerifierVerifyCall

Verify indicates an expected call of Verify.

type MockconsensusProtocol

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

MockconsensusProtocol is a mock of consensusProtocol interface.

func NewMockconsensusProtocol

func NewMockconsensusProtocol(ctrl *gomock.Controller) *MockconsensusProtocol

NewMockconsensusProtocol creates a new mock instance.

func (*MockconsensusProtocol) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockconsensusProtocol) HandleEligibility

func (m *MockconsensusProtocol) HandleEligibility(arg0 context.Context, arg1 *types.HareEligibilityGossip)

HandleEligibility mocks base method.

type MockconsensusProtocolMockRecorder

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

MockconsensusProtocolMockRecorder is the mock recorder for MockconsensusProtocol.

func (*MockconsensusProtocolMockRecorder) HandleEligibility

func (mr *MockconsensusProtocolMockRecorder) HandleEligibility(arg0, arg1 any) *consensusProtocolHandleEligibilityCall

HandleEligibility indicates an expected call of HandleEligibility.

type Mocktortoise

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

Mocktortoise is a mock of tortoise interface.

func NewMocktortoise

func NewMocktortoise(ctrl *gomock.Controller) *Mocktortoise

NewMocktortoise creates a new mock instance.

func (*Mocktortoise) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*Mocktortoise) OnMalfeasance

func (m *Mocktortoise) OnMalfeasance(arg0 types.NodeID)

OnMalfeasance mocks base method.

type MocktortoiseMockRecorder

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

MocktortoiseMockRecorder is the mock recorder for Mocktortoise.

func (*MocktortoiseMockRecorder) OnMalfeasance

func (mr *MocktortoiseMockRecorder) OnMalfeasance(arg0 any) *tortoiseOnMalfeasanceCall

OnMalfeasance indicates an expected call of OnMalfeasance.

type SigVerifier

type SigVerifier interface {
	Verify(signing.Domain, types.NodeID, []byte, types.EdSignature) bool
}

type SigVerifierVerifyCall added in v1.1.5

type SigVerifierVerifyCall struct {
	*gomock.Call
}

SigVerifierVerifyCall wrap *gomock.Call

func (*SigVerifierVerifyCall) Do added in v1.1.5

Do rewrite *gomock.Call.Do

func (*SigVerifierVerifyCall) DoAndReturn added in v1.1.5

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*SigVerifierVerifyCall) Return added in v1.1.5

Return rewrite *gomock.Call.Return

Jump to

Keyboard shortcuts

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