From ed3a5c673133d9a765426bcbbaf13173eb5f0343 Mon Sep 17 00:00:00 2001 From: Dariusz Rybicki <dariusz@elixxir.io> Date: Wed, 20 Jul 2022 16:45:19 +0100 Subject: [PATCH] Add GetDefaultE2EParams functor --- .../ElixxirDAppsSDK/GetDefaultE2EParams.swift | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 Sources/ElixxirDAppsSDK/GetDefaultE2EParams.swift diff --git a/Sources/ElixxirDAppsSDK/GetDefaultE2EParams.swift b/Sources/ElixxirDAppsSDK/GetDefaultE2EParams.swift new file mode 100644 index 00000000..fb067fd1 --- /dev/null +++ b/Sources/ElixxirDAppsSDK/GetDefaultE2EParams.swift @@ -0,0 +1,25 @@ +import Bindings +import XCTestDynamicOverlay + +public struct GetDefaultE2EParams { + public var run: () -> Data + + public func callAsFunction() -> Data { + run() + } +} + +extension GetDefaultE2EParams { + public static let live = GetDefaultE2EParams { + guard let data = BindingsGetDefaultE2EParams() else { + fatalError("BindingsGetDefaultE2EParams returned `nil`") + } + return data + } +} + +extension GetDefaultE2EParams { + public static let unimplemented = GetDefaultE2EParams( + run: XCTUnimplemented("\(Self.self)") + ) +} -- GitLab