Make tests use mock beacon

Signed-off-by: Jakub Sztandera <kubuxu@protocol.ai>
This commit is contained in:
Jakub Sztandera 2020-04-14 20:41:05 +02:00
parent eb501f7290
commit 0c5e3e2533
2 changed files with 6 additions and 6 deletions

View File

@ -28,7 +28,6 @@ import (
"github.com/filecoin-project/lotus/api" "github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/build" "github.com/filecoin-project/lotus/build"
"github.com/filecoin-project/lotus/chain/beacon" "github.com/filecoin-project/lotus/chain/beacon"
"github.com/filecoin-project/lotus/chain/beacon/drand"
genesis2 "github.com/filecoin-project/lotus/chain/gen/genesis" genesis2 "github.com/filecoin-project/lotus/chain/gen/genesis"
"github.com/filecoin-project/lotus/chain/stmgr" "github.com/filecoin-project/lotus/chain/stmgr"
"github.com/filecoin-project/lotus/chain/store" "github.com/filecoin-project/lotus/chain/store"
@ -215,11 +214,11 @@ func NewGenerator() (*ChainGen, error) {
miners := []address.Address{maddr1, maddr2} miners := []address.Address{maddr1, maddr2}
//beac := beacon.NewMockBeacon(time.Second) beac := beacon.NewMockBeacon(time.Second)
beac, err := drand.NewDrandBeacon(tpl.Timestamp, build.BlockDelay) //beac, err := drand.NewDrandBeacon(tpl.Timestamp, build.BlockDelay)
if err != nil { //if err != nil {
return nil, xerrors.Errorf("could not create beacon: %w", err) //return nil, xerrors.Errorf("could not create beacon: %w", err)
} //}
gen := &ChainGen{ gen := &ChainGen{
bs: bs, bs: bs,

View File

@ -486,5 +486,6 @@ func Test() Option {
return Options( return Options(
Unset(RunPeerMgrKey), Unset(RunPeerMgrKey),
Unset(new(*peermgr.PeerMgr)), Unset(new(*peermgr.PeerMgr)),
Override(new(beacon.RandomBeacon), testing.RandomBeacon),
) )
} }