[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
- [GNUnet-SVN] [taler-exchange] branch master updated (8ec523a -> e94e8c3), gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 03/06: trigger refund fee currency missmatch., gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 01/06: prepare ground to refund twist-tests., gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 05/06: Trigger invalid merchant signature on refund, gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 02/06: Adding the refund CMD, genuine for now, to be evil-tuned., gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 04/06: Trigger above-amount error, gnunet, 2018/05/17
- [GNUnet-SVN] [taler-exchange] 06/06: Trigger deposit to refund not found,
gnunet <=