github.com/onflow/flow-go@v0.35.7-crescendo-preview.23-atree-inlining/consensus/hotstuff/signature/static_randombeacon_signer_store.go (about)

     1  package signature
     2  
     3  import (
     4  	"github.com/onflow/crypto"
     5  
     6  	"github.com/onflow/flow-go/module"
     7  )
     8  
     9  // StaticRandomBeaconSignerStore is a simple implementation of module.RandomBeaconKeyStore
    10  // that returns same key for each view. This structure was implemented for bootstrap process
    11  // and should be used only for it.
    12  type StaticRandomBeaconSignerStore struct {
    13  	beaconKey crypto.PrivateKey
    14  }
    15  
    16  var _ module.RandomBeaconKeyStore = (*StaticRandomBeaconSignerStore)(nil)
    17  
    18  func NewStaticRandomBeaconSignerStore(beaconKey crypto.PrivateKey) *StaticRandomBeaconSignerStore {
    19  	return &StaticRandomBeaconSignerStore{
    20  		beaconKey: beaconKey,
    21  	}
    22  }
    23  
    24  func (s *StaticRandomBeaconSignerStore) ByView(_ uint64) (crypto.PrivateKey, error) {
    25  	return s.beaconKey, nil
    26  }