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

minor changes related to migration #42

Merged
merged 1 commit into from
Nov 1, 2023
Merged
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
4 changes: 2 additions & 2 deletions Sources/CommonSources/Models/AllNodeDetailsModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ public struct AllNodeDetailsModel:Equatable, Decodable {
self.torusNodeTSSEndpoints = torusNodeTSSEndpoints
}

public mutating func setNodeDetails(nodeDetails: AllNodeDetailsModel) {
public mutating func setNodeDetails(nodeDetails: AllNodeDetailsModel, updated: Bool) {
self.torusNodeEndpoints = nodeDetails.torusNodeEndpoints
self.torusNodeSSSEndpoints = nodeDetails.torusNodeSSSEndpoints
self.torusNodeRSSEndpoints = nodeDetails.torusNodeRSSEndpoints
self.torusNodeTSSEndpoints = nodeDetails.torusNodeTSSEndpoints
self.torusNodePub = nodeDetails.torusNodePub
self.torusIndexes = nodeDetails.torusIndexes
self.currentEpoch = nodeDetails.currentEpoch
self.updated = true
self.updated = updated
}
}
2 changes: 1 addition & 1 deletion Sources/FetchNodeDetails/Constants/Constants.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let TORUS_NETWORK: [TorusNetwork: String] = [
public typealias TORUS_NETWORK_TYPE = String


let MULTI_CLUSTER_NETWORKS: [LegacyNetwork] = [ .AQUA, .CELESTE, .CYAN ]
let MULTI_CLUSTER_NETWORKS: [LegacyNetwork] = [.CELESTE]

let NETWORK_MAP: [LegacyNetwork: String] = [
.MAINNET: "mainnet",
Expand Down
4 changes: 2 additions & 2 deletions Sources/FetchNodeDetails/NodeDetailManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,13 @@ open class NodeDetailManager {
let (data, _) = try await URLSession.shared.data(from: url)
let response = try JSONDecoder().decode(NodeDetailsResponse.self, from: data)
let nodeDetails = response.getNodeDetails()
fndResult.setNodeDetails(nodeDetails: nodeDetails)
fndResult.setNodeDetails(nodeDetails: nodeDetails, updated: true)
return fndResult
} catch let error {
os_log("Failed to fetch node details from server, using local. %s", log: getTorusLogger(log: FNDLogger.core, type: .error), type: .error, error.localizedDescription)
}
let nodeDetails = try fetchLocalConfig(network: self.network)!
fndResult.setNodeDetails(nodeDetails: nodeDetails)
fndResult.setNodeDetails(nodeDetails: nodeDetails, updated: false)
return fndResult
}

Expand Down
30 changes: 0 additions & 30 deletions Sources/FndBase/Configs/LegacyConfig.swift

This file was deleted.

1 change: 0 additions & 1 deletion Sources/FndBase/Utils/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ public func fetchLocalConfig(network: TorusNetwork) throws -> AllNodeDetailsMode
if (network.migration_map.migrationCompleted) {
return try SapphireConfig(network: network.migration_map.networkMigratedTo )
}
if (network == LegacyNetwork.MAINNET ) { return NODE_DETAILS_MAINNET }
return nil

case .sapphire(let network) :
Expand Down
Loading