Skip to content

Commit 51fe091

Browse files
roberto-bayardoshekhirin
authored andcommitted
miner: fail early if core.NewBlockChain fails (ethereum#26079)
don't ignore errors returned by core.NewBlockChain when initializing tests
1 parent e3b9cd8 commit 51fe091

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

miner/worker_test.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,10 @@ func newTestWorkerBackend(t *testing.T, chainConfig *params.ChainConfig, engine
134134
default:
135135
t.Fatalf("unexpected consensus engine type: %T", engine)
136136
}
137-
chain, _ := core.NewBlockChain(db, &core.CacheConfig{TrieDirtyDisabled: true}, gspec, nil, engine, vm.Config{}, nil, nil)
137+
chain, err := core.NewBlockChain(db, &core.CacheConfig{TrieDirtyDisabled: true}, gspec, nil, engine, vm.Config{}, nil, nil)
138+
if err != nil {
139+
t.Fatalf("core.NewBlockChain failed: %v", err)
140+
}
138141
txpool := txpool.NewTxPool(testTxPoolConfig, chainConfig, chain)
139142

140143
// Generate a small n-block chain and an uncle block for it

0 commit comments

Comments
 (0)