gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 01/02: Reproducing [1] as a test case.


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 01/02: Reproducing [1] as a test case.
Date: Thu, 28 Jun 2018 10:42:14 +0200

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

marcello pushed a commit to branch master
in repository exchange.

commit 48cccb62ca8ccd27216c6d42b2eee5e4689a7922
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Jun 28 10:38:42 2018 +0200

    Reproducing [1] as a test case.
    
    [1] https://gnunet.org/bugs/view.php?id=5366#c13087
---
 src/exchange-lib/test_exchange_api_new.c   | 54 ++++++++++++++++++++++++++++++
 src/exchange-lib/testing_api_cmd_deposit.c |  3 ++
 2 files changed, 57 insertions(+)

diff --git a/src/exchange-lib/test_exchange_api_new.c 
b/src/exchange-lib/test_exchange_api_new.c
index 3b50d70..b0819f8 100644
--- a/src/exchange-lib/test_exchange_api_new.c
+++ b/src/exchange-lib/test_exchange_api_new.c
@@ -457,6 +457,57 @@ run (void *cls,
   };
 
 
+  /**
+   * This block checks whether a wire deadline
+   * very far in the future does NOT get aggregated now.
+   */
+  struct TALER_TESTING_Command unaggregation[] = {
+
+    TALER_TESTING_cmd_check_bank_empty
+      ("far-future-aggregation-a"),
+
+    CMD_TRANSFER_TO_EXCHANGE ("create-reserve-unaggregated",
+                              "EUR:5.01"),
+
+    CMD_EXEC_WIREWATCH ("wirewatch-unaggregated"),
+
+    /* "consume" reserve creation transfer.  */
+    TALER_TESTING_cmd_check_bank_transfer
+      ("check_bank_transfer-unaggregated",
+       exchange_url,
+       "EUR:5.01",
+       42,
+       2),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-unaggregated",
+       is->exchange,
+       "create-reserve-unaggregated",
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_deposit
+      ("deposit-unaggregated",
+       is->exchange,
+       "withdraw-coin-unaggregated",
+       0,
+       TALER_TESTING_make_wire_details
+         (43,
+          fakebank_url),
+       "{\"items\":[{\"name\":\"ice cream\",\"value\":1}]}",
+       GNUNET_TIME_UNIT_FOREVER_REL,
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    CMD_EXEC_AGGREGATOR ("aggregation-attempt"),
+
+    TALER_TESTING_cmd_check_bank_empty
+      ("far-future-aggregation-b"),
+
+    TALER_TESTING_cmd_end ()
+  };
+
+
   struct TALER_TESTING_Command refund[] = {
 
     /**
@@ -839,6 +890,9 @@ run (void *cls,
     TALER_TESTING_cmd_batch ("track",
                              track),
 
+    TALER_TESTING_cmd_batch ("unaggregation",
+                             unaggregation),
+
     TALER_TESTING_cmd_batch ("refund",
                              refund),
 
diff --git a/src/exchange-lib/testing_api_cmd_deposit.c 
b/src/exchange-lib/testing_api_cmd_deposit.c
index d5c0542..07895c1 100644
--- a/src/exchange-lib/testing_api_cmd_deposit.c
+++ b/src/exchange-lib/testing_api_cmd_deposit.c
@@ -225,6 +225,9 @@ deposit_run (void *cls,
   ds->merchant_priv.eddsa_priv = *merchant_priv;
   GNUNET_free (merchant_priv);
 
+  /* FIXME: this looks very odd: why take times as relatives,
+   * just to convert them to absolutes soon after? */
+
   if (0 != ds->refund_deadline.rel_value_us)
   {
     refund_deadline = GNUNET_TIME_relative_to_absolute

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]