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