allow overriding drand config

This commit is contained in:
Yusef Napora
2020-06-23 13:33:18 -04:00
parent 7b2241f051
commit 566a99240d
2 changed files with 20 additions and 10 deletions
+2 -1
View File
@@ -108,6 +108,7 @@ func RetrievalResolver(l *discovery.Local) retrievalmarket.PeerResolver {
type RandomBeaconParams struct {
fx.In
DrandConfig *drand.DrandConfig `optional:"true"`
PubSub *pubsub.PubSub `optional:"true"`
Cs *store.ChainStore
}
@@ -119,5 +120,5 @@ func RandomBeacon(p RandomBeaconParams, _ dtypes.AfterGenesisSet) (beacon.Random
}
//return beacon.NewMockBeacon(build.BlockDelay * time.Second)
return drand.NewDrandBeacon(gen.Timestamp, build.BlockDelay, p.PubSub)
return drand.NewDrandBeacon(gen.Timestamp, build.BlockDelay, p.PubSub, p.DrandConfig)
}