gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] branch master updated (dbadf34 -> 77fd7e5)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (dbadf34 -> 77fd7e5)
Date: Tue, 25 Jul 2017 16:53:30 +0200

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

marcello pushed a change to branch master
in repository merchant.

    from dbadf34  moving proposal mark-as-paid in the right place (= after 
exchange confirmation of all deposited coins)
     new 1a93081  do not use hugely futuristic time while testing /history
     new 5fc7324  Checking that a contract whose payment didn't get through 
doesn't belong to /history response.
     new b490670  comments
     new 77fd7e5  comment

The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 src/lib/test_merchant_api.c | 37 +++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/src/lib/test_merchant_api.c b/src/lib/test_merchant_api.c
index cc193b1..644bc52 100644
--- a/src/lib/test_merchant_api.c
+++ b/src/lib/test_merchant_api.c
@@ -2257,6 +2257,10 @@ interpreter_run (void *cls)
     return;
   }
   case OC_HISTORY:
+    if (0 == cmd->details.history.date.abs_value_us)
+      cmd->details.history.date = GNUNET_TIME_absolute_add
+        (GNUNET_TIME_absolute_get (),
+         GNUNET_TIME_UNIT_HOURS);
     if (NULL == (cmd->details.history.ho
         = TALER_MERCHANT_history (ctx,
                                  MERCHANT_URI,
@@ -2561,7 +2565,26 @@ run (void *cls)
       .details.pay.coin_ref = "withdraw-coin-1",
       .details.pay.amount_with_fee = "EUR:5",
       .details.pay.amount_without_fee = "EUR:4.99" },
-    
+
+    { .oc = OC_HISTORY,
+      .label = "history-0",
+      .expected_response_code = MHD_HTTP_OK,
+      /**
+       * all records to be returned; setting date as 0 lets the
+       * interpreter set it as 'now' + one hour delta, just to
+       * make sure it surpasses the proposal's timestamp.
+       */
+      .details.history.date.abs_value_us = 0,
+      /**
+       * We only expect ONE result (create-proposal-1) to be
+       * included in /history response, because create-proposal-3
+       * did NOT go through because of double spending.
+       */
+      .details.history.nresult = 1,
+      .details.history.start = 10,
+      .details.history.nrows = 10
+    },
+
     /* Fill second reserve with EUR:1 */
     { .oc = OC_ADMIN_ADD_INCOMING,
       .label = "create-reserve-2",
@@ -2710,21 +2733,27 @@ run (void *cls)
     { .oc = OC_HISTORY,
       .label = "history-1",
       .expected_response_code = MHD_HTTP_OK,
-      /*all records to be returned*/
-      .details.history.date.abs_value_us = 99999999999 * 1000LL * 1000LL,
+      .details.history.date.abs_value_us = 0,
+      /**
+       * Now we expect BOTH contracts (create-proposal-{1,2})
+       * to be included in /history response, because
+       * create-proposal-2 has now been correctly paid.
+       */
       .details.history.nresult = 2,
       .details.history.start = 10,
       .details.history.nrows = 10
     },
+
     { .oc = OC_HISTORY,
       .label = "history-2",
       .expected_response_code = MHD_HTTP_OK,
       /*no records returned, time limit too ancient*/
-      .details.history.date.abs_value_us = 0,
+      .details.history.date.abs_value_us = 1,
       .details.history.nresult = 0,
       .details.history.start = 10,
       .details.history.nrows = 10
     },
+
     { .oc = OC_REFUND_INCREASE,
       .label = "refund-increase-1",
       .details.refund_increase.refund_amount = "EUR:0.1",

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



reply via email to

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