From 4138d33627cc89e58669c12d4fee9530d1956258 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Tue, 9 Aug 2022 19:15:02 +0100
Subject: [PATCH] Update ChannelBroadcast functor

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

diff --git a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift
index ee9a3adf..9c7e895e 100644
--- a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift
+++ b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift
@@ -2,16 +2,19 @@ import Bindings
 import XCTestDynamicOverlay
 
 public struct ChannelBroadcast {
-  public var run: (Data) throws -> Data
+  public var run: (Data) throws -> BroadcastReport
 
-  public func callAsFunction(_ payload: Data) throws -> Data {
+  public func callAsFunction(_ payload: Data) throws -> BroadcastReport {
     try run(payload)
   }
 }
 
 extension ChannelBroadcast {
   public static func live(_ bindingsChannel: BindingsChannel) -> ChannelBroadcast {
-    ChannelBroadcast(run: bindingsChannel.broadcast)
+    ChannelBroadcast { payload in
+      let reportData = try bindingsChannel.broadcast(payload)
+      return try BroadcastReport.decode(reportData)
+    }
   }
 }
 
-- 
GitLab