gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 19/28: Sendable for Swift 6


From: gnunet
Subject: [taler-taler-ios] 19/28: Sendable for Swift 6
Date: Tue, 19 Sep 2023 03:44:38 +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 cb080273b802e82f683c0616ccd6835875234a3b
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Sep 18 08:43:58 2023 +0200

    Sendable for Swift 6
---
 TalerWallet.xcodeproj/project.pbxproj        |  2 ++
 TalerWallet1/Backend/Transaction.swift       | 22 +++++++++++-----------
 TalerWallet1/Model/Model+Balances.swift      |  4 ++--
 taler-swift/Sources/taler-swift/Amount.swift | 12 ++++++------
 taler-swift/Sources/taler-swift/Time.swift   |  2 +-
 5 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/TalerWallet.xcodeproj/project.pbxproj 
b/TalerWallet.xcodeproj/project.pbxproj
index e61115c..a982f4d 100644
--- a/TalerWallet.xcodeproj/project.pbxproj
+++ b/TalerWallet.xcodeproj/project.pbxproj
@@ -1376,6 +1376,7 @@
                                SDKROOT = iphoneos;
                                SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
                                SWIFT_OPTIMIZATION_LEVEL = "-Onone";
+                               SWIFT_STRICT_CONCURRENCY = complete;
                                SWIFT_VERSION = 5.0;
                        };
                        name = Debug;
@@ -1430,6 +1431,7 @@
                                SDKROOT = iphoneos;
                                SWIFT_COMPILATION_MODE = wholemodule;
                                SWIFT_OPTIMIZATION_LEVEL = "-O";
+                               SWIFT_STRICT_CONCURRENCY = complete;
                                SWIFT_VERSION = 5.0;
                                VALIDATE_PRODUCT = YES;
                        };
diff --git a/TalerWallet1/Backend/Transaction.swift 
b/TalerWallet1/Backend/Transaction.swift
index 7f2aac5..06ce358 100644
--- a/TalerWallet1/Backend/Transaction.swift
+++ b/TalerWallet1/Backend/Transaction.swift
@@ -142,7 +142,7 @@ enum TransactionType: String, Codable {
     var isIncoming   : Bool { isP2pIncoming || isWithdrawal || isRefund || 
isReward }
 }
 
-struct TransactionCommon: Decodable {
+struct TransactionCommon: Decodable, Sendable {
     var type: TransactionType
     var txState: TransactionState
     var amountEffective: Amount
@@ -222,7 +222,7 @@ struct WithdrawalTransactionDetails: Decodable {
     var withdrawalDetails: WithdrawalDetails
 }
 
-struct WithdrawalTransaction {
+struct WithdrawalTransaction : Sendable{
     var common: TransactionCommon
     var details: WithdrawalTransactionDetails
 }
@@ -237,7 +237,7 @@ struct PaymentTransactionDetails: Decodable {
     var info: OrderShortInfo
 }
 
-struct PaymentTransaction {
+struct PaymentTransaction : Sendable{
     var common: TransactionCommon
     var details: PaymentTransactionDetails
 }
@@ -250,7 +250,7 @@ struct RefundTransactionDetails: Decodable {
     var info: OrderShortInfo?       // TODO: is this still here?
 }
 
-struct RefundTransaction {
+struct RefundTransaction : Sendable{
     var common: TransactionCommon
     var details: RefundTransactionDetails
 }
@@ -260,7 +260,7 @@ struct RewardTransactionDetails: Decodable {
     var exchangeBaseUrl: String
 }
 
-struct RewardTransaction {
+struct RewardTransaction : Sendable{
     var common: TransactionCommon
     var details: RewardTransactionDetails
 }
@@ -285,32 +285,32 @@ struct RefreshTransactionDetails: Decodable {
     var refreshOutputAmount: Amount
 }
 
-struct RefreshTransaction {
+struct RefreshTransaction : Sendable{
     var common: TransactionCommon
     var details: RefreshTransactionDetails
 }
 
-struct P2pShortInfo: Codable {
+struct P2pShortInfo: Codable, Sendable {
     var summary: String
     var expiration: Timestamp
 }
 
-struct P2PTransactionDetails: Codable {
+struct P2PTransactionDetails: Codable, Sendable {
     var exchangeBaseUrl: String
     var talerUri: String?       // only if we initiated the transaction
     var info: P2pShortInfo
 }
 
-struct P2PTransaction {
+struct P2PTransaction : Sendable{
     var common: TransactionCommon
     var details: P2PTransactionDetails
 }
 
-struct DummyTransaction {
+struct DummyTransaction : Sendable{
     var common: TransactionCommon
 }
 
-enum Transaction: Decodable, Hashable, Identifiable {
+enum Transaction: Decodable, Hashable, Identifiable, Sendable {
     case dummy (DummyTransaction)
     case withdrawal (WithdrawalTransaction)
     case payment (PaymentTransaction)
diff --git a/TalerWallet1/Model/Model+Balances.swift 
b/TalerWallet1/Model/Model+Balances.swift
index f1a651c..f0cee38 100644
--- a/TalerWallet1/Model/Model+Balances.swift
+++ b/TalerWallet1/Model/Model+Balances.swift
@@ -8,7 +8,7 @@ fileprivate let ASYNCDELAY: UInt = 0   //set e.g to 6 or 9 
seconds for debugging
 
 // MARK: -
 /// A currency balance
-struct Balance: Decodable, Hashable {
+struct Balance: Decodable, Hashable, Sendable {
     var available: Amount
     var scopeInfo: ScopeInfo
     var requiresUserInput: Bool
@@ -36,7 +36,7 @@ fileprivate struct Balances: WalletBackendFormattedRequest {
 
     struct Args: Encodable {}                           // no arguments needed
 
-    struct Response: Decodable {                        // list of balances
+    struct Response: Decodable, Sendable {              // list of balances
         var balances: [Balance]
     }
 }
diff --git a/taler-swift/Sources/taler-swift/Amount.swift 
b/taler-swift/Sources/taler-swift/Amount.swift
index 647055b..2e91e6c 100644
--- a/taler-swift/Sources/taler-swift/Amount.swift
+++ b/taler-swift/Sources/taler-swift/Amount.swift
@@ -38,15 +38,15 @@ enum AmountError: Error {
     case divideByZero
 }
 
-public struct ScopedCurrencyInfo: Codable {
-    var decimalSeparator: String
-    var numFractionalDigits: Int        // 0 Yen, 2 €,$, 3 arabic
-    var numTinyDigits: Int              // SuperScriptDigits
-    var isCurrencyNameLeading: Bool
+public struct ScopedCurrencyInfo: Codable, Sendable {
+    let decimalSeparator: String
+    let numFractionalDigits: Int        // 0 Yen, 2 €,$, 3 arabic
+    let numTinyDigits: Int              // SuperScriptDigits
+    let isCurrencyNameLeading: Bool
 }
 
 /// A value of some currency.
-public class Amount: Codable, Hashable, CustomStringConvertible {
+public final class Amount: Codable, Hashable, @unchecked Sendable, 
CustomStringConvertible {        // TODO: @unchecked
     /// Format that a currency must match.
     private static let currencyRegex = #"^[-_*A-Za-z0-9]{1,12}$"#
     
diff --git a/taler-swift/Sources/taler-swift/Time.swift 
b/taler-swift/Sources/taler-swift/Time.swift
index 43ada5d..98f0e27 100644
--- a/taler-swift/Sources/taler-swift/Time.swift
+++ b/taler-swift/Sources/taler-swift/Time.swift
@@ -17,7 +17,7 @@ enum TimestampError: Error {
 }
 
 /// A point in time, represented by milliseconds from January 1, 1970..
-public enum Timestamp: Codable, Hashable {
+public enum Timestamp: Codable, Hashable, Sendable {
     case milliseconds(UInt64)
     case never
     

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