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.
This commit is contained in:
@ -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")
|
||||
|
Reference in New Issue
Block a user