Skip to content
Snippets Groups Projects
Commit fd86cea6 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Update IdentityMaker to return Identity

parent 473295a2
No related branches found
No related tags found
1 merge request!12Use codable models in API
import Bindings import Bindings
public struct IdentityMaker { 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() try make()
} }
} }
...@@ -11,7 +11,9 @@ public struct IdentityMaker { ...@@ -11,7 +11,9 @@ public struct IdentityMaker {
extension IdentityMaker { extension IdentityMaker {
public static func live(bindingsClient: BindingsClient) -> IdentityMaker { public static func live(bindingsClient: BindingsClient) -> IdentityMaker {
IdentityMaker { IdentityMaker {
try bindingsClient.makeIdentity() let data = try bindingsClient.makeIdentity()
let decoder = JSONDecoder()
return try decoder.decode(Identity.self, from: data)
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment