From 82c7afcb70d61fad35679365f777822ea473f811 Mon Sep 17 00:00:00 2001 From: lightclient Date: Fri, 16 Jan 2026 09:47:45 -0700 Subject: [PATCH] core/state: fix test by simulated opcode handler behavior --- core/state/statedb_hooked_test.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/state/statedb_hooked_test.go b/core/state/statedb_hooked_test.go index 4d85e61679..e4c1457bcd 100644 --- a/core/state/statedb_hooked_test.go +++ b/core/state/statedb_hooked_test.go @@ -49,6 +49,8 @@ func TestBurn(t *testing.T) { createAndDestroy := func(addr common.Address) { hooked.AddBalance(addr, uint256.NewInt(100), tracing.BalanceChangeUnspecified) hooked.CreateContract(addr) + // Simulate what the opcode handler does: clear balance before selfdestruct + hooked.SubBalance(addr, hooked.GetBalance(addr), tracing.BalanceDecreaseSelfdestruct) hooked.SelfDestruct(addr) // sanity-check that balance is now 0 if have, want := hooked.GetBalance(addr), new(uint256.Int); !have.Eq(want) {