@@ -26,6 +26,7 @@ class ABIElementsTest: XCTestCase {
26
26
XCTAssertEqual ( EthError ( name: " Error " , inputs: [ . init( name: " " , type: . address) ] ) . errorDeclaration, " Error(address) " )
27
27
XCTAssertEqual ( EthError ( name: " Error " , inputs: [ . init( name: " " , type: . address) , . init( name: " " , type: . uint( bits: 256 ) ) ] ) . errorDeclaration, " Error(address,uint256) " )
28
28
XCTAssertEqual ( EthError ( name: " Error " , inputs: [ . init( name: " sender " , type: . address) , . init( name: " " , type: . uint( bits: 256 ) ) ] ) . errorDeclaration, " Error(address sender,uint256) " )
29
+ // Not all types are supported in errors, e.g. tuples and functions are not supported
29
30
let allTypesNamedAndNot : [ ABI . Element . InOut ] = [
30
31
. init( name: " sender " , type: . address) ,
31
32
. init( name: " " , type: . address) ,
@@ -44,11 +45,12 @@ class ABIElementsTest: XCTestCase {
44
45
. init( name: " someFlag " , type: . bool) ,
45
46
. init( name: " rand_bytes " , type: . bytes( length: 123 ) ) ,
46
47
. init( name: " " , type: . dynamicBytes) ,
48
+ . init( name: " arrarrarray123 " , type: . array( type: . bool, length: 0 ) ) ,
47
49
. init( name: " error_message_maybe " , type: . string) ,
48
50
]
49
51
XCTAssertEqual ( EthError ( name: " VeryCustomErrorName " ,
50
52
inputs: allTypesNamedAndNot) . errorDeclaration,
51
- " VeryCustomErrorName(address sender,address,uint8,uint16,uint32,uint64,uint128,uint256,int8 my_int_8,int16 my_int_16,int32 my_int_32,int64 my_int_64,int128 my_int_128,int256 my_int_256,bool someFlag,bytes123 rand_bytes,bytes,string error_message_maybe) " )
53
+ " VeryCustomErrorName(address sender,address,uint8,uint16,uint32,uint64,uint128,uint256,int8 my_int_8,int16 my_int_16,int32 my_int_32,int64 my_int_64,int128 my_int_128,int256 my_int_256,bool someFlag,bytes123 rand_bytes,bytes,bool[] arrarrarray123, string error_message_maybe) " )
52
54
}
53
55
54
56
}
0 commit comments