gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 18/32: updateExchange


From: gnunet
Subject: [taler-taler-ios] 18/32: updateExchange
Date: Mon, 16 Oct 2023 00:03:16 +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 c6cd080659131d682b26749904afdaca96eb691b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Oct 13 19:22:22 2023 +0200

    updateExchange
---
 TalerWallet1/Model/Model+Exchange.swift | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/TalerWallet1/Model/Model+Exchange.swift 
b/TalerWallet1/Model/Model+Exchange.swift
index bf4a2ca..7ac8d72 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -82,10 +82,23 @@ fileprivate struct ListExchanges: 
WalletBackendFormattedRequest {
     }
 }
 
+/// A request to update a single exchange.
+fileprivate struct UpdateExchange: WalletBackendFormattedRequest {
+    struct Response: Decodable {}   // no result - getting no error back means 
success
+    func operation() -> String { return "updateExchangeEntry" }
+    func args() -> Args { return Args(scopeInfo: scopeInfo) }
+
+    var scopeInfo: ScopeInfo
+
+    struct Args: Encodable {
+        var scopeInfo: ScopeInfo
+    }
+}
+
 /// A request to add an exchange.
 fileprivate struct AddExchange: WalletBackendFormattedRequest {
     struct Response: Decodable {}   // no result - getting no error back means 
success
-    func operation() -> String { return "addExchange" }
+    func operation() -> String { return "addExchange" }     // addExchangeEntry
     func args() -> Args { return Args(exchangeBaseUrl: exchangeBaseUrl) }
 
     var exchangeBaseUrl: String
@@ -129,6 +142,14 @@ extension WalletModel {
         _ = try await sendRequest(request)
     }
 
+    /// ask wallet-core to update an existing exchange by querying it for 
denominations, fees, and scoped currency info
+    func updateExchange(scopeInfo: ScopeInfo)
+      async throws  {
+        let request = UpdateExchange(scopeInfo: scopeInfo)
+        logger.info("updating exchange for: \(scopeInfo.currency, privacy: 
.public)")
+        _ = try await sendRequest(request)
+    }
+
     @MainActor func getCurrencySpecificationM(scope: ScopeInfo)
       async throws -> CurrencySpecification {   // M for MainActor
         let request = GetCurrencySpecification(scope: scope)

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