gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] 06/06: Trigger deposit to refund not found


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] 06/06: Trigger deposit to refund not found
Date: Thu, 17 May 2018 13:11:28 +0200

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

marcello pushed a commit to branch master
in repository exchange.

commit e94e8c34c58343001dfe84ed8f5a87f1516c687d
Author: Marcello Stanisci <address@hidden>
AuthorDate: Thu May 17 13:07:56 2018 +0200

    Trigger deposit to refund not found
---
 src/exchange-lib/test_exchange_api_twisted.c | 39 ++++++++++++++++++++++++----
 src/exchange/taler-exchange-httpd_refund.c   |  1 +
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/src/exchange-lib/test_exchange_api_twisted.c 
b/src/exchange-lib/test_exchange_api_twisted.c
index 369aaba..6b044a8 100644
--- a/src/exchange-lib/test_exchange_api_twisted.c
+++ b/src/exchange-lib/test_exchange_api_twisted.c
@@ -198,14 +198,15 @@ run (void *cls,
        "refresh-melt",
        MHD_HTTP_CONFLICT),
 
-       /* Next chunk, refund conflicts (contract hash missmatch,
-                                        original deposit does not exist,
-                                        currency missmatch);
+       /* Next chunk, refund conflicts
+       
+         (contract hash missmatch [!],
+          original deposit does not exist,
+          currency missmatch) V;
           
           'refund_transaction()' has many of the relevant cases;
        */
 
-
     CMD_TRANSFER_TO_EXCHANGE
       ("create-reserve-r1",
        "EUR:5.01"),
@@ -262,11 +263,39 @@ run (void *cls,
 
     TALER_TESTING_cmd_refund
       ("refund-bad-sig",
-       MHD_HTTP_BAD_REQUEST,
+       MHD_HTTP_UNAUTHORIZED,
        "EUR:5",
        "EUR:0.01",
        "deposit-refund-1"),
 
+    /* This deposit CMD is used to provide "good" traits
+     * to the next refund CMD, where 'good' means that the
+     * POST /refund will pass the signature verification,
+     * but the handler will then NOT judge the deposit as
+     * refundable - actually it won't be found since it will
+     * fail as double-spending attempt.  */
+
+    TALER_TESTING_cmd_deposit
+      ("deposit-refund-to-fail",
+       is->exchange,
+       "withdraw-coin-r1",
+       0, /* coin index.  */
+       TALER_TESTING_make_wire_details
+         (42,
+          fakebank_url),
+       "{\"items\":[{\"name\":\"ice skate\","
+                    "\"value\":\"EUR:5\"}]}",
+       GNUNET_TIME_UNIT_MINUTES,
+       "EUR:5",
+       MHD_HTTP_FORBIDDEN),
+
+    TALER_TESTING_cmd_refund
+      ("refund-deposit-not-found",
+       MHD_HTTP_BAD_REQUEST,
+       "EUR:5",
+       "EUR:0.01",
+       "deposit-refund-to-fail"),
+
     TALER_TESTING_cmd_end ()
   };
 
diff --git a/src/exchange/taler-exchange-httpd_refund.c 
b/src/exchange/taler-exchange-httpd_refund.c
index 97cd935..8d573e4 100644
--- a/src/exchange/taler-exchange-httpd_refund.c
+++ b/src/exchange/taler-exchange-httpd_refund.c
@@ -243,6 +243,7 @@ refund_transaction (void *cls,
   /* handle if deposit was NOT found */
   if (GNUNET_NO == deposit_found)
   {
+    TALER_LOG_WARNING ("Deposit to /refund was not found\n");
     TEH_plugin->free_coin_transaction_list (TEH_plugin->cls,
                                             tl);
     *mhd_ret = TEH_RESPONSE_reply_transaction_unknown (connection,

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



reply via email to

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