aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/unpack_test.go
diff options
context:
space:
mode:
authorDiep Pham <mrfavadi@gmail.com>2018-09-04 23:53:28 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-09-04 23:53:28 +0800
commit42bd67bd6fd599a5583452f011152a0c26c9dff4 (patch)
tree41176161eda207d0fd4b27358d5d3adb00d4f252 /accounts/abi/unpack_test.go
parentbeee7a52e08f6e948d4cca9de8ff59d5b8305917 (diff)
downloaddexon-42bd67bd6fd599a5583452f011152a0c26c9dff4.tar.gz
dexon-42bd67bd6fd599a5583452f011152a0c26c9dff4.tar.zst
dexon-42bd67bd6fd599a5583452f011152a0c26c9dff4.zip
accounts/abi: fix unpacking of negative int256 (#17583)
Diffstat (limited to 'accounts/abi/unpack_test.go')
-rw-r--r--accounts/abi/unpack_test.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go
index bdbab10b4..97552b90c 100644
--- a/accounts/abi/unpack_test.go
+++ b/accounts/abi/unpack_test.go
@@ -118,6 +118,11 @@ var unpackTests = []unpackTest{
want: big.NewInt(1),
},
{
+ def: `[{"type": "int256"}]`,
+ enc: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
+ want: big.NewInt(-1),
+ },
+ {
def: `[{"type": "address"}]`,
enc: "0000000000000000000000000100000000000000000000000000000000000000",
want: common.Address{1},