Skip to content

Commit

Permalink
remove sapphire testnet
Browse files Browse the repository at this point in the history
  • Loading branch information
hqjang-pepper committed Aug 2, 2023
1 parent 5dc0393 commit 9ec9715
Show file tree
Hide file tree
Showing 6 changed files with 1 addition and 67 deletions.
7 changes: 1 addition & 6 deletions Sources/CommonSources/TorusNetwork.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
Expand All @@ -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"
}
Expand Down Expand Up @@ -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 :
Expand Down
1 change: 0 additions & 1 deletion Sources/FetchNodeDetails/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
18 changes: 0 additions & 18 deletions Sources/FndBase/Configs/SapphireConfig.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand All @@ -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",
Expand Down
7 changes: 0 additions & 7 deletions Sources/FndBase/Endpoints/Endpoints.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
22 changes: 0 additions & 22 deletions Tests/FetchNodeDetailsTests/SampleOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
13 changes: 0 additions & 13 deletions Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9ec9715

Please sign in to comment.