expand DB test to cover #6124 better (passed immediately, does not explain the failure)

This commit is contained in:
Christian Grothoff 2020-03-14 19:45:43 +01:00
parent d9c3627bc5
commit 6aca928cf8
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
2 changed files with 34 additions and 10 deletions

View File

@ -260,6 +260,7 @@ withdraw_transaction (void *cls,
char *amount_required;
char *r_balance;
struct TALER_EXCHANGEDB_ReserveHistory *rh;
/* The reserve does not have the required amount (actual
* amount + withdraw fee) */
GNUNET_break_op (0);

View File

@ -1656,16 +1656,39 @@ run (void *cls)
plugin->ensure_coin_known (plugin->cls,
session,
&deposit.coin));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_recoup_request (plugin->cls,
session,
&reserve_pub,
&deposit.coin,
&coin_sig,
&coin_blind,
&value,
&cbc.h_coin_envelope,
deadline));
{
struct TALER_EXCHANGEDB_Reserve pre_reserve;
struct TALER_EXCHANGEDB_Reserve post_reserve;
struct TALER_Amount delta;
pre_reserve.pub = reserve_pub;
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->reserves_get (plugin->cls,
session,
&pre_reserve));
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->insert_recoup_request (plugin->cls,
session,
&reserve_pub,
&deposit.coin,
&coin_sig,
&coin_blind,
&value,
&cbc.h_coin_envelope,
deadline));
post_reserve.pub = reserve_pub;
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->reserves_get (plugin->cls,
session,
&post_reserve));
FAILIF (GNUNET_OK !=
TALER_amount_subtract (&delta,
&post_reserve.balance,
&pre_reserve.balance));
FAILIF (0 !=
TALER_amount_cmp (&delta,
&value));
}
FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT !=
plugin->select_recoup_above_serial_id (plugin->cls,
session,