[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.
- [taler-taler-ios] 58/69: use scopeInfo, (continued)
- [taler-taler-ios] 58/69: use scopeInfo, gnunet, 2024/01/19
- [taler-taler-ios] 52/69: return to Balances after tx, gnunet, 2024/01/19
- [taler-taler-ios] 33/69: bars relative to fontSize, gnunet, 2024/01/19
- [taler-taler-ios] 63/69: Locale.preferredLanguageCode, gnunet, 2024/01/19
- [taler-taler-ios] 40/69: Exchange -> Banking, gnunet, 2024/01/19
- [taler-taler-ios] 65/69: Restrictions, gnunet, 2024/01/19
- [taler-taler-ios] 62/69: cleanup, preview, gnunet, 2024/01/19
- [taler-taler-ios] 36/69: b-i-withdrawal hint, gnunet, 2024/01/19
- [taler-taler-ios] 45/69: remove SideBarView, gnunet, 2024/01/19
- [taler-taler-ios] 69/69: Bump version to 0.9.4 (1), gnunet, 2024/01/19
- [taler-taler-ios] 61/69: InfiniteTransactionLoop,
gnunet <=
- [taler-taler-ios] 55/69: logging, gnunet, 2024/01/19
- [taler-taler-ios] 42/69: remove payto scheme, gnunet, 2024/01/19
- [taler-taler-ios] 48/69: fix fractions, gnunet, 2024/01/19
- [taler-taler-ios] 66/69: InterfaceOrientation, gnunet, 2024/01/19
- [taler-taler-ios] 41/69: AppIcon blue, gnunet, 2024/01/19
- [taler-taler-ios] 38/69: remove, gnunet, 2024/01/19
- [taler-taler-ios] 39/69: Bump version to 0.9.3 (34), gnunet, 2024/01/19
- [taler-taler-ios] 35/69: Markdown for ToS, gnunet, 2024/01/19
- [taler-taler-ios] 37/69: dbg+cleanup, gnunet, 2024/01/19
- [taler-taler-ios] 53/69: Summary no longer twice, gnunet, 2024/01/19