gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 61/69: InfiniteTransactionLoop


From: gnunet
Subject: [taler-taler-ios] 61/69: InfiniteTransactionLoop
Date: Fri, 19 Jan 2024 09:02:34 +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 ca2329e8edbe4029c99c13e666b485ae8781c92f
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 18 09:34:48 2024 +0100

    InfiniteTransactionLoop
---
 TalerWallet1/Model/Model+Settings.swift        | 25 +++++++++++++++++++++++++
 TalerWallet1/Views/Settings/SettingsView.swift | 17 +++++++++++++++++
 2 files changed, 42 insertions(+)

diff --git a/TalerWallet1/Model/Model+Settings.swift 
b/TalerWallet1/Model/Model+Settings.swift
index 7aef9fc..eb3b019 100644
--- a/TalerWallet1/Model/Model+Settings.swift
+++ b/TalerWallet1/Model/Model+Settings.swift
@@ -92,4 +92,29 @@ extension WalletModel {
                                          amountToSpend: amountS)
         let _ = try await sendRequest(request, ASYNCDELAY)
     }
+} // runIntegrationTestM()
+  // MARK: -
+/// A request to add a test balance to the wallet.
+fileprivate struct InfiniteTransactionLoop: WalletBackendFormattedRequest {
+    struct Response: Decodable {}   // no result - getting no error back means 
success
+    func operation() -> String { "testingInfiniteTransactionLoop" }
+    func args() -> Args { Args(delayMs: delayMs,
+                               shouldFetch: shouldFetch)
+    }
+
+    let delayMs: Int32
+    let shouldFetch: Bool
+
+
+    struct Args: Encodable {
+        let delayMs: Int32
+        let shouldFetch: Bool
+    }
+}
+extension WalletModel {
+    func testingInfiniteTransaction(delayMs: Int32, shouldFetch: Bool)
+      async throws {
+        let request = InfiniteTransactionLoop(delayMs: delayMs, shouldFetch: 
shouldFetch)
+        let _ = try await sendRequest(request, ASYNCDELAY)
+    }
 } // runIntegrationTestM()
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index 3313e97..06d552d 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -246,6 +246,23 @@ struct SettingsView: View {
                             .buttonStyle(.bordered)
                             .disabled(checkDisabled)
                         }.id("test2runTest")
+                        SettingsItem(name: String("Run Infinite Transaction 
Loop"), id1: "runInfinite",
+                              description: hideDescriptions ? nil : 
String("Check DB in background")) {
+                            let title = "Loop"
+                            Button(title) {
+                                checkDisabled = true    // don't run twice
+                                Task { // runs on MainActor
+                                    symLog.log("Running Infinite Transaction 
Loop")
+                                    do {
+                                        try await 
model.testingInfiniteTransaction(delayMs: 10_000, shouldFetch: true)
+                                    } catch {    // TODO: show error
+                                        symLog.log(error.localizedDescription)
+                                    }
+                                }
+                            }
+                            .buttonStyle(.bordered)
+                            .disabled(checkDisabled)
+                        }.id("runInfiniteLoop")
                         SettingsItem(name: String("Save Logfile"), id1: "save",
                               description: hideDescriptions ? nil : 
String("Help debugging wallet-core")) {
                             Button("Save") {

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