gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: add support for coin open-deposi


From: gnunet
Subject: [taler-exchange] branch master updated: add support for coin open-deposit and coin purse refunds to auditor logic
Date: Sun, 16 Oct 2022 16:38:26 +0200

This is an automated email from the git hooks/post-receive script.

grothoff pushed a commit to branch master
in repository exchange.

The following commit(s) were added to refs/heads/master by this push:
     new 35e505f6 add support for coin open-deposit and coin purse refunds to 
auditor logic
35e505f6 is described below

commit 35e505f6bf983a5bffa4fd5d5ef4344c7da75a9f
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Oct 16 16:38:21 2022 +0200

    add support for coin open-deposit and coin purse refunds to auditor logic
---
 src/auditor/taler-helper-auditor-aggregation.c | 40 +++++++++++++++++++++++++-
 src/auditor/taler-helper-auditor-coins.c       | 18 ++++++++++--
 2 files changed, 55 insertions(+), 3 deletions(-)

diff --git a/src/auditor/taler-helper-auditor-aggregation.c 
b/src/auditor/taler-helper-auditor-aggregation.c
index c03dffe3..b1595063 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -593,7 +593,45 @@ check_transaction_history_for_deposit (
                                 amount_with_fee);
         break;
       }
-    }
+
+    case TALER_EXCHANGEDB_TT_PURSE_REFUND:
+      {
+        const struct TALER_Amount *amount_with_fee;
+
+        amount_with_fee = &tl->details.purse_refund->refund_amount;
+        fee_claimed = &tl->details.purse_refund->refund_fee;
+        TALER_ARL_amount_add (&refunds,
+                              &refunds,
+                              amount_with_fee);
+        TALER_ARL_amount_add (&expenditures,
+                              &expenditures,
+                              fee_claimed);
+        /* Check that the fees given in the transaction list and in dki match 
*/
+        if (0 !=
+            TALER_amount_cmp (&issue->fees.refund,
+                              fee_claimed))
+        {
+          /* Disagreement in fee structure between exchange and auditor! */
+          report_amount_arithmetic_inconsistency ("refund fee",
+                                                  0,
+                                                  fee_claimed,
+                                                  &issue->fees.refund,
+                                                  1);
+        }
+        break;
+      }
+
+    case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
+      {
+        const struct TALER_Amount *amount_with_fee;
+
+        amount_with_fee = &tl->details.reserve_open->coin_contribution;
+        TALER_ARL_amount_add (&expenditures,
+                              &expenditures,
+                              amount_with_fee);
+        break;
+      }
+    } /* switch (tl->type) */
   } /* for 'tl' */
 
   GNUNET_log (GNUNET_ERROR_TYPE_INFO,
diff --git a/src/auditor/taler-helper-auditor-coins.c 
b/src/auditor/taler-helper-auditor-coins.c
index aa3e34b7..23d543dc 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -539,8 +539,22 @@ check_coin_history (const struct TALER_CoinSpendPublicKeyP 
*coin_pub,
                             &spent,
                             &pos->details.purse_deposit->amount);
       break;
-    }
-  }
+    case TALER_EXCHANGEDB_TT_PURSE_REFUND:
+      TALER_ARL_amount_add (&refunded,
+                            &refunded,
+                            &tl->details.purse_refund->refund_amount);
+      TALER_ARL_amount_add (&spent,
+                            &spent,
+                            &pos->details.purse_refund->refund_fee);
+      have_refund = true;
+      break;
+    case TALER_EXCHANGEDB_TT_RESERVE_OPEN:
+      TALER_ARL_amount_add (&spent,
+                            &spent,
+                            &tl->details.reserve_open->coin_contribution);
+      break;
+    } /* switch (pos->type) */
+  } /* for (...) */
 
   if (have_refund)
   {

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