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