Skip to content
Snippets Groups Projects
Commit 87acdfc7 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Remove unneeded code

parent 235e90d6
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!18Update Bindings
//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
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
//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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment