summaryrefslogtreecommitdiffhomepage
path: root/ios/MullvadMockData/MullvadREST/MockRelayCache.swift
blob: 63cc4e89a484914c7eaa2bffc209e6200f25955a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
//
//  MockRelayCache.swift
//  MullvadVPN
//
//  Created by Mojgan on 2025-03-10.
//  Copyright © 2025 Mullvad VPN AB. All rights reserved.
//

import Foundation

@testable import MullvadREST

public struct MockRelayCache: RelayCacheProtocol {
    public init() {}

    public func read() throws -> MullvadREST.StoredRelays {
        try .init(
            cachedRelays: CachedRelays(
                relays: ServerRelaysResponseStubs.sampleRelays,
                updatedAt: Date()
            )
        )
    }

    public func readPrebundledRelays() throws -> MullvadREST.StoredRelays {
        try self.read()
    }

    public func write(record: MullvadREST.StoredRelays) throws {}
}