From fd86cea6245d58fc31e9befd3f76d2af66720223 Mon Sep 17 00:00:00 2001
From: Dariusz Rybicki <dariusz@elixxir.io>
Date: Tue, 7 Jun 2022 11:04:34 +0200
Subject: [PATCH] Update IdentityMaker to return Identity

---
 Sources/ElixxirDAppsSDK/IdentityMaker.swift | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/Sources/ElixxirDAppsSDK/IdentityMaker.swift b/Sources/ElixxirDAppsSDK/IdentityMaker.swift
index 91e7eeed..863e180e 100644
--- a/Sources/ElixxirDAppsSDK/IdentityMaker.swift
+++ b/Sources/ElixxirDAppsSDK/IdentityMaker.swift
@@ -1,9 +1,9 @@
 import Bindings
 
 public struct IdentityMaker {
-  public var make: () throws -> Data
+  public var make: () throws -> Identity
 
-  public func callAsFunction() throws -> Data {
+  public func callAsFunction() throws -> Identity {
     try make()
   }
 }
@@ -11,7 +11,9 @@ public struct IdentityMaker {
 extension IdentityMaker {
   public static func live(bindingsClient: BindingsClient) -> IdentityMaker {
     IdentityMaker {
-      try bindingsClient.makeIdentity()
+      let data = try bindingsClient.makeIdentity()
+      let decoder = JSONDecoder()
+      return try decoder.decode(Identity.self, from: data)
     }
   }
 }
-- 
GitLab