aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-03-27 12:30:40 +0100
committerChristian Grothoff <christian@grothoff.org>2020-03-27 12:30:40 +0100
commit0ebbea705fa7b20dfbe0479e668df36bc0d7da5f (patch)
treebec128226c24c13f261d3d5d3c30cba7a77deaa9 /src
parent31746d812837b64e1c6ba345efd6d59764e0c4dc (diff)
parent0a047c155ac8f572db0c7184cc491092c724c5c5 (diff)
Merge branch 'master' of git+ssh://git.taler.net/exchange
Diffstat (limited to 'src')
-rw-r--r--src/testing/test_exchange_api_revocation.c35
1 files changed, 32 insertions, 3 deletions
diff --git a/src/testing/test_exchange_api_revocation.c b/src/testing/test_exchange_api_revocation.c
index 05ec06b16..f91d8b548 100644
--- a/src/testing/test_exchange_api_revocation.c
+++ b/src/testing/test_exchange_api_revocation.c
@@ -63,15 +63,15 @@ run (void *cls,
{
struct TALER_TESTING_Command revocation[] = {
/**
- * Fill reserve with EUR:5.01, as withdraw fee is 1 ct per
+ * Fill reserve with EUR:10.02, as withdraw fee is 1 ct per
* config.
*/
TALER_TESTING_cmd_admin_add_incoming ("create-reserve-1",
- "EUR:5.01",
+ "EUR:10.02",
&bc.exchange_auth,
bc.user42_payto),
TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-1",
- "EUR:5.01",
+ "EUR:10.02",
bc.user42_payto,
bc.exchange_payto,
"create-reserve-1"),
@@ -85,6 +85,11 @@ run (void *cls,
"create-reserve-1",
"EUR:5",
MHD_HTTP_OK),
+ /* Withdraw another 5 EUR coin, at fee of 1 ct */
+ TALER_TESTING_cmd_withdraw_amount ("withdraw-revocation-coin-2",
+ "create-reserve-1",
+ "EUR:5",
+ MHD_HTTP_OK),
/* Try to partially spend (deposit) 1 EUR of the 5 EUR coin (in full)
* (merchant would receive EUR:0.99 due to 1 ct deposit fee) *///
TALER_TESTING_cmd_deposit ("deposit-partial",
@@ -95,6 +100,15 @@ run (void *cls,
GNUNET_TIME_UNIT_ZERO,
"EUR:1",
MHD_HTTP_OK),
+ /* Deposit another coin in full */
+ TALER_TESTING_cmd_deposit ("deposit-full",
+ "withdraw-revocation-coin-2",
+ 0,
+ bc.user42_payto,
+ "{\"items\":[{\"name\":\"ice cream\",\"value\":\"EUR:5\"}]}",
+ GNUNET_TIME_UNIT_ZERO,
+ "EUR:5",
+ MHD_HTTP_OK),
/**
* Melt SOME of the rest of the coin's value
* (EUR:3.17 = 3x EUR:1.03 + 7x EUR:0.13) */
@@ -108,11 +122,26 @@ run (void *cls,
TALER_TESTING_cmd_refresh_reveal ("refresh-reveal-1",
"refresh-melt-1",
MHD_HTTP_OK),
+ /* Try to recoup before it's allowed */
+ TALER_TESTING_cmd_recoup ("recoup-not-allowed",
+ MHD_HTTP_NOT_FOUND,
+ "refresh-reveal-1#0",
+ "refresh-melt-1"),
/* Make refreshed coin invalid */
TALER_TESTING_cmd_revoke ("revoke-2-EUR:5",
MHD_HTTP_OK,
"refresh-melt-1",
CONFIG_FILE),
+ /* Also make fully spent coin invalid (should be same denom) */
+ TALER_TESTING_cmd_revoke ("revoke-2-EUR:5",
+ MHD_HTTP_OK,
+ "withdraw-revocation-coin-2",
+ CONFIG_FILE),
+ /* Refund fully spent coin (which should fail) */
+ TALER_TESTING_cmd_recoup ("recoup-fully-spent",
+ MHD_HTTP_CONFLICT,
+ "withdraw-revocation-coin-2",
+ NULL),
/* Refund coin to original coin */
TALER_TESTING_cmd_recoup ("recoup-1a",
MHD_HTTP_OK,