-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathactionstore.go
37 lines (27 loc) · 1.2 KB
/
actionstore.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
package tmstore
import (
"context"
"github.com/gordian-engine/gordian/gcrypto"
"github.com/gordian-engine/gordian/tm/tmconsensus"
)
// ActionStore stores the active actions the current state machine and application take;
// specifically, proposed blocks, prevotes, and precommits.
type ActionStore interface {
SaveProposedHeaderAction(context.Context, tmconsensus.ProposedHeader) error
SavePrevoteAction(ctx context.Context, pubKey gcrypto.PubKey, vt tmconsensus.VoteTarget, sig []byte) error
SavePrecommitAction(ctx context.Context, pubKey gcrypto.PubKey, vt tmconsensus.VoteTarget, sig []byte) error
// LoadActions returns all actions recorded for this round.
LoadActions(ctx context.Context, height uint64, round uint32) (RoundActions, error)
}
// RoundActions contains all three possible actions the current validator
// may have taken for a single round.
type RoundActions struct {
Height uint64
Round uint32
ProposedHeader tmconsensus.ProposedHeader
PubKey gcrypto.PubKey
PrevoteTarget string // Block hash or empty string for nil.
PrevoteSignature string // Immutable signature.
PrecommitTarget string // Block hash or empty string for nil.
PrecommitSignature string // Immutable signature.
}