-
Notifications
You must be signed in to change notification settings - Fork 211
/
interface.go
43 lines (34 loc) · 1007 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
37
38
39
40
41
42
43
package blocks
import (
"context"
"github.com/spacemeshos/go-spacemesh/common/types"
)
//go:generate mockgen -typed -package=mocks -destination=./mocks/mocks.go -source=./interface.go
type layerPatrol interface {
CompleteHare(types.LayerID)
}
type meshProvider interface {
ProcessedLayer() types.LayerID
AddBlockWithTXs(context.Context, *types.Block) error
ProcessLayerPerHareOutput(context.Context, types.LayerID, types.BlockID, bool) error
}
type executor interface {
ExecuteOptimistic(
context.Context,
types.LayerID,
uint64,
[]types.AnyReward,
[]types.TransactionID,
) (*types.Block, error)
}
type layerClock interface {
AwaitLayer(layerID types.LayerID) <-chan struct{}
CurrentLayer() types.LayerID
}
type certifier interface {
RegisterForCert(context.Context, types.LayerID, types.BlockID) error
CertifyIfEligible(context.Context, types.LayerID, types.BlockID) error
}
type tortoiseProvider interface {
GetMissingActiveSet(types.EpochID, []types.ATXID) []types.ATXID
}