Skip to content

Commit

Permalink
Rename proximity timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
Hopsaheysa committed Dec 6, 2023
1 parent 3eaab0c commit 3b6094c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class WMTAuthorizationData: Codable {
self.proximityCheck = proximityCheck
}

init(operation: WMTOperation, timestampSigned: Date = Date()) {
init(operation: WMTOperation, timestampSent: Date = Date()) {
self.id = operation.id
self.data = operation.data

Expand All @@ -46,8 +46,8 @@ class WMTAuthorizationData: Codable {
self.proximityCheck = WMTProximityCheckData(
otp: proximityCheck.totp,
type: proximityCheck.type,
timestampRequested: proximityCheck.timestampRequested,
timestampSigned: timestampSigned
timestampRecieved: proximityCheck.timestampRecieved,
timestampSent: timestampSent
)
}
}
Expand All @@ -62,8 +62,8 @@ struct WMTProximityCheckData: Codable {
let type: WMTProximityCheckType

/// Timestamp when the operation was delivered to the app
let timestampRequested: Date
let timestampRecieved: Date

/// Timestamp when the operation was signed
let timestampSigned: Date
let timestampSent: Date
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,12 @@ public class WMTProximityCheck: Codable {
public let type: WMTProximityCheckType

/// Timestamp when the operation was scanned (qrCode) or delivered to the device (deeplink)
public let timestampRequested: Date
public let timestampRecieved: Date

public init(totp: String, type: WMTProximityCheckType, timestampRequested: Date = Date()) {
public init(totp: String, type: WMTProximityCheckType, timestampRecieved: Date = Date()) {
self.totp = totp
self.type = type
self.timestampRequested = timestampRequested
self.timestampRecieved = timestampRecieved
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ class WMTOperationsImpl<T: WMTUserOperation>: WMTOperations, WMTService {
return nil
}

let data = WMTAuthorizationData(operation: operation, timestampSigned: currentServerDate ?? Date())
let data = WMTAuthorizationData(operation: operation, timestampSent: currentServerDate ?? Date())

return networking.post(data: .init(data), signedWith: authentication, to: WMTOperationEndpoints.Authorize.endpoint) { response, error in
self.processResult(response: response, error: error) { result in
Expand Down

0 comments on commit 3b6094c

Please sign in to comment.