diff --git a/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift b/Sources/ElixxirDAppsSDK/Legacy/ClientCreator.swift index 6021adc126b597b92de7068d8d5fd447cec36313..8988e08512e9017bd2082c873b880a5ac13b4c2e 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 6e214d6c20878656a2d798a3fb6b1d956b018b11..07920a5f052dd8446b72dcdf70b6d7eea7da9e7e 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 50628c4ae46a3c4614bf1cc257c920d2cd0ad2b8..22473583899cc343bda522d8b287324e5a30bc33 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 65d8944da93045d390b76c4431e68554daa65625..21dcb624fadacfe33ee34a1469e11f8bef1868d0 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