diff --git a/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift b/Sources/ElixxirDAppsSDK/Channel/Functors/ChannelBroadcast.swift index ee9a3adf8b5f4cf6e745a9f103715663165279bd..9c7e895e541b9a3e713f27b1d5205b033d1b7ee3 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) + } } }