aboutsummaryrefslogtreecommitdiff
path: root/src/testing/test_exchange_p2p.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-05-16 14:01:04 +0200
committerChristian Grothoff <christian@grothoff.org>2022-05-16 14:01:04 +0200
commitd803d86bf9c69947f6b6e37caf8800abbd24135f (patch)
treed3cd6136083d8a18a45a93f387b3978ba34a036b /src/testing/test_exchange_p2p.c
parent3db8f0f22d0a7c1710b4c4f9097103b124c58971 (diff)
downloadexchange-d803d86bf9c69947f6b6e37caf8800abbd24135f.tar.xz
-work purse_deposit conflict handling
Diffstat (limited to 'src/testing/test_exchange_p2p.c')
-rw-r--r--src/testing/test_exchange_p2p.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testing/test_exchange_p2p.c b/src/testing/test_exchange_p2p.c
index e4d6f5b2f..b3e98daa4 100644
--- a/src/testing/test_exchange_p2p.c
+++ b/src/testing/test_exchange_p2p.c
@@ -112,6 +112,8 @@ run (void *cls,
*/
CMD_TRANSFER_TO_EXCHANGE ("create-reserve-1",
"EUR:5.01"),
+ CMD_TRANSFER_TO_EXCHANGE ("create-reserve-2",
+ "EUR:5.01"),
TALER_TESTING_cmd_reserve_poll ("poll-reserve-1",
"create-reserve-1",
"EUR:5.01",
@@ -122,6 +124,11 @@ run (void *cls,
bc.user42_payto,
bc.exchange_payto,
"create-reserve-1"),
+ TALER_TESTING_cmd_check_bank_admin_transfer ("check-create-reserve-2",
+ "EUR:5.01",
+ bc.user42_payto,
+ bc.exchange_payto,
+ "create-reserve-2"),
/**
* Make a reserve exist, according to the previous
* transfer.
@@ -193,6 +200,13 @@ run (void *cls,
"EUR:1",
MHD_HTTP_OK),
#endif
+ /* Test conflicting merge */
+ TALER_TESTING_cmd_purse_merge (
+ "purse-merge-into-reserve",
+ MHD_HTTP_CONFLICT,
+ "push-get-contract",
+ "create-reserve-2"),
+
TALER_TESTING_cmd_end ()
};
struct TALER_TESTING_Command pull[] = {
@@ -242,6 +256,24 @@ run (void *cls,
"EUR:2",
MHD_HTTP_OK),
#endif
+ /* create 2nd purse for a deposit conflict */
+ TALER_TESTING_cmd_purse_create_with_reserve (
+ "purse-create-with-reserve-2",
+ MHD_HTTP_OK,
+ "{\"amount\":\"EUR:4\",\"summary\":\"beer\"}",
+ true /* upload contract */,
+ GNUNET_TIME_UNIT_MINUTES, /* expiration */
+ "create-reserve-1"),
+#if FIXME_RESERVE_HISTORY
+ TALER_TESTING_cmd_purse_deposit_coins (
+ "purse-deposit-coins-conflict",
+ MHD_HTTP_CONFLICT,
+ 0 /* min age */,
+ "purse-create-with-reserve-2",
+ "withdraw-coin-1",
+ "EUR:4.01",
+ NULL),
+#endif
TALER_TESTING_cmd_end ()
};