gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 03/11: ExchangeListItem


From: gnunet
Subject: [taler-taler-ios] 03/11: ExchangeListItem
Date: Sat, 21 Oct 2023 21:10:01 +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 0ebc3a84249e00a44d9fe4cdc4cc836211e83cf0
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Oct 20 08:46:58 2023 +0200

    ExchangeListItem
---
 TalerWallet1/Model/Model+Exchange.swift | 16 ++++++++++++++++
 TalerWallet1/Model/Model+Withdraw.swift | 17 -----------------
 2 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/TalerWallet1/Model/Model+Exchange.swift 
b/TalerWallet1/Model/Model+Exchange.swift
index 1ab91f4..56af21d 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -59,7 +59,23 @@ struct Exchange: Codable, Hashable, Identifiable {
 struct ExchangeError: Codable, Hashable {
     var error: HTTPError
 }
+struct ExchangeListItem: Codable, Hashable {
+    var exchangeBaseUrl: String
+    var currency: String
+    var paytoUris: [String]
+
+    public static func == (lhs: ExchangeListItem, rhs: ExchangeListItem) -> 
Bool {
+        return lhs.exchangeBaseUrl == rhs.exchangeBaseUrl &&
+        lhs.currency == rhs.currency &&
+        lhs.paytoUris == rhs.paytoUris
+    }
 
+    public func hash(into hasher: inout Hasher) {
+        hasher.combine(exchangeBaseUrl)
+        hasher.combine(currency)
+        hasher.combine(paytoUris)
+    }
+}
 // MARK: -
 /// A request to list exchanges.
 fileprivate struct ListExchanges: WalletBackendFormattedRequest {
diff --git a/TalerWallet1/Model/Model+Withdraw.swift 
b/TalerWallet1/Model/Model+Withdraw.swift
index f0084eb..5afeea4 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -14,23 +14,6 @@ struct WithdrawUriInfoResponse: Decodable {
     var defaultExchangeBaseUrl: String?             // TODO: might be nil 
❗️Yikes
     var possibleExchanges: [ExchangeListItem]       // TODO: query these for 
fees?
 }
-struct ExchangeListItem: Codable, Hashable {
-    var exchangeBaseUrl: String
-    var currency: String
-    var paytoUris: [String]
-
-    public static func == (lhs: ExchangeListItem, rhs: ExchangeListItem) -> 
Bool {
-        return lhs.exchangeBaseUrl == rhs.exchangeBaseUrl &&
-        lhs.currency == rhs.currency &&
-        lhs.paytoUris == rhs.paytoUris
-    }
-
-    public func hash(into hasher: inout Hasher) {
-        hasher.combine(exchangeBaseUrl)
-        hasher.combine(currency)
-        hasher.combine(paytoUris)
-    }
-}
 /// A request to get an exchange's withdrawal details.
 fileprivate struct GetWithdrawalDetailsForURI: WalletBackendFormattedRequest {
     typealias Response = WithdrawUriInfoResponse

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