miner: fail early if core.NewBlockChain fails (#26079)

don't ignore errors returned by core.NewBlockChain when initializing tests
pull/26095/head
Roberto Bayardo 2 years ago committed by GitHub
parent a2a144c593
commit 24f08ece62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      miner/worker_test.go

@ -134,7 +134,10 @@ func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine
default:
t.Fatalf("unexpected consensus engine type: %T", engine)
}
chain, _ := core.NewBlockChain(db, &core.CacheConfig{TrieDirtyDisabled: true}, gspec, nil, engine, vm.Config{}, nil, nil)
chain, err := core.NewBlockChain(db, &core.CacheConfig{TrieDirtyDisabled: true}, gspec, nil, engine, vm.Config{}, nil, nil)
if err != nil {
t.Fatalf("core.NewBlockChain failed: %v", err)
}
txpool := txpool.NewTxPool(testTxPoolConfig, chainConfig, chain)
// Generate a small n-block chain and an uncle block for it

Loading…
Cancel
Save