Skip to content

Commit d4eb962

Browse files
chore: XCTAsserts added + removed empty lines
1 parent 6e8e6c0 commit d4eb962

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

Tests/web3swiftTests/localTests/UserCases.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ class UserCases: XCTestCase {
2525
let readTransaction = contract.createReadOperation("balanceOf", parameters: [account] as [AnyObject])!
2626
readTransaction.transaction.from = account
2727
let response = try await readTransaction.callContractMethod()
28-
let balance = response["0"] as? BigUInt
29-
28+
XCTAssertNotNil(response["0"] as? BigUInt)
3029
}
3130

3231
func testUserCase2() async {
@@ -88,23 +87,17 @@ class UserCases: XCTestCase {
8887
let receipt = try await web3.eth.transactionReceipt(txHash)
8988

9089
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")
9792
}
9893

9994
let details = try await web3.eth.transactionDetails(txHash)
100-
10195
XCTAssert(details.transaction.to == .contractDeploymentAddress())
10296
}
10397

10498
func testNonBatchedRequest() async throws {
10599
let web3 = try await Web3.new(LocalTestCase.url)
106100
let address = EthereumAddress("0xe22b8979739D724343bd002F9f432F5990879901")!
107-
let balanceResult = try await web3.eth.getBalance(for: address)
108-
101+
_ = try await web3.eth.getBalance(for: address)
109102
}
110103
}

0 commit comments

Comments
 (0)