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{}.
This commit is contained in:
cui 2026-05-12 20:50:04 +08:00 committed by GitHub
parent 91f8e7cd9e
commit 6af374e6aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -910,7 +910,7 @@ func TestUnpackTuple(t *testing.T) {
}, },
}, },
FieldT: T{ FieldT: T{
big.NewInt(0), big.NewInt(1), big.NewInt(0).SetBits([]big.Word{}), big.NewInt(1),
}, },
A: big.NewInt(1), A: big.NewInt(1),
} }
@ -919,7 +919,7 @@ func TestUnpackTuple(t *testing.T) {
if err != nil { if err != nil {
t.Error(err) t.Error(err)
} }
if reflect.DeepEqual(ret, expected) { if !reflect.DeepEqual(ret, expected) {
t.Error("unexpected unpack value") t.Error("unexpected unpack value")
} }
} }