aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_exchange_api_revocation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:33 +0100
committerChristian Grothoff <christian@grothoff.org>2021-12-25 13:56:40 +0100
commit87376e02eba3f5c2cf83a493446dee0c300565a4 (patch)
tree18103edb2bdf2b29a773cce2de596b06d8265abb /src/testing/test_exchange_api_revocation.c
parent2c14d338704f4574055c4b5c51d8a79dd2e22345 (diff)
downloadexchange-87376e02eba3f5c2cf83a493446dee0c300565a4.tar.xz
protocol v12 changes (/recoup split, signature changes) plus database sharding plus O(n^2)=>O(n) worst-case complexity reduction on coin balance checks
Diffstat (limited to 'src/testing/test_exchange_api_revocation.c')
-rw-r--r--src/testing/test_exchange_api_revocation.c92
1 files changed, 45 insertions, 47 deletions
diff --git a/src/testing/test_exchange_api_revocation.c b/src/testing/test_exchange_api_revocation.c
index 1a334a71b..0531c5b83 100644
--- a/src/testing/test_exchange_api_revocation.c
+++ b/src/testing/test_exchange_api_revocation.c
@@ -135,11 +135,11 @@ run (void *cls,
"refresh-melt-1",
MHD_HTTP_OK),
/* Try to recoup before it's allowed */
- TALER_TESTING_cmd_recoup ("recoup-not-allowed",
- MHD_HTTP_GONE,
- "refresh-reveal-1#0",
- "refresh-melt-1",
- "EUR:0.1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-not-allowed",
+ MHD_HTTP_GONE,
+ "refresh-reveal-1#0",
+ "refresh-melt-1",
+ "EUR:0.1"),
/* Make refreshed coin invalid */
TALER_TESTING_cmd_revoke ("revoke-2-EUR:5",
MHD_HTTP_OK,
@@ -154,45 +154,44 @@ run (void *cls,
TALER_TESTING_cmd_recoup ("recoup-fully-spent",
MHD_HTTP_CONFLICT,
"withdraw-revocation-coin-2",
- NULL,
"EUR:0.1"),
/* Refund coin to original coin */
- TALER_TESTING_cmd_recoup ("recoup-1a",
- MHD_HTTP_OK,
- "refresh-reveal-1#0",
- "refresh-melt-1",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-1b",
- MHD_HTTP_OK,
- "refresh-reveal-1#1",
- "refresh-melt-1",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-1c",
- MHD_HTTP_OK,
- "refresh-reveal-1#2",
- "refresh-melt-1",
- "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1a",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#0",
+ "refresh-melt-1",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1b",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#1",
+ "refresh-melt-1",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1c",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#2",
+ "refresh-melt-1",
+ "EUR:1"),
/* Repeat recoup to test idempotency */
- TALER_TESTING_cmd_recoup ("recoup-1c",
- MHD_HTTP_OK,
- "refresh-reveal-1#2",
- "refresh-melt-1",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-1c",
- MHD_HTTP_OK,
- "refresh-reveal-1#2",
- "refresh-melt-1",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-1c",
- MHD_HTTP_OK,
- "refresh-reveal-1#2",
- "refresh-melt-1",
- "EUR:1"),
- TALER_TESTING_cmd_recoup ("recoup-1c",
- MHD_HTTP_OK,
- "refresh-reveal-1#2",
- "refresh-melt-1",
- "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1c",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#2",
+ "refresh-melt-1",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1c",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#2",
+ "refresh-melt-1",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1c",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#2",
+ "refresh-melt-1",
+ "EUR:1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-1c",
+ MHD_HTTP_OK,
+ "refresh-reveal-1#2",
+ "refresh-melt-1",
+ "EUR:1"),
/* Now we have EUR:3.83 EUR back after 3x EUR:1 in recoups */
/* Melt original coin AGAIN, but only create one 0.1 EUR coin;
This costs EUR:0.03 in refresh and EUR:01 in withdraw fees,
@@ -219,17 +218,16 @@ run (void *cls,
"withdraw-revocation-coin-1",
CONFIG_FILE),
/* Refund coin EUR:0.1 to original coin, creating zombie! */
- TALER_TESTING_cmd_recoup ("recoup-2",
- MHD_HTTP_OK,
- "refresh-reveal-2",
- "refresh-melt-2",
- "EUR:0.1"),
+ TALER_TESTING_cmd_recoup_refresh ("recoup-2",
+ MHD_HTTP_OK,
+ "refresh-reveal-2",
+ "refresh-melt-2",
+ "EUR:0.1"),
/* Due to recoup, original coin is now at EUR:3.79 */
/* Refund original (now zombie) coin to reserve */
TALER_TESTING_cmd_recoup ("recoup-3",
MHD_HTTP_OK,
"withdraw-revocation-coin-1",
- NULL,
"EUR:3.79"),
/* Check the money is back with the reserve */
TALER_TESTING_cmd_status ("recoup-reserve-status-1",