import DrandConfig from dtypes

This commit is contained in:
Yusef Napora 2020-06-23 16:23:06 -04:00
parent b448de422e
commit 5074cf8beb
2 changed files with 3 additions and 11 deletions

View File

@ -23,15 +23,11 @@ import (
"github.com/filecoin-project/lotus/chain/beacon"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/node/modules/dtypes"
)
var log = logging.Logger("drand")
type DrandConfig struct {
Servers []string
ChainInfoJSON string
}
type drandPeer struct {
addr string
tls bool
@ -61,7 +57,7 @@ type DrandBeacon struct {
localCache map[uint64]types.BeaconEntry
}
func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config DrandConfig) (*DrandBeacon, error) {
func NewDrandBeacon(genesisTs, interval uint64, ps *pubsub.PubSub, config dtypes.DrandConfig) (*DrandBeacon, error) {
if genesisTs == 0 {
panic("what are you doing this cant be zero")
}

View File

@ -124,9 +124,5 @@ func RandomBeacon(p RandomBeaconParams, _ dtypes.AfterGenesisSet) (beacon.Random
}
//return beacon.NewMockBeacon(build.BlockDelay * time.Second)
config := drand.DrandConfig{
Servers: p.DrandConfig.Servers,
ChainInfoJSON: p.DrandConfig.ChainInfoJSON,
}
return drand.NewDrandBeacon(gen.Timestamp, build.BlockDelay, p.PubSub, config)
return drand.NewDrandBeacon(gen.Timestamp, build.BlockDelay, p.PubSub, p.DrandConfig)
}