aboutsummaryrefslogtreecommitdiffstats
path: root/accounts/abi/reflect.go
diff options
context:
space:
mode:
authorMatt K <1036969+mkrump@users.noreply.github.com>2018-12-29 18:32:58 +0800
committerGuillaume Ballet <gballet@gmail.com>2018-12-29 18:32:58 +0800
commita4af734328d50b9ea89405c7e5050065a8087946 (patch)
tree5741ded89a84cef4ca38faf10b5cc9094a1c7529 /accounts/abi/reflect.go
parent735343430dec74a340f5c9a18822537e18165caa (diff)
downloaddexon-a4af734328d50b9ea89405c7e5050065a8087946.tar.gz
dexon-a4af734328d50b9ea89405c7e5050065a8087946.tar.zst
dexon-a4af734328d50b9ea89405c7e5050065a8087946.zip
accounts/abi: change unpacking of abi fields w/ underscores (#16513)
* accounts/abi: fix name styling when unpacking 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.
Diffstat (limited to 'accounts/abi/reflect.go')
-rw-r--r--accounts/abi/reflect.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/accounts/abi/reflect.go b/accounts/abi/reflect.go
index 6ec79a12f..f541cf3bf 100644
--- a/accounts/abi/reflect.go
+++ b/accounts/abi/reflect.go
@@ -186,7 +186,7 @@ func mapAbiToStructFields(args Arguments, value reflect.Value) (map[string]strin
for _, arg := range args {
abiFieldName := arg.Name
- structFieldName := capitalise(abiFieldName)
+ structFieldName := ToCamelCase(abiFieldName)
if structFieldName == "" {
return nil, fmt.Errorf("abi: purely underscored output cannot unpack to struct")