github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/model/flow/dkg.go (about)

     1  package flow
     2  
     3  // DKGEndState captures the final state of a completed DKG.
     4  type DKGEndState uint32
     5  
     6  const (
     7  	// DKGEndStateUnknown - zero value for this enum, indicates unset value
     8  	DKGEndStateUnknown DKGEndState = iota
     9  	// DKGEndStateSuccess - the DKG completed, this node has a valid beacon key.
    10  	DKGEndStateSuccess
    11  	// DKGEndStateInconsistentKey - the DKG completed, this node has an invalid beacon key.
    12  	DKGEndStateInconsistentKey
    13  	// DKGEndStateNoKey - this node did not store a key, typically caused by a crash mid-DKG.
    14  	DKGEndStateNoKey
    15  	// DKGEndStateDKGFailure - the underlying DKG library reported an error.
    16  	DKGEndStateDKGFailure
    17  )
    18  
    19  func (state DKGEndState) String() string {
    20  	switch state {
    21  	case DKGEndStateSuccess:
    22  		return "DKGEndStateSuccess"
    23  	case DKGEndStateInconsistentKey:
    24  		return "DKGEndStateInconsistentKey"
    25  	case DKGEndStateNoKey:
    26  		return "DKGEndStateNoKey"
    27  	case DKGEndStateDKGFailure:
    28  		return "DKGEndStateDKGFailure"
    29  	default:
    30  		return "DKGEndStateUnknown"
    31  	}
    32  }