Documentation ¶
Overview ¶
Package malfeasance is a generated GoMock package.
Index ¶
- Constants
- type Handler
- func (h *Handler) HandleMalfeasanceProof(ctx context.Context, peer p2p.Peer, data []byte) error
- func (h *Handler) HandleSyncedMalfeasanceProof(ctx context.Context, expHash types.Hash32, peer p2p.Peer, data []byte) error
- func (h *Handler) Info(data []byte) (map[string]string, error)
- func (h *Handler) RegisterHandler(malfeasanceType MalfeasanceType, handler MalfeasanceHandler)
- func (h *Handler) Validate(ctx context.Context, p *wire.MalfeasanceProof) (types.NodeID, error)
- type MalfeasanceHandler
- type MalfeasanceType
- type MockMalfeasanceHandler
- func (m *MockMalfeasanceHandler) EXPECT() *MockMalfeasanceHandlerMockRecorder
- func (m *MockMalfeasanceHandler) Info(data wire.ProofData) (map[string]string, error)
- func (m *MockMalfeasanceHandler) ReportInvalidProof(vec *prometheus.CounterVec)
- func (m *MockMalfeasanceHandler) ReportProof(vec *prometheus.CounterVec)
- func (m *MockMalfeasanceHandler) Validate(ctx context.Context, data wire.ProofData) (types.NodeID, error)
- type MockMalfeasanceHandlerInfoCall
- func (c *MockMalfeasanceHandlerInfoCall) Do(f func(wire.ProofData) (map[string]string, error)) *MockMalfeasanceHandlerInfoCall
- func (c *MockMalfeasanceHandlerInfoCall) DoAndReturn(f func(wire.ProofData) (map[string]string, error)) *MockMalfeasanceHandlerInfoCall
- func (c *MockMalfeasanceHandlerInfoCall) Return(arg0 map[string]string, arg1 error) *MockMalfeasanceHandlerInfoCall
- type MockMalfeasanceHandlerMockRecorder
- func (mr *MockMalfeasanceHandlerMockRecorder) Info(data any) *MockMalfeasanceHandlerInfoCall
- func (mr *MockMalfeasanceHandlerMockRecorder) ReportInvalidProof(vec any) *MockMalfeasanceHandlerReportInvalidProofCall
- func (mr *MockMalfeasanceHandlerMockRecorder) ReportProof(vec any) *MockMalfeasanceHandlerReportProofCall
- func (mr *MockMalfeasanceHandlerMockRecorder) Validate(ctx, data any) *MockMalfeasanceHandlerValidateCall
- type MockMalfeasanceHandlerReportInvalidProofCall
- func (c *MockMalfeasanceHandlerReportInvalidProofCall) Do(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportInvalidProofCall
- func (c *MockMalfeasanceHandlerReportInvalidProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportInvalidProofCall
- func (c *MockMalfeasanceHandlerReportInvalidProofCall) Return() *MockMalfeasanceHandlerReportInvalidProofCall
- type MockMalfeasanceHandlerReportProofCall
- func (c *MockMalfeasanceHandlerReportProofCall) Do(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportProofCall
- func (c *MockMalfeasanceHandlerReportProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportProofCall
- func (c *MockMalfeasanceHandlerReportProofCall) Return() *MockMalfeasanceHandlerReportProofCall
- type MockMalfeasanceHandlerValidateCall
- func (c *MockMalfeasanceHandlerValidateCall) Do(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockMalfeasanceHandlerValidateCall
- func (c *MockMalfeasanceHandlerValidateCall) DoAndReturn(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockMalfeasanceHandlerValidateCall
- func (c *MockMalfeasanceHandlerValidateCall) Return(arg0 types.NodeID, arg1 error) *MockMalfeasanceHandlerValidateCall
- type Mocktortoise
- type MocktortoiseMockRecorder
- type MocktortoiseOnMalfeasanceCall
Constants ¶
const ( MultipleATXs MalfeasanceType = MalfeasanceType(wire.MultipleATXs) MultipleBallots = MalfeasanceType(wire.MultipleBallots) HareEquivocation = MalfeasanceType(wire.HareEquivocation) InvalidPostIndex = MalfeasanceType(wire.InvalidPostIndex) InvalidPrevATX = MalfeasanceType(wire.InvalidPrevATX) )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
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 (*Handler) HandleMalfeasanceProof ¶
HandleMalfeasanceProof is the gossip receiver for MalfeasanceGossip.
func (*Handler) HandleSyncedMalfeasanceProof ¶
func (h *Handler) HandleSyncedMalfeasanceProof( ctx context.Context, expHash types.Hash32, peer p2p.Peer, data []byte, ) error
HandleSyncedMalfeasanceProof is the sync validator for MalfeasanceProof.
func (*Handler) RegisterHandler ¶ added in v1.7.2
func (h *Handler) RegisterHandler(malfeasanceType MalfeasanceType, handler MalfeasanceHandler)
type MalfeasanceHandler ¶ added in v1.7.2
type MalfeasanceHandler interface { Validate(ctx context.Context, data wire.ProofData) (types.NodeID, error) Info(data wire.ProofData) (map[string]string, error) ReportProof(vec *prometheus.CounterVec) ReportInvalidProof(vec *prometheus.CounterVec) }
type MalfeasanceType ¶ added in v1.6.0
type MalfeasanceType byte
type MockMalfeasanceHandler ¶ added in v1.7.2
type MockMalfeasanceHandler struct {
// contains filtered or unexported fields
}
MockMalfeasanceHandler is a mock of MalfeasanceHandler interface.
func NewMockMalfeasanceHandler ¶ added in v1.7.2
func NewMockMalfeasanceHandler(ctrl *gomock.Controller) *MockMalfeasanceHandler
NewMockMalfeasanceHandler creates a new mock instance.
func (*MockMalfeasanceHandler) EXPECT ¶ added in v1.7.2
func (m *MockMalfeasanceHandler) EXPECT() *MockMalfeasanceHandlerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockMalfeasanceHandler) ReportInvalidProof ¶ added in v1.7.2
func (m *MockMalfeasanceHandler) ReportInvalidProof(vec *prometheus.CounterVec)
ReportInvalidProof mocks base method.
func (*MockMalfeasanceHandler) ReportProof ¶ added in v1.7.2
func (m *MockMalfeasanceHandler) ReportProof(vec *prometheus.CounterVec)
ReportProof mocks base method.
type MockMalfeasanceHandlerInfoCall ¶ added in v1.7.2
MockMalfeasanceHandlerInfoCall wrap *gomock.Call
func (*MockMalfeasanceHandlerInfoCall) Do ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerInfoCall) Do(f func(wire.ProofData) (map[string]string, error)) *MockMalfeasanceHandlerInfoCall
Do rewrite *gomock.Call.Do
func (*MockMalfeasanceHandlerInfoCall) DoAndReturn ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerInfoCall) DoAndReturn(f func(wire.ProofData) (map[string]string, error)) *MockMalfeasanceHandlerInfoCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockMalfeasanceHandlerInfoCall) Return ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerInfoCall) Return(arg0 map[string]string, arg1 error) *MockMalfeasanceHandlerInfoCall
Return rewrite *gomock.Call.Return
type MockMalfeasanceHandlerMockRecorder ¶ added in v1.7.2
type MockMalfeasanceHandlerMockRecorder struct {
// contains filtered or unexported fields
}
MockMalfeasanceHandlerMockRecorder is the mock recorder for MockMalfeasanceHandler.
func (*MockMalfeasanceHandlerMockRecorder) Info ¶ added in v1.7.2
func (mr *MockMalfeasanceHandlerMockRecorder) Info(data any) *MockMalfeasanceHandlerInfoCall
Info indicates an expected call of Info.
func (*MockMalfeasanceHandlerMockRecorder) ReportInvalidProof ¶ added in v1.7.2
func (mr *MockMalfeasanceHandlerMockRecorder) ReportInvalidProof(vec any) *MockMalfeasanceHandlerReportInvalidProofCall
ReportInvalidProof indicates an expected call of ReportInvalidProof.
func (*MockMalfeasanceHandlerMockRecorder) ReportProof ¶ added in v1.7.2
func (mr *MockMalfeasanceHandlerMockRecorder) ReportProof(vec any) *MockMalfeasanceHandlerReportProofCall
ReportProof indicates an expected call of ReportProof.
func (*MockMalfeasanceHandlerMockRecorder) Validate ¶ added in v1.7.2
func (mr *MockMalfeasanceHandlerMockRecorder) Validate(ctx, data any) *MockMalfeasanceHandlerValidateCall
Validate indicates an expected call of Validate.
type MockMalfeasanceHandlerReportInvalidProofCall ¶ added in v1.7.2
MockMalfeasanceHandlerReportInvalidProofCall wrap *gomock.Call
func (*MockMalfeasanceHandlerReportInvalidProofCall) Do ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportInvalidProofCall) Do(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportInvalidProofCall
Do rewrite *gomock.Call.Do
func (*MockMalfeasanceHandlerReportInvalidProofCall) DoAndReturn ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportInvalidProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportInvalidProofCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockMalfeasanceHandlerReportInvalidProofCall) Return ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportInvalidProofCall) Return() *MockMalfeasanceHandlerReportInvalidProofCall
Return rewrite *gomock.Call.Return
type MockMalfeasanceHandlerReportProofCall ¶ added in v1.7.2
MockMalfeasanceHandlerReportProofCall wrap *gomock.Call
func (*MockMalfeasanceHandlerReportProofCall) Do ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportProofCall) Do(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportProofCall
Do rewrite *gomock.Call.Do
func (*MockMalfeasanceHandlerReportProofCall) DoAndReturn ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockMalfeasanceHandlerReportProofCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockMalfeasanceHandlerReportProofCall) Return ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerReportProofCall) Return() *MockMalfeasanceHandlerReportProofCall
Return rewrite *gomock.Call.Return
type MockMalfeasanceHandlerValidateCall ¶ added in v1.7.2
MockMalfeasanceHandlerValidateCall wrap *gomock.Call
func (*MockMalfeasanceHandlerValidateCall) Do ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerValidateCall) Do(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockMalfeasanceHandlerValidateCall
Do rewrite *gomock.Call.Do
func (*MockMalfeasanceHandlerValidateCall) DoAndReturn ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerValidateCall) DoAndReturn(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockMalfeasanceHandlerValidateCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockMalfeasanceHandlerValidateCall) Return ¶ added in v1.7.2
func (c *MockMalfeasanceHandlerValidateCall) Return(arg0 types.NodeID, arg1 error) *MockMalfeasanceHandlerValidateCall
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 ¶
func (m *Mocktortoise) EXPECT() *MocktortoiseMockRecorder
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) *MocktortoiseOnMalfeasanceCall
OnMalfeasance indicates an expected call of OnMalfeasance.
type MocktortoiseOnMalfeasanceCall ¶ added in v1.4.0
MocktortoiseOnMalfeasanceCall wrap *gomock.Call
func (*MocktortoiseOnMalfeasanceCall) Do ¶ added in v1.4.0
func (c *MocktortoiseOnMalfeasanceCall) Do(f func(types.NodeID)) *MocktortoiseOnMalfeasanceCall
Do rewrite *gomock.Call.Do
func (*MocktortoiseOnMalfeasanceCall) DoAndReturn ¶ added in v1.4.0
func (c *MocktortoiseOnMalfeasanceCall) DoAndReturn(f func(types.NodeID)) *MocktortoiseOnMalfeasanceCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MocktortoiseOnMalfeasanceCall) Return ¶ added in v1.4.0
func (c *MocktortoiseOnMalfeasanceCall) Return() *MocktortoiseOnMalfeasanceCall
Return rewrite *gomock.Call.Return