gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 18/54: remove loaded


From: gnunet
Subject: [taler-taler-ios] 18/54: remove loaded
Date: Fri, 30 Jun 2023 22:33:50 +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 9b9273933e1a6a67bbdab8b2c94886cd090fb8eb
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Jun 24 13:07:21 2023 +0200

    remove loaded
---
 TalerWallet1/Backend/Transaction.swift             | 46 ++++------------------
 .../Views/Transactions/TransactionDetailView.swift |  5 +--
 .../Views/Transactions/TransactionRowView.swift    |  5 +--
 3 files changed, 11 insertions(+), 45 deletions(-)

diff --git a/TalerWallet1/Backend/Transaction.swift 
b/TalerWallet1/Backend/Transaction.swift
index 2e278b2..5e7045c 100644
--- a/TalerWallet1/Backend/Transaction.swift
+++ b/TalerWallet1/Backend/Transaction.swift
@@ -166,7 +166,6 @@ struct WithdrawalTransactionDetails: Decodable {
 struct WithdrawalTransaction {
     var common: TransactionCommon
     var details: WithdrawalTransactionDetails
-    var loaded: Timestamp
 }
 
 struct PaymentTransactionDetails: Decodable {
@@ -182,7 +181,6 @@ struct PaymentTransactionDetails: Decodable {
 struct PaymentTransaction {
     var common: TransactionCommon
     var details: PaymentTransactionDetails
-    var loaded: Timestamp
 }
 
 struct RefundTransactionDetails: Decodable {
@@ -196,7 +194,6 @@ struct RefundTransactionDetails: Decodable {
 struct RefundTransaction {
     var common: TransactionCommon
     var details: RefundTransactionDetails
-    var loaded: Timestamp
 }
 
 struct RewardTransactionDetails: Decodable {
@@ -207,7 +204,6 @@ struct RewardTransactionDetails: Decodable {
 struct RewardTransaction {
     var common: TransactionCommon
     var details: RewardTransactionDetails
-    var loaded: Timestamp
 }
 
 //struct TipTransactionDetails: Decodable {
@@ -218,7 +214,6 @@ struct RewardTransaction {
 //struct TipTransaction {
 //    var common: TransactionCommon
 //    var details: TipTransactionDetails
-//    var loaded: Timestamp
 //}
 
 enum RefreshReason: String, Decodable {
@@ -244,7 +239,6 @@ struct RefreshTransactionDetails: Decodable {
 struct RefreshTransaction {
     var common: TransactionCommon
     var details: RefreshTransactionDetails
-    var loaded: Timestamp
 }
 
 struct P2pShortInfo: Codable {
@@ -261,11 +255,10 @@ struct P2PTransactionDetails: Codable {
 struct P2PTransaction {
     var common: TransactionCommon
     var details: P2PTransactionDetails
-    var loaded: Timestamp
 }
+
 struct DummyTransaction {
     var common: TransactionCommon
-    var loaded: Timestamp
 }
 
 enum Transaction: Decodable, Hashable, Identifiable {
@@ -281,30 +274,28 @@ enum Transaction: Decodable, Hashable, Identifiable {
     init(from decoder: Decoder) throws {
         do {
             let common = try TransactionCommon.init(from: decoder)
-            let now = Timestamp.now()
-
             switch (common.type) {
                 case .withdrawal:
                     let details = try WithdrawalTransactionDetails.init(from: 
decoder)
-                    self = .withdrawal(WithdrawalTransaction(common: common, 
details: details, loaded: now))
+                    self = .withdrawal(WithdrawalTransaction(common: common, 
details: details))
                 case .payment:
                     let details = try PaymentTransactionDetails.init(from: 
decoder)
-                    self = .payment(PaymentTransaction(common: common, 
details: details, loaded: now))
+                    self = .payment(PaymentTransaction(common: common, 
details: details))
                 case .refund:
                     let details = try RefundTransactionDetails.init(from: 
decoder)
-                    self = .refund(RefundTransaction(common: common, details: 
details, loaded: now))
+                    self = .refund(RefundTransaction(common: common, details: 
details))
                 case .reward:
                     let details = try RewardTransactionDetails.init(from: 
decoder)
-                    self = .reward(RewardTransaction(common: common, details: 
details, loaded: now))
+                    self = .reward(RewardTransaction(common: common, details: 
details))
 //                case .tip:
 //                    let details = try TipTransactionDetails.init(from: 
decoder)
-//                    self = .tip(TipTransaction(common: common, details: 
details, loaded: now))
+//                    self = .tip(TipTransaction(common: common, details: 
details))
                 case .refresh:
                     let details = try RefreshTransactionDetails.init(from: 
decoder)
-                    self = .refresh(RefreshTransaction(common: common, 
details: details, loaded: now))
+                    self = .refresh(RefreshTransaction(common: common, 
details: details))
                 case .peerPushDebit, .peerPullCredit, .scanPullDebit, 
.scanPushCredit:
                     let details = try P2PTransactionDetails.init(from: decoder)
-                    self = .peer2peer(P2PTransaction(common: common, details: 
details, loaded: now))
+                    self = .peer2peer(P2PTransaction(common: common, details: 
details))
                 default:
                     let context = DecodingError.Context(
                         codingPath: decoder.codingPath,
@@ -413,27 +404,6 @@ enum Transaction: Decodable, Hashable, Identifiable {
         }
     }
 
-    var loaded: Timestamp {
-        switch self {
-            case .dummy(let dummyTransaction):
-                return dummyTransaction.loaded
-            case .withdrawal(let withdrawalTransaction):
-                return withdrawalTransaction.loaded
-            case .payment(let paymentTransaction):
-                return paymentTransaction.loaded
-            case .refund(let refundTransaction):
-                return refundTransaction.loaded
-            case .reward(let rewardTransaction):
-                return rewardTransaction.loaded
-//            case .tip(let tipTransaction):
-//                return tipTransaction.loaded
-            case .refresh(let refreshTransaction):
-                return refreshTransaction.loaded
-            case .peer2peer(let p2pTransaction):
-                return p2pTransaction.loaded
-        }
-    }
-
     func detailsToShow() -> Dictionary<String, String> {
         var result: [String:String] = [:]
         switch self {
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index 59351d4..9627ef5 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -17,7 +17,7 @@ extension Transaction {             // for Dummys
                                        transactionId: "",
                                        timestamp: now,
                                        txActions: [])
-        self = .dummy(DummyTransaction(common: common, loaded: now))
+        self = .dummy(DummyTransaction(common: common))
     }
 }
 // MARK: -
@@ -44,15 +44,12 @@ struct TransactionDetailView: View {
 #endif
         let common = transaction.common
         let pending = transaction.isPending
-        let loaded = TalerDater.dateString(from: transaction.loaded)
         let dateString = TalerDater.dateString(from: common.timestamp)
         let localizedType = transaction.localizedType
         let navTitle = pending ? String(localized: "Pending \(localizedType)")
                                : localizedType
         Group {
             List {
-                Text("Loaded: \(loaded)")
-                    .font(.title2)
                 if developerMode {
                     if transaction.isSuspendable { if let suspendAction {
                         TransactionButton(transactionId: common.transactionId,
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift 
b/TalerWallet1/Views/Transactions/TransactionRowView.swift
index b64cec7..b6e9286 100644
--- a/TalerWallet1/Views/Transactions/TransactionRowView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -93,7 +93,6 @@ extension Transaction {             // for PreViews
                               transactionId: id,
                                   timestamp: time,
                                   txActions: [.abort])
-        let now = Timestamp.now()
         if incoming {
             // if pending then manual else bank-integrated
             let payto = 
"payto://iban/SANDBOXX/DE159593?receiver-name=Exchange+Company&amount=KUDOS%3A9.99&message=Taler+Withdrawal+J41FQPJGAP1BED1SFSXHC989EN8HRDYAHK688MQ228H6SKBMV0AG"
@@ -104,7 +103,7 @@ extension Transaction {             // for PreViews
                                          exchangePaytoUris: pending ? [payto] 
: nil)
             let wDetails = WithdrawalTransactionDetails(exchangeBaseUrl: 
DEMOEXCHANGE,
                                                       withdrawalDetails: 
withdrawalDetails)
-            self = .withdrawal(WithdrawalTransaction(common: common, details: 
wDetails, loaded: now))
+            self = .withdrawal(WithdrawalTransaction(common: common, details: 
wDetails))
         } else {
             let merchant = Merchant(name: "some random shop")
             let info = OrderShortInfo(orderId: "some order ID",
@@ -115,7 +114,7 @@ extension Transaction {             // for PreViews
                                                  totalRefundRaw: try! 
Amount(fromString: refRaw),
                                            totalRefundEffective: try! 
Amount(fromString: refEff),
                                                            info: info)
-            self = .payment(PaymentTransaction(common: common, details: 
pDetails, loaded: now))
+            self = .payment(PaymentTransaction(common: common, details: 
pDetails))
         }
     }
 }

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