Documentation ¶
Overview ¶
Code generated by MockGen. DO NOT EDIT. Source: ./interface.go
Generated by this command:
mockgen -typed -package=miner -destination=./mocks.go -source=./interface.go
Package miner is a generated GoMock package.
Package miner is responsible for creating valid blocks that contain valid activation transactions and transactions
Index ¶
- func ActiveSetFromEpochFirstBlock(db sql.Executor, epoch types.EpochID) ([]types.ATXID, error)
- type AtxGrade
- type EpochEligibility
- type MockconservativeState
- type MockconservativeStateMockRecorder
- type MocklayerClock
- type MocklayerClockMockRecorder
- type Mockmesh
- type MockmeshMockRecorder
- type MocknonceFetcher
- type MocknonceFetcherMockRecorder
- type MockproposalOracle
- type MockproposalOracleMockRecorder
- type MockvotesEncoder
- func (m *MockvotesEncoder) EXPECT() *MockvotesEncoderMockRecorder
- func (m *MockvotesEncoder) EncodeVotes(arg0 context.Context, arg1 ...tortoise.EncodeVotesOpts) (*types.Opinion, error)
- func (m *MockvotesEncoder) LatestComplete() types.LayerID
- func (m *MockvotesEncoder) TallyVotes(arg0 context.Context, arg1 types.LayerID)
- type MockvotesEncoderMockRecorder
- type Opt
- func WithHdist(dist uint32) Opt
- func WithLayerPerEpoch(layers uint32) Opt
- func WithLayerSize(size uint32) Opt
- func WithLogger(logger log.Log) Opt
- func WithMinGoodAtxPct(pct int) Opt
- func WithMinimalActiveSetWeight(weight uint64) Opt
- func WithNetworkDelay(delay time.Duration) Opt
- func WithNodeID(id types.NodeID) Opt
- type Oracle
- type ProposalBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AtxGrade ¶ added in v1.0.7
type AtxGrade int
AtxGrade describes the grade of an ATX as described in https://community.spacemesh.io/t/grading-atxs-for-the-active-set/335
let s be the start of the epoch, and δ the network propagation time. grade 0: ATX was received at time t >= s-3δ, or an equivocation proof was received by time s-δ. grade 1: ATX was received at time t < s-3δ before the start of the epoch, and no equivocation proof was received by time s-δ. grade 2: ATX was received at time t < s-4δ, and no equivocation proof was received for that id until time s.
type EpochEligibility ¶ added in v1.0.0
type MockconservativeState ¶ added in v1.0.0
type MockconservativeState struct {
// contains filtered or unexported fields
}
MockconservativeState is a mock of conservativeState interface.
func NewMockconservativeState ¶ added in v1.0.0
func NewMockconservativeState(ctrl *gomock.Controller) *MockconservativeState
NewMockconservativeState creates a new mock instance.
func (*MockconservativeState) EXPECT ¶ added in v1.0.0
func (m *MockconservativeState) EXPECT() *MockconservativeStateMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockconservativeState) SelectProposalTXs ¶ added in v1.0.0
func (m *MockconservativeState) SelectProposalTXs(arg0 types.LayerID, arg1 int) []types.TransactionID
SelectProposalTXs mocks base method.
type MockconservativeStateMockRecorder ¶ added in v1.0.0
type MockconservativeStateMockRecorder struct {
// contains filtered or unexported fields
}
MockconservativeStateMockRecorder is the mock recorder for MockconservativeState.
func (*MockconservativeStateMockRecorder) SelectProposalTXs ¶ added in v1.0.0
func (mr *MockconservativeStateMockRecorder) SelectProposalTXs(arg0, arg1 any) *conservativeStateSelectProposalTXsCall
SelectProposalTXs indicates an expected call of SelectProposalTXs.
type MocklayerClock ¶ added in v1.0.0
type MocklayerClock struct {
// contains filtered or unexported fields
}
MocklayerClock is a mock of layerClock interface.
func NewMocklayerClock ¶ added in v1.0.0
func NewMocklayerClock(ctrl *gomock.Controller) *MocklayerClock
NewMocklayerClock creates a new mock instance.
func (*MocklayerClock) AwaitLayer ¶ added in v1.0.0
func (m *MocklayerClock) AwaitLayer(layerID types.LayerID) <-chan struct{}
AwaitLayer mocks base method.
func (*MocklayerClock) CurrentLayer ¶ added in v1.0.0
func (m *MocklayerClock) CurrentLayer() types.LayerID
CurrentLayer mocks base method.
func (*MocklayerClock) EXPECT ¶ added in v1.0.0
func (m *MocklayerClock) EXPECT() *MocklayerClockMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocklayerClock) LayerToTime ¶ added in v1.0.0
func (m *MocklayerClock) LayerToTime(arg0 types.LayerID) time.Time
LayerToTime mocks base method.
type MocklayerClockMockRecorder ¶ added in v1.0.0
type MocklayerClockMockRecorder struct {
// contains filtered or unexported fields
}
MocklayerClockMockRecorder is the mock recorder for MocklayerClock.
func (*MocklayerClockMockRecorder) AwaitLayer ¶ added in v1.0.0
func (mr *MocklayerClockMockRecorder) AwaitLayer(layerID any) *layerClockAwaitLayerCall
AwaitLayer indicates an expected call of AwaitLayer.
func (*MocklayerClockMockRecorder) CurrentLayer ¶ added in v1.0.0
func (mr *MocklayerClockMockRecorder) CurrentLayer() *layerClockCurrentLayerCall
CurrentLayer indicates an expected call of CurrentLayer.
func (*MocklayerClockMockRecorder) LayerToTime ¶ added in v1.0.0
func (mr *MocklayerClockMockRecorder) LayerToTime(arg0 any) *layerClockLayerToTimeCall
LayerToTime indicates an expected call of LayerToTime.
type Mockmesh ¶ added in v1.0.7
type Mockmesh struct {
// contains filtered or unexported fields
}
Mockmesh is a mock of mesh interface.
func NewMockmesh ¶ added in v1.0.7
func NewMockmesh(ctrl *gomock.Controller) *Mockmesh
NewMockmesh creates a new mock instance.
func (*Mockmesh) EXPECT ¶ added in v1.0.7
func (m *Mockmesh) EXPECT() *MockmeshMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*Mockmesh) GetMalfeasanceProof ¶ added in v1.0.7
GetMalfeasanceProof mocks base method.
type MockmeshMockRecorder ¶ added in v1.0.7
type MockmeshMockRecorder struct {
// contains filtered or unexported fields
}
MockmeshMockRecorder is the mock recorder for Mockmesh.
func (*MockmeshMockRecorder) GetMalfeasanceProof ¶ added in v1.0.7
func (mr *MockmeshMockRecorder) GetMalfeasanceProof(nodeID any) *meshGetMalfeasanceProofCall
GetMalfeasanceProof indicates an expected call of GetMalfeasanceProof.
type MocknonceFetcher ¶ added in v1.0.0
type MocknonceFetcher struct {
// contains filtered or unexported fields
}
MocknonceFetcher is a mock of nonceFetcher interface.
func NewMocknonceFetcher ¶ added in v1.0.0
func NewMocknonceFetcher(ctrl *gomock.Controller) *MocknonceFetcher
NewMocknonceFetcher creates a new mock instance.
func (*MocknonceFetcher) EXPECT ¶ added in v1.0.0
func (m *MocknonceFetcher) EXPECT() *MocknonceFetcherMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MocknonceFetcher) VRFNonce ¶ added in v1.0.0
func (m *MocknonceFetcher) VRFNonce(arg0 types.NodeID, arg1 types.EpochID) (types.VRFPostIndex, error)
VRFNonce mocks base method.
type MocknonceFetcherMockRecorder ¶ added in v1.0.0
type MocknonceFetcherMockRecorder struct {
// contains filtered or unexported fields
}
MocknonceFetcherMockRecorder is the mock recorder for MocknonceFetcher.
func (*MocknonceFetcherMockRecorder) VRFNonce ¶ added in v1.0.0
func (mr *MocknonceFetcherMockRecorder) VRFNonce(arg0, arg1 any) *nonceFetcherVRFNonceCall
VRFNonce indicates an expected call of VRFNonce.
type MockproposalOracle ¶ added in v1.0.0
type MockproposalOracle struct {
// contains filtered or unexported fields
}
MockproposalOracle is a mock of proposalOracle interface.
func NewMockproposalOracle ¶ added in v1.0.0
func NewMockproposalOracle(ctrl *gomock.Controller) *MockproposalOracle
NewMockproposalOracle creates a new mock instance.
func (*MockproposalOracle) EXPECT ¶ added in v1.0.0
func (m *MockproposalOracle) EXPECT() *MockproposalOracleMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockproposalOracle) ProposalEligibility ¶ added in v1.0.7
func (m *MockproposalOracle) ProposalEligibility(arg0 types.LayerID, arg1 types.Beacon, arg2 types.VRFPostIndex) (*EpochEligibility, error)
ProposalEligibility mocks base method.
type MockproposalOracleMockRecorder ¶ added in v1.0.0
type MockproposalOracleMockRecorder struct {
// contains filtered or unexported fields
}
MockproposalOracleMockRecorder is the mock recorder for MockproposalOracle.
func (*MockproposalOracleMockRecorder) ProposalEligibility ¶ added in v1.0.7
func (mr *MockproposalOracleMockRecorder) ProposalEligibility(arg0, arg1, arg2 any) *proposalOracleProposalEligibilityCall
ProposalEligibility indicates an expected call of ProposalEligibility.
type MockvotesEncoder ¶ added in v1.0.0
type MockvotesEncoder struct {
// contains filtered or unexported fields
}
MockvotesEncoder is a mock of votesEncoder interface.
func NewMockvotesEncoder ¶ added in v1.0.0
func NewMockvotesEncoder(ctrl *gomock.Controller) *MockvotesEncoder
NewMockvotesEncoder creates a new mock instance.
func (*MockvotesEncoder) EXPECT ¶ added in v1.0.0
func (m *MockvotesEncoder) EXPECT() *MockvotesEncoderMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockvotesEncoder) EncodeVotes ¶ added in v1.0.0
func (m *MockvotesEncoder) EncodeVotes(arg0 context.Context, arg1 ...tortoise.EncodeVotesOpts) (*types.Opinion, error)
EncodeVotes mocks base method.
func (*MockvotesEncoder) LatestComplete ¶ added in v1.0.0
func (m *MockvotesEncoder) LatestComplete() types.LayerID
LatestComplete mocks base method.
func (*MockvotesEncoder) TallyVotes ¶ added in v1.0.0
func (m *MockvotesEncoder) TallyVotes(arg0 context.Context, arg1 types.LayerID)
TallyVotes mocks base method.
type MockvotesEncoderMockRecorder ¶ added in v1.0.0
type MockvotesEncoderMockRecorder struct {
// contains filtered or unexported fields
}
MockvotesEncoderMockRecorder is the mock recorder for MockvotesEncoder.
func (*MockvotesEncoderMockRecorder) EncodeVotes ¶ added in v1.0.0
func (mr *MockvotesEncoderMockRecorder) EncodeVotes(arg0 any, arg1 ...any) *votesEncoderEncodeVotesCall
EncodeVotes indicates an expected call of EncodeVotes.
func (*MockvotesEncoderMockRecorder) LatestComplete ¶ added in v1.0.0
func (mr *MockvotesEncoderMockRecorder) LatestComplete() *votesEncoderLatestCompleteCall
LatestComplete indicates an expected call of LatestComplete.
func (*MockvotesEncoderMockRecorder) TallyVotes ¶ added in v1.0.0
func (mr *MockvotesEncoderMockRecorder) TallyVotes(arg0, arg1 any) *votesEncoderTallyVotesCall
TallyVotes indicates an expected call of TallyVotes.
type Opt ¶ added in v1.0.0
type Opt func(h *ProposalBuilder)
Opt for configuring ProposalBuilder.
func WithLayerPerEpoch ¶ added in v1.0.0
WithLayerPerEpoch defines the number of layers per epoch.
func WithLayerSize ¶ added in v1.0.0
WithLayerSize defines the average number of proposal per layer.
func WithLogger ¶ added in v1.0.0
WithLogger defines the logger.
func WithMinGoodAtxPct ¶ added in v1.1.0
func WithMinimalActiveSetWeight ¶ added in v1.0.0
func WithNetworkDelay ¶ added in v1.0.7
func WithNodeID ¶ added in v1.0.0
WithNodeID defines the miner's NodeID.
type Oracle ¶ added in v0.1.15
type Oracle struct {
// contains filtered or unexported fields
}
Oracle provides proposal eligibility proofs for the miner.
func (*Oracle) ProposalEligibility ¶ added in v1.0.7
func (o *Oracle) ProposalEligibility(lid types.LayerID, beacon types.Beacon, nonce types.VRFPostIndex) (*EpochEligibility, error)
ProposalEligibility returns the miner's ATXID and the active set for the layer's epoch, along with the list of eligibility proofs for that layer.
type ProposalBuilder ¶ added in v1.0.0
type ProposalBuilder struct {
// contains filtered or unexported fields
}
ProposalBuilder builds Proposals for a miner.
func NewProposalBuilder ¶ added in v1.0.0
func NewProposalBuilder( ctx context.Context, clock layerClock, signer *signing.EdSigner, vrfSigner *signing.VRFSigner, cdb *datastore.CachedDB, publisher pubsub.Publisher, trtl votesEncoder, beaconProvider system.BeaconGetter, syncer system.SyncStateProvider, conState conservativeState, opts ...Opt, ) *ProposalBuilder
NewProposalBuilder creates a struct of block builder type.
func (*ProposalBuilder) Close ¶ added in v1.0.0
func (pb *ProposalBuilder) Close()
Close stops the loop that listens to layers and build proposals.