-
Notifications
You must be signed in to change notification settings - Fork 175
/
encodable.go
70 lines (62 loc) · 1.92 KB
/
encodable.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package inmem
import (
"github.com/onflow/flow-go/model/cluster"
"github.com/onflow/flow-go/model/encodable"
"github.com/onflow/flow-go/model/flow"
)
// EncodableSnapshot is the encoding format for protocol.Snapshot
type EncodableSnapshot struct {
Head *flow.Header
Identities flow.IdentityList
LatestSeal *flow.Seal
LatestResult *flow.ExecutionResult
SealingSegment *flow.SealingSegment
QuorumCertificate *flow.QuorumCertificate
Phase flow.EpochPhase
Epochs EncodableEpochs
Params EncodableParams
}
// EncodableEpochs is the encoding format for protocol.EpochQuery
type EncodableEpochs struct {
Previous *EncodableEpoch
Current EncodableEpoch // cannot be nil
Next *EncodableEpoch
}
// EncodableEpoch is the encoding format for protocol.Epoch
type EncodableEpoch struct {
Counter uint64
FirstView uint64
DKGPhase1FinalView uint64
DKGPhase2FinalView uint64
DKGPhase3FinalView uint64
FinalView uint64
RandomSource []byte
InitialIdentities flow.IdentityList
Clustering flow.ClusterList
Clusters []EncodableCluster
DKG *EncodableDKG
}
// EncodableDKG is the encoding format for protocol.DKG
type EncodableDKG struct {
GroupKey encodable.RandomBeaconPubKey
Participants map[flow.Identifier]flow.DKGParticipant
}
type EncodableFullDKG struct {
GroupKey encodable.RandomBeaconPubKey
PrivKeyShares []encodable.RandomBeaconPrivKey
PubKeyShares []encodable.RandomBeaconPubKey
}
// EncodableCluster is the encoding format for protocol.Cluster
type EncodableCluster struct {
Index uint
Counter uint64
Members flow.IdentityList
RootBlock *cluster.Block
RootQC *flow.QuorumCertificate
}
// EncodableParams is the encoding format for protocol.GlobalParams
type EncodableParams struct {
ChainID flow.ChainID
SporkID flow.Identifier
ProtocolVersion uint
}