gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 116/204: Settings


From: gnunet
Subject: [taler-taler-ios] 116/204: Settings
Date: Thu, 05 Dec 2024 23:51:24 +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 05eed763d0f142dd2ebd78fcae4dc35fc6663824
Author: Marc Stibane <marc@taler.net>
AuthorDate: Fri Nov 8 22:15:28 2024 +0100

    Settings
---
 TalerWallet1/Model/Model+Settings.swift        | 16 ++++++++--------
 TalerWallet1/Views/Main/WalletEmptyView.swift  |  2 +-
 TalerWallet1/Views/Settings/SettingsView.swift | 21 +++++++++++----------
 3 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/TalerWallet1/Model/Model+Settings.swift 
b/TalerWallet1/Model/Model+Settings.swift
index ad0f1c8..83caa7f 100644
--- a/TalerWallet1/Model/Model+Settings.swift
+++ b/TalerWallet1/Model/Model+Settings.swift
@@ -34,8 +34,8 @@ fileprivate struct WithdrawTestBalanceRequest: 
WalletBackendFormattedRequest {
     }
 }
 extension WalletModel {
-    @MainActor func loadTestKudosM(_ test: Int, amount: Amount, viewHandles: 
Bool = false)
-    async throws {          // M for MainActor
+    nonisolated func loadTestKudos(_ test: Int, amount: Amount, viewHandles: 
Bool = false)
+      async throws {
         let request = WithdrawTestBalanceRequest(amount: amount,
                                             bankBaseUrl: test == 2 ? HEADBANK
                                                        : test == 1 ? TESTBANK 
: DEMOBANK,
@@ -43,7 +43,7 @@ extension WalletModel {
                                                        : test == 1 ? 
TESTEXCHANGE : DEMOEXCHANGE)
         let response = try await sendRequest(request, ASYNCDELAY, viewHandles: 
viewHandles)
     }
-} // loadTestKudosM()
+} // loadTestKudos
 // MARK: -
 /// A request to add a test balance to the wallet.
 fileprivate struct RunIntegrationTest: WalletBackendFormattedRequest {
@@ -77,8 +77,8 @@ fileprivate struct RunIntegrationTest: 
WalletBackendFormattedRequest {
     }
 }
 extension WalletModel {
-    @MainActor func runIntegrationTestM(newVersion: Bool, test: Bool, 
viewHandles: Bool = false)
-    async throws {               // M for MainActor
+    nonisolated  func runIntegrationTest(newVersion: Bool, test: Bool, 
viewHandles: Bool = false)
+      async throws {
         let amountW = Amount(currency: test ? TESTCURRENCY : DEMOCURRENCY, 
cent: 300)
         let amountS = Amount(currency: test ? TESTCURRENCY : DEMOCURRENCY, 
cent: 100)
         let request = RunIntegrationTest(newVersion: newVersion,
@@ -90,7 +90,7 @@ extension WalletModel {
                                       amountToSpend: amountS)
         let _ = try await sendRequest(request, ASYNCDELAY, viewHandles: 
viewHandles)
     }
-} // runIntegrationTestM()
+} // runIntegrationTest
   // MARK: -
 /// A request to add a test balance to the wallet.
 fileprivate struct InfiniteTransactionLoop: WalletBackendFormattedRequest {
@@ -110,9 +110,9 @@ fileprivate struct InfiniteTransactionLoop: 
WalletBackendFormattedRequest {
     }
 }
 extension WalletModel {
-    func testingInfiniteTransaction(delayMs: Int32, shouldFetch: Bool, 
viewHandles: Bool = false)
+    nonisolated func testingInfiniteTransaction(delayMs: Int32, shouldFetch: 
Bool, viewHandles: Bool = false)
       async throws {
         let request = InfiniteTransactionLoop(delayMs: delayMs, shouldFetch: 
shouldFetch)
         let _ = try await sendRequest(request, ASYNCDELAY, viewHandles: 
viewHandles)
     }
-} // runIntegrationTestM()
+} // testingInfiniteTransaction
diff --git a/TalerWallet1/Views/Main/WalletEmptyView.swift 
b/TalerWallet1/Views/Main/WalletEmptyView.swift
index c21f5cb..69f6cce 100644
--- a/TalerWallet1/Views/Main/WalletEmptyView.swift
+++ b/TalerWallet1/Views/Main/WalletEmptyView.swift
@@ -45,7 +45,7 @@ struct WalletEmptyView: View {
                     Task { // runs on MainActor
                         let amount = Amount(currency:  DEMOCURRENCY, cent: 
2500)
                         symLog.log("Withdraw KUDOS")
-                        try? await model.loadTestKudosM(0, amount: amount)
+                        try? await model.loadTestKudos(0, amount: amount)
                     }
                 }
                 .buttonStyle(TalerButtonStyle(type: .prominent, narrow: false, 
disabled: withDrawDisabled, aligned: .center))
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index a4ff007..9107e25 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -167,7 +167,7 @@ struct SettingsView: View {
                                 Task { // runs on MainActor
                                     symLog.log("Withdraw DEMO KUDOS")
                                     let amount = Amount(currency:  
DEMOCURRENCY, cent: 1100)
-                                    try? await model.loadTestKudosM(0, amount: 
amount)
+                                    try? await model.loadTestKudos(0, amount: 
amount)
                                 }
                             }
                             .buttonStyle(.bordered)
@@ -181,7 +181,7 @@ struct SettingsView: View {
                                 Task { // runs on MainActor
                                     symLog.log("Withdraw TESTKUDOS")
                                     let amount = Amount(currency:  
TESTCURRENCY, cent: 1100)
-                                    try? await model.loadTestKudosM(1, amount: 
amount)
+                                    try? await model.loadTestKudos(1, amount: 
amount)
                                 }
                             }
                             .buttonStyle(.bordered)
@@ -195,16 +195,17 @@ struct SettingsView: View {
                                 Task { // runs on MainActor
                                     symLog.log("Withdraw HEAD KUDOS")
                                     let amount = Amount(currency:  
DEMOCURRENCY, cent: 1100)
-                                    try? await model.loadTestKudosM(2, amount: 
amount)
+                                    try? await model.loadTestKudos(2, amount: 
amount)
                                 }
                             }
                             .buttonStyle(.bordered)
                             .disabled(withDrawDisabled)
                         }.id("head1withdraw")
                         SettingsToggle(name: String("Set 2 seconds delay"),
-                                       value: $developDelay.onChange({ delay in
-                            walletCore.developDelay = delay}), id1: "delay",
-                                       description: hideDescriptions ? nil : 
String("After each wallet-core action"))
+                                      value: $developDelay.onChange({ delay in
+                                                walletCore.developDelay = 
delay}),
+                                        id1: "delay",
+                                description: hideDescriptions ? nil : 
String("After each wallet-core action"))
                             .id("delay")
 #if DEBUG
                         SettingsItem(name: String("Run Dev Experiment"), id1: 
"applyDevExperiment",
@@ -228,7 +229,7 @@ struct SettingsView: View {
                                 checkDisabled = true    // don't run twice
                                 Task { // runs on MainActor
                                     symLog.log("running integration test on 
demo")
-                                    try? await 
model.runIntegrationTestM(newVersion: false, test: false)
+                                    try? await 
model.runIntegrationTest(newVersion: false, test: false)
                                 }
                             }
                             .buttonStyle(.bordered)
@@ -241,7 +242,7 @@ struct SettingsView: View {
                                 checkDisabled = true    // don't run twice
                                 Task { // runs on MainActor
                                     symLog.log("running integration test on 
test")
-                                    try? await 
model.runIntegrationTestM(newVersion: false, test: true)
+                                    try? await 
model.runIntegrationTest(newVersion: false, test: true)
                                 }
                             }
                             .buttonStyle(.bordered)
@@ -254,7 +255,7 @@ struct SettingsView: View {
                                 checkDisabled = true    // don't run twice
                                 Task { // runs on MainActor
                                     symLog.log("running integration test V2 on 
demo")
-                                    try? await 
model.runIntegrationTestM(newVersion: true, test: false)
+                                    try? await 
model.runIntegrationTest(newVersion: true, test: false)
                                 }
                             }
                             .buttonStyle(.bordered)
@@ -267,7 +268,7 @@ struct SettingsView: View {
                                 checkDisabled = true    // don't run twice
                                 Task { // runs on MainActor
                                     symLog.log("running integration test V2 on 
test")
-                                    try? await 
model.runIntegrationTestM(newVersion: true, test: true)
+                                    try? await 
model.runIntegrationTest(newVersion: true, test: true)
                                 }
                             }
                             .buttonStyle(.bordered)

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