Documentation ¶
Overview ¶
Code generated by MockGen. DO NOT EDIT. Source: ./interface.go
Generated by this command:
mockgen -typed -package=proposals -destination=./mocks.go -source=./interface.go
Package proposals is a generated GoMock package.
nolint
Index ¶
- Variables
- func MustGetNumEligibleSlots(weight, minWeight, totalWeight uint64, committeeSize, layersPerEpoch uint32) uint32
- func MustSerializeVRFMessage(beacon types.Beacon, epoch types.EpochID, nonce types.VRFPostIndex, ...) []byte
- type Config
- type Handler
- func (h *Handler) HandleActiveSet(ctx context.Context, id types.Hash32, peer p2p.Peer, data []byte) error
- func (h *Handler) HandleProposal(ctx context.Context, peer p2p.Peer, data []byte) error
- func (h *Handler) HandleSyncedBallot(ctx context.Context, expHash types.Hash32, peer p2p.Peer, data []byte) error
- func (h *Handler) HandleSyncedProposal(ctx context.Context, expHash types.Hash32, peer p2p.Peer, data []byte) error
- type MockeligibilityValidator
- type MockeligibilityValidatorMockRecorder
- type MocklayerClock
- type MocklayerClockMockRecorder
- type MockmeshProvider
- func (m *MockmeshProvider) AddBallot(arg0 context.Context, arg1 *types.Ballot) (*types.MalfeasanceProof, error)
- func (m *MockmeshProvider) AddTXsFromProposal(arg0 context.Context, arg1 types.LayerID, arg2 types.ProposalID, ...) error
- func (m *MockmeshProvider) EXPECT() *MockmeshProviderMockRecorder
- func (m *MockmeshProvider) ProcessedLayer() types.LayerID
- type MockmeshProviderMockRecorder
- func (mr *MockmeshProviderMockRecorder) AddBallot(arg0, arg1 any) *meshProviderAddBallotCall
- func (mr *MockmeshProviderMockRecorder) AddTXsFromProposal(arg0, arg1, arg2, arg3 any) *meshProviderAddTXsFromProposalCall
- func (mr *MockmeshProviderMockRecorder) ProcessedLayer() *meshProviderProcessedLayerCall
- type MocknonceFetcher
- type MocknonceFetcherMockRecorder
- type MocktortoiseProvider
- func (m *MocktortoiseProvider) DecodeBallot(arg0 *types.BallotTortoiseData) (*tortoise.DecodedBallot, error)
- func (m *MocktortoiseProvider) EXPECT() *MocktortoiseProviderMockRecorder
- func (m *MocktortoiseProvider) GetBallot(arg0 types.BallotID) *tortoise.BallotData
- func (m *MocktortoiseProvider) GetMissingActiveSet(arg0 types.EpochID, arg1 []types.ATXID) []types.ATXID
- func (m *MocktortoiseProvider) StoreBallot(arg0 *tortoise.DecodedBallot) error
- type MocktortoiseProviderMockRecorder
- func (mr *MocktortoiseProviderMockRecorder) DecodeBallot(arg0 any) *tortoiseProviderDecodeBallotCall
- func (mr *MocktortoiseProviderMockRecorder) GetBallot(arg0 any) *tortoiseProviderGetBallotCall
- func (mr *MocktortoiseProviderMockRecorder) GetMissingActiveSet(arg0, arg1 any) *tortoiseProviderGetMissingActiveSetCall
- func (mr *MocktortoiseProviderMockRecorder) StoreBallot(arg0 any) *tortoiseProviderStoreBallotCall
- type MockvrfVerifier
- type MockvrfVerifierMockRecorder
- type Opt
- type Validator
- type ValidatorOpt
- type VrfMessage
Constants ¶
This section is empty.
Variables ¶
var ( CalcEligibleLayer = util.CalcEligibleLayer GetNumEligibleSlots = util.GetNumEligibleSlots )
Functions ¶
func MustGetNumEligibleSlots ¶ added in v1.2.2
func MustSerializeVRFMessage ¶ added in v1.1.4
func MustSerializeVRFMessage(beacon types.Beacon, epoch types.EpochID, nonce types.VRFPostIndex, counter uint32) []byte
MustSerializeVRFMessage serializes a message for generating/verifying a VRF signature.
Types ¶
type Config ¶
type Config struct { LayerSize uint32 LayersPerEpoch uint32 GoldenATXID types.ATXID MaxExceptions int Hdist uint32 MinimalActiveSetWeight uint64 }
Config defines configuration for the handler.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
Handler processes Proposal from gossip and, if deems it valid, propagates it to peers.
func NewHandler ¶
func NewHandler( cdb *datastore.CachedDB, edVerifier *signing.EdVerifier, p pubsub.Publisher, f system.Fetcher, bc system.BeaconCollector, m meshProvider, tortoise tortoiseProvider, verifier vrfVerifier, clock layerClock, opts ...Opt, ) *Handler
NewHandler creates new Handler.
func (*Handler) HandleActiveSet ¶ added in v1.1.5
func (*Handler) HandleProposal ¶
HandleProposal is the gossip receiver for Proposal.
type MockeligibilityValidator ¶
type MockeligibilityValidator struct {
// contains filtered or unexported fields
}
MockeligibilityValidator is a mock of eligibilityValidator interface.
func NewMockeligibilityValidator ¶
func NewMockeligibilityValidator(ctrl *gomock.Controller) *MockeligibilityValidator
NewMockeligibilityValidator creates a new mock instance.
func (*MockeligibilityValidator) CheckEligibility ¶
func (m *MockeligibilityValidator) CheckEligibility(arg0 context.Context, arg1 *types.Ballot, arg2 []types.ATXID) (bool, error)
CheckEligibility mocks base method.
func (*MockeligibilityValidator) EXPECT ¶
func (m *MockeligibilityValidator) EXPECT() *MockeligibilityValidatorMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockeligibilityValidatorMockRecorder ¶
type MockeligibilityValidatorMockRecorder struct {
// contains filtered or unexported fields
}
MockeligibilityValidatorMockRecorder is the mock recorder for MockeligibilityValidator.
func (*MockeligibilityValidatorMockRecorder) CheckEligibility ¶
func (mr *MockeligibilityValidatorMockRecorder) CheckEligibility(arg0, arg1, arg2 any) *eligibilityValidatorCheckEligibilityCall
CheckEligibility indicates an expected call of CheckEligibility.
type MocklayerClock ¶
type MocklayerClock struct {
// contains filtered or unexported fields
}
MocklayerClock is a mock of layerClock interface.
func NewMocklayerClock ¶
func NewMocklayerClock(ctrl *gomock.Controller) *MocklayerClock
NewMocklayerClock creates a new mock instance.
func (*MocklayerClock) CurrentLayer ¶
func (m *MocklayerClock) CurrentLayer() types.LayerID
CurrentLayer mocks base method.
func (*MocklayerClock) EXPECT ¶
func (m *MocklayerClock) EXPECT() *MocklayerClockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocklayerClock) LayerToTime ¶
func (m *MocklayerClock) LayerToTime(arg0 types.LayerID) time.Time
LayerToTime mocks base method.
type MocklayerClockMockRecorder ¶
type MocklayerClockMockRecorder struct {
// contains filtered or unexported fields
}
MocklayerClockMockRecorder is the mock recorder for MocklayerClock.
func (*MocklayerClockMockRecorder) CurrentLayer ¶
func (mr *MocklayerClockMockRecorder) CurrentLayer() *layerClockCurrentLayerCall
CurrentLayer indicates an expected call of CurrentLayer.
func (*MocklayerClockMockRecorder) LayerToTime ¶
func (mr *MocklayerClockMockRecorder) LayerToTime(arg0 any) *layerClockLayerToTimeCall
LayerToTime indicates an expected call of LayerToTime.
type MockmeshProvider ¶
type MockmeshProvider struct {
// contains filtered or unexported fields
}
MockmeshProvider is a mock of meshProvider interface.
func NewMockmeshProvider ¶
func NewMockmeshProvider(ctrl *gomock.Controller) *MockmeshProvider
NewMockmeshProvider creates a new mock instance.
func (*MockmeshProvider) AddBallot ¶
func (m *MockmeshProvider) AddBallot(arg0 context.Context, arg1 *types.Ballot) (*types.MalfeasanceProof, error)
AddBallot mocks base method.
func (*MockmeshProvider) AddTXsFromProposal ¶
func (m *MockmeshProvider) AddTXsFromProposal(arg0 context.Context, arg1 types.LayerID, arg2 types.ProposalID, arg3 []types.TransactionID) error
AddTXsFromProposal mocks base method.
func (*MockmeshProvider) EXPECT ¶
func (m *MockmeshProvider) EXPECT() *MockmeshProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockmeshProvider) ProcessedLayer ¶ added in v1.1.6
func (m *MockmeshProvider) ProcessedLayer() types.LayerID
ProcessedLayer mocks base method.
type MockmeshProviderMockRecorder ¶
type MockmeshProviderMockRecorder struct {
// contains filtered or unexported fields
}
MockmeshProviderMockRecorder is the mock recorder for MockmeshProvider.
func (*MockmeshProviderMockRecorder) AddBallot ¶
func (mr *MockmeshProviderMockRecorder) AddBallot(arg0, arg1 any) *meshProviderAddBallotCall
AddBallot indicates an expected call of AddBallot.
func (*MockmeshProviderMockRecorder) AddTXsFromProposal ¶
func (mr *MockmeshProviderMockRecorder) AddTXsFromProposal(arg0, arg1, arg2, arg3 any) *meshProviderAddTXsFromProposalCall
AddTXsFromProposal indicates an expected call of AddTXsFromProposal.
func (*MockmeshProviderMockRecorder) ProcessedLayer ¶ added in v1.1.6
func (mr *MockmeshProviderMockRecorder) ProcessedLayer() *meshProviderProcessedLayerCall
ProcessedLayer indicates an expected call of ProcessedLayer.
type MocknonceFetcher ¶
type MocknonceFetcher struct {
// contains filtered or unexported fields
}
MocknonceFetcher is a mock of nonceFetcher interface.
func NewMocknonceFetcher ¶
func NewMocknonceFetcher(ctrl *gomock.Controller) *MocknonceFetcher
NewMocknonceFetcher creates a new mock instance.
func (*MocknonceFetcher) EXPECT ¶
func (m *MocknonceFetcher) EXPECT() *MocknonceFetcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocknonceFetcher) VRFNonce ¶
func (m *MocknonceFetcher) VRFNonce(arg0 types.NodeID, arg1 types.EpochID) (types.VRFPostIndex, error)
VRFNonce mocks base method.
type MocknonceFetcherMockRecorder ¶
type MocknonceFetcherMockRecorder struct {
// contains filtered or unexported fields
}
MocknonceFetcherMockRecorder is the mock recorder for MocknonceFetcher.
func (*MocknonceFetcherMockRecorder) VRFNonce ¶
func (mr *MocknonceFetcherMockRecorder) VRFNonce(arg0, arg1 any) *nonceFetcherVRFNonceCall
VRFNonce indicates an expected call of VRFNonce.
type MocktortoiseProvider ¶ added in v1.1.4
type MocktortoiseProvider struct {
// contains filtered or unexported fields
}
MocktortoiseProvider is a mock of tortoiseProvider interface.
func NewMocktortoiseProvider ¶ added in v1.1.4
func NewMocktortoiseProvider(ctrl *gomock.Controller) *MocktortoiseProvider
NewMocktortoiseProvider creates a new mock instance.
func (*MocktortoiseProvider) DecodeBallot ¶ added in v1.1.4
func (m *MocktortoiseProvider) DecodeBallot(arg0 *types.BallotTortoiseData) (*tortoise.DecodedBallot, error)
DecodeBallot mocks base method.
func (*MocktortoiseProvider) EXPECT ¶ added in v1.1.4
func (m *MocktortoiseProvider) EXPECT() *MocktortoiseProviderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocktortoiseProvider) GetBallot ¶ added in v1.1.4
func (m *MocktortoiseProvider) GetBallot(arg0 types.BallotID) *tortoise.BallotData
GetBallot mocks base method.
func (*MocktortoiseProvider) GetMissingActiveSet ¶ added in v1.1.4
func (m *MocktortoiseProvider) GetMissingActiveSet(arg0 types.EpochID, arg1 []types.ATXID) []types.ATXID
GetMissingActiveSet mocks base method.
func (*MocktortoiseProvider) StoreBallot ¶ added in v1.1.4
func (m *MocktortoiseProvider) StoreBallot(arg0 *tortoise.DecodedBallot) error
StoreBallot mocks base method.
type MocktortoiseProviderMockRecorder ¶ added in v1.1.4
type MocktortoiseProviderMockRecorder struct {
// contains filtered or unexported fields
}
MocktortoiseProviderMockRecorder is the mock recorder for MocktortoiseProvider.
func (*MocktortoiseProviderMockRecorder) DecodeBallot ¶ added in v1.1.4
func (mr *MocktortoiseProviderMockRecorder) DecodeBallot(arg0 any) *tortoiseProviderDecodeBallotCall
DecodeBallot indicates an expected call of DecodeBallot.
func (*MocktortoiseProviderMockRecorder) GetBallot ¶ added in v1.1.4
func (mr *MocktortoiseProviderMockRecorder) GetBallot(arg0 any) *tortoiseProviderGetBallotCall
GetBallot indicates an expected call of GetBallot.
func (*MocktortoiseProviderMockRecorder) GetMissingActiveSet ¶ added in v1.1.4
func (mr *MocktortoiseProviderMockRecorder) GetMissingActiveSet(arg0, arg1 any) *tortoiseProviderGetMissingActiveSetCall
GetMissingActiveSet indicates an expected call of GetMissingActiveSet.
func (*MocktortoiseProviderMockRecorder) StoreBallot ¶ added in v1.1.4
func (mr *MocktortoiseProviderMockRecorder) StoreBallot(arg0 any) *tortoiseProviderStoreBallotCall
StoreBallot indicates an expected call of StoreBallot.
type MockvrfVerifier ¶
type MockvrfVerifier struct {
// contains filtered or unexported fields
}
MockvrfVerifier is a mock of vrfVerifier interface.
func NewMockvrfVerifier ¶
func NewMockvrfVerifier(ctrl *gomock.Controller) *MockvrfVerifier
NewMockvrfVerifier creates a new mock instance.
func (*MockvrfVerifier) EXPECT ¶
func (m *MockvrfVerifier) EXPECT() *MockvrfVerifierMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockvrfVerifier) Verify ¶
func (m *MockvrfVerifier) Verify(arg0 types.NodeID, arg1 []byte, arg2 types.VrfSignature) bool
Verify mocks base method.
type MockvrfVerifierMockRecorder ¶
type MockvrfVerifierMockRecorder struct {
// contains filtered or unexported fields
}
MockvrfVerifierMockRecorder is the mock recorder for MockvrfVerifier.
func (*MockvrfVerifierMockRecorder) Verify ¶
func (mr *MockvrfVerifierMockRecorder) Verify(arg0, arg1, arg2 any) *vrfVerifierVerifyCall
Verify indicates an expected call of Verify.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
Validator validates the eligibility of a Ballot. the validation focuses on eligibility only and assumes the Ballot to be valid otherwise.
func NewEligibilityValidator ¶
func NewEligibilityValidator( avgLayerSize, layersPerEpoch uint32, minActiveSetWeight uint64, clock layerClock, tortoise tortoiseProvider, cdb *datastore.CachedDB, bc system.BeaconCollector, lg log.Log, vrfVerifier vrfVerifier, opts ...ValidatorOpt, ) *Validator
NewEligibilityValidator returns a new EligibilityValidator.
type ValidatorOpt ¶
type ValidatorOpt func(h *Validator)
ValidatorOpt for configuring Validator.
func WithNonceFetcher ¶
func WithNonceFetcher(nf nonceFetcher) ValidatorOpt
type VrfMessage ¶
type VrfMessage struct { Type types.EligibilityType // always types.EligibilityVoting Beacon types.Beacon Epoch types.EpochID Nonce types.VRFPostIndex Counter uint32 }
VrfMessage is a verification message. It is the payload for the signature in `VotingEligibility`.
func (*VrfMessage) DecodeScale ¶
func (t *VrfMessage) DecodeScale(dec *scale.Decoder) (total int, err error)
func (*VrfMessage) EncodeScale ¶
func (t *VrfMessage) EncodeScale(enc *scale.Encoder) (total int, err error)