-
Notifications
You must be signed in to change notification settings - Fork 211
/
interface.go
36 lines (28 loc) · 988 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
36
package proposals
import (
"context"
"time"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/tortoise"
)
//go:generate mockgen -typed -package=proposals -destination=./mocks.go -source=./interface.go
type meshProvider interface {
ProcessedLayer() types.LayerID
AddBallot(context.Context, *types.Ballot) (*types.MalfeasanceProof, error)
AddTXsFromProposal(context.Context, types.LayerID, types.ProposalID, []types.TransactionID) error
}
type eligibilityValidator interface {
CheckEligibility(context.Context, *types.Ballot, uint64) (bool, error)
}
type tortoiseProvider interface {
GetBallot(types.BallotID) *tortoise.BallotData
DecodeBallot(*types.BallotTortoiseData) (*tortoise.DecodedBallot, error)
StoreBallot(*tortoise.DecodedBallot) error
}
type vrfVerifier interface {
Verify(types.NodeID, []byte, types.VrfSignature) bool
}
type layerClock interface {
CurrentLayer() types.LayerID
LayerToTime(types.LayerID) time.Time
}