[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 10/28: ExchangeTosStatus
From: |
gnunet |
Subject: |
[taler-taler-ios] 10/28: ExchangeTosStatus |
Date: |
Tue, 19 Sep 2023 03:44:29 +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 241f614407fa92a3fa3e8447310fa2b2dadcb661
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sun Sep 10 11:32:30 2023 +0200
ExchangeTosStatus
---
TalerWallet1/Model/Model+Exchange.swift | 26 +++++++++++++++++-----
TalerWallet1/Model/Model+Withdraw.swift | 8 +++----
.../Views/Exchange/ExchangeSectionView.swift | 16 ++++++-------
TalerWallet1/Views/Exchange/ManualWithdraw.swift | 8 +++----
.../Views/Exchange/ManualWithdrawDone.swift | 8 +++----
5 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/TalerWallet1/Model/Model+Exchange.swift
b/TalerWallet1/Model/Model+Exchange.swift
index f52ee75..304ef06 100644
--- a/TalerWallet1/Model/Model+Exchange.swift
+++ b/TalerWallet1/Model/Model+Exchange.swift
@@ -7,22 +7,38 @@ import taler_swift
import SymLog
fileprivate let ASYNCDELAY: UInt = 0 //set e.g to 6 or 9 seconds for
debugging
+enum ExchangeEntryStatus: String, Codable {
+ case preset
+ case ephemeral
+ case used
+}
+
+enum ExchangeUpdateStatus: String, Codable {
+ case initial
+ case initialUpdate = "initial(update)"
+ case suspended
+ case failed
+ case outdatedUpdate = "outdated(update)"
+ case ready
+ case readyUpdate = "ready(update)"
+}
// MARK: -
/// The result from wallet-core's ListExchanges
struct Exchange: Codable, Hashable, Identifiable {
static func == (lhs: Exchange, rhs: Exchange) -> Bool {
return lhs.exchangeBaseUrl == rhs.exchangeBaseUrl &&
- lhs.exchangeStatus == rhs.exchangeStatus &&
- lhs.permanent == rhs.permanent
+ lhs.tosStatus == rhs.tosStatus &&
+ lhs.exchangeEntryStatus == rhs.exchangeEntryStatus &&
+ lhs.exchangeUpdateStatus == rhs.exchangeUpdateStatus
}
var exchangeBaseUrl: String
var currency: String?
var paytoUris: [String]
- var tosStatus: String
- var exchangeStatus: String
+ var tosStatus: ExchangeTosStatus
+ var exchangeEntryStatus: ExchangeEntryStatus
+ var exchangeUpdateStatus: ExchangeUpdateStatus
var ageRestrictionOptions: [Int]
- var permanent: Bool
var lastUpdateErrorInfo: ExchangeError?
var id: String {
diff --git a/TalerWallet1/Model/Model+Withdraw.swift
b/TalerWallet1/Model/Model+Withdraw.swift
index 754c9dd..bff4394 100644
--- a/TalerWallet1/Model/Model+Withdraw.swift
+++ b/TalerWallet1/Model/Model+Withdraw.swift
@@ -67,11 +67,9 @@ fileprivate struct GetWithdrawalDetailsForAmount:
WalletBackendFormattedRequest
}
// MARK: -
enum ExchangeTosStatus: String, Codable {
- case new = "new"
- case accepted = "accepted"
- case changed = "changed"
- case notFound = "not-found"
- case unknown = "unknown"
+ case pending
+ case proposed
+ case accepted
}
struct ExchangeTermsOfService: Decodable {
var currentEtag: String
diff --git a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
index ffe53dc..945e147 100644
--- a/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
+++ b/TalerWallet1/Views/Exchange/ExchangeSectionView.swift
@@ -76,17 +76,17 @@ struct ExchangeRow_Container : View {
let exchange1 = Exchange(exchangeBaseUrl: ARS_AGE_EXCHANGE,
currency: LONGCURRENCY,
paytoUris: [],
- tosStatus: "tosStatus",
- exchangeStatus: "exchangeStatus",
- ageRestrictionOptions: [12,16],
- permanent: true)
+ tosStatus: .pending,
+ exchangeEntryStatus: .preset,
+ exchangeUpdateStatus: .initial,
+ ageRestrictionOptions: [12,16])
let exchange2 = Exchange(exchangeBaseUrl: ARS_EXP_EXCHANGE,
currency: LONGCURRENCY,
paytoUris: [],
- tosStatus: "tosStatus",
- exchangeStatus: "exchangeStatus",
- ageRestrictionOptions: [],
- permanent: false)
+ tosStatus: .proposed,
+ exchangeEntryStatus: .ephemeral,
+ exchangeUpdateStatus: .ready,
+ ageRestrictionOptions: [])
ExchangeSectionView(currency: LONGCURRENCY, exchanges: [exchange1,
exchange2],
centsToTransfer: $centsToTransfer)
}
diff --git a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
index 2cf02e8..c15f149 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdraw.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdraw.swift
@@ -101,10 +101,10 @@ struct ManualWithdraw_Container : View {
let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE,
currency: LONGCURRENCY,
paytoUris: [],
- tosStatus: "tosStatus",
- exchangeStatus: "exchangeStatus",
- ageRestrictionOptions: [],
- permanent: false)
+ tosStatus: .pending,
+ exchangeEntryStatus: .preset,
+ exchangeUpdateStatus: .initial,
+ ageRestrictionOptions: [])
ManualWithdraw(exchange: exchange,
centsToTransfer: $centsToTransfer,
withdrawalAmountDetails: details)
diff --git a/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
b/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
index e5d3b20..ff265e5 100644
--- a/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
+++ b/TalerWallet1/Views/Exchange/ManualWithdrawDone.swift
@@ -71,10 +71,10 @@ struct ManualWithdrawDone_Container : View {
let exchange = Exchange(exchangeBaseUrl: DEMOEXCHANGE,
currency: LONGCURRENCY,
paytoUris: [],
- tosStatus: "tosStatus",
- exchangeStatus: "exchangeStatus",
- ageRestrictionOptions: [],
- permanent: false)
+ tosStatus: .pending,
+ exchangeEntryStatus: .preset,
+ exchangeUpdateStatus: .initial,
+ ageRestrictionOptions: [])
ManualWithdrawDone(exchange: exchange,
centsToTransfer: centsToTransfer)
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] branch master updated (7d32de8 -> 8b2cfb1), gnunet, 2023/09/18
- [taler-taler-ios] 02/28: move to HelperViews, gnunet, 2023/09/18
- [taler-taler-ios] 04/28: Font, gnunet, 2023/09/18
- [taler-taler-ios] 01/28: Haptics, gnunet, 2023/09/18
- [taler-taler-ios] 08/28: Binding+onChange, gnunet, 2023/09/18
- [taler-taler-ios] 10/28: ExchangeTosStatus,
gnunet <=
- [taler-taler-ios] 03/28: talerFonts, gnunet, 2023/09/18
- [taler-taler-ios] 09/28: move AgePicker, gnunet, 2023/09/18
- [taler-taler-ios] 13/28: Comment, gnunet, 2023/09/18
- [taler-taler-ios] 06/28: Black, gnunet, 2023/09/18
- [taler-taler-ios] 14/28: ToSButton, gnunet, 2023/09/18
- [taler-taler-ios] 07/28: DebugView static font size, gnunet, 2023/09/18
- [taler-taler-ios] 12/28: Italic, gnunet, 2023/09/18
- [taler-taler-ios] 15/28: Speed up Sidebar, gnunet, 2023/09/18
- [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