From 9ec971573426247b0806e46b88a82fa8f96cf34a Mon Sep 17 00:00:00 2001 From: hqjang-pepper Date: Wed, 2 Aug 2023 16:44:40 +0900 Subject: [PATCH] remove sapphire testnet --- Sources/CommonSources/TorusNetwork.swift | 7 +----- .../Constants/Constants.swift | 1 - Sources/FndBase/Configs/SapphireConfig.swift | 18 --------------- Sources/FndBase/Endpoints/Endpoints.swift | 7 ------ .../FetchNodeDetailsTests/SampleOutput.swift | 22 ------------------- .../fetchNodeDetailsTests.swift | 13 ----------- 6 files changed, 1 insertion(+), 67 deletions(-) diff --git a/Sources/CommonSources/TorusNetwork.swift b/Sources/CommonSources/TorusNetwork.swift index 33ce153..a1e958b 100644 --- a/Sources/CommonSources/TorusNetwork.swift +++ b/Sources/CommonSources/TorusNetwork.swift @@ -25,15 +25,12 @@ public enum TorusNetwork : Equatable, Hashable { public enum SapphireNetwork: Equatable, Hashable { case SAPPHIRE_DEVNET - case SAPPHIRE_TESTNET case SAPPHIRE_MAINNET public var path: String { switch self { case .SAPPHIRE_DEVNET: return "sapphire_devnet" - case .SAPPHIRE_TESTNET: - return "sapphire_testnet" case .SAPPHIRE_MAINNET: return "sapphire_mainnet" } @@ -43,8 +40,6 @@ public enum SapphireNetwork: Equatable, Hashable { switch self { case .SAPPHIRE_DEVNET: return "sapphire_devnet" - case .SAPPHIRE_TESTNET: - return "sapphire_testnet" case .SAPPHIRE_MAINNET: return "sapphire_mainnet" } @@ -94,7 +89,7 @@ public enum LegacyNetwork: Equatable, Hashable { case .MAINNET: return LegacyNetworkMigrationInfo(migrationCompleted: false, networkIdentifier: self.name, networkMigratedTo: SapphireNetwork.SAPPHIRE_MAINNET) case .TESTNET: - return LegacyNetworkMigrationInfo(migrationCompleted: true, networkIdentifier: "teal", networkMigratedTo: SapphireNetwork.SAPPHIRE_TESTNET) + return LegacyNetworkMigrationInfo(migrationCompleted: true, networkIdentifier: "teal", networkMigratedTo: SapphireNetwork.SAPPHIRE_DEVNET) case .CYAN : return LegacyNetworkMigrationInfo(migrationCompleted: false, networkIdentifier: self.name, networkMigratedTo: SapphireNetwork.SAPPHIRE_MAINNET) case .AQUA : diff --git a/Sources/FetchNodeDetails/Constants/Constants.swift b/Sources/FetchNodeDetails/Constants/Constants.swift index 55ab921..2f46c8a 100644 --- a/Sources/FetchNodeDetails/Constants/Constants.swift +++ b/Sources/FetchNodeDetails/Constants/Constants.swift @@ -2,7 +2,6 @@ import CommonSources let TORUS_NETWORK: [TorusNetwork: String] = [ TorusNetwork.sapphire(SapphireNetwork.SAPPHIRE_DEVNET) : "sapphire_devnet", - TorusNetwork.sapphire(SapphireNetwork.SAPPHIRE_TESTNET) : "sapphire_testnet", TorusNetwork.sapphire(SapphireNetwork.SAPPHIRE_MAINNET) : "sapphire_mainnet", TorusNetwork.legacy(LegacyNetwork.MAINNET) : "mainnet", TorusNetwork.legacy(LegacyNetwork.TESTNET) : "testnet", diff --git a/Sources/FndBase/Configs/SapphireConfig.swift b/Sources/FndBase/Configs/SapphireConfig.swift index 76376cc..f496053 100644 --- a/Sources/FndBase/Configs/SapphireConfig.swift +++ b/Sources/FndBase/Configs/SapphireConfig.swift @@ -15,14 +15,6 @@ public var SapphireMainnetNodePub : [TorusNodePubModel] = [ .init(_X: "2b5f58d8e340f1ab922e89b3a69a68930edfe51364644a456335e179bc130128", _Y: "4b4daa05939426e3cbe7d08f0e773d2bf36f64c00d04620ee6df2a7af4d2247"), .init(_X: "3ecbb6a68afe72cf34ec6c0a12b5cb78a0d2e83ba402983b6adbc5f36219861a", _Y: "dc1031c5cc8f0472bd521a62a64ebca9e163902c247bf05937daf4ae835091e4"), ] -public var SapphireTestnetNodePub : [TorusNodePubModel] = [ - .init(_X: "f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247", _Y: "54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"), - .init(_X: "bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a", _Y: "ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"), - .init(_X: "b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb", _Y: "759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"), - .init(_X: "7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767", _Y: "336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"), - .init(_X: "bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773", _Y: "bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"), - -] public var SapphireDevnetNodePub : [TorusNodePubModel] = [ .init(_X: "f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247", _Y: "54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"), .init(_X: "bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a", _Y: "ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"), @@ -43,16 +35,6 @@ public func SapphireConfig ( network : SapphireNetwork) throws -> AllNodeDetails _torusIndexes: [1, 2, 3, 4, 5], _torusNodePub: SapphireMainnetNodePub ) - case .SAPPHIRE_TESTNET : - return .init( - _currentEpoch: "1", - _torusNodeEndpoints: try getSSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusNodeSSSEndpoints: try getSSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusNodeRSSEndpoints: try getRSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusNodeTSSEndpoints: try getTSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusIndexes: [1, 2, 3, 4, 5], - _torusNodePub: SapphireTestnetNodePub - ) case .SAPPHIRE_DEVNET : return .init( _currentEpoch: "1", diff --git a/Sources/FndBase/Endpoints/Endpoints.swift b/Sources/FndBase/Endpoints/Endpoints.swift index fe59446..bd6e52f 100644 --- a/Sources/FndBase/Endpoints/Endpoints.swift +++ b/Sources/FndBase/Endpoints/Endpoints.swift @@ -8,13 +8,6 @@ let SAPPHIRE_NETWORK_URLS: [SapphireNetwork: [String]] = [ "https://sapphire-dev-2-4.authnetwork.dev", "https://sapphire-dev-2-5.authnetwork.dev", ], - .SAPPHIRE_TESTNET: [ - "https://sapphire-dev-2-1.authnetwork.dev", - "https://sapphire-dev-2-2.authnetwork.dev", - "https://sapphire-dev-2-3.authnetwork.dev", - "https://sapphire-dev-2-4.authnetwork.dev", - "https://sapphire-dev-2-5.authnetwork.dev", - ], .SAPPHIRE_MAINNET: [ "https://sapphire-1.auth.network", "https://sapphire-2.auth.network", diff --git a/Tests/FetchNodeDetailsTests/SampleOutput.swift b/Tests/FetchNodeDetailsTests/SampleOutput.swift index 54777e1..b424239 100644 --- a/Tests/FetchNodeDetailsTests/SampleOutput.swift +++ b/Tests/FetchNodeDetailsTests/SampleOutput.swift @@ -202,28 +202,6 @@ public struct SampleOutputSAPPHIREDEVNET { } } -public struct SampleOutputSAPPHIRETESTNET { - var val: AllNodeDetailsModel { - return .init( - _currentEpoch: "1", - _torusNodeEndpoints: try! getSSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)),// SAPPHIRE_NETWORK_URLS[.SAPPHIRE_TESTNET]!, - _torusNodeSSSEndpoints: try! getSSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusNodeRSSEndpoints: try! getRSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusNodeTSSEndpoints: try! getTSSEndpoints(network: .sapphire(SapphireNetwork.SAPPHIRE_TESTNET)), - _torusIndexes: [1, 2, 3, 4, 5], - _torusNodePub: [ - .init(_X: "f74389b0a4c8d10d2a687ae575f69b20f412d41ab7f1fe6b358aa14871327247", _Y: "54e3a73098ed9bced3ef8821736e9794f9264a1420c0c7ad15d2fa617ba35ef7"), - .init(_X: "bc38813a6873e526087918507c78fc3a61624670ee851ecfb4f3bef55d027b5a", _Y: "ac4b21229f662a0aefdfdac21cf17c3261a392c74a8790db218b34e3e4c1d56a"), - .init(_X: "b56541684ea5fa40c8337b7688d502f0e9e092098962ad344c34e94f06d293fb", _Y: "759a998cef79d389082f9a75061a29190eec0cac99b8c25ddcf6b58569dad55c"), - .init(_X: "7bcb058d4c6ffc6ba4bfdfd93d141af35a66338a62c7c27cdad2ae3f8289b767", _Y: "336ab1935e41ed4719e162587f0ab55518db4207a1eb36cc72303f1b86689d2b"), - .init(_X: "bf12a136ef94399ea098f926f04e26a4ec4ac70f69cce274e8893704c4951773", _Y: "bdd44828020f52ce510e026338216ada184a6867eb4e19fb4c2d495d4a7e15e4"), - - ], - _updated: true - ) - } -} - public struct SampleOutputSAPPHIREMAINNET { var val: AllNodeDetailsModel { return .init( diff --git a/Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift b/Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift index 04cb77e..3e5b893 100644 --- a/Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift +++ b/Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift @@ -54,19 +54,6 @@ class fetchNodeDetailsTests: XCTestCase { } } - func test_getNode_SapphireTestnet() async { - let fnd = NodeDetailManager(network: .sapphire(.SAPPHIRE_TESTNET)) - do { - let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId) - var config = try! SapphireConfig(network: .SAPPHIRE_TESTNET) - config.updated = true - XCTAssertEqual(result, config) - XCTAssertEqual(result, SampleOutputSAPPHIRETESTNET().val) - } catch { - XCTFail(error.localizedDescription) - } - } - func test_getNode_SapphireMainnet() async { let fnd = NodeDetailManager(network: .sapphire(.SAPPHIRE_MAINNET)) do {