gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] [taler-exchange] branch master updated (8ec523a -> e94e8c3)


From: gnunet
Subject: [GNUnet-SVN] [taler-exchange] branch master updated (8ec523a -> e94e8c3)
Date: Thu, 17 May 2018 13:11:22 +0200

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

marcello pushed a change to branch master
in repository exchange.

    from 8ec523a  Triggering 409 Conflict for /refresh/reveal
     new 7a1bb2b  prepare ground to refund twist-tests.
     new 776f222  Adding the refund CMD, genuine for now, to be evil-tuned.
     new e5ec16b  trigger refund fee currency missmatch.
     new 920462e  Trigger above-amount error
     new b898399  Trigger invalid merchant signature on refund
     new e94e8c3  Trigger deposit to refund not found

The 6 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/exchange-lib/test_exchange_api_twisted.c | 98 ++++++++++++++++++++++++++++
 src/exchange/taler-exchange-httpd_refund.c   |  1 +
 2 files changed, 99 insertions(+)

diff --git a/src/exchange-lib/test_exchange_api_twisted.c 
b/src/exchange-lib/test_exchange_api_twisted.c
index 762f124..6b044a8 100644
--- a/src/exchange-lib/test_exchange_api_twisted.c
+++ b/src/exchange-lib/test_exchange_api_twisted.c
@@ -198,6 +198,104 @@ run (void *cls,
        "refresh-melt",
        MHD_HTTP_CONFLICT),
 
+       /* 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"),
+
+    CMD_EXEC_WIREWATCH
+      ("wirewatch-r1"),
+
+    TALER_TESTING_cmd_withdraw_amount
+      ("withdraw-coin-r1",
+       is->exchange,
+       "create-reserve-r1",
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_deposit
+      ("deposit-refund-1",
+       is->exchange,
+       "withdraw-coin-r1",
+       0,
+       TALER_TESTING_make_wire_details
+         (42,
+          fakebank_url),
+       "{\"items\":[{\"name\":\"ice cream\","
+                    "\"value\":\"EUR:5\"}]}",
+       GNUNET_TIME_UNIT_MINUTES,
+       "EUR:5",
+       MHD_HTTP_OK),
+
+    TALER_TESTING_cmd_modify_object_ul
+      ("hack-currency",
+       CONFIG_FILE,
+       /* Will make currency missmatch */
+       "refund_amount",
+       "USD:5"),
+
+    TALER_TESTING_cmd_refund
+      ("refund-currency-missmatch",
+       MHD_HTTP_BAD_REQUEST,
+       "EUR:5",
+       "EUR:0.01",
+       "deposit-refund-1"),
+
+    TALER_TESTING_cmd_refund
+      ("refund-above-amount",
+       MHD_HTTP_BAD_REQUEST,
+       "EUR:5",
+       "EUR:10",
+       "deposit-refund-1"),
+
+    TALER_TESTING_cmd_flip_upload
+      ("flip-upload",
+       CONFIG_FILE,
+       "merchant_sig"),
+
+    TALER_TESTING_cmd_refund
+      ("refund-bad-sig",
+       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]