gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 07/10: Wallet changes + bugfixes


From: gnunet
Subject: [taler-taler-ios] 07/10: Wallet changes + bugfixes
Date: Tue, 08 Aug 2023 12:29:26 +0200

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 bf9bfba90aed389a0ff802b861a3c0dc5882518b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Aug 8 12:18:26 2023 +0200

    Wallet changes + bugfixes
---
 TalerWallet1/Backend/WalletBackendRequest.swift  | 13 +++++++------
 TalerWallet1/Backend/WalletCore.swift            |  2 +-
 TalerWallet1/Model/WalletModel.swift             |  2 +-
 TalerWallet1/Views/Exchange/ManualWithdraw.swift |  2 +-
 4 files changed, 10 insertions(+), 9 deletions(-)

diff --git a/TalerWallet1/Backend/WalletBackendRequest.swift 
b/TalerWallet1/Backend/WalletBackendRequest.swift
index 9bf8d80..ec9d2ca 100644
--- a/TalerWallet1/Backend/WalletBackendRequest.swift
+++ b/TalerWallet1/Backend/WalletBackendRequest.swift
@@ -28,18 +28,19 @@ struct ScopeInfo: Codable, Hashable {
     enum ScopeInfoType: String, Codable {
         case global
         case exchange
+        case auditor
     }
     var type: ScopeInfoType
-    var exchangeBaseUrl: String?    // only for "exchange"
+    var url: String?    // only for "exchange"
     var currency: String
 
     public static func == (lhs: ScopeInfo, rhs: ScopeInfo) -> Bool {
-        if let lhsBaseURL = lhs.exchangeBaseUrl {
-            if let rhsBaseURL = rhs.exchangeBaseUrl {
+        if let lhsBaseURL = lhs.url {
+            if let rhsBaseURL = rhs.url {
                 if lhsBaseURL != rhsBaseURL { return false }    // different 
exchanges
                                                                 // else fall 
thru and check type & currency
             } else { return false }                             // left but 
not right
-        } else if rhs.exchangeBaseUrl != nil {
+        } else if rhs.url != nil {
             return false                                        // right but 
not left
         }
         return lhs.type == rhs.type &&
@@ -47,8 +48,8 @@ struct ScopeInfo: Codable, Hashable {
     }
     public func hash(into hasher: inout Hasher) {
         hasher.combine(type)
-        if let baseURL = exchangeBaseUrl {
-            hasher.combine(baseURL)
+        if let url {
+            hasher.combine(url)
         }
         hasher.combine(currency)
     }
diff --git a/TalerWallet1/Backend/WalletCore.swift 
b/TalerWallet1/Backend/WalletCore.swift
index 3def60d..f2f0460 100644
--- a/TalerWallet1/Backend/WalletCore.swift
+++ b/TalerWallet1/Backend/WalletCore.swift
@@ -186,7 +186,7 @@ extension WalletCore {
         do {
             let decoded = try JSONDecoder().decode(TransactionTransition.self, 
from: jsonData)
             if decoded.newTxState != decoded.oldTxState {
-                let components = decoded.transactionId.components(separatedBy: 
[":"])
+                let components = decoded.transactionId.components(separatedBy: 
":")
                 if components.count >= 3 {  // txn:$txtype:$uid
                     if let type = TransactionType(rawValue: components[1]) {
                         guard type != .refresh else { return }
diff --git a/TalerWallet1/Model/WalletModel.swift 
b/TalerWallet1/Model/WalletModel.swift
index 1de0aff..d5dc714 100644
--- a/TalerWallet1/Model/WalletModel.swift
+++ b/TalerWallet1/Model/WalletModel.swift
@@ -69,7 +69,7 @@ fileprivate struct GetTransactionById: 
WalletBackendFormattedRequest {
 // MARK: -
 /// The info returned from Wallet-core init
 struct VersionInfo: Decodable {
-    var hash: String
+    var hash: String?
     var version: String
     var exchange: String
     var merchant: String
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift 
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 6077474..5486073 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -25,7 +25,7 @@ struct ManualWithdraw: View {
         let _ = Self._printChanges()
         let _ = symLog.vlog()       // just to get the # to compare it with 
.onAppear & onDisappear
 #endif
-        let currency = exchange.currency!
+        let currency = exchange.currency ?? String(localized: "Unknown", 
comment: "unknown currency")
         let navTitle = String(localized: "Withdraw \(currency)")
         let currencyField = CurrencyField(value: $centsToTransfer, currency: 
currency) // becomeFirstResponder
 //        let agePicker = AgePicker(ageMenuList: $ageMenuList, selectedAge: 
$selectedAge)

-- 
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]