From fced48066b81655028c20bf1d322cf754dc4007d Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Wed, 20 Jul 2022 11:39:10 +0100
Subject: [PATCH] WIP

Comment out code that needs to be updated
---
 .../Legacy/ClientCreator.swift                | 74 ++++++++--------
 .../Legacy/IdentityMaker.swift                | 56 ++++++-------
 .../Legacy/NetworkHealthListener.swift        | 84 +++++++++----------
 .../Legacy/NetworkHealthProvider.swift        | 46 +++++-----
 4 files changed, 130 insertions(+), 130 deletions(-)

diff --git a/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift b/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift
index 6021adc1..8988e085 100644
--- a/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift
+++ b/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift
@@ -1,37 +1,37 @@
-import Bindings
-
-public struct ClientCreator {
-  public var create: (URL, Data, Data, String?) throws -> Void
-
-  public func callAsFunction(
-    directoryURL: URL,
-    ndf: Data,
-    password: Data,
-    regCode: String? = nil
-  ) throws {
-    try create(directoryURL, ndf, password, regCode)
-  }
-}
-
-extension ClientCreator {
-  public static let live = ClientCreator { directoryURL, ndf, password, regCode in
-    var error: NSError?
-    let network = String(data: ndf, encoding: .utf8)!
-    let created = BindingsNewKeystore(network, directoryURL.path, password, regCode, &error)
-    if let error = error {
-      throw error
-    }
-    if !created {
-      fatalError("BindingsNewClient returned `false` without providing error")
-    }
-  }
-}
-
-#if DEBUG
-extension ClientCreator {
-  public static let failing = ClientCreator { _, _, _, _ in
-    struct NotImplemented: Error {}
-    throw NotImplemented()
-  }
-}
-#endif
+//import Bindings
+//
+//public struct ClientCreator {
+//  public var create: (URL, Data, Data, String?) throws -> Void
+//
+//  public func callAsFunction(
+//    directoryURL: URL,
+//    ndf: Data,
+//    password: Data,
+//    regCode: String? = nil
+//  ) throws {
+//    try create(directoryURL, ndf, password, regCode)
+//  }
+//}
+//
+//extension ClientCreator {
+//  public static let live = ClientCreator { directoryURL, ndf, password, regCode in
+//    var error: NSError?
+//    let network = String(data: ndf, encoding: .utf8)!
+//    let created = BindingsNewKeystore(network, directoryURL.path, password, regCode, &error)
+//    if let error = error {
+//      throw error
+//    }
+//    if !created {
+//      fatalError("BindingsNewClient returned `false` without providing error")
+//    }
+//  }
+//}
+//
+//#if DEBUG
+//extension ClientCreator {
+//  public static let failing = ClientCreator { _, _, _, _ in
+//    struct NotImplemented: Error {}
+//    throw NotImplemented()
+//  }
+//}
+//#endif
diff --git a/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift b/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift
index 6e214d6c..07920a5f 100644
--- a/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift
+++ b/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift
@@ -1,28 +1,28 @@
-import Bindings
-
-public struct IdentityMaker {
-  public var make: () throws -> Identity
-
-  public func callAsFunction() throws -> Identity {
-    try make()
-  }
-}
-
-extension IdentityMaker {
-  public static func live(bindingsClient: BindingsCmix) -> IdentityMaker {
-    IdentityMaker {
-      let data = try bindingsClient.makeIdentity()
-      let decoder = JSONDecoder()
-      return try decoder.decode(Identity.self, from: data)
-    }
-  }
-}
-
-#if DEBUG
-extension IdentityMaker {
-  public static let failing = IdentityMaker {
-    struct NotImplemented: Error {}
-    throw NotImplemented()
-  }
-}
-#endif
+//import Bindings
+//
+//public struct IdentityMaker {
+//  public var make: () throws -> Identity
+//
+//  public func callAsFunction() throws -> Identity {
+//    try make()
+//  }
+//}
+//
+//extension IdentityMaker {
+//  public static func live(bindingsClient: BindingsCmix) -> IdentityMaker {
+//    IdentityMaker {
+//      let data = try bindingsClient.makeIdentity()
+//      let decoder = JSONDecoder()
+//      return try decoder.decode(Identity.self, from: data)
+//    }
+//  }
+//}
+//
+//#if DEBUG
+//extension IdentityMaker {
+//  public static let failing = IdentityMaker {
+//    struct NotImplemented: Error {}
+//    throw NotImplemented()
+//  }
+//}
+//#endif
diff --git a/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthListener.swift b/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthListener.swift
index 50628c4a..22473583 100644
--- a/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthListener.swift
+++ b/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthListener.swift
@@ -1,42 +1,42 @@
-import Bindings
-
-public struct NetworkHealthListener {
-  public var listen: (@escaping (Bool) -> Void) -> Cancellable
-
-  public func callAsFunction(callback: @escaping (Bool) -> Void) -> Cancellable {
-    listen(callback)
-  }
-}
-
-extension NetworkHealthListener {
-  public static func live(bindingsClient: BindingsCmix) -> NetworkHealthListener {
-    NetworkHealthListener { callback in
-      let listener = Listener(onCallback: callback)
-      let id = bindingsClient.registerNetworkHealthCB(listener)
-      return Cancellable {
-        bindingsClient.unregisterNetworkHealthCB(id)
-      }
-    }
-  }
-}
-
-private final class Listener: NSObject, BindingsNetworkHealthCallbackProtocol {
-  init(onCallback: @escaping (Bool) -> Void) {
-    self.onCallback = onCallback
-    super.init()
-  }
-
-  let onCallback: (Bool) -> Void
-
-  func callback(_ p0: Bool) {
-    onCallback(p0)
-  }
-}
-
-#if DEBUG
-extension NetworkHealthListener {
-  public static let failing = NetworkHealthListener { _ in
-    fatalError("Not implemented")
-  }
-}
-#endif
+//import Bindings
+//
+//public struct NetworkHealthListener {
+//  public var listen: (@escaping (Bool) -> Void) -> Cancellable
+//
+//  public func callAsFunction(callback: @escaping (Bool) -> Void) -> Cancellable {
+//    listen(callback)
+//  }
+//}
+//
+//extension NetworkHealthListener {
+//  public static func live(bindingsClient: BindingsCmix) -> NetworkHealthListener {
+//    NetworkHealthListener { callback in
+//      let listener = Listener(onCallback: callback)
+//      let id = bindingsClient.registerNetworkHealthCB(listener)
+//      return Cancellable {
+//        bindingsClient.unregisterNetworkHealthCB(id)
+//      }
+//    }
+//  }
+//}
+//
+//private final class Listener: NSObject, BindingsNetworkHealthCallbackProtocol {
+//  init(onCallback: @escaping (Bool) -> Void) {
+//    self.onCallback = onCallback
+//    super.init()
+//  }
+//
+//  let onCallback: (Bool) -> Void
+//
+//  func callback(_ p0: Bool) {
+//    onCallback(p0)
+//  }
+//}
+//
+//#if DEBUG
+//extension NetworkHealthListener {
+//  public static let failing = NetworkHealthListener { _ in
+//    fatalError("Not implemented")
+//  }
+//}
+//#endif
diff --git a/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthProvider.swift b/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthProvider.swift
index 65d8944d..21dcb624 100644
--- a/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthProvider.swift
+++ b/Sources/ElixxirDAppsSDK/Legacy/NetworkHealthProvider.swift
@@ -1,23 +1,23 @@
-import Bindings
-
-public struct NetworkHealthProvider {
-  public var get: () -> Bool
-
-  public func callAsFunction() -> Bool {
-    get()
-  }
-}
-
-extension NetworkHealthProvider {
-  public static func live(bindingsClient: BindingsCmix) -> NetworkHealthProvider {
-    NetworkHealthProvider(get: bindingsClient.isNetworkHealthy)
-  }
-}
-
-#if DEBUG
-extension NetworkHealthProvider {
-  public static let failing = NetworkHealthProvider {
-    fatalError("Not implemented")
-  }
-}
-#endif
+//import Bindings
+//
+//public struct NetworkHealthProvider {
+//  public var get: () -> Bool
+//
+//  public func callAsFunction() -> Bool {
+//    get()
+//  }
+//}
+//
+//extension NetworkHealthProvider {
+//  public static func live(bindingsClient: BindingsCmix) -> NetworkHealthProvider {
+//    NetworkHealthProvider(get: bindingsClient.isNetworkHealthy)
+//  }
+//}
+//
+//#if DEBUG
+//extension NetworkHealthProvider {
+//  public static let failing = NetworkHealthProvider {
+//    fatalError("Not implemented")
+//  }
+//}
+//#endif
-- 
GitLab