From 6af374e6aa35d9a6be18184ffa831815dbc42155 Mon Sep 17 00:00:00 2001 From: cui Date: Tue, 12 May 2026 20:50:04 +0800 Subject: [PATCH] accounts/abi: fix unittest code (#34740) 1. should use !reflect.DeepEqual. 2. big.NewInt(0).SetBits([]big.Word{}) work around for DeepEqual when big.Int is zero, unpack return a []big.Word{}. --- accounts/abi/unpack_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 90713c03ca..90cfa68655 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -910,7 +910,7 @@ func TestUnpackTuple(t *testing.T) { }, }, FieldT: T{ - big.NewInt(0), big.NewInt(1), + big.NewInt(0).SetBits([]big.Word{}), big.NewInt(1), }, A: big.NewInt(1), } @@ -919,7 +919,7 @@ func TestUnpackTuple(t *testing.T) { if err != nil { t.Error(err) } - if reflect.DeepEqual(ret, expected) { + if !reflect.DeepEqual(ret, expected) { t.Error("unexpected unpack value") } }