@@ -16,6 +16,8 @@ func TestParseSelector(t *testing.T) {
16
16
result = append (result , ArgumentMarshaling {name , typeName , typeName , nil , false })
17
17
} else if components , ok := typeOrComponents .([]ArgumentMarshaling ); ok {
18
18
result = append (result , ArgumentMarshaling {name , "tuple" , "tuple" , components , false })
19
+ } else if components , ok := typeOrComponents .([][]ArgumentMarshaling ); ok {
20
+ result = append (result , ArgumentMarshaling {name , "tuple[]" , "tuple[]" , components [0 ], false })
19
21
} else {
20
22
log .Fatalf ("unexpected type %T" , typeOrComponents )
21
23
}
@@ -34,6 +36,13 @@ func TestParseSelector(t *testing.T) {
34
36
{"singleNest(bytes32,uint8,(uint256,uint256),address)" , "singleNest" , mkType ("bytes32" , "uint8" , mkType ("uint256" , "uint256" ), "address" )},
35
37
{"multiNest(address,(uint256[],uint256),((address,bytes32),uint256))" , "multiNest" ,
36
38
mkType ("address" , mkType ("uint256[]" , "uint256" ), mkType (mkType ("address" , "bytes32" ), "uint256" ))},
39
+ {"arrayNest((uint256,uint256)[],bytes32)" , "arrayNest" , mkType ([][]ArgumentMarshaling {mkType ("uint256" , "uint256" )}, "bytes32" )},
40
+ {"multiArrayNest((uint256,uint256)[],(uint256,uint256)[])" , "multiArrayNest" ,
41
+ mkType ([][]ArgumentMarshaling {mkType ("uint256" , "uint256" )}, [][]ArgumentMarshaling {mkType ("uint256" , "uint256" )})},
42
+ {"singleArrayNestAndArray((uint256,uint256)[],bytes32[])" , "singleArrayNestAndArray" ,
43
+ mkType ([][]ArgumentMarshaling {mkType ("uint256" , "uint256" )}, "bytes32[]" )},
44
+ {"singleArrayNestWithArrayAndArray((uint256[],address[2],uint8[4][][5])[],bytes32[])" , "singleArrayNestWithArrayAndArray" ,
45
+ mkType ([][]ArgumentMarshaling {mkType ("uint256[]" , "address[2]" , "uint8[4][][5]" )}, "bytes32[]" )},
37
46
}
38
47
for i , tt := range tests {
39
48
selector , err := ParseSelector (tt .input )
0 commit comments