-
Notifications
You must be signed in to change notification settings - Fork 210
/
interface.go
35 lines (27 loc) · 905 Bytes
/
interface.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package miner
import (
"context"
"time"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/tortoise"
)
//go:generate mockgen -package=miner -destination=./mocks.go -source=./interface.go
type proposalOracle interface {
GetProposalEligibility(types.LayerID, types.Beacon, types.VRFPostIndex) (*EpochEligibility, error)
}
type conservativeState interface {
SelectProposalTXs(types.LayerID, int) []types.TransactionID
}
type votesEncoder interface {
LatestComplete() types.LayerID
TallyVotes(context.Context, types.LayerID)
EncodeVotes(context.Context, ...tortoise.EncodeVotesOpts) (*types.Opinion, error)
}
type nonceFetcher interface {
VRFNonce(types.NodeID, types.EpochID) (types.VRFPostIndex, error)
}
type layerClock interface {
AwaitLayer(layerID types.LayerID) chan struct{}
CurrentLayer() types.LayerID
LayerToTime(types.LayerID) time.Time
}