mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-07 23:48:36 +00:00
eth/tracers: add missing teardown in TestTraceChain (#32472)
The TestTraceChain function was missing a defer backend.teardown() call, which is required to properly release blockchain resources after test completion. --------- Co-authored-by: Sina Mahmoodi <itz.s1na@gmail.com>
This commit is contained in:
parent
42467f1370
commit
7a87d8a46d
1 changed files with 6 additions and 5 deletions
|
|
@ -527,7 +527,7 @@ func TestTraceTransaction(t *testing.T) {
|
||||||
b.AddTx(tx)
|
b.AddTx(tx)
|
||||||
target = tx.Hash()
|
target = tx.Hash()
|
||||||
})
|
})
|
||||||
defer backend.chain.Stop()
|
defer backend.teardown()
|
||||||
api := NewAPI(backend)
|
api := NewAPI(backend)
|
||||||
result, err := api.TraceTransaction(context.Background(), target, nil)
|
result, err := api.TraceTransaction(context.Background(), target, nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -584,7 +584,7 @@ func TestTraceBlock(t *testing.T) {
|
||||||
b.AddTx(tx)
|
b.AddTx(tx)
|
||||||
txHash = tx.Hash()
|
txHash = tx.Hash()
|
||||||
})
|
})
|
||||||
defer backend.chain.Stop()
|
defer backend.teardown()
|
||||||
api := NewAPI(backend)
|
api := NewAPI(backend)
|
||||||
|
|
||||||
var testSuite = []struct {
|
var testSuite = []struct {
|
||||||
|
|
@ -681,7 +681,7 @@ func TestTracingWithOverrides(t *testing.T) {
|
||||||
signer, accounts[0].key)
|
signer, accounts[0].key)
|
||||||
b.AddTx(tx)
|
b.AddTx(tx)
|
||||||
})
|
})
|
||||||
defer backend.chain.Stop()
|
defer backend.teardown()
|
||||||
api := NewAPI(backend)
|
api := NewAPI(backend)
|
||||||
randomAccounts := newAccounts(3)
|
randomAccounts := newAccounts(3)
|
||||||
type res struct {
|
type res struct {
|
||||||
|
|
@ -1105,6 +1105,7 @@ func TestTraceChain(t *testing.T) {
|
||||||
nonce += 1
|
nonce += 1
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
defer backend.teardown()
|
||||||
backend.refHook = func() { ref.Add(1) }
|
backend.refHook = func() { ref.Add(1) }
|
||||||
backend.relHook = func() { rel.Add(1) }
|
backend.relHook = func() { rel.Add(1) }
|
||||||
api := NewAPI(backend)
|
api := NewAPI(backend)
|
||||||
|
|
@ -1212,7 +1213,7 @@ func TestTraceBlockWithBasefee(t *testing.T) {
|
||||||
txHash = tx.Hash()
|
txHash = tx.Hash()
|
||||||
baseFee.Set(b.BaseFee())
|
baseFee.Set(b.BaseFee())
|
||||||
})
|
})
|
||||||
defer backend.chain.Stop()
|
defer backend.teardown()
|
||||||
api := NewAPI(backend)
|
api := NewAPI(backend)
|
||||||
|
|
||||||
var testSuite = []struct {
|
var testSuite = []struct {
|
||||||
|
|
@ -1298,7 +1299,7 @@ func TestStandardTraceBlockToFile(t *testing.T) {
|
||||||
b.AddTx(tx)
|
b.AddTx(tx)
|
||||||
txHashs = append(txHashs, tx.Hash())
|
txHashs = append(txHashs, tx.Hash())
|
||||||
})
|
})
|
||||||
defer backend.chain.Stop()
|
defer backend.teardown()
|
||||||
|
|
||||||
var testSuite = []struct {
|
var testSuite = []struct {
|
||||||
blockNumber rpc.BlockNumber
|
blockNumber rpc.BlockNumber
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue