gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: -subtract only after success to


From: gnunet
Subject: [taler-exchange] branch master updated: -subtract only after success to tolerate currency mismatch in test
Date: Mon, 27 Nov 2023 04:28:53 +0100

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 23b109ce -subtract only after success to tolerate currency mismatch in 
test
23b109ce is described below

commit 23b109ce4bfa30fba74e3caa7fb1a38d58a36058
Author: Christian Grothoff <grothoff@gnunet.org>
AuthorDate: Mon Nov 27 12:28:46 2023 +0900

    -subtract only after success to tolerate currency mismatch in test
---
 src/testing/testing_api_cmd_refund.c | 32 ++++++++++++++++++++++++++++----
 1 file changed, 28 insertions(+), 4 deletions(-)

diff --git a/src/testing/testing_api_cmd_refund.c 
b/src/testing/testing_api_cmd_refund.c
index 516d6450..29b68ef0 100644
--- a/src/testing/testing_api_cmd_refund.c
+++ b/src/testing/testing_api_cmd_refund.c
@@ -97,6 +97,34 @@ refund_cb (void *cls,
                                      rs->expected_response_code);
     return;
   }
+  if (MHD_HTTP_OK == hr->http_status)
+  {
+    struct TALER_Amount refund_amount;
+
+    if (GNUNET_OK !=
+        TALER_string_to_amount (rs->refund_amount,
+                                &refund_amount))
+    {
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Failed to parse amount `%s'\n",
+                  rs->refund_amount);
+      TALER_TESTING_interpreter_fail (rs->is);
+      return;
+    }
+    if (0 >
+        TALER_amount_subtract (&rs->che.amount,
+                               &refund_amount,
+                               &rs->che.details.refund.refund_fee))
+    {
+      GNUNET_break (0);
+      GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+                  "Failed to subtract %s from %s\n",
+                  TALER_amount2s (&rs->che.details.refund.refund_fee),
+                  rs->refund_amount);
+      TALER_TESTING_interpreter_fail (rs->is);
+      return;
+    }
+  }
   TALER_TESTING_interpreter_next (rs->is);
 }
 
@@ -187,10 +215,6 @@ refund_run (void *cls,
     &rs->che.details.refund.merchant_pub.eddsa_pub);
   rs->che.details.refund.refund_fee = denom_pub->fees.refund;
   rs->che.details.refund.sig_amount = refund_amount;
-  GNUNET_assert (0 <=
-                 TALER_amount_subtract (&rs->che.amount,
-                                        &refund_amount,
-                                        &rs->che.details.refund.refund_fee));
   rs->che.details.refund.rtransaction_id = rs->refund_transaction_id;
   TALER_merchant_refund_sign (&rs->coin,
                               &h_contract_terms,

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