Skip to content

Commit 8a02610

Browse files
Broken tests fixed:
- Goerli gateway returns 403 now - "https://rpc-mainnet.maticvigil.com/" returns 410 now - `testInitURLError` shouldn't be working since there's always valid URL built within the client method itself, but it fails on empty data (wrong place).
1 parent 4359267 commit 8a02610

File tree

3 files changed

+2
-33
lines changed

3 files changed

+2
-33
lines changed

Tests/web3swiftTests/remoteTests/EIP1559Tests.swift

+2-18
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,7 @@ final class EIP1559Tests: XCTestCase {
1919
type: .eip1559,
2020
to: EthereumAddress("0xb47292B7bBedA4447564B8336E4eD1f93735e7C7")!,
2121
chainID: web3.provider.network!.chainID,
22-
value: try XCTUnwrap(Utilities.parseToBigUInt("0.1", units: .ether)),
23-
gasLimit: 21_000
24-
)
25-
// Vitalik's address
26-
tx.from = EthereumAddress("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B")!
27-
// Should fail if there would be something wrong with the tx
28-
let res = try await web3.eth.estimateGas(for: tx)
29-
XCTAssertGreaterThan(res, 0)
30-
}
31-
32-
func testEIP1159GoerliTransaction() async throws {
33-
let web3 = try await Web3.InfuraGoerliWeb3(accessToken: Constants.infuraToken)
34-
var tx = CodableTransaction(
35-
type: .eip1559,
36-
to: EthereumAddress("0xeBec795c9c8bBD61FFc14A6662944748F299cAcf")!,
37-
chainID: web3.provider.network!.chainID,
38-
value: try XCTUnwrap(Utilities.parseToBigUInt("0.1", units: .ether)),
39-
gasLimit: 21_000
22+
value: try XCTUnwrap(Utilities.parseToBigUInt("0.1", units: .ether))
4023
)
4124
// Vitalik's address
4225
tx.from = EthereumAddress("0xAb5801a7D398351b8bE11C439e05C5B3259aeC9B")!
@@ -45,4 +28,5 @@ final class EIP1559Tests: XCTestCase {
4528
XCTAssertGreaterThan(res, 0)
4629
}
4730

31+
// MARK: Here was Goerli network test, but now gateway returns 410
4832
}

Tests/web3swiftTests/remoteTests/EtherscanTransactionCheckerTests.swift

-12
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ final class EtherscanTransactionCheckerTests: XCTestCase {
4242
}
4343
}
4444

45-
func testInitURLError() async throws {
46-
do {
47-
let sut = EtherscanTransactionChecker(urlSession: URLSessionMock(), apiKey: " ")
48-
49-
_ = try await sut.hasTransactions(ethereumAddress: try XCTUnwrap(EthereumAddress(vitaliksAddress)))
50-
51-
XCTFail("URL init must throw an error")
52-
} catch EtherscanTransactionCheckerError.invalidUrl {
53-
XCTAssertTrue(true)
54-
}
55-
}
56-
5745
func testWrongApiKey() async throws {
5846
do {
5947
let sut = EtherscanTransactionChecker(urlSession: URLSession.shared, apiKey: "-")

Tests/web3swiftTests/remoteTests/Web3HttpProviderTests.swift

-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ final class Web3HttpProviderTests: XCTestCase {
2424
web3 = try await Web3HttpProvider(url: URL(string: "https://rpc.ankr.com/bsc")!, network: nil)
2525
XCTAssertEqual(web3.network?.chainID, 56)
2626

27-
web3 = try await Web3HttpProvider(url: URL(string: "https://rpc-mainnet.maticvigil.com/")!, network: nil)
28-
XCTAssertEqual(web3.network?.chainID, 137)
29-
3027
web3 = try await Web3HttpProvider(url: URL(string: "https://optimism.gateway.tenderly.co")!, network: nil)
3128
XCTAssertEqual(web3.network?.chainID, 10)
3229
}

0 commit comments

Comments
 (0)