diff options
author | Christian Grothoff <christian@grothoff.org> | 2024-08-21 17:39:11 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2024-08-21 17:45:08 +0200 |
commit | dc6d8b08ec4a58f5d0cf88517559afc7d7305d68 (patch) | |
tree | 08bc211bbbc47a9bcc77f577874fdce07c00be99 /src/auditordb | |
parent | ca32c9ce98ddfda91935c7b5bcc8bfb604ff7868 (diff) |
fix auditordb test and nested transaction use by auditors
Diffstat (limited to 'src/auditordb')
-rw-r--r-- | src/auditordb/pg_get_balance.c | 17 | ||||
-rw-r--r-- | src/auditordb/test_auditordb.c | 13 |
2 files changed, 17 insertions, 13 deletions
diff --git a/src/auditordb/pg_get_balance.c b/src/auditordb/pg_get_balance.c index 2bacbb507..7a0b7c38c 100644 --- a/src/auditordb/pg_get_balance.c +++ b/src/auditordb/pg_get_balance.c @@ -80,13 +80,12 @@ balance_cb (void *cls, GNUNET_assert (num_results <= ctx->len); for (unsigned int i = 0; i < num_results; i++) { - bool is_missing = false; struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_allow_null ( TALER_PQ_result_spec_amount ("balance", pg->currency, ctx->dst[i]), - &is_missing), + NULL), GNUNET_PQ_result_spec_end }; @@ -99,11 +98,6 @@ balance_cb (void *cls, ctx->failure = true; return; } - if (is_missing) - { - TALER_amount_set_zero (pg->currency, - ctx->dst[i]); - } ctx->off++; } } @@ -124,9 +118,13 @@ TAH_PG_get_balance (void *cls, while (NULL != va_arg (ap, const char *)) { + struct TALER_Amount *dst; + cnt++; - (void) va_arg (ap, - struct TALER_Amount *); + dst = va_arg (ap, + struct TALER_Amount *); + TALER_amount_set_zero (pg->currency, + dst); } va_end (ap); { @@ -148,7 +146,6 @@ TAH_PG_get_balance (void *cls, keys[0] = balance_key; dsts[0] = balance_value; - va_start (ap, balance_value); while (off < cnt) diff --git a/src/auditordb/test_auditordb.c b/src/auditordb/test_auditordb.c index b72e95ab1..ab08a9bb7 100644 --- a/src/auditordb/test_auditordb.c +++ b/src/auditordb/test_auditordb.c @@ -106,6 +106,7 @@ static struct TALER_Amount reserve_profits; static enum GNUNET_GenericReturnValue select_historic_denom_revenue_result ( void *cls, + uint64_t rowid, const struct TALER_DenominationHashP *denom_pub_hash2, struct GNUNET_TIME_Timestamp revenue_timestamp2, const struct TALER_Amount *revenue_balance2, @@ -144,6 +145,7 @@ select_historic_denom_revenue_result ( static enum GNUNET_GenericReturnValue select_historic_reserve_revenue_result ( void *cls, + uint64_t rowid, struct GNUNET_TIME_Timestamp start_time2, struct GNUNET_TIME_Timestamp end_time2, const struct TALER_Amount *reserve_profits2) @@ -414,6 +416,8 @@ run (void *cls) FAILIF (0 >= plugin->select_historic_denom_revenue ( plugin->cls, + 0, + 1024, &select_historic_denom_revenue_result, NULL)); GNUNET_log (GNUNET_ERROR_TYPE_INFO, @@ -434,9 +438,12 @@ run (void *cls) GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Test: select_historic_reserve_revenue\n"); FAILIF (0 >= - plugin->select_historic_reserve_revenue (plugin->cls, - select_historic_reserve_revenue_result, - NULL)); + plugin->select_historic_reserve_revenue ( + plugin->cls, + 0, + 1024, + &select_historic_reserve_revenue_result, + NULL)); FAILIF (0 > plugin->commit (plugin->cls)); |