-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from torusresearch/update_network_migrations
feat: update migration status for cyan and aqua networks
- Loading branch information
Showing
3 changed files
with
69 additions
and
128 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,14 +6,10 @@ import XCTest | |
class fetchNodeDetailsTests: XCTestCase { | ||
var timeout: TimeInterval = 10 | ||
var verifierId = "[email protected]" | ||
func test_getNode_Mainnet() async { | ||
func test_getNode_Mainnet() async throws { | ||
let fnd = NodeDetailManager(network: .legacy(.MAINNET)) | ||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputMainnet().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputMainnet().val) | ||
} | ||
|
||
// TODO: https://mainnet.infura.io/v3/7f287687b3d049e2bea7b64869ee30a3 is unsupported network | ||
|
@@ -27,71 +23,45 @@ class fetchNodeDetailsTests: XCTestCase { | |
// } | ||
// } | ||
|
||
func test_getNode_Testnet() async { | ||
func test_getNode_Testnet() async throws { | ||
let fnd = NodeDetailManager(network: .legacy(.TESTNET)) | ||
|
||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputTestnet().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputTestnet().val) | ||
} | ||
func test_getNode_SapphireDevnet() async { | ||
|
||
func test_getNode_SapphireDevnet() async throws { | ||
let fnd = NodeDetailManager(network: .sapphire(.SAPPHIRE_DEVNET)) | ||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
var config = try! SapphireConfig(network: .SAPPHIRE_DEVNET) | ||
config.updated = true | ||
XCTAssertEqual(result, config) | ||
XCTAssertEqual(result, SampleOutputSAPPHIREDEVNET().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
var config = try! SapphireConfig(network: .SAPPHIRE_DEVNET) | ||
config.updated = true | ||
XCTAssertEqual(result, config) | ||
XCTAssertEqual(result, SampleOutputSAPPHIREDEVNET().val) | ||
} | ||
func test_getNode_SapphireMainnet() async { | ||
|
||
func test_getNode_SapphireMainnet() async throws { | ||
let fnd = NodeDetailManager(network: .sapphire(.SAPPHIRE_MAINNET)) | ||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
var config = try! SapphireConfig(network: .SAPPHIRE_MAINNET) | ||
config.updated = true | ||
XCTAssertEqual(result, config) | ||
XCTAssertEqual(result, SampleOutputSAPPHIREMAINNET().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
var config = try! SapphireConfig(network: .SAPPHIRE_MAINNET) | ||
config.updated = true | ||
XCTAssertEqual(result, config) | ||
XCTAssertEqual(result, SampleOutputSAPPHIREMAINNET().val) | ||
} | ||
|
||
|
||
func test_getNode_Cyan() async { | ||
|
||
func test_getNode_Cyan() async throws { | ||
let fnd = NodeDetailManager(network: .legacy(.CYAN)) | ||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputCyan().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputCyan().val) | ||
} | ||
|
||
func test_getNode_Aqua() async { | ||
func test_getNode_Aqua() async throws { | ||
let fnd = NodeDetailManager(network: .legacy(.AQUA)) | ||
do { | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputAqua().val) | ||
} catch { | ||
XCTFail(error.localizedDescription) | ||
} | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) | ||
XCTAssertEqual(result, SampleOutputAqua().val) | ||
} | ||
|
||
func test_getNode_Celeste() async { | ||
do { | ||
let fnd = NodeDetailManager(network: .legacy(.CELESTE)) | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: "[email protected]") | ||
XCTAssertEqual(result, SampleOutputCeleste().val) | ||
} catch { | ||
XCTFail() | ||
} | ||
func test_getNode_Celeste() async throws { | ||
let fnd = NodeDetailManager(network: .legacy(.CELESTE)) | ||
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: "[email protected]") | ||
XCTAssertEqual(result, SampleOutputCeleste().val) | ||
} | ||
} |