[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.
- [taler-taler-ios] 11/28: AccessibleFont, (continued)
- [taler-taler-ios] 11/28: AccessibleFont, gnunet, 2023/09/18
- [taler-taler-ios] 28/28: !!! Temporarily add back old cases to ExchangeTosStatus to be able to run with older wallet-core version !!!, gnunet, 2023/09/18
- [taler-taler-ios] 27/28: simplify log, gnunet, 2023/09/18
- [taler-taler-ios] 18/28: MainActor for Swift 6, gnunet, 2023/09/18
- [taler-taler-ios] 05/28: Terms of Service, gnunet, 2023/09/18
- [taler-taler-ios] 16/28: ScreenSize, gnunet, 2023/09/18
- [taler-taler-ios] 22/28: CallStack, gnunet, 2023/09/18
- [taler-taler-ios] 23/28: logging, gnunet, 2023/09/18
- [taler-taler-ios] 26/28: fix warning, gnunet, 2023/09/18
- [taler-taler-ios] 21/28: test.taler.net now uses KUDOS (instead of TESTKUDOS), gnunet, 2023/09/18
- [taler-taler-ios] 19/28: Sendable for Swift 6,
gnunet <=
- [taler-taler-ios] 25/28: simplify, gnunet, 2023/09/18
- [taler-taler-ios] 20/28: Wording: don't use "encrypt", gnunet, 2023/09/18
- [taler-taler-ios] 17/28: Bargraph shows the last transactions visually, gnunet, 2023/09/18
- [taler-taler-ios] 24/28: more CallStack debugging, gnunet, 2023/09/18