-
Notifications
You must be signed in to change notification settings - Fork 177
/
dkg.go
32 lines (29 loc) · 989 Bytes
/
dkg.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
package flow
// DKGEndState captures the final state of a completed DKG.
type DKGEndState uint32
const (
// DKGEndStateUnknown - zero value for this enum, indicates unset value
DKGEndStateUnknown DKGEndState = iota
// DKGEndStateSuccess - the DKG completed, this node has a valid beacon key.
DKGEndStateSuccess
// DKGEndStateInconsistentKey - the DKG completed, this node has an invalid beacon key.
DKGEndStateInconsistentKey
// DKGEndStateNoKey - this node did not store a key, typically caused by a crash mid-DKG.
DKGEndStateNoKey
// DKGEndStateDKGFailure - the underlying DKG library reported an error.
DKGEndStateDKGFailure
)
func (state DKGEndState) String() string {
switch state {
case DKGEndStateSuccess:
return "DKGEndStateSuccess"
case DKGEndStateInconsistentKey:
return "DKGEndStateInconsistentKey"
case DKGEndStateNoKey:
return "DKGEndStateNoKey"
case DKGEndStateDKGFailure:
return "DKGEndStateDKGFailure"
default:
return "DKGEndStateUnknown"
}
}