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

---
 Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift b/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift
index 16f6d1bc..8f2540a1 100644
--- a/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift
+++ b/Sources/ElixxirDAppsSDK/E2E/Functors/E2ESend.swift
@@ -2,21 +2,29 @@ import Bindings
 import XCTestDynamicOverlay
 
 public struct E2ESend {
-  public var run: (Int, Data, Data, Data) throws -> Data
+  public var run: (Int, Data, Data, Data) throws -> E2ESendReport
 
   public func callAsFunction(
     messageType: Int,
     recipientId: Data,
     payload: Data,
     e2eParams: Data
-  ) throws -> Data {
+  ) throws -> E2ESendReport {
     try run(messageType, recipientId, payload, e2eParams)
   }
 }
 
 extension E2ESend {
   public static func live(_ bindingsE2E: BindingsE2e) -> E2ESend {
-    E2ESend(run: bindingsE2E.sendE2E(_:recipientId:payload:e2eParams:))
+    E2ESend { messageType, recipientId, payload, e2eParams in
+      let reportData = try bindingsE2E.sendE2E(
+        messageType,
+        recipientId: recipientId,
+        payload: payload,
+        e2eParams: e2eParams
+      )
+      return try E2ESendReport.decode(reportData)
+    }
   }
 }
 
-- 
GitLab