Skip to content

Commit

Permalink
Add different transactions to testBatchGetTransactionByHash
Browse files Browse the repository at this point in the history
  • Loading branch information
franciszekjob committed May 12, 2024
1 parent 2fd5b3b commit 1beafcb
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Tests/StarknetTests/Providers/ProviderTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -411,14 +411,16 @@ final class ProviderTests: XCTestCase {

let transactionsResponse = try await provider.batchRequests(requests: [
provider.getTransactionBy(hash: previousResult.transaction.hash!),
provider.getTransactionBy(hash: previousResult.transaction.hash!),
provider.getTransactionBy(hash: "0x123"),
]
).send()

XCTAssertEqual(transactionsResponse.count, 2)
XCTAssertEqual(try transactionsResponse[0].get().transaction.hash, previousResult.transaction.hash)
XCTAssertEqual(try transactionsResponse[1].get().transaction.hash, previousResult.transaction.hash)

print(transactionsResponse)

do {
let _ = try transactionsResponse[1].get().transaction.hash
XCTFail("Fetching transaction with nonexistent hash should fail")
} catch {}
}
}

0 comments on commit 1beafcb

Please sign in to comment.