gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 58/69: use scopeInfo


From: gnunet
Subject: [taler-taler-ios] 58/69: use scopeInfo
Date: Fri, 19 Jan 2024 09:02:31 +0100

This is an automated email from the git hooks/post-receive script.

marc-stibane pushed a commit to branch master
in repository taler-ios.

commit fa377b5ca34c21f287994999f5db5b7e7f861ca4
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 00:59:05 2024 +0100

    use scopeInfo
---
 TalerWallet1/Views/Banking/ExchangeListView.swift    | 3 ++-
 TalerWallet1/Views/Banking/ExchangeRowView.swift     | 8 +++++---
 TalerWallet1/Views/Banking/ExchangeSectionView.swift | 5 +++--
 TalerWallet1/Views/Banking/ManualWithdrawDone.swift  | 3 ++-
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/TalerWallet1/Views/Banking/ExchangeListView.swift 
b/TalerWallet1/Views/Banking/ExchangeListView.swift
index aa5c261..718291f 100644
--- 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
index 59c76de..a16e6ad 100644
--- 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
index 80a8e9a..09bfa7e 100644
--- 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
index d9ecd26..d4fa7ec 100644
--- 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,

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]