exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 7eef17eae2c261e6b680eeef91f835ccf9f39950
parent a2313bd41e8f695ea56568ca279aa70f1018822e
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Fri,  6 Oct 2023 21:17:31 +0200

add coin history test to test suite

Diffstat:
Msrc/testing/test_exchange_api.c | 4++++
Msrc/testing/test_kyc_api.c | 8++++++++
Msrc/testing/testing_api_cmd_coin_history.c | 8+++++++-
3 files changed, 19 insertions(+), 1 deletion(-)

diff --git 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 @@ -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 @@ -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; }