Skip to content
Snippets Groups Projects

Update Bindings

Merged Dariusz Rybicki requested to merge dev/update-bindings into development
1 file
+ 6
3
Compare changes
  • Side-by-side
  • Inline
@@ -2,19 +2,22 @@ import Bindings
import XCTestDynamicOverlay
public struct ChannelBroadcastAsymmetric {
public var run: (Data, Data) throws -> Data
public var run: (Data, Data) throws -> BroadcastReport
public func callAsFunction(
payload: Data,
privateKey: Data
) throws -> Data {
) throws -> BroadcastReport {
try run(payload, privateKey)
}
}
extension 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)
}
}
}
Loading