-
Notifications
You must be signed in to change notification settings - Fork 209
/
interface.go
52 lines (39 loc) · 1.18 KB
/
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
44
45
46
47
48
49
50
51
52
package fetch
import (
"context"
"github.com/spacemeshos/go-spacemesh/common/types"
"github.com/spacemeshos/go-spacemesh/p2p"
)
//go:generate mockgen -package=mocks -destination=./mocks/mocks.go -source=./interface.go
type requester interface {
Request(context.Context, p2p.Peer, []byte, func([]byte), func(error)) error
}
type MalfeasanceValidator interface {
HandleSyncedMalfeasanceProof(context.Context, p2p.Peer, []byte) error
}
type AtxValidator interface {
HandleAtxData(context.Context, p2p.Peer, []byte) error
}
type BlockValidator interface {
HandleSyncedBlock(context.Context, p2p.Peer, []byte) error
}
type BallotValidator interface {
HandleSyncedBallot(context.Context, p2p.Peer, []byte) error
}
type ProposalValidator interface {
HandleSyncedProposal(context.Context, p2p.Peer, []byte) error
}
type TxValidator interface {
HandleBlockTransaction(context.Context, p2p.Peer, []byte) error
HandleProposalTransaction(context.Context, p2p.Peer, []byte) error
}
type PoetValidator interface {
ValidateAndStoreMsg(context.Context, p2p.Peer, []byte) error
}
type meshProvider interface {
LastVerified() types.LayerID
}
type host interface {
GetPeers() []p2p.Peer
Close() error
}