accounts/abi: Add the original name as json-structtag for tuples.

This commit is contained in:
Mats Julian Olsen
2019-03-28 14:32:09 +01:00
committed by Guillaume Ballet
parent 67fc0377e1
commit 5b0d3fa393
2 changed files with 8 additions and 1 deletions

View File

@ -188,6 +188,7 @@ func NewType(t string, components []ArgumentMarshaling) (typ Type, err error) {
fields = append(fields, reflect.StructField{
Name: ToCamelCase(c.Name), // reflect.StructOf will panic for any exported field.
Type: cType.Type,
Tag: reflect.StructTag("json:\"" + c.Name + "\""),
})
elems = append(elems, &cType)
names = append(names, c.Name)