-
Notifications
You must be signed in to change notification settings - Fork 211
/
interface.go
33 lines (25 loc) · 904 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
package blocks
import (
"context"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/log"
)
//go:generate mockgen -package=mocks -destination=./mocks/mocks.go -source=./interface.go
type layerPatrol interface {
CompleteHare(types.LayerID)
}
type meshProvider interface {
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, log.Log, types.LayerID, types.BlockID) error
}