From 24f08ece621f3257bd9e24080a3c5d798a9ea7ad Mon Sep 17 00:00:00 2001 From: Roberto Bayardo Date: Wed, 2 Nov 2022 04:57:09 -0700 Subject: [PATCH] miner: fail early if core.NewBlockChain fails (#26079) don't ignore errors returned by core.NewBlockChain when initializing tests --- miner/worker_test.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/miner/worker_test.go b/miner/worker_test.go index 104417c341..859495d7bf 100644 --- a/miner/worker_test.go +++ b/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