-
Notifications
You must be signed in to change notification settings - Fork 211
/
interface.go
36 lines (28 loc) · 965 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"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/signing"
)
//go:generate mockgen -package=mocks -destination=./mocks/mocks.go -source=./interface.go
type atxDB interface {
GetAtxHeader(types.ATXID) (*types.ActivationTxHeader, error)
}
type ballotDB interface {
GetBallot(types.BallotID) (*types.Ballot, error)
}
type meshDB interface {
AddTXsFromProposal(context.Context, types.LayerID, types.ProposalID, []types.TransactionID) error
HasBallot(types.BallotID) bool
AddBallot(*types.Ballot) error
GetBallot(types.BallotID) (*types.Ballot, error)
GetBlockLayer(types.BlockID) (types.LayerID, error)
SetIdentityMalicious(*signing.PublicKey) error
}
type proposalDB interface {
HasProposal(types.ProposalID) bool
AddProposal(context.Context, *types.Proposal) error
}
type eligibilityValidator interface {
CheckEligibility(context.Context, *types.Ballot) (bool, error)
}