gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-merchant] 01/02: to the point where a double-spend i


From: gnunet
Subject: [GNUnet-SVN] [taler-merchant] 01/02: to the point where a double-spend is triggered.
Date: Thu, 22 Mar 2018 19:45:52 +0100

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

marcello pushed a commit to branch master
in repository merchant.

commit ecf859b65b5c7d497b234a45833fadf1bae62532
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu Mar 22 19:10:03 2018 +0100

    to the point where a double-spend is triggered.
---
 src/lib/test_merchant_api_twisted.c | 77 +++++++++++++++++++++++++++++++++++++
 1 file changed, 77 insertions(+)

diff --git a/src/lib/test_merchant_api_twisted.c 
b/src/lib/test_merchant_api_twisted.c
index fe5c737..d28d485 100644
--- a/src/lib/test_merchant_api_twisted.c
+++ b/src/lib/test_merchant_api_twisted.c
@@ -562,6 +562,8 @@ run (void *cls,
                          \"value\":\"{EUR:3}\"} ] }",
         NULL),
 
+    /* Will only pay _half_ the supposed price,
+     * so we'll then have the right to abort.  */
     TALER_TESTING_cmd_pay ("deposit-simple-for-abort",
                            twister_merchant_url,
                            is->ctx,
@@ -615,6 +617,81 @@ run (void *cls,
                                  "deposit-simple-for-abort",
                                  is->ctx,
                                  0),
+
+    CMD_TRANSFER_TO_EXCHANGE ("create-reserve-double-spend",
+                              "EUR:1.01"),
+
+    CMD_EXEC_WIREWATCH ("wirewatch-double-spend"),
+
+    TALER_TESTING_cmd_proposal
+      ("create-proposal-double-spend",
+       twister_merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "{\"max_fee\":\
+          {\"currency\":\"EUR\",\
+           \"value\":0,\
+           \"fraction\":50000000},\
+        \"order_id\":\"DS-1\",\
+        \"refund_deadline\":\"\\/Date(0)\\/\",\
+        \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+        \"fulfillment_url\": \"https://example.com/\",\
+        \"amount\":\
+          {\"currency\":\"EUR\",\
+           \"value\":1,\
+           \"fraction\":0},\
+        \"summary\": \"merchant-lib testcase\",\
+        \"products\": [ {\"description\": \"will succeed\"}] }",
+        NULL),
+
+    TALER_TESTING_cmd_proposal
+      ("create-proposal-double-spend-1",
+       twister_merchant_url,
+       is->ctx,
+       MHD_HTTP_OK,
+       "{\"max_fee\":\
+          {\"currency\":\"EUR\",\
+           \"value\":0,\
+           \"fraction\":50000000},\
+        \"order_id\":\"DS-2\",\
+        \"refund_deadline\":\"\\/Date(0)\\/\",\
+        \"pay_deadline\":\"\\/Date(99999999999)\\/\",\
+        \"fulfillment_url\": \"https://example.com/\",\
+        \"amount\":\
+          {\"currency\":\"EUR\",\
+           \"value\":1,\
+           \"fraction\":0},\
+        \"summary\": \"merchant-lib testcase\",\
+        \"products\": [ {\"description\": \"will fail\"}] }",
+        NULL),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-double-spend",
+       is->exchange,
+       "create-reserve-double-spend",
+       "EUR:1",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_pay ("deposit-simple-ok",
+                           twister_merchant_url,
+                           is->ctx,
+                           MHD_HTTP_OK,
+                           "create-proposal-double-spend",
+                           "withdraw-coin-double-spend",
+                           "EUR:1",
+                           "EUR:1.99", // no sense now
+                           "EUR:0.01"), // no sense now
+
+    TALER_TESTING_cmd_pay ("deposit-simple-fail",
+                           twister_merchant_url,
+                           is->ctx,
+                           MHD_HTTP_FORBIDDEN,
+                           "create-proposal-double-spend-1",
+                           "withdraw-coin-double-spend",
+                           "EUR:1",
+                           "EUR:1.99", // no sense now
+                           "EUR:0.01"), // no sense now
+
     /**
      * End the suite.  Fixme: better to have a label for this
      * too, as it shows a "(null)" token on logs.

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



reply via email to

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