From 93d8814ac0b5d1f992a35925130d23f5f6d3f58e Mon Sep 17 00:00:00 2001 From: Matt Krump Date: Mon, 16 Apr 2018 13:34:57 -0500 Subject: [PATCH] accounts/abi: change unpacking of abi fields w/ underscores ABI fields with underscores that are being unpacked into structs expect structs with following form: int_one -> Int_one whereas in abigen the generated structs are camelcased int_one -> IntOne so updated the unpack method to expect camelcased structs as well. --- accounts/abi/unpack_test.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/accounts/abi/unpack_test.go b/accounts/abi/unpack_test.go index 29ed4522cf..df776ea922 100644 --- a/accounts/abi/unpack_test.go +++ b/accounts/abi/unpack_test.go @@ -300,6 +300,13 @@ var unpackTests = []unpackTest{ Int2 *big.Int }{big.NewInt(1), big.NewInt(2)}, }, + { + def: `[{"name":"int_one","type":"int256"}]`, + enc: "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002", + want: struct { + IntOne *big.Int + }{big.NewInt(1)}, + }, { def: `[{"name":"int","type":"int256"},{"name":"Int","type":"int256"}]`, enc: "00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000002",