gnunet-svn
[Top][All Lists]
Advanced

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

[taler-exchange] branch master updated: make replay deposit command not


From: gnunet
Subject: [taler-exchange] branch master updated: make replay deposit command not use current time
Date: Sun, 29 Oct 2023 20:55:55 +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 3784541b make replay deposit command not use current time
3784541b is described below

commit 3784541b6c7e178546e91d9cb6579d8643989f59
Author: Christian Grothoff <christian@grothoff.org>
AuthorDate: Sun Oct 29 20:51:26 2023 +0100

    make replay deposit command not use current time
---
 src/testing/test_exchange_api.c       | 15 ++++++++++++++-
 src/testing/testing_api_cmd_deposit.c | 34 +++++++++++++++++-----------------
 2 files changed, 31 insertions(+), 18 deletions(-)

diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c
index b3ea8811..4ae47aff 100644
--- a/src/testing/test_exchange_api.c
+++ b/src/testing/test_exchange_api.c
@@ -186,7 +186,12 @@ run (void *cls,
                                GNUNET_TIME_UNIT_ZERO,
                                "EUR:5",
                                MHD_HTTP_OK),
-    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay",
+    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-1",
+                                      "deposit-simple",
+                                      MHD_HTTP_OK),
+    TALER_TESTING_cmd_sleep ("sleep-before-deposit-replay",
+                             1),
+    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-2",
                                       "deposit-simple",
                                       MHD_HTTP_OK),
     /* This creates a conflict, as we have the same coin public key (reuse!),
@@ -405,6 +410,14 @@ run (void *cls,
     TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age",
                                       "deposit-simple-age",
                                       MHD_HTTP_OK),
+    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age-1",
+                                      "deposit-simple-age",
+                                      MHD_HTTP_OK),
+    TALER_TESTING_cmd_sleep ("sleep-before-age-deposit-replay",
+                             1),
+    TALER_TESTING_cmd_deposit_replay ("deposit-simple-replay-age-2",
+                                      "deposit-simple-age",
+                                      MHD_HTTP_OK),
     TALER_TESTING_cmd_end ()
   };
 
diff --git a/src/testing/testing_api_cmd_deposit.c 
b/src/testing/testing_api_cmd_deposit.c
index b7f7c66c..a80b4486 100644
--- a/src/testing/testing_api_cmd_deposit.c
+++ b/src/testing/testing_api_cmd_deposit.c
@@ -313,6 +313,22 @@ deposit_run (void *cls,
     return;
   }
   ds->is = is;
+  if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time))
+  {
+    struct GNUNET_TIME_Relative refund_deadline;
+
+    refund_deadline
+      = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time);
+    ds->wire_deadline
+      = GNUNET_TIME_relative_to_timestamp (
+          GNUNET_TIME_relative_multiply (refund_deadline,
+                                         2));
+  }
+  else
+  {
+    ds->refund_deadline = ds->wallet_timestamp;
+    ds->wire_deadline = GNUNET_TIME_timestamp_get ();
+  }
   if (NULL != ds->deposit_reference)
   {
     /* We're copying another deposit operation, initialize here. */
@@ -335,6 +351,7 @@ deposit_run (void *cls,
     ds->contract_terms = json_incref (ods->contract_terms);
     ds->wallet_timestamp = ods->wallet_timestamp;
     ds->refund_deadline = ods->refund_deadline;
+    ds->wire_deadline = ods->wire_deadline;
     ds->amount = ods->amount;
     ds->merchant_priv = ods->merchant_priv;
     ds->command_initialized = GNUNET_YES;
@@ -415,23 +432,6 @@ deposit_run (void *cls,
   GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv,
                                       &coin_pub.eddsa_pub);
 
-  if (! GNUNET_TIME_absolute_is_zero (ds->refund_deadline.abs_time))
-  {
-    struct GNUNET_TIME_Relative refund_deadline;
-
-    refund_deadline
-      = GNUNET_TIME_absolute_get_remaining (ds->refund_deadline.abs_time);
-    ds->wire_deadline
-      =
-        GNUNET_TIME_relative_to_timestamp (
-          GNUNET_TIME_relative_multiply (refund_deadline,
-                                         2));
-  }
-  else
-  {
-    ds->refund_deadline = ds->wallet_timestamp;
-    ds->wire_deadline = ds->wallet_timestamp;
-  }
   GNUNET_CRYPTO_eddsa_key_get_public (&ds->merchant_priv.eddsa_priv,
                                       &merchant_pub.eddsa_pub);
   {

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