accounts/abi: typo

This commit is contained in:
Marius van der Wijden 2020-05-05 13:05:52 +02:00
parent 02478bf727
commit 97974281da
2 changed files with 6 additions and 6 deletions

View file

@ -56,7 +56,7 @@ type Type struct {
TupleRawName string // Raw struct name defined in source code, may be empty. TupleRawName string // Raw struct name defined in source code, may be empty.
TupleElems []*Type // Type information of all tuple fields TupleElems []*Type // Type information of all tuple fields
TupleRawNames []string // Raw field name of all tuple fields TupleRawNames []string // Raw field name of all tuple fields
TupelType reflect.Type // Underlying struct of the tuple TupleType reflect.Type // Underlying struct of the tuple
} }
var ( var (
@ -185,7 +185,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty
} }
expression += ")" expression += ")"
typ.TupelType = reflect.StructOf(fields) typ.TupleType = reflect.StructOf(fields)
typ.TupleElems = elems typ.TupleElems = elems
typ.TupleRawNames = names typ.TupleRawNames = names
typ.T = TupleTy typ.T = TupleTy
@ -226,7 +226,7 @@ func (t Type) getType() reflect.Type {
case ArrayTy: case ArrayTy:
return reflect.ArrayOf(t.Size, t.Elem.getType()) return reflect.ArrayOf(t.Size, t.Elem.getType())
case TupleTy: case TupleTy:
return t.TupelType return t.TupleType
case AddressTy: case AddressTy:
return reflect.TypeOf(common.Address{}) return reflect.TypeOf(common.Address{})
case FixedBytesTy: case FixedBytesTy:

View file

@ -95,11 +95,11 @@ func TestTypeRegexp(t *testing.T) {
// {"fixed[2]", nil, Type{}}, // {"fixed[2]", nil, Type{}},
// {"fixed128x128[]", nil, Type{}}, // {"fixed128x128[]", nil, Type{}},
// {"fixed128x128[2]", nil, Type{}}, // {"fixed128x128[2]", nil, Type{}},
{"tuple", []ArgumentMarshaling{{Name: "a", Type: "int64"}}, Type{T: TupleTy, TupelType: reflect.TypeOf(struct { {"tuple", []ArgumentMarshaling{{Name: "a", Type: "int64"}}, Type{T: TupleTy, TupleType: reflect.TypeOf(struct {
A int64 `json:"a"` A int64 `json:"a"`
}{}), stringKind: "(int64)", }{}), stringKind: "(int64)",
TupleElems: []*Type{{T: IntTy, Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"a"}}}, TupleElems: []*Type{{T: IntTy, Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"a"}}},
{"tuple with long name", []ArgumentMarshaling{{Name: "aTypicalParamName", Type: "int64"}}, Type{T: TupleTy, TupelType: reflect.TypeOf(struct { {"tuple with long name", []ArgumentMarshaling{{Name: "aTypicalParamName", Type: "int64"}}, Type{T: TupleTy, TupleType: reflect.TypeOf(struct {
ATypicalParamName int64 `json:"aTypicalParamName"` ATypicalParamName int64 `json:"aTypicalParamName"`
}{}), stringKind: "(int64)", }{}), stringKind: "(int64)",
TupleElems: []*Type{{T: IntTy, Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"aTypicalParamName"}}}, TupleElems: []*Type{{T: IntTy, Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"aTypicalParamName"}}},
@ -312,7 +312,7 @@ func TestInternalType(t *testing.T) {
internalType := "struct a.b[]" internalType := "struct a.b[]"
kind := Type{ kind := Type{
T: TupleTy, T: TupleTy,
TupelType: reflect.TypeOf(struct { TupleType: reflect.TypeOf(struct {
A int64 `json:"a"` A int64 `json:"a"`
}{}), }{}),
stringKind: "(int64)", stringKind: "(int64)",