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 (4a06127 -> 8239e50)


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] branch master updated (4a06127 -> 8239e50)
Date: Tue, 03 Jul 2018 12:58:47 +0200

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

marcello pushed a change to branch master
in repository merchant.

    from 4a06127  detect --help option under sub-command.
     new a670cee  fix amounts/orders definition
     new 8239e50  merge data from former "alt" generator into melted version.

The 2 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/merchant-tools/taler-merchant-benchmark.c | 203 +++++++++++++++++++-------
 1 file changed, 152 insertions(+), 51 deletions(-)

diff --git a/src/merchant-tools/taler-merchant-benchmark.c 
b/src/merchant-tools/taler-merchant-benchmark.c
index 35818f9..da5aef7 100644
--- a/src/merchant-tools/taler-merchant-benchmark.c
+++ b/src/merchant-tools/taler-merchant-benchmark.c
@@ -62,6 +62,7 @@ enum PaymentGeneratorError {
 
 #define FIRST_INSTRUCTION -1
 #define TRACKS_INSTRUCTION 9
+#define TWOCOINS_INSTRUCTION 5
 
 #define CMD_TRANSFER_TO_EXCHANGE(label,amount) \
    TALER_TESTING_cmd_fakebank_transfer (label, amount, \
@@ -175,8 +176,17 @@ static char *currency;
  */
 
 #define ALLOCATE_AMOUNTS(...) \
-  GNUNET_asprintf (&CURRENCY_25_05, \
-                   "%s:25.05", \
+  char *CURRENCY_10_02; \
+  char *CURRENCY_10; \
+  char *CURRENCY_9_98; \
+  char *CURRENCY_5_01; \
+  char *CURRENCY_5; \
+  char *CURRENCY_4_99; \
+  char *CURRENCY_0_02; \
+  char *CURRENCY_0_01; \
+  \
+  GNUNET_asprintf (&CURRENCY_10_02, \
+                   "%s:10.02", \
                    currency); \
   GNUNET_asprintf (&CURRENCY_10, \
                    "%s:10", \
@@ -184,6 +194,12 @@ static char *currency;
   GNUNET_asprintf (&CURRENCY_9_98, \
                    "%s:9.98", \
                    currency); \
+  GNUNET_asprintf (&CURRENCY_10_02, \
+                   "%s:9.98", \
+                   currency); \
+  GNUNET_asprintf (&CURRENCY_5_01, \
+                   "%s:5.01", \
+                   currency); \
   GNUNET_asprintf (&CURRENCY_5, \
                    "%s:5", \
                    currency); \
@@ -198,6 +214,11 @@ static char *currency;
                    currency);
 
 #define ALLOCATE_ORDERS(...) \
+  char *order_worth_5; \
+  char *order_worth_5_track; \
+  char *order_worth_5_unaggregated; \
+  char *order_worth_10_2coins; \
+  \
   GNUNET_asprintf \
     (&order_worth_5, \
      "{\"max_fee\":\
@@ -218,7 +239,7 @@ static char *currency;
      currency, \
      currency); \
   GNUNET_asprintf \
-    (&order_worth_10_2coins, \
+    (&order_worth_5_track, \
      "{\"max_fee\":\
        {\"currency\":\"%s\",\
         \"value\":0,\
@@ -227,36 +248,37 @@ static char *currency;
        \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
        \"amount\":\
          {\"currency\":\"%s\",\
-          \"value\":10,\
+          \"value\":5,\
           \"fraction\":0},\
-        \"summary\": \"2-coins untracked payment\",\
+        \"summary\": \"ice track cream!\",\
         \"fulfillment_url\": \"https://example.com/\",\
-        \"products\": [ {\"description\":\"2-coins payment\",\
-                         \"value\":\"{%s:10}\"} ] }", \
+        \"products\": [ {\"description\":\"ice track cream\",\
+                         \"value\":\"{%s:5}\"} ] }", \
      currency, \
      currency, \
      currency); \
   GNUNET_asprintf \
-    (&order_worth_5_track, \
+    (&order_worth_5_unaggregated, \
      "{\"max_fee\":\
        {\"currency\":\"%s\",\
         \"value\":0,\
         \"fraction\":50000000},\
-       \"refund_deadline\":\"\\/Date(0)\\/\",\
-       \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+       \"wire_transfer_delay\":\"\\/Delay(30000)\\/\",\
+       \"refund_deadline\":\"\\/Date(22)\\/\",\
+       \"pay_deadline\":\"\\/Date(1)\\/\",\
        \"amount\":\
          {\"currency\":\"%s\",\
           \"value\":5,\
           \"fraction\":0},\
-        \"summary\": \"ice track cream!\",\
+        \"summary\": \"unaggregated deposit!\",\
         \"fulfillment_url\": \"https://example.com/\",\
-        \"products\": [ {\"description\":\"ice track cream\",\
+        \"products\": [ {\"description\":\"unaggregated cream\",\
                          \"value\":\"{%s:5}\"} ] }", \
      currency, \
      currency, \
      currency); \
   GNUNET_asprintf \
-    (&order_worth_5_unaggregated, \
+    (&order_worth_10_2coins, \
      "{\"max_fee\":\
        {\"currency\":\"%s\",\
         \"value\":0,\
@@ -265,16 +287,17 @@ static char *currency;
        \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
        \"amount\":\
          {\"currency\":\"%s\",\
-          \"value\":5,\
+          \"value\":10,\
           \"fraction\":0},\
-        \"summary\": \"unaggregated deposit!\",\
+        \"summary\": \"2-coins payment\",\
         \"fulfillment_url\": \"https://example.com/\",\
-        \"products\": [ {\"description\":\"unaggregated cream\",\
-                         \"value\":\"{%s:5}\"} ] }", \
+        \"products\": [ {\"description\":\"2-coins payment\",\
+                         \"value\":\"{%s:10}\"} ] }", \
      currency, \
      currency, \
      currency);
 
+
 /**
  * Actual commands collection.
  */
@@ -283,47 +306,31 @@ run (void *cls,
      struct TALER_TESTING_Interpreter *is)
 {
 
-  /* Currency strings.  */
-  char *CURRENCY_25_05;
-  char *CURRENCY_10;
-  char *CURRENCY_9_98;
-  char *CURRENCY_5;
-  char *CURRENCY_4_99;
-  char *CURRENCY_0_02;
-  char *CURRENCY_0_01;
+  /* Will be freed by testing-lib.  */
+  GNUNET_assert
+    (GNUNET_OK == GNUNET_CURL_append_header
+      (is->ctx, APIKEY_SANDBOX));
 
   ALLOCATE_AMOUNTS
-    (CURRENCY_25_05,
-     CURRENCY_10,
-     CURRENCY_9_98,
-     CURRENCY_5,
-     CURRENCY_4_99,
-     CURRENCY_0_02,
-     CURRENCY_0_01);
-
-
-  /* Orders.  */
-  char *order_worth_5;
-  char *order_worth_10_2coins;
-  char *order_worth_5_track;
-  char *order_worth_5_unaggregated;
+      (CURRENCY_10_02,
+       CURRENCY_9_98,
+       CURRENCY_5_01,
+       CURRENCY_5,
+       CURRENCY_4_99,
+       CURRENCY_0_02,
+       CURRENCY_0_01);
 
   ALLOCATE_ORDERS
     (order_worth_5,
-     order_worth_10_2coins,
      order_worth_5_track,
-     order_worth_5_unaggregated);
+     order_worth_5_unaggregated,
+     order_worth_10_2coins);
 
-  /* Will be freed by testing-lib.  */
-  GNUNET_assert
-    (GNUNET_OK == GNUNET_CURL_append_header
-      (is->ctx, APIKEY_SANDBOX));
-
-  struct TALER_TESTING_Command corner_commands[] = {
+  struct TALER_TESTING_Command ordinary_commands[] = {
 
     CMD_TRANSFER_TO_EXCHANGE
       ("create-reserve-1",
-       CURRENCY_25_05),
+       CURRENCY_10_02),
 
     TALER_TESTING_cmd_exec_wirewatch
       ("wirewatch-1",
@@ -418,6 +425,101 @@ run (void *cls,
     TALER_TESTING_cmd_end ()
   };
 
+  struct TALER_TESTING_Command corner_commands[] = {
+
+    CMD_TRANSFER_TO_EXCHANGE
+      ("create-reserve-1",
+       CURRENCY_5_01),
+
+    TALER_TESTING_cmd_exec_wirewatch
+      ("wirewatch-1",
+       cfg_filename),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-1",
+       is->exchange,
+       "create-reserve-1",
+       CURRENCY_5,
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_proposal
+      ("create-unaggregated-proposal",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       order_worth_5_unaggregated,
+       alt_instance),
+
+    TALER_TESTING_cmd_pay
+      ("deposit-unaggregated",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "create-unaggregated-proposal",
+       "withdraw-coin-1",
+       CURRENCY_5,
+       CURRENCY_4_99,
+       CURRENCY_0_01),
+
+    TALER_TESTING_cmd_rewind_ip
+      ("rewind-unaggregated",
+       FIRST_INSTRUCTION,
+       &unaggregated_number),
+
+    CMD_TRANSFER_TO_EXCHANGE
+      ("create-reserve-2",
+       CURRENCY_10_02),
+
+    TALER_TESTING_cmd_exec_wirewatch
+      ("wirewatch-2",
+       cfg_filename),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-2",
+       is->exchange,
+       "create-reserve-2",
+       CURRENCY_5,
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-3",
+       is->exchange,
+       "create-reserve-2",
+       CURRENCY_5,
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_proposal
+      ("create-twocoins-proposal",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       order_worth_10_2coins,
+       NULL),
+
+    TALER_TESTING_cmd_pay
+      ("deposit-twocoins",
+       merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "create-twocoins-proposal",
+       "withdraw-coin-2;withdraw-coin-3",
+       CURRENCY_10,
+       CURRENCY_9_98,
+       CURRENCY_0_02),
+
+    TALER_TESTING_cmd_exec_aggregator
+      ("aggregate-twocoins",
+       cfg_filename),
+
+    TALER_TESTING_cmd_rewind_ip
+      ("rewind-twocoins",
+       TWOCOINS_INSTRUCTION,
+       &twocoins_number),
+
+    TALER_TESTING_cmd_end ()
+  };
+
+
   if (GNUNET_OK == ordinary)
     TALER_TESTING_run (is,
                        ordinary_commands);
@@ -427,7 +529,8 @@ run (void *cls,
                        corner_commands);
   TALER_LOG_ERROR ("Neither ordinary or corner payments"
                    " were specified to be run.\n");
-  return 1;
+
+  result = 1;
 }
 
 /**
@@ -665,8 +768,6 @@ main (int argc,
     return 1;  
   }
 
-  return 0;
-
   if (NULL == cfg_filename)
     cfg_filename = (char *) default_config_file;
 

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



reply via email to

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