From 7eef17eae2c261e6b680eeef91f835ccf9f39950 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 6 Oct 2023 21:17:31 +0200 Subject: add coin history test to test suite --- src/testing/test_exchange_api.c | 4 ++++ src/testing/test_kyc_api.c | 8 ++++++++ src/testing/testing_api_cmd_coin_history.c | 8 +++++++- 3 files changed, 19 insertions(+), 1 deletion(-) (limited to 'src/testing') diff --git a/src/testing/test_exchange_api.c b/src/testing/test_exchange_api.c index e3ef5a5bb..b3ea88113 100644 --- a/src/testing/test_exchange_api.c +++ b/src/testing/test_exchange_api.c @@ -1169,6 +1169,10 @@ run (void *cls, "batch-withdraw-coin-1#1", "EUR:1", NULL), + TALER_TESTING_cmd_coin_history ("coin-history-batch-1", + "batch-withdraw-coin-1#0", + "EUR:0.0", + MHD_HTTP_OK), TALER_TESTING_cmd_end () }; diff --git a/src/testing/test_kyc_api.c b/src/testing/test_kyc_api.c index 71f1216a0..b7b28985c 100644 --- a/src/testing/test_kyc_api.c +++ b/src/testing/test_kyc_api.c @@ -294,6 +294,10 @@ run (void *cls, "p2p_withdraw-coin-1", "EUR:1.01", NULL), + TALER_TESTING_cmd_coin_history ("coin-history-purse-with-deposit", + "p2p_withdraw-coin-1#0", + "EUR:3.99", + MHD_HTTP_OK), TALER_TESTING_cmd_purse_poll ( "push-poll-purse-before-merge", MHD_HTTP_OK, @@ -388,6 +392,10 @@ run (void *cls, "p2p_withdraw-coin-1", "EUR:1.01", NULL), + TALER_TESTING_cmd_coin_history ("coin-history-purse-pull-deposit", + "p2p_withdraw-coin-1#0", + "EUR:2.98", + MHD_HTTP_OK), TALER_TESTING_cmd_purse_poll_finish ( "pull-deposit-purse-poll-finish", GNUNET_TIME_relative_multiply ( diff --git a/src/testing/testing_api_cmd_coin_history.c b/src/testing/testing_api_cmd_coin_history.c index b6b404f90..2de125932 100644 --- a/src/testing/testing_api_cmd_coin_history.c +++ b/src/testing/testing_api_cmd_coin_history.c @@ -302,12 +302,18 @@ coin_history_cb (void *cls, TALER_TESTING_interpreter_fail (ss->is); return; } - if (0 >= + if (0 > TALER_amount_subtract (&hbal, &total_in, &total_out)) { GNUNET_break (0); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Coin credits: %s\n", + TALER_amount2s (&total_in)); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Coin debits: %s\n", + TALER_amount2s (&total_out)); TALER_TESTING_interpreter_fail (ss->is); return; } -- cgit v1.2.3