diff options
author | Christian Blättler <blatc2@bfh.ch> | 2024-06-06 09:15:40 +0200 |
---|---|---|
committer | Christian Blättler <blatc2@bfh.ch> | 2024-06-06 09:15:40 +0200 |
commit | 1c42a82671cbc792a47d4ae7b86aee339dee2041 (patch) | |
tree | 2e2bb90dfca73bb8c7c1e5adfcf166e7a1515b3d /src/testing | |
parent | 44ef77be8ce3ae7bb89f3c10a4f864981f1d0481 (diff) |
add test for double-spending a token
Diffstat (limited to 'src/testing')
-rw-r--r-- | src/testing/test_merchant_api.c | 27 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_pay_order.c | 2 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/testing/test_merchant_api.c b/src/testing/test_merchant_api.c index 9e9025ed..4ac4d96a 100644 --- a/src/testing/test_merchant_api.c +++ b/src/testing/test_merchant_api.c @@ -1729,9 +1729,30 @@ run (void *cls, merchant_url, MHD_HTTP_OK, "create-order-with-input-and-output", - "withdraw-coin-2", - "EUR:5", - "EUR:4.99", + "", + "EUR:0", + "EUR:0", + NULL, + 0, + "pay-order-with-output"), + TALER_TESTING_cmd_merchant_post_orders_choices ("create-another-order-with-input-and-output", + cred.cfg, + merchant_url, + MHD_HTTP_OK, + "create-tokenfamily", + 1, + 1, + "5-input-output-2", + GNUNET_TIME_UNIT_ZERO_TS, + GNUNET_TIME_UNIT_FOREVER_TS, + "EUR:0.0"), + TALER_TESTING_cmd_merchant_pay_order_choices ("double-spend-token", + merchant_url, + MHD_HTTP_CONFLICT, + "create-another-order-with-input-and-output", + "", + "EUR:0", + "EUR:0", NULL, 0, "pay-order-with-output"), diff --git a/src/testing/testing_api_cmd_pay_order.c b/src/testing/testing_api_cmd_pay_order.c index a356d327..dbcb5b24 100644 --- a/src/testing/testing_api_cmd_pay_order.c +++ b/src/testing/testing_api_cmd_pay_order.c @@ -300,7 +300,7 @@ build_coins (struct TALER_MERCHANT_PayCoin **pc, /* Token syntax is "LABEL[/NUMBER]" */ ctok = strchr (token, '/'); - // TODO: Check why this is not used? + // TODO: Check why ci variable is parsed but not used? ci = 0; if (NULL != ctok) { |