@@ -57,7 +57,8 @@ const jsondata = `
57
57
{ "type" : "function", "name" : "fixedArrBytes", "stateMutability" : "view", "inputs" : [ { "name" : "bytes", "type" : "bytes" }, { "name" : "fixedArr", "type" : "uint256[2]" } ] },
58
58
{ "type" : "function", "name" : "mixedArrStr", "stateMutability" : "view", "inputs" : [ { "name" : "str", "type" : "string" }, { "name" : "fixedArr", "type" : "uint256[2]" }, { "name" : "dynArr", "type" : "uint256[]" } ] },
59
59
{ "type" : "function", "name" : "doubleFixedArrStr", "stateMutability" : "view", "inputs" : [ { "name" : "str", "type" : "string" }, { "name" : "fixedArr1", "type" : "uint256[2]" }, { "name" : "fixedArr2", "type" : "uint256[3]" } ] },
60
- { "type" : "function", "name" : "multipleMixedArrStr", "stateMutability" : "view", "inputs" : [ { "name" : "str", "type" : "string" }, { "name" : "fixedArr1", "type" : "uint256[2]" }, { "name" : "dynArr", "type" : "uint256[]" }, { "name" : "fixedArr2", "type" : "uint256[3]" } ] }
60
+ { "type" : "function", "name" : "multipleMixedArrStr", "stateMutability" : "view", "inputs" : [ { "name" : "str", "type" : "string" }, { "name" : "fixedArr1", "type" : "uint256[2]" }, { "name" : "dynArr", "type" : "uint256[]" }, { "name" : "fixedArr2", "type" : "uint256[3]" } ] },
61
+ { "type" : "function", "name" : "overloadedNames", "stateMutability" : "view", "inputs": [ { "components": [ { "internalType": "uint256", "name": "_f", "type": "uint256" }, { "internalType": "uint256", "name": "__f", "type": "uint256"}, { "internalType": "uint256", "name": "f", "type": "uint256"}],"internalType": "struct Overloader.F", "name": "f","type": "tuple"}]}
61
62
]`
62
63
63
64
var (
80
81
Uint256ArrNested , _ = NewType ("uint256[2][2]" , "" , nil )
81
82
Uint8ArrNested , _ = NewType ("uint8[][2]" , "" , nil )
82
83
Uint8SliceNested , _ = NewType ("uint8[][]" , "" , nil )
84
+ TupleF , _ = NewType ("tuple" , "struct Overloader.F" , []ArgumentMarshaling {
85
+ {Name : "_f" , Type : "uint256" },
86
+ {Name : "__f" , Type : "uint256" },
87
+ {Name : "f" , Type : "uint256" }})
83
88
)
84
89
85
90
var methods = map [string ]Method {
@@ -108,6 +113,7 @@ var methods = map[string]Method{
108
113
"mixedArrStr" : NewMethod ("mixedArrStr" , "mixedArrStr" , Function , "view" , false , false , []Argument {{"str" , String , false }, {"fixedArr" , Uint256Arr2 , false }, {"dynArr" , Uint256Arr , false }}, nil ),
109
114
"doubleFixedArrStr" : NewMethod ("doubleFixedArrStr" , "doubleFixedArrStr" , Function , "view" , false , false , []Argument {{"str" , String , false }, {"fixedArr1" , Uint256Arr2 , false }, {"fixedArr2" , Uint256Arr3 , false }}, nil ),
110
115
"multipleMixedArrStr" : NewMethod ("multipleMixedArrStr" , "multipleMixedArrStr" , Function , "view" , false , false , []Argument {{"str" , String , false }, {"fixedArr1" , Uint256Arr2 , false }, {"dynArr" , Uint256Arr , false }, {"fixedArr2" , Uint256Arr3 , false }}, nil ),
116
+ "overloadedNames" : NewMethod ("overloadedNames" , "overloadedNames" , Function , "view" , false , false , []Argument {{"f" , TupleF , false }}, nil ),
111
117
}
112
118
113
119
func TestReader (t * testing.T ) {
@@ -117,7 +123,7 @@ func TestReader(t *testing.T) {
117
123
118
124
exp , err := JSON (strings .NewReader (jsondata ))
119
125
if err != nil {
120
- t .Error (err )
126
+ t .Fatal (err )
121
127
}
122
128
123
129
for name , expM := range exp .Methods {
0 commit comments