Fix miner tests, push back fork time

This commit is contained in:
whyrusleeping 2020-01-16 23:10:47 -08:00
parent c6186a03f1
commit 6ccf24ce6c
3 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,3 @@
package build
const ForkBlizzardHeight = 6250
const ForkBlizzardHeight = 6288

View File

@ -24,7 +24,11 @@ var log = logging.Logger("miner")
type waitFunc func(ctx context.Context, baseTime uint64) error
func NewMiner(api api.FullNode, epp gen.ElectionPoStProver) *Miner {
arc, _ := lru.NewARC(10000)
arc, err := lru.NewARC(10000)
if err != nil {
panic(err)
}
return &Miner{
api: api,
epp: epp,

View File

@ -6,14 +6,21 @@ import (
"github.com/filecoin-project/go-address"
"github.com/filecoin-project/lotus/api"
"github.com/filecoin-project/lotus/chain/gen"
lru "github.com/hashicorp/golang-lru"
)
func NewTestMiner(nextCh <-chan struct{}, addr address.Address) func(api.FullNode, gen.ElectionPoStProver) *Miner {
return func(api api.FullNode, epp gen.ElectionPoStProver) *Miner {
arc, err := lru.NewARC(10000)
if err != nil {
panic(err)
}
m := &Miner{
api: api,
waitFunc: chanWaiter(nextCh),
epp: epp,
api: api,
waitFunc: chanWaiter(nextCh),
epp: epp,
minedBlockHeights: arc,
}
if err := m.Register(addr); err != nil {