diff --git a/Sources/XXClient/Models/SingleUseCallbackReport.swift b/Sources/XXClient/Models/SingleUseCallbackReport.swift index 032f7c1c2b75b5e527037569a6d9867cc2487633..7456382e5e9cea8d2055881237c004789a967eee 100644 --- a/Sources/XXClient/Models/SingleUseCallbackReport.swift +++ b/Sources/XXClient/Models/SingleUseCallbackReport.swift @@ -3,12 +3,14 @@ import Foundation public struct SingleUseCallbackReport: Equatable { public init( rounds: [Int], + roundURL: String, payload: Data, partner: Data, ephId: Int64, receptionId: Data ) { self.rounds = rounds + self.roundURL = roundURL self.payload = payload self.partner = partner self.ephId = ephId @@ -16,6 +18,7 @@ public struct SingleUseCallbackReport: Equatable { } public var rounds: [Int] + public var roundURL: String public var payload: Data public var partner: Data public var ephId: Int64 @@ -25,6 +28,7 @@ public struct SingleUseCallbackReport: Equatable { extension SingleUseCallbackReport: Codable { enum CodingKeys: String, CodingKey { case rounds = "Rounds" + case roundURL = "RoundURL" case payload = "Payload" case partner = "Partner" case ephId = "EphID" diff --git a/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift b/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift index b0b22284a301ab7bda575c45605bc03bde7616c3..297754da807264c9c4ab99cc85e0c93d74e4df74 100644 --- a/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift +++ b/Tests/XXClientTests/Models/SingleUseCallbackReportTests.swift @@ -5,6 +5,7 @@ import XCTest final class SingleUseCallbackReportTests: XCTestCase { func testCoding() throws { let rounds: [Int] = [1, 5, 9] + let roundURL = "https://dashboard.xx.network/rounds/25?xxmessenger=true" let payloadB64 = "rSuPD35ELWwm5KTR9ViKIz/r1YGRgXIl5792SF8o8piZzN6sT4Liq4rUU/nfOPvQEjbfWNh/NYxdJ72VctDnWw==" let partnerB64 = "emV6aW1hAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD" let ephId: Int64 = 1_655_533 @@ -12,6 +13,7 @@ final class SingleUseCallbackReportTests: XCTestCase { let jsonString = """ { "Rounds": [\(rounds.map { "\($0)" }.joined(separator: ", "))], + "RoundURL": "\(roundURL)", "Payload": "\(payloadB64)", "Partner": "\(partnerB64)", "EphID": \(ephId), @@ -23,6 +25,7 @@ final class SingleUseCallbackReportTests: XCTestCase { XCTAssertNoDifference(model, SingleUseCallbackReport( rounds: rounds, + roundURL: roundURL, payload: Data(base64Encoded: payloadB64)!, partner: Data(base64Encoded: partnerB64)!, ephId: ephId,