Skip to content

Commit

Permalink
Remove timezoneOffset. (#767)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
samsymons committed Apr 12, 2024
1 parent 1b6ceff commit bc70d1a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ 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=",
hostNames: ["duckduckgo.com"],
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=",
hostNames: [],
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,
Expand All @@ -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"))
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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")
}
Expand All @@ -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")
}
Expand Down

0 comments on commit bc70d1a

Please sign in to comment.