From bc70d1a27263cc97a4060ac9e73ec10929c28a29 Mon Sep 17 00:00:00 2001 From: Sam Symons Date: Thu, 11 Apr 2024 20:50:23 -0700 Subject: [PATCH] Remove timezoneOffset. (#767) Required: Task/Issue URL: https://app.asana.com/0/0/1207032029127388/f iOS PR: duckduckgo/iOS#2701 macOS PR: duckduckgo/macos-browser#2580 What kind of version bump will this require?: Major Description: This PR removes tzOffset from the server object. It wasn't being used and is in the process of being removed. --- .../Models/NetworkProtectionServerInfo.swift | 2 -- .../Mocks/NetworkProtectionServerMocks.swift | 8 ++++---- .../NetworkProtectionServerInfoTests.swift | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Sources/NetworkProtection/Models/NetworkProtectionServerInfo.swift b/Sources/NetworkProtection/Models/NetworkProtectionServerInfo.swift index 06d9c8883..7641e25a2 100644 --- a/Sources/NetworkProtection/Models/NetworkProtectionServerInfo.swift +++ b/Sources/NetworkProtection/Models/NetworkProtectionServerInfo.swift @@ -29,13 +29,11 @@ public struct NetworkProtectionServerInfo: Codable, Equatable, Sendable { public let city: String public let country: String public let state: String - public let timezoneOffset: Int enum CodingKeys: String, CodingKey { case city case country case state - case timezoneOffset = "tzOffset" } } diff --git a/Tests/NetworkProtectionTests/Mocks/NetworkProtectionServerMocks.swift b/Tests/NetworkProtectionTests/Mocks/NetworkProtectionServerMocks.swift index 3fdd9056c..d39e4287a 100644 --- a/Tests/NetworkProtectionTests/Mocks/NetworkProtectionServerMocks.swift +++ b/Tests/NetworkProtectionTests/Mocks/NetworkProtectionServerMocks.swift @@ -35,7 +35,7 @@ extension NetworkProtectionServerInfo { ips: ["192.168.1.1"], internalIP: "10.11.12.1", port: 443, - attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0)) + attributes: .init(city: "City", country: "Country", state: "State")) static let hostNameOnly = NetworkProtectionServerInfo(name: "Mock Server", publicKey: "ovn9RpzUuvQ4XLQt6B3RKuEXGIxa5QpTnehjduZlcSE=", @@ -43,7 +43,7 @@ extension NetworkProtectionServerInfo { ips: [], internalIP: "10.11.12.1", port: 443, - attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0)) + attributes: .init(city: "City", country: "Country", state: "State")) static let ipAddressOnly = NetworkProtectionServerInfo(name: "Mock Server", publicKey: "ovn9RpzUuvQ4XLQt6B3RKuEXGIxa5QpTnehjduZlcSE=", @@ -51,7 +51,7 @@ extension NetworkProtectionServerInfo { ips: ["192.168.1.1"], internalIP: "10.11.12.1", port: 443, - attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0)) + attributes: .init(city: "City", country: "Country", state: "State")) static func make(named name: String, withPublicKey publicKey: String = "") -> Self { NetworkProtectionServerInfo(name: name, @@ -60,7 +60,7 @@ extension NetworkProtectionServerInfo { ips: ["192.168.1.1"], internalIP: "10.11.12.1", port: 443, - attributes: .init(city: "City", country: "Country", state: "State", timezoneOffset: 0)) + attributes: .init(city: "City", country: "Country", state: "State")) } } diff --git a/Tests/NetworkProtectionTests/NetworkProtectionServerInfoTests.swift b/Tests/NetworkProtectionTests/NetworkProtectionServerInfoTests.swift index 3d4a8da2c..b5057d608 100644 --- a/Tests/NetworkProtectionTests/NetworkProtectionServerInfoTests.swift +++ b/Tests/NetworkProtectionTests/NetworkProtectionServerInfoTests.swift @@ -29,7 +29,7 @@ final class NetworkProtectionServerInfoTests: XCTestCase { ips: [], internalIP: "10.11.12.1", port: 42, - attributes: .init(city: "Amsterdam", country: "nl", state: "na", timezoneOffset: 3600)) + attributes: .init(city: "Amsterdam", country: "nl", state: "na")) XCTAssertEqual(serverInfo.serverLocation, "Amsterdam, NL") } @@ -41,7 +41,7 @@ final class NetworkProtectionServerInfoTests: XCTestCase { ips: [], internalIP: "10.11.12.1", port: 42, - attributes: .init(city: "New York", country: "us", state: "ny", timezoneOffset: 3600)) + attributes: .init(city: "New York", country: "us", state: "ny")) XCTAssertEqual(serverInfo.serverLocation, "New York, NY") }