Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove celeste support #51

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import PackageDescription

let package = Package(
name: "FetchNodeDetails",
platforms: [.iOS(.v13), .macOS(.v10_15)],
platforms: [.iOS(.v14), .macOS(.v10_15)],
products: [
.library(
name: "FetchNodeDetails",
Expand Down
10 changes: 1 addition & 9 deletions Sources/CommonSources/TorusNetwork.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,14 @@ public enum LegacyNetwork: Equatable, Hashable {
case TESTNET
case CYAN
case AQUA
case CELESTE

public var path: String {
switch self {
case .MAINNET:
return "mainnet"
case .TESTNET:
return "goerli"
case .CYAN, .AQUA, .CELESTE:
case .CYAN, .AQUA:
return "polygon-mainnet"
}
}
Expand All @@ -90,8 +89,6 @@ public enum LegacyNetwork: Equatable, Hashable {
return "cyan"
case .AQUA :
return "aqua"
case .CELESTE:
return "celeste"
}
}

Expand All @@ -105,8 +102,6 @@ public enum LegacyNetwork: Equatable, Hashable {
return LegacyNetworkMigrationInfo(migrationCompleted: true, networkIdentifier: self.name, networkMigratedTo: SapphireNetwork.SAPPHIRE_MAINNET)
case .AQUA :
return LegacyNetworkMigrationInfo(migrationCompleted: true, networkIdentifier: self.name, networkMigratedTo: SapphireNetwork.SAPPHIRE_MAINNET)
case .CELESTE:
return LegacyNetworkMigrationInfo(migrationCompleted: true, networkIdentifier: self.name, networkMigratedTo: SapphireNetwork.SAPPHIRE_MAINNET)
}
}

Expand All @@ -116,7 +111,6 @@ public enum LegacyNetwork: Equatable, Hashable {
case .TESTNET: return "goerli"
case .CYAN: return "polygon-mainnet"
case .AQUA: return "polygon-mainnet"
case .CELESTE: return "polygon-mainnet"
}
}

Expand All @@ -126,7 +120,6 @@ public enum LegacyNetwork: Equatable, Hashable {
case .TESTNET: return "https://signer.web3auth.io"
case .CYAN: return "https://signer-polygon.web3auth.io"
case .AQUA: return "https://signer-polygon.web3auth.io"
case .CELESTE: return "https://signer-polygon.web3auth.io"
}
}

Expand All @@ -136,7 +129,6 @@ public enum LegacyNetwork: Equatable, Hashable {
case .TESTNET: return "https://metadata.web3auth.io"
case .CYAN: return "https://metadata.web3auth.io"
case .AQUA: return "https://metadata.web3auth.io"
case .CELESTE: return "https://metadata.web3auth.io"
}
}
}
Expand Down
3 changes: 0 additions & 3 deletions Sources/CommonSources/Web3AuthNetwork.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ public enum Web3AuthNetwork : Equatable, Hashable {
case TESTNET
case CYAN
case AQUA
case CELESTE

public var path: String {
return self.torusNetwork.path
Expand Down Expand Up @@ -66,8 +65,6 @@ public enum Web3AuthNetwork : Equatable, Hashable {
return .legacy(.CYAN)
case .AQUA:
return .legacy(.AQUA)
case .CELESTE:
return .legacy(.CELESTE)
}
}
}
4 changes: 0 additions & 4 deletions Sources/FetchNodeDetails/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ let TORUS_NETWORK: [TorusNetwork: String] = [
TorusNetwork.legacy(LegacyNetwork.MAINNET) : "mainnet",
TorusNetwork.legacy(LegacyNetwork.TESTNET) : "testnet",
TorusNetwork.legacy(LegacyNetwork.CYAN) : "cyan",
TorusNetwork.legacy(LegacyNetwork.CELESTE) : "celeste",
]
public typealias TORUS_NETWORK_TYPE = String


let MULTI_CLUSTER_NETWORKS: [LegacyNetwork] = [.CELESTE]
4 changes: 2 additions & 2 deletions Sources/FetchNodeDetails/NodeDetailManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ open class NodeDetailManager {

public func getNodeDetails(verifier: String, verifierID: String) async throws -> AllNodeDetailsModel {
switch network.torusNetwork {
case .legacy(let legacyNetwork):
if updated && !MULTI_CLUSTER_NETWORKS.contains(legacyNetwork) {
case .legacy(_):
if updated {
return nodeDetails
}
case .sapphire(_):
Expand Down
26 changes: 0 additions & 26 deletions Tests/FetchNodeDetailsTests/SampleOutput.swift
Original file line number Diff line number Diff line change
Expand Up @@ -109,32 +109,6 @@ public struct SampleOutputAqua {
}
}

public struct SampleOutputCeleste {
var val: AllNodeDetailsModel {
return .init(
_currentEpoch: "1",
_torusNodeEndpoints: try! getSSSEndpoints(network: .legacy(.CELESTE)),
_torusNodeSSSEndpoints: try! getSSSEndpoints(network: .legacy(.CELESTE)),
_torusNodeRSSEndpoints: try! getRSSEndpoints(network: .legacy(.CELESTE)),
_torusNodeTSSEndpoints: try! getTSSEndpoints(network: .legacy(.CELESTE)),
_torusIndexes: [1, 2, 3, 4, 5],
_torusNodePub: [
.init(_X: "e0925898fee0e9e941fdca7ee88deec99939ae9407e923535c4d4a3a3ff8b052",
_Y: "54b9fea924e3f3e40791f9987f4234ae4222412d65b74068032fa5d8b63375c1"),
.init(_X: "9124cf1e280aab32ba50dffd2de81cecabc13d82d2c1fe9de82f3b3523f9b637",
_Y: "fca939a1ceb42ce745c55b21ef094f543b457630cb63a94ef4f1afeee2b1f107"),
.init(_X: "555f681a63d469cc6c3a58a97e29ebd277425f0e6159708e7c7bf05f18f89476",
_Y: "606f2bcc0884fa5b64366fc3e8362e4939841b56acd60d5f4553cf36b891ac4e"),
.init(_X: "2b5f58d8e340f1ab922e89b3a69a68930edfe51364644a456335e179bc130128",
_Y: "4b4daa05939426e3cbe7d08f0e773d2bf36f64c00d04620ee6df2a7af4d2247"),
.init(_X: "3ecbb6a68afe72cf34ec6c0a12b5cb78a0d2e83ba402983b6adbc5f36219861a",
_Y: "dc1031c5cc8f0472bd521a62a64ebca9e163902c247bf05937daf4ae835091e4"),
],
_updated: true
)
}
}

public struct SampleOutputSAPPHIREDEVNET {
var val: AllNodeDetailsModel {
return .init(
Expand Down
6 changes: 0 additions & 6 deletions Tests/FetchNodeDetailsTests/fetchNodeDetailsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,6 @@ class fetchNodeDetailsTests: XCTestCase {
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: verifierId)
XCTAssertEqual(result, SampleOutputAqua().val)
}

func test_getNode_Celeste() async throws {
let fnd = NodeDetailManager(network: .CELESTE)
let result = try await fnd.getNodeDetails(verifier: "google", verifierID: "[email protected]")
XCTAssertEqual(result, SampleOutputCeleste().val)
}

func test_getMetadata_Mainnet() async throws {
let fnd = NodeDetailManager(network: .MAINNET)
Expand Down
2 changes: 1 addition & 1 deletion Torus-fetchNodeDetails.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |spec|
spec.name = "Torus-fetchNodeDetails"
spec.version = "7.0.0"
spec.version = "8.0.0"
spec.ios.deployment_target = '13.0'
spec.summary = "Fetches the node details from torus nodelist smart contract"
spec.homepage = "https://github.com/torusresearch/fetch-node-details-swift"
Expand Down
4 changes: 2 additions & 2 deletions cocoapods/Podfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
PODS:
- BigInt (5.2.0)
- Torus-fetchNodeDetails (7.0.0):
- Torus-fetchNodeDetails (8.0.0):
- BigInt (~> 5.2.0)

DEPENDENCIES:
Expand All @@ -16,7 +16,7 @@ EXTERNAL SOURCES:

SPEC CHECKSUMS:
BigInt: f668a80089607f521586bbe29513d708491ef2f7
Torus-fetchNodeDetails: d12f3511de52bdca33ccabf35f618c296edf94c5
Torus-fetchNodeDetails: 3eec6966cf62e359e99bd0337a9275c047843311

PODFILE CHECKSUM: 33add72342a492adb43676625c404c97ced731da

Expand Down
Loading