malfeasance

package
v1.4.0-alpha.7 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Overview

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,
	postVerifier postVerifier,
	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,
	edVerifier SigVerifier,
	tortoise tortoise,
	postVerifier postVerifier,
) *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) *MockSigVerifierVerifyCall

Verify indicates an expected call of Verify.

type MockSigVerifierVerifyCall added in v1.4.0

type MockSigVerifierVerifyCall struct {
	*gomock.Call
}

MockSigVerifierVerifyCall wrap *gomock.Call

func (*MockSigVerifierVerifyCall) Do added in v1.4.0

Do rewrite *gomock.Call.Do

func (*MockSigVerifierVerifyCall) DoAndReturn added in v1.4.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockSigVerifierVerifyCall) Return added in v1.4.0

Return rewrite *gomock.Call.Return

type MockpostVerifier added in v1.4.0

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

MockpostVerifier is a mock of postVerifier interface.

func NewMockpostVerifier added in v1.4.0

func NewMockpostVerifier(ctrl *gomock.Controller) *MockpostVerifier

NewMockpostVerifier creates a new mock instance.

func (*MockpostVerifier) EXPECT added in v1.4.0

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

func (*MockpostVerifier) Verify added in v1.4.0

Verify mocks base method.

type MockpostVerifierMockRecorder added in v1.4.0

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

MockpostVerifierMockRecorder is the mock recorder for MockpostVerifier.

func (*MockpostVerifierMockRecorder) Verify added in v1.4.0

func (mr *MockpostVerifierMockRecorder) Verify(ctx, p, m any, opts ...any) *MockpostVerifierVerifyCall

Verify indicates an expected call of Verify.

type MockpostVerifierVerifyCall added in v1.4.0

type MockpostVerifierVerifyCall struct {
	*gomock.Call
}

MockpostVerifierVerifyCall wrap *gomock.Call

func (*MockpostVerifierVerifyCall) Do added in v1.4.0

Do rewrite *gomock.Call.Do

func (*MockpostVerifierVerifyCall) DoAndReturn added in v1.4.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MockpostVerifierVerifyCall) Return added in v1.4.0

Return rewrite *gomock.Call.Return

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

OnMalfeasance indicates an expected call of OnMalfeasance.

type MocktortoiseOnMalfeasanceCall added in v1.4.0

type MocktortoiseOnMalfeasanceCall struct {
	*gomock.Call
}

MocktortoiseOnMalfeasanceCall wrap *gomock.Call

func (*MocktortoiseOnMalfeasanceCall) Do added in v1.4.0

Do rewrite *gomock.Call.Do

func (*MocktortoiseOnMalfeasanceCall) DoAndReturn added in v1.4.0

DoAndReturn rewrite *gomock.Call.DoAndReturn

func (*MocktortoiseOnMalfeasanceCall) Return added in v1.4.0

Return rewrite *gomock.Call.Return

type SigVerifier

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

Jump to

Keyboard shortcuts

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