[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-exchange] branch master updated: expand DB test to cover #6124 be
From: |
gnunet |
Subject: |
[taler-exchange] branch master updated: expand DB test to cover #6124 better (passed immediately, does not explain the failure) |
Date: |
Sat, 14 Mar 2020 19:45:45 +0100 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository exchange.
The following commit(s) were added to refs/heads/master by this push:
new 6aca928c expand DB test to cover #6124 better (passed immediately,
does not explain the failure)
6aca928c is described below
commit 6aca928cf89bbd3ddc9384d773415dbb04f0659f
Author: Christian Grothoff <address@hidden>
AuthorDate: Sat Mar 14 19:45:43 2020 +0100
expand DB test to cover #6124 better (passed immediately, does not explain
the failure)
---
src/exchange/taler-exchange-httpd_withdraw.c | 1 +
src/exchangedb/test_exchangedb.c | 43 +++++++++++++++++++++-------
2 files changed, 34 insertions(+), 10 deletions(-)
diff --git a/src/exchange/taler-exchange-httpd_withdraw.c
b/src/exchange/taler-exchange-httpd_withdraw.c
index 52503e6c..ddb543c8 100644
--- a/src/exchange/taler-exchange-httpd_withdraw.c
+++ b/src/exchange/taler-exchange-httpd_withdraw.c
@@ -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);
diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c
index 3520ff24..e9b47942 100644
--- a/src/exchangedb/test_exchangedb.c
+++ b/src/exchangedb/test_exchangedb.c
@@ -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,
--
To stop receiving notification emails like this one, please contact
address@hidden.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [taler-exchange] branch master updated: expand DB test to cover #6124 better (passed immediately, does not explain the failure),
gnunet <=