diff --git a/Sources/ElixxirDAppsSDK/E2E.swift b/Sources/ElixxirDAppsSDK/E2E.swift index 24e443ae8f293a66e1650c702e0ff6416ee6d3c3..20a900d839f13f061d644250c30fa0e4c9f54f6f 100644 --- a/Sources/ElixxirDAppsSDK/E2E.swift +++ b/Sources/ElixxirDAppsSDK/E2E.swift @@ -12,6 +12,7 @@ public struct E2E { public var addPartnerCallback: E2EAddPartnerCallback public var addService: E2EAddService public var removeService: E2ERemoveService + public var hasAuthenticatedChannel: E2EHasAuthenticatedChannel public var send: E2ESend // TODO: @@ -31,6 +32,7 @@ extension E2E { addPartnerCallback: .live(bindingsE2E), addService: .live(bindingsE2E), removeService: .live(bindingsE2E), + hasAuthenticatedChannel: .live(bindingsE2E), send: .live(bindingsE2E) ) } @@ -49,6 +51,7 @@ extension E2E { addPartnerCallback: .unimplemented, addService: .unimplemented, removeService: .unimplemented, + hasAuthenticatedChannel: .unimplemented, send: .unimplemented ) } diff --git a/Sources/ElixxirDAppsSDK/E2EHasAuthenticatedChannel.swift b/Sources/ElixxirDAppsSDK/E2EHasAuthenticatedChannel.swift new file mode 100644 index 0000000000000000000000000000000000000000..3871ce867120aa5124aa51adeb06eb144b1cb123 --- /dev/null +++ b/Sources/ElixxirDAppsSDK/E2EHasAuthenticatedChannel.swift @@ -0,0 +1,26 @@ +import Bindings +import XCTestDynamicOverlay + +public struct E2EHasAuthenticatedChannel { + public var run: (Data) throws -> Bool + + public func callAsFunction(partnerId: Data) throws -> Bool { + try run(partnerId) + } +} + +extension E2EHasAuthenticatedChannel { + public static func live(_ bindingsE2E: BindingsE2e) -> E2EHasAuthenticatedChannel { + E2EHasAuthenticatedChannel { partnerId in + var result: ObjCBool = false + try bindingsE2E.hasAuthenticatedChannel(partnerId, ret0_: &result) + return result.boolValue + } + } +} + +extension E2EHasAuthenticatedChannel { + public static let unimplemented = E2EHasAuthenticatedChannel( + run: XCTUnimplemented("\(Self.self)") + ) +}