Skip to content

Commit 6bc5100

Browse files
chore: test update - added array type to error arguments
1 parent f2cb4b9 commit 6bc5100

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Tests/web3swiftTests/localTests/ABIElementsTests.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ class ABIElementsTest: XCTestCase {
2626
XCTAssertEqual(EthError(name: "Error", inputs: [.init(name: " ", type: .address)]).errorDeclaration, "Error(address)")
2727
XCTAssertEqual(EthError(name: "Error", inputs: [.init(name: " ", type: .address), .init(name: "", type: .uint(bits: 256))]).errorDeclaration, "Error(address,uint256)")
2828
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
2930
let allTypesNamedAndNot: [ABI.Element.InOut] = [
3031
.init(name: "sender", type: .address),
3132
.init(name: "", type: .address),
@@ -44,11 +45,12 @@ class ABIElementsTest: XCTestCase {
4445
.init(name: "someFlag", type: .bool),
4546
.init(name: "rand_bytes", type: .bytes(length: 123)),
4647
.init(name: "", type: .dynamicBytes),
48+
.init(name: "arrarrarray123", type: .array(type: .bool, length: 0)),
4749
.init(name: "error_message_maybe", type: .string),
4850
]
4951
XCTAssertEqual(EthError(name: "VeryCustomErrorName",
5052
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)")
5254
}
5355

5456
}

0 commit comments

Comments
 (0)