Skip to content
Snippets Groups Projects
Commit 44eac201 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Update ChannelBroadcastAsymmetric functor

parent 4138d336
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!25Update Bindings
...@@ -2,19 +2,22 @@ import Bindings ...@@ -2,19 +2,22 @@ import Bindings
import XCTestDynamicOverlay import XCTestDynamicOverlay
public struct ChannelBroadcastAsymmetric { public struct ChannelBroadcastAsymmetric {
public var run: (Data, Data) throws -> Data public var run: (Data, Data) throws -> BroadcastReport
public func callAsFunction( public func callAsFunction(
payload: Data, payload: Data,
privateKey: Data privateKey: Data
) throws -> Data { ) throws -> BroadcastReport {
try run(payload, privateKey) try run(payload, privateKey)
} }
} }
extension ChannelBroadcastAsymmetric { extension ChannelBroadcastAsymmetric {
public static func live(_ bindingsChannel: BindingsChannel) -> ChannelBroadcastAsymmetric { public static func live(_ bindingsChannel: BindingsChannel) -> ChannelBroadcastAsymmetric {
ChannelBroadcastAsymmetric(run: bindingsChannel.broadcastAsymmetric(_:pk:)) ChannelBroadcastAsymmetric { payload, privateKey in
let reportData = try bindingsChannel.broadcastAsymmetric(payload, pk: privateKey)
return try BroadcastReport.decode(reportData)
}
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment