diff --git a/Sources/ElixxirDAppsSDK/Functors/IsRegisteredWithUD.swift b/Sources/ElixxirDAppsSDK/Functors/IsRegisteredWithUD.swift new file mode 100644 index 0000000000000000000000000000000000000000..79097aba3071b40fbe2a9a1f64205a2b3b43fe18 --- /dev/null +++ b/Sources/ElixxirDAppsSDK/Functors/IsRegisteredWithUD.swift @@ -0,0 +1,32 @@ +import Bindings +import XCTestDynamicOverlay + +public struct IsRegisteredWithUD { + public var run: (Int) throws -> Bool + + public func callAsFunction(e2eId: Int) throws -> Bool { + try run(e2eId) + } +} + +extension IsRegisteredWithUD { + public static let live = IsRegisteredWithUD { e2eId in + var result: ObjCBool = false + var error: NSError? + BindingsIsRegisteredWithUD( + e2eId, + &result, + &error + ) + if let error = error { + throw error + } + return result.boolValue + } +} + +extension IsRegisteredWithUD { + public static let unimplemented = IsRegisteredWithUD( + run: XCTUnimplemented("\(Self.self)") + ) +}