From 87acdfc715eb9f1eca0084682b71b022422c7b50 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Mon, 25 Jul 2022 18:12:43 +0100 Subject: [PATCH] Remove unneeded code --- .../Legacy/ClientE2ELogin.swift | 36 ------------------- .../Legacy/ContactFromIdentityProvider.swift | 30 ---------------- .../Legacy/IdentityMaker.swift | 28 --------------- 3 files changed, 94 deletions(-) delete mode 100644 Sources/ElixxirDAppsSDK/Legacy/ClientE2ELogin.swift delete mode 100644 Sources/ElixxirDAppsSDK/Legacy/ContactFromIdentityProvider.swift delete mode 100644 Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift diff --git a/Sources/ElixxirDAppsSDK/Legacy/ClientE2ELogin.swift b/Sources/ElixxirDAppsSDK/Legacy/ClientE2ELogin.swift deleted file mode 100644 index 4590644a..00000000 --- a/Sources/ElixxirDAppsSDK/Legacy/ClientE2ELogin.swift +++ /dev/null @@ -1,36 +0,0 @@ -//import Bindings -// -//public struct ClientE2ELogin { -// public var login: (Client) throws -> ClientE2E -// -// public func callAsFunction(with client: Client) throws -> ClientE2E { -// try login(client) -// } -//} -// -//extension ClientE2ELogin { -// public static let live = ClientE2ELogin { client in -// var error: NSError? -// let cMixId = client.getId() -// let myIdentity = try client.makeIdentity() -// let encoder = JSONEncoder() -// let myIdentityData = try encoder.encode(myIdentity) -// let bindingsClientE2E = BindingsLoginE2e(cMixId, nil, myIdentityData, &error) -// if let error = error { -// throw error -// } -// guard let bindingsClientE2E = bindingsClientE2E else { -// fatalError("BindingsLoginE2E returned `nil` without providing error") -// } -// return ClientE2E.live(bindingsClientE2E: bindingsClientE2E) -// } -//} -// -//#if DEBUG -//extension ClientE2ELogin { -// public static let failing = ClientE2ELogin { _ in -// struct NotImplemented: Error {} -// throw NotImplemented() -// } -//} -//#endif diff --git a/Sources/ElixxirDAppsSDK/Legacy/ContactFromIdentityProvider.swift b/Sources/ElixxirDAppsSDK/Legacy/ContactFromIdentityProvider.swift deleted file mode 100644 index e38a7c01..00000000 --- a/Sources/ElixxirDAppsSDK/Legacy/ContactFromIdentityProvider.swift +++ /dev/null @@ -1,30 +0,0 @@ -import Bindings - -public struct ContactFromIdentityProvider { - public var get: () throws -> Data - - public func callAsFunction() throws -> Data { - try get() - } -} - -extension ContactFromIdentityProvider { - public static func live(bindingsClientE2E: BindingsE2e) -> ContactFromIdentityProvider { - ContactFromIdentityProvider { - let contactData = bindingsClientE2E.getContact() - guard let contactData = contactData else { - fatalError("BindingsGetContact returned `nil` without providing error") - } - return contactData - } - } -} - -#if DEBUG -extension ContactFromIdentityProvider { - public static let failing = ContactFromIdentityProvider { - struct NotImplemented: Error {} - throw NotImplemented() - } -} -#endif diff --git a/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift b/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift deleted file mode 100644 index 07920a5f..00000000 --- a/Sources/ElixxirDAppsSDK/Legacy/IdentityMaker.swift +++ /dev/null @@ -1,28 +0,0 @@ -//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 -- GitLab