diff options
| author | mojganii <mojgan.jelodar@codic.se> | 2024-08-14 14:03:23 +0200 |
|---|---|---|
| committer | Bug Magnet <marco.nikic@mullvad.net> | 2024-08-15 09:38:02 +0200 |
| commit | bdfd39740fdbf9c5462967c23a03e29aeece41d2 (patch) | |
| tree | 27ea3bacb29034e424ee7d865e1b3a67c252b3b7 /ios/MullvadMockData | |
| parent | 1283882cf051a68fe28b26ebbce93ae1bf0895b6 (diff) | |
| download | mullvadvpn-bdfd39740fdbf9c5462967c23a03e29aeece41d2.tar.xz mullvadvpn-bdfd39740fdbf9c5462967c23a03e29aeece41d2.zip | |
Add DAITA into TunnelSettings
Diffstat (limited to 'ios/MullvadMockData')
| -rw-r--r-- | ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift b/ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift index 4445aa8cc8..7dd95ae976 100644 --- a/ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift +++ b/ios/MullvadMockData/MullvadREST/RelaySelectorStub.swift @@ -12,17 +12,14 @@ import WireGuardKitTypes /// Relay selector stub that accepts a block that can be used to provide custom implementation. public final class RelaySelectorStub: RelaySelectorProtocol { - var selectedRelaysResult: (RelayConstraints, UInt) throws -> SelectedRelays + var selectedRelaysResult: (UInt) throws -> SelectedRelays - init(selectedRelaysResult: @escaping (RelayConstraints, UInt) throws -> SelectedRelays) { + init(selectedRelaysResult: @escaping (UInt) throws -> SelectedRelays) { self.selectedRelaysResult = selectedRelaysResult } - public func selectRelays( - with constraints: RelayConstraints, - connectionAttemptCount: UInt - ) throws -> SelectedRelays { - return try selectedRelaysResult(constraints, connectionAttemptCount) + public func selectRelays(connectionAttemptCount: UInt) throws -> SelectedRelays { + return try selectedRelaysResult(connectionAttemptCount) } } @@ -31,7 +28,7 @@ extension RelaySelectorStub { public static func nonFallible() -> RelaySelectorStub { let publicKey = PrivateKey().publicKey.rawValue - return RelaySelectorStub { _, _ in + return RelaySelectorStub { _ in let cityRelay = SelectedRelay( endpoint: MullvadEndpoint( ipv4Relay: IPv4Endpoint(ip: .loopback, port: 1300), @@ -60,7 +57,7 @@ extension RelaySelectorStub { /// Returns a relay selector that cannot satisfy constraints . public static func unsatisfied() -> RelaySelectorStub { - return RelaySelectorStub { _, _ in + return RelaySelectorStub { _ in throw NoRelaysSatisfyingConstraintsError() } } |
