File tree Expand file tree Collapse file tree 1 file changed +4
-11
lines changed
Tests/web3swiftTests/localTests Expand file tree Collapse file tree 1 file changed +4
-11
lines changed Original file line number Diff line number Diff line change @@ -25,8 +25,7 @@ class UserCases: XCTestCase {
25
25
let readTransaction = contract. createReadOperation ( " balanceOf " , parameters: [ account] as [ AnyObject ] ) !
26
26
readTransaction. transaction. from = account
27
27
let response = try await readTransaction. callContractMethod ( )
28
- let balance = response [ " 0 " ] as? BigUInt
29
-
28
+ XCTAssertNotNil ( response [ " 0 " ] as? BigUInt )
30
29
}
31
30
32
31
func testUserCase2( ) async {
@@ -88,23 +87,17 @@ class UserCases: XCTestCase {
88
87
let receipt = try await web3. eth. transactionReceipt ( txHash)
89
88
90
89
XCTAssert ( receipt. contractAddress != nil )
91
-
92
- switch receipt. status {
93
- case . notYetProcessed:
94
- return
95
- default :
96
- break
90
+ if case . notYetProcessed = receipt. status {
91
+ throw Web3Error . processingError ( desc: " Transaction is not yet complete " )
97
92
}
98
93
99
94
let details = try await web3. eth. transactionDetails ( txHash)
100
-
101
95
XCTAssert ( details. transaction. to == . contractDeploymentAddress( ) )
102
96
}
103
97
104
98
func testNonBatchedRequest( ) async throws {
105
99
let web3 = try await Web3 . new ( LocalTestCase . url)
106
100
let address = EthereumAddress ( " 0xe22b8979739D724343bd002F9f432F5990879901 " ) !
107
- let balanceResult = try await web3. eth. getBalance ( for: address)
108
-
101
+ _ = try await web3. eth. getBalance ( for: address)
109
102
}
110
103
}
You can’t perform that action at this time.
0 commit comments