diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2023-10-06 21:17:31 +0200 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2023-10-06 21:17:31 +0200 |
commit | 7eef17eae2c261e6b680eeef91f835ccf9f39950 (patch) | |
tree | 152a5c2c0e52eeb9d370cec9cb85ef63f7bc1444 | |
parent | a2313bd41e8f695ea56568ca279aa70f1018822e (diff) |
add coin history test to test suite
-rw-r--r-- | src/testing/test_exchange_api.c | 4 | ||||
-rw-r--r-- | src/testing/test_kyc_api.c | 8 | ||||
-rw-r--r-- | src/testing/testing_api_cmd_coin_history.c | 8 |
3 files changed, 19 insertions, 1 deletions
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; } |