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

Remove DHKey Encodable conformance

parent 2e04409f
No related branches found
No related tags found
2 merge requests!102Release 1.0.0,!49Update Bindings
...@@ -10,7 +10,7 @@ public struct DHKey: Equatable { ...@@ -10,7 +10,7 @@ public struct DHKey: Equatable {
public var fingerprint: UInt64 public var fingerprint: UInt64
} }
extension DHKey: Codable { extension DHKey: Decodable {
enum CodingKeys: String, CodingKey { enum CodingKeys: String, CodingKey {
case value = "Value" case value = "Value"
case fingerprint = "Fingerprint" case fingerprint = "Fingerprint"
...@@ -20,8 +20,4 @@ extension DHKey: Codable { ...@@ -20,8 +20,4 @@ extension DHKey: Codable {
let data = convertJsonNumberToString(in: data, at: "Value") let data = convertJsonNumberToString(in: data, at: "Value")
return try JSONDecoder().decode(Self.self, from: data) return try JSONDecoder().decode(Self.self, from: data)
} }
public func encode() throws -> Data {
try JSONEncoder().encode(self)
}
} }
...@@ -19,10 +19,5 @@ final class DHKeyTests: XCTestCase { ...@@ -19,10 +19,5 @@ final class DHKeyTests: XCTestCase {
value: value, value: value,
fingerprint: fingerprint fingerprint: fingerprint
)) ))
let encodedModel = try model.encode()
let decodedModel = try DHKey.decode(encodedModel)
XCTAssertNoDifference(decodedModel, model)
} }
} }
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