From 97974281dad9b5dd8141e5380f894aa72bdad428 Mon Sep 17 00:00:00 2001 From: Marius van der Wijden Date: Tue, 5 May 2020 13:05:52 +0200 Subject: [PATCH] accounts/abi: typo --- accounts/abi/type.go | 6 +++--- accounts/abi/type_test.go | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/accounts/abi/type.go b/accounts/abi/type.go index c78c51e634..09d75fb887 100644 --- a/accounts/abi/type.go +++ b/accounts/abi/type.go @@ -56,7 +56,7 @@ type Type struct { TupleRawName string // Raw struct name defined in source code, may be empty. TupleElems []*Type // Type information 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 ( @@ -185,7 +185,7 @@ func NewType(t string, internalType string, components []ArgumentMarshaling) (ty } expression += ")" - typ.TupelType = reflect.StructOf(fields) + typ.TupleType = reflect.StructOf(fields) typ.TupleElems = elems typ.TupleRawNames = names typ.T = TupleTy @@ -226,7 +226,7 @@ func (t Type) getType() reflect.Type { case ArrayTy: return reflect.ArrayOf(t.Size, t.Elem.getType()) case TupleTy: - return t.TupelType + return t.TupleType case AddressTy: return reflect.TypeOf(common.Address{}) case FixedBytesTy: diff --git a/accounts/abi/type_test.go b/accounts/abi/type_test.go index 93510f4348..566f991c54 100644 --- a/accounts/abi/type_test.go +++ b/accounts/abi/type_test.go @@ -95,11 +95,11 @@ func TestTypeRegexp(t *testing.T) { // {"fixed[2]", nil, Type{}}, // {"fixed128x128[]", 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"` }{}), stringKind: "(int64)", 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"` }{}), stringKind: "(int64)", TupleElems: []*Type{{T: IntTy, Size: 64, stringKind: "int64"}}, TupleRawNames: []string{"aTypicalParamName"}}}, @@ -312,7 +312,7 @@ func TestInternalType(t *testing.T) { internalType := "struct a.b[]" kind := Type{ T: TupleTy, - TupelType: reflect.TypeOf(struct { + TupleType: reflect.TypeOf(struct { A int64 `json:"a"` }{}), stringKind: "(int64)",