diff --git a/Sources/ElixxirDAppsSDK/Functors/NewUdManagerFromBackup.swift b/Sources/ElixxirDAppsSDK/Functors/NewUdManagerFromBackup.swift index 8c57aa35d51eef3664db8ea1f3974d536d5a9c99..09dbf72ecd665e1eb391ecc8f88b8c1be5d5d4ec 100644 --- a/Sources/ElixxirDAppsSDK/Functors/NewUdManagerFromBackup.swift +++ b/Sources/ElixxirDAppsSDK/Functors/NewUdManagerFromBackup.swift @@ -2,28 +2,52 @@ import Bindings import XCTestDynamicOverlay public struct NewUdManagerFromBackup { - public var run: (Int, UdNetworkStatus, Fact?, Fact?) throws -> UserDiscovery + public struct Params { + public init( + e2eId: Int, + follower: UdNetworkStatus, + email: Fact?, + phone: Fact?, + cert: Data, + contactFile: Data, + address: String + ) { + self.e2eId = e2eId + self.follower = follower + self.email = email + self.phone = phone + self.cert = cert + self.contactFile = contactFile + self.address = address + } - public func callAsFunction( - e2eId: Int, - follower: UdNetworkStatus, - email: Fact?, - phone: Fact? - ) throws -> UserDiscovery { - try run(e2eId, follower, email, phone) + public var e2eId: Int + public var follower: UdNetworkStatus + public var email: Fact? + public var phone: Fact? + public var cert: Data + public var contactFile: Data + public var address: String + } + + public var run: (Params) throws -> UserDiscovery + + public func callAsFunction(_ params: Params) throws -> UserDiscovery { + try run(params) } } extension NewUdManagerFromBackup { - public static let live = NewUdManagerFromBackup { - e2eId, follower, email, phone in - + public static let live = NewUdManagerFromBackup { params in var error: NSError? let bindingsUD = BindingsNewUdManagerFromBackup( - e2eId, - follower.makeBindingsUdNetworkStatus(), - try email?.encode(), - try phone?.encode(), + params.e2eId, + params.follower.makeBindingsUdNetworkStatus(), + try params.email?.encode(), + try params.phone?.encode(), + params.cert, + params.contactFile, + params.address, &error ) if let error = error {