diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-12-05 17:16:00 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-12-05 17:16:00 +0100 |
commit | 67de20d26e7eed951528db6aaedaf163108f49a5 (patch) | |
tree | 900f533ef8cd5ce0217fab1ff20b61d228ae753b /src/exchangedb/test_exchangedb.c | |
parent | c0d2af8a49a35e4face7e758aad670de94682633 (diff) | |
download | exchange-67de20d26e7eed951528db6aaedaf163108f49a5.tar.xz |
major rework of withdraw transaction to use stored procedure and (presumably) reduce serialization failures by avoiding SELECT before INSERT
Diffstat (limited to 'src/exchangedb/test_exchangedb.c')
-rw-r--r-- | src/exchangedb/test_exchangedb.c | 24 |
1 files changed, 20 insertions, 4 deletions
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, |