Add fake price fetcher for debug mode

This commit is contained in:
2024-02-21 09:48:26 -05:00
parent e9c44eec2c
commit 86da8b1bba
6 changed files with 62 additions and 8 deletions

View File

@@ -0,0 +1,39 @@
//
// PriceSource.swift
// SatsPrice
//
// Created by Terry Yiu on 2/20/24.
//
import Foundation
enum PriceSource: CaseIterable, CustomStringConvertible {
static var allCases: [PriceSource] {
#if DEBUG
[.coinbase, .coingecko, .fake]
#else
[.coinbase, .coingecko]
#endif
}
case coinbase
case coingecko
#if DEBUG
case fake
#endif
var description: String {
switch self {
case .coinbase:
"Coinbase"
case .coingecko:
"CoinGecko"
#if DEBUG
case .fake:
"Fake"
#endif
}
}
}