Documentation ¶
Overview ¶
Package malfeasance is a generated GoMock package.
Index ¶
- Constants
- Variables
- 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, _ p2p.Peer, data []byte) error
- func (h *Handler) RegisterHandlerV1(malfeasanceType MalfeasanceType, handler HandlerV1)
- func (h *Handler) RegisterHandlerV2(malfeasanceType MalfeasanceType, handler HandlerV2)
- func (h *Handler) Validate(ctx context.Context, p *wire.MalfeasanceGossip) (types.NodeID, error)
- type HandlerV1
- type HandlerV2
- type MalfeasanceType
- type MockHandlerV1
- type MockHandlerV1MockRecorder
- type MockHandlerV1ReportInvalidProofCall
- func (c *MockHandlerV1ReportInvalidProofCall) Do(f func(*prometheus.CounterVec)) *MockHandlerV1ReportInvalidProofCall
- func (c *MockHandlerV1ReportInvalidProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockHandlerV1ReportInvalidProofCall
- func (c *MockHandlerV1ReportInvalidProofCall) Return() *MockHandlerV1ReportInvalidProofCall
- type MockHandlerV1ReportProofCall
- type MockHandlerV1ValidateCall
- func (c *MockHandlerV1ValidateCall) Do(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockHandlerV1ValidateCall
- func (c *MockHandlerV1ValidateCall) DoAndReturn(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockHandlerV1ValidateCall
- func (c *MockHandlerV1ValidateCall) Return(arg0 types.NodeID, arg1 error) *MockHandlerV1ValidateCall
- type MockHandlerV2
- type MockHandlerV2MockRecorder
- type MockHandlerV2ValidateCall
- func (c *MockHandlerV2ValidateCall) Do(f func(context.Context, []byte) (types.NodeID, error)) *MockHandlerV2ValidateCall
- func (c *MockHandlerV2ValidateCall) DoAndReturn(f func(context.Context, []byte) (types.NodeID, error)) *MockHandlerV2ValidateCall
- func (c *MockHandlerV2ValidateCall) Return(arg0 types.NodeID, arg1 error) *MockHandlerV2ValidateCall
- type Mocktortoise
- type MocktortoiseMockRecorder
- type MocktortoiseOnMalfeasanceCall
Constants ¶
const ( // V1 types. MultipleATXs MalfeasanceType = MalfeasanceType(wire.MultipleATXs) MultipleBallots = MalfeasanceType(wire.MultipleBallots) HareEquivocation = MalfeasanceType(wire.HareEquivocation) InvalidPostIndex = MalfeasanceType(wire.InvalidPostIndex) InvalidPrevATX = MalfeasanceType(wire.InvalidPrevATX) // V2 types // TODO(mafa): for future use. InvalidActivation MalfeasanceType = iota + 10 InvalidBallot InvalidHareMsg )
Variables ¶
var (
ErrKnownProof = errors.New("known proof")
)
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, _ p2p.Peer, data []byte, ) error
HandleSyncedMalfeasanceProof is the sync validator for MalfeasanceProof.
func (*Handler) RegisterHandlerV1 ¶ added in v1.6.0
func (h *Handler) RegisterHandlerV1(malfeasanceType MalfeasanceType, handler HandlerV1)
func (*Handler) RegisterHandlerV2 ¶ added in v1.6.0
func (h *Handler) RegisterHandlerV2(malfeasanceType MalfeasanceType, handler HandlerV2)
type HandlerV1 ¶ added in v1.6.0
type HandlerV1 interface { Validate(ctx context.Context, data wire.ProofData) (types.NodeID, error) ReportProof(vec *prometheus.CounterVec) ReportInvalidProof(vec *prometheus.CounterVec) }
type MalfeasanceType ¶ added in v1.6.0
type MalfeasanceType byte
type MockHandlerV1 ¶ added in v1.6.0
type MockHandlerV1 struct {
// contains filtered or unexported fields
}
MockHandlerV1 is a mock of HandlerV1 interface.
func NewMockHandlerV1 ¶ added in v1.6.0
func NewMockHandlerV1(ctrl *gomock.Controller) *MockHandlerV1
NewMockHandlerV1 creates a new mock instance.
func (*MockHandlerV1) EXPECT ¶ added in v1.6.0
func (m *MockHandlerV1) EXPECT() *MockHandlerV1MockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockHandlerV1) ReportInvalidProof ¶ added in v1.6.0
func (m *MockHandlerV1) ReportInvalidProof(vec *prometheus.CounterVec)
ReportInvalidProof mocks base method.
func (*MockHandlerV1) ReportProof ¶ added in v1.6.0
func (m *MockHandlerV1) ReportProof(vec *prometheus.CounterVec)
ReportProof mocks base method.
type MockHandlerV1MockRecorder ¶ added in v1.6.0
type MockHandlerV1MockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerV1MockRecorder is the mock recorder for MockHandlerV1.
func (*MockHandlerV1MockRecorder) ReportInvalidProof ¶ added in v1.6.0
func (mr *MockHandlerV1MockRecorder) ReportInvalidProof(vec any) *MockHandlerV1ReportInvalidProofCall
ReportInvalidProof indicates an expected call of ReportInvalidProof.
func (*MockHandlerV1MockRecorder) ReportProof ¶ added in v1.6.0
func (mr *MockHandlerV1MockRecorder) ReportProof(vec any) *MockHandlerV1ReportProofCall
ReportProof indicates an expected call of ReportProof.
func (*MockHandlerV1MockRecorder) Validate ¶ added in v1.6.0
func (mr *MockHandlerV1MockRecorder) Validate(ctx, data any) *MockHandlerV1ValidateCall
Validate indicates an expected call of Validate.
type MockHandlerV1ReportInvalidProofCall ¶ added in v1.6.0
MockHandlerV1ReportInvalidProofCall wrap *gomock.Call
func (*MockHandlerV1ReportInvalidProofCall) Do ¶ added in v1.6.0
func (c *MockHandlerV1ReportInvalidProofCall) Do(f func(*prometheus.CounterVec)) *MockHandlerV1ReportInvalidProofCall
Do rewrite *gomock.Call.Do
func (*MockHandlerV1ReportInvalidProofCall) DoAndReturn ¶ added in v1.6.0
func (c *MockHandlerV1ReportInvalidProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockHandlerV1ReportInvalidProofCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHandlerV1ReportInvalidProofCall) Return ¶ added in v1.6.0
func (c *MockHandlerV1ReportInvalidProofCall) Return() *MockHandlerV1ReportInvalidProofCall
Return rewrite *gomock.Call.Return
type MockHandlerV1ReportProofCall ¶ added in v1.6.0
MockHandlerV1ReportProofCall wrap *gomock.Call
func (*MockHandlerV1ReportProofCall) Do ¶ added in v1.6.0
func (c *MockHandlerV1ReportProofCall) Do(f func(*prometheus.CounterVec)) *MockHandlerV1ReportProofCall
Do rewrite *gomock.Call.Do
func (*MockHandlerV1ReportProofCall) DoAndReturn ¶ added in v1.6.0
func (c *MockHandlerV1ReportProofCall) DoAndReturn(f func(*prometheus.CounterVec)) *MockHandlerV1ReportProofCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHandlerV1ReportProofCall) Return ¶ added in v1.6.0
func (c *MockHandlerV1ReportProofCall) Return() *MockHandlerV1ReportProofCall
Return rewrite *gomock.Call.Return
type MockHandlerV1ValidateCall ¶ added in v1.6.0
MockHandlerV1ValidateCall wrap *gomock.Call
func (*MockHandlerV1ValidateCall) Do ¶ added in v1.6.0
func (c *MockHandlerV1ValidateCall) Do(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockHandlerV1ValidateCall
Do rewrite *gomock.Call.Do
func (*MockHandlerV1ValidateCall) DoAndReturn ¶ added in v1.6.0
func (c *MockHandlerV1ValidateCall) DoAndReturn(f func(context.Context, wire.ProofData) (types.NodeID, error)) *MockHandlerV1ValidateCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHandlerV1ValidateCall) Return ¶ added in v1.6.0
func (c *MockHandlerV1ValidateCall) Return(arg0 types.NodeID, arg1 error) *MockHandlerV1ValidateCall
Return rewrite *gomock.Call.Return
type MockHandlerV2 ¶ added in v1.6.0
type MockHandlerV2 struct {
// contains filtered or unexported fields
}
MockHandlerV2 is a mock of HandlerV2 interface.
func NewMockHandlerV2 ¶ added in v1.6.0
func NewMockHandlerV2(ctrl *gomock.Controller) *MockHandlerV2
NewMockHandlerV2 creates a new mock instance.
func (*MockHandlerV2) EXPECT ¶ added in v1.6.0
func (m *MockHandlerV2) EXPECT() *MockHandlerV2MockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockHandlerV2MockRecorder ¶ added in v1.6.0
type MockHandlerV2MockRecorder struct {
// contains filtered or unexported fields
}
MockHandlerV2MockRecorder is the mock recorder for MockHandlerV2.
func (*MockHandlerV2MockRecorder) Validate ¶ added in v1.6.0
func (mr *MockHandlerV2MockRecorder) Validate(ctx, data any) *MockHandlerV2ValidateCall
Validate indicates an expected call of Validate.
type MockHandlerV2ValidateCall ¶ added in v1.6.0
MockHandlerV2ValidateCall wrap *gomock.Call
func (*MockHandlerV2ValidateCall) Do ¶ added in v1.6.0
func (c *MockHandlerV2ValidateCall) Do(f func(context.Context, []byte) (types.NodeID, error)) *MockHandlerV2ValidateCall
Do rewrite *gomock.Call.Do
func (*MockHandlerV2ValidateCall) DoAndReturn ¶ added in v1.6.0
func (c *MockHandlerV2ValidateCall) DoAndReturn(f func(context.Context, []byte) (types.NodeID, error)) *MockHandlerV2ValidateCall
DoAndReturn rewrite *gomock.Call.DoAndReturn
func (*MockHandlerV2ValidateCall) Return ¶ added in v1.6.0
func (c *MockHandlerV2ValidateCall) Return(arg0 types.NodeID, arg1 error) *MockHandlerV2ValidateCall
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