diff --git a/Sources/ElixxirDAppsSDK/Models/EventReport.swift b/Sources/ElixxirDAppsSDK/Models/EventReport.swift index 9802daa05a6b236522bfe383d895d1a80485e0be..e437480342d43771153069816821bcc32d1dfe27 100644 --- a/Sources/ElixxirDAppsSDK/Models/EventReport.swift +++ b/Sources/ElixxirDAppsSDK/Models/EventReport.swift @@ -27,7 +27,7 @@ extension EventReport: Codable { case details = "Details" } - public static func decode(_ data: Data) throws -> EventReport { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } diff --git a/Sources/ElixxirDAppsSDK/Models/Fact.swift b/Sources/ElixxirDAppsSDK/Models/Fact.swift index 7d8dc591d1f336eddeaf17ee68c95f4a6ce52f25..456ad36c4c8d2285ffc8e2d8c06d2590740ae697 100644 --- a/Sources/ElixxirDAppsSDK/Models/Fact.swift +++ b/Sources/ElixxirDAppsSDK/Models/Fact.swift @@ -19,7 +19,7 @@ extension Fact: Codable { case type = "Type" } - public static func decode(_ data: Data) throws -> Fact { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } @@ -29,7 +29,7 @@ extension Fact: Codable { } extension Array where Element == Fact { - public static func decode(_ data: Data) throws -> [Fact] { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } diff --git a/Sources/ElixxirDAppsSDK/Models/Message.swift b/Sources/ElixxirDAppsSDK/Models/Message.swift index c554d1191a726d040a64ce430538eceb398f8e8b..3abaec655124e10c8089249dac2c7170f416ed3c 100644 --- a/Sources/ElixxirDAppsSDK/Models/Message.swift +++ b/Sources/ElixxirDAppsSDK/Models/Message.swift @@ -47,7 +47,7 @@ extension Message: Codable { case roundId = "RoundId" } - public static func decode(_ data: Data) throws -> Message { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } diff --git a/Sources/ElixxirDAppsSDK/Models/MessageSendReport.swift b/Sources/ElixxirDAppsSDK/Models/MessageSendReport.swift index 0e3a6bf0901a36cb2aa5fc52a6b0969f86b795d6..be8d383384c252422fb9a4e1833b0e838d98c91e 100644 --- a/Sources/ElixxirDAppsSDK/Models/MessageSendReport.swift +++ b/Sources/ElixxirDAppsSDK/Models/MessageSendReport.swift @@ -23,7 +23,7 @@ extension MessageSendReport: Codable { case timestamp = "Timestamp" } - public static func decode(_ data: Data) throws -> MessageSendReport { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } diff --git a/Sources/ElixxirDAppsSDK/Models/ReceptionIdentity.swift b/Sources/ElixxirDAppsSDK/Models/ReceptionIdentity.swift index d0c1571e5451edb9a08890a61b1969fc4358348f..312ec2c3956be5b36ad238bb0eeea8cf862d654d 100644 --- a/Sources/ElixxirDAppsSDK/Models/ReceptionIdentity.swift +++ b/Sources/ElixxirDAppsSDK/Models/ReceptionIdentity.swift @@ -27,7 +27,7 @@ extension ReceptionIdentity: Codable { case dhKeyPrivate = "DHKeyPrivate" } - public static func decode(_ data: Data) throws -> ReceptionIdentity { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) } diff --git a/Sources/ElixxirDAppsSDK/Models/RestlikeMessage.swift b/Sources/ElixxirDAppsSDK/Models/RestlikeMessage.swift index 65b63786066e4e8a275f2d0c048bb05896f845ff..4c33ec5ad026d9461b8bccf8d0c8f0a59827004f 100644 --- a/Sources/ElixxirDAppsSDK/Models/RestlikeMessage.swift +++ b/Sources/ElixxirDAppsSDK/Models/RestlikeMessage.swift @@ -35,7 +35,7 @@ extension RestlikeMessage: Codable { case error = "Error" } - public static func decode(_ data: Data) throws -> RestlikeMessage { + public static func decode(_ data: Data) throws -> Self { try JSONDecoder().decode(Self.self, from: data) }