From 44eac2012c01bfc0f2c07b0746375be63ef14d8b Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Tue, 9 Aug 2022 19:16:26 +0100
Subject: [PATCH] Update ChannelBroadcastAsymmetric functor

---
 .../Channel/Functors/ChannelBroadcastAsymmetric.swift    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift
index 9d92e002..b3b82e01 100644
--- a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift
+++ b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcastAsymmetric.swift
@@ -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)
+    }
   }
 }
 
-- 
GitLab