-
Notifications
You must be signed in to change notification settings - Fork 210
/
interfaces.go
29 lines (23 loc) · 979 Bytes
/
interfaces.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
package tortoise
import (
"context"
"github.com/spacemeshos/go-spacemesh/common/types"
)
//go:generate mockgen -package=mocks -destination=./mocks/mocks.go -source=./interfaces.go
type blockDataProvider interface {
LayerContextuallyValidBlocks(context.Context, types.LayerID) (map[types.BlockID]struct{}, error)
GetBlock(types.BlockID) (*types.Block, error)
GetBallot(id types.BallotID) (*types.Ballot, error)
LayerBallots(types.LayerID) ([]*types.Ballot, error)
LayerBlockIds(layerID types.LayerID) ([]types.BlockID, error)
GetCoinflip(context.Context, types.LayerID) (bool, bool)
GetHareConsensusOutput(types.LayerID) (types.BlockID, error)
ContextualValidity(types.BlockID) (bool, error)
}
type blockValidityUpdater interface {
UpdateBlockValidity(types.BlockID, types.LayerID, bool) error
}
type atxDataProvider interface {
GetAtxHeader(types.ATXID) (*types.ActivationTxHeader, error)
GetEpochWeight(epochID types.EpochID) (uint64, []types.ATXID, error)
}