accounts/abi: fix unpacking of negative int256 (#17583)

This commit is contained in:
Diep Pham
2018-09-04 22:53:28 +07:00
committed by Felix Lange
parent beee7a52e0
commit 42bd67bd6f
2 changed files with 30 additions and 3 deletions

View File

@ -117,6 +117,11 @@ var unpackTests = []unpackTest{
enc: "0000000000000000000000000000000000000000000000000000000000000001",
want: big.NewInt(1),
},
{
def: `[{"type": "int256"}]`,
enc: "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",
want: big.NewInt(-1),
},
{
def: `[{"type": "address"}]`,
enc: "0000000000000000000000000100000000000000000000000000000000000000",