commit fa377b5ca34c21f287994999f5db5b7e7f861ca4 parent 20225fb5c04da51927e043f384d97ded6d370911 Author: Marc Stibane <marc@taler.net> Date: Thu, 18 Jan 2024 00:59:05 +0100 use scopeInfo Diffstat:
4 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/TalerWallet1/Views/Banking/ExchangeListView.swift b/TalerWallet1/Views/Banking/ExchangeListView.swift @@ -120,7 +120,8 @@ extension ExchangeListCommonV { var currencies: [String : [Exchange]] = [:] for exchange in exchanges { - let currency = exchange.currency ?? "Unknown" + let currency = exchange.scopeInfo?.currency + ?? exchange.currency ?? "Unknown" if currencies[currency] != nil { currencies[currency]!.append(exchange) } else { diff --git a/TalerWallet1/Views/Banking/ExchangeRowView.swift b/TalerWallet1/Views/Banking/ExchangeRowView.swift @@ -105,7 +105,8 @@ struct ExchangeRowView: View { if controller.hasInfo(for: currency) == nil { symLog.log("fetching info for \(currency)") // FIXME: remove fake ScopeInfo once the REAL one is in exchange.scopeInfo - let scopeInfo = exchange.scopeInfo ?? ScopeInfo(type: .global, currency: currency) + let scopeInfo = exchange.scopeInfo + ?? ScopeInfo(type: .global, currency: currency) do { let info = try await model.getCurrencyInfoM(scope: scopeInfo, delay: delay) // logger.info("got info: \(scope.currency, privacy: .public)") @@ -124,15 +125,16 @@ fileprivate struct ExchangeRow_Container : View { // let amount = Amount(currency: LONGCURRENCY, cent: 123456) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset, exchangeUpdateStatus: .initial, ageRestrictionOptions: [12,16]) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed, exchangeEntryStatus: .ephemeral, diff --git a/TalerWallet1/Views/Banking/ExchangeSectionView.swift b/TalerWallet1/Views/Banking/ExchangeSectionView.swift @@ -55,15 +55,16 @@ fileprivate struct ExchangeRow_Container : View { // let amount = Amount(currency: LONGCURRENCY, cent: 123456) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset, exchangeUpdateStatus: .initial, ageRestrictionOptions: [12,16]) let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .proposed, exchangeEntryStatus: .ephemeral, diff --git a/TalerWallet1/Views/Banking/ManualWithdrawDone.swift b/TalerWallet1/Views/Banking/ManualWithdrawDone.swift @@ -73,8 +73,9 @@ struct ManualWithdrawDone_Container : View { @State private var amountToTransfer = Amount(currency: LONGCURRENCY, cent: 510) var body: some View { + let scopeInfo = ScopeInfo(type: .exchange, currency: LONGCURRENCY) let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE, - currency: LONGCURRENCY, + scopeInfo: scopeInfo, paytoUris: [], tosStatus: .pending, exchangeEntryStatus: .preset,