From 67de20d26e7eed951528db6aaedaf163108f49a5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Sun, 5 Dec 2021 17:16:00 +0100 Subject: major rework of withdraw transaction to use stored procedure and (presumably) reduce serialization failures by avoiding SELECT before INSERT --- src/exchangedb/test_exchangedb.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) (limited to 'src/exchangedb/test_exchangedb.c') diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 6807c2425..12cff4907 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -1659,10 +1659,26 @@ run (void *cls) cbc.reserve_pub = reserve_pub; cbc.amount_with_fee = value; GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (CURRENCY, &cbc.withdraw_fee)); - FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != - plugin->insert_withdraw_info (plugin->cls, - &cbc)); + TALER_amount_set_zero (CURRENCY, + &cbc.withdraw_fee)); + { + bool found; + bool balance_ok; + struct TALER_EXCHANGEDB_KycStatus kyc; + uint64_t ruuid; + + FAILIF (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != + plugin->do_withdraw (plugin->cls, + &cbc, + now, + &found, + &balance_ok, + &kyc, + &ruuid)); + GNUNET_assert (found); + GNUNET_assert (balance_ok); + GNUNET_assert (! kyc.ok); + } FAILIF (GNUNET_OK != check_reserve (&reserve_pub, value.value, -- cgit v1.2.3