From 1beafcb9b88718a32536705b342d4b083f78dc19 Mon Sep 17 00:00:00 2001 From: Fiiranek Date: Mon, 13 May 2024 00:01:54 +0200 Subject: [PATCH] Add different transactions to `testBatchGetTransactionByHash` --- Tests/StarknetTests/Providers/ProviderTests.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Tests/StarknetTests/Providers/ProviderTests.swift b/Tests/StarknetTests/Providers/ProviderTests.swift index 954f24161..6f83f85a6 100644 --- a/Tests/StarknetTests/Providers/ProviderTests.swift +++ b/Tests/StarknetTests/Providers/ProviderTests.swift @@ -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 {} } }