diff options
Diffstat (limited to 'src/auditordb')
46 files changed, 759 insertions, 871 deletions
diff --git a/src/auditordb/0002-auditor_denomination_pending.sql b/src/auditordb/0002-auditor_denomination_pending.sql index c52e8c0cf..6c1239d7b 100644 --- a/src/auditordb/0002-auditor_denomination_pending.sql +++ b/src/auditordb/0002-auditor_denomination_pending.sql @@ -15,7 +15,8 @@ -- CREATE TABLE auditor_denomination_pending - (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) ,denom_balance taler_amount NOT NULL ,denom_loss taler_amount NOT NULL ,num_issued INT8 NOT NULL diff --git a/src/auditordb/0002-auditor_exchange_signkeys.sql b/src/auditordb/0002-auditor_exchange_signkeys.sql index 5fbd7d781..7a160a929 100644 --- a/src/auditordb/0002-auditor_exchange_signkeys.sql +++ b/src/auditordb/0002-auditor_exchange_signkeys.sql @@ -15,7 +15,8 @@ -- CREATE TABLE auditor_exchange_signkeys - (exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + exchange_pub BYTEA PRIMARY KEY CHECK (LENGTH(exchange_pub)=32) ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) ,ep_valid_from INT8 NOT NULL ,ep_expire_sign INT8 NOT NULL diff --git a/src/auditordb/0002-auditor_historic_denomination_revenue.sql b/src/auditordb/0002-auditor_historic_denomination_revenue.sql index f85c1bc1d..4c8a2cd92 100644 --- a/src/auditordb/0002-auditor_historic_denomination_revenue.sql +++ b/src/auditordb/0002-auditor_historic_denomination_revenue.sql @@ -15,7 +15,9 @@ -- CREATE TABLE auditor_historic_denomination_revenue - (denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) + ( + row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE , + denom_pub_hash BYTEA PRIMARY KEY CHECK (LENGTH(denom_pub_hash)=64) ,revenue_timestamp INT8 NOT NULL ,revenue_balance taler_amount NOT NULL ,loss_balance taler_amount NOT NULL, diff --git a/src/auditordb/0002-auditor_historic_reserve_summary.sql b/src/auditordb/0002-auditor_historic_reserve_summary.sql index a81abb832..35020a742 100644 --- a/src/auditordb/0002-auditor_historic_reserve_summary.sql +++ b/src/auditordb/0002-auditor_historic_reserve_summary.sql @@ -16,7 +16,8 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_historic_reserve_summary - (start_date INT8 PRIMARY KEY + (row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE, + start_date INT8 PRIMARY KEY ,end_date INT8 NOT NULL ,reserve_profits taler_amount NOT NULL, suppressed BOOLEAN NOT NULL DEFAULT FALSE diff --git a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql index 1a9e1c7f2..8e1390ce8 100644 --- a/src/auditordb/0002-auditor_reserve_in_inconsistency.sql +++ b/src/auditordb/0002-auditor_reserve_in_inconsistency.sql @@ -22,8 +22,8 @@ CREATE TABLE IF NOT EXISTS auditor_reserve_in_inconsistency amount_wired taler_amount,
reserve_pub BYTEA,
timestamp BIGINT,
- account BYTEA,
- diagnostic BYTEA,
+ account TEXT,
+ diagnostic TEXT,
suppressed BOOLEAN NOT NULL DEFAULT FALSE
);
COMMENT ON TABLE auditor_reserve_in_inconsistency
diff --git a/src/auditordb/0002-auditor_wire_out_inconsistency.sql b/src/auditordb/0002-auditor_wire_out_inconsistency.sql index efd1b56d9..cc3d811d3 100644 --- a/src/auditordb/0002-auditor_wire_out_inconsistency.sql +++ b/src/auditordb/0002-auditor_wire_out_inconsistency.sql @@ -18,7 +18,7 @@ SET search_path TO auditor; CREATE TABLE IF NOT EXISTS auditor_wire_out_inconsistency
(
row_id BIGINT GENERATED BY DEFAULT AS IDENTITY UNIQUE PRIMARY KEY,
- destination_account BYTEA,
+ destination_account TEXT,
expected taler_amount,
claimed taler_amount,
suppressed BOOLEAN NOT NULL DEFAULT FALSE
diff --git a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c index 312d9e233..4579a19ed 100644 --- a/src/auditordb/pg_get_amount_arithmetic_inconsistency.c +++ b/src/auditordb/pg_get_amount_arithmetic_inconsistency.c @@ -109,14 +109,16 @@ TAH_PG_get_amount_arithmetic_inconsistency ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct AmountArithmeticInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -138,22 +140,25 @@ TAH_PG_get_amount_arithmetic_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_amount_arithmetic_inconsistency_select_asc", - "SELECT" - " row_id" - ",operation" - ",exchange_amount" - ",auditor_amount" - ",profitable" - " FROM auditor_amount_arithmetic_inconsistency" - " WHERE (row_id>$1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_amount_arithmetic_inconsistency_select_asc", + "SELECT" + " row_id" + ",operation" + ",exchange_amount" + ",auditor_amount" + ",profitable" + " FROM auditor_amount_arithmetic_inconsistency" + " WHERE (row_id>$1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_amount_arithmetic_inconsistency_select_asc" : "auditor_amount_arithmetic_inconsistency_select_desc", + (limit > 0) ? + "auditor_amount_arithmetic_inconsistency_select_asc" + : + "auditor_amount_arithmetic_inconsistency_select_desc", params, &amount_arithmetic_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_auditor_closure_lags.c b/src/auditordb/pg_get_auditor_closure_lags.c index 409be8a9b..8cc48caa2 100644 --- a/src/auditordb/pg_get_auditor_closure_lags.c +++ b/src/auditordb/pg_get_auditor_closure_lags.c @@ -103,13 +103,15 @@ TAH_PG_get_auditor_closure_lags ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct ClosureLagsContext dcc = { .cb = cb, @@ -132,22 +134,25 @@ TAH_PG_get_auditor_closure_lags ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_closure_lags_get_asc", - "SELECT" - " row_id" - ",amount" - ",deadline" - ",wtid" - ",account" - " FROM auditor_closure_lags" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_closure_lags_get_asc", + "SELECT" + " row_id" + ",amount" + ",deadline" + ",wtid" + ",account" + " FROM auditor_closure_lags" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_auditor_closure_lags_get_asc" : "auditor_auditor_closure_lags_get_desc", + (limit > 0) ? + "auditor_auditor_closure_lags_get_asc" + : + "auditor_auditor_closure_lags_get_desc", params, &closure_lags_cb, &dcc); diff --git a/src/auditordb/pg_get_bad_sig_losses.c b/src/auditordb/pg_get_bad_sig_losses.c index 7c2e8eae0..b2194c13c 100644 --- a/src/auditordb/pg_get_bad_sig_losses.c +++ b/src/auditordb/pg_get_bad_sig_losses.c @@ -104,12 +104,12 @@ TAH_PG_get_bad_sig_losses ( TALER_AUDITORDB_BadSigLossesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct BadSigLossesContext dcc = { diff --git a/src/auditordb/pg_get_coin_inconsistency.c b/src/auditordb/pg_get_coin_inconsistency.c index 0e6c45a18..866900b67 100644 --- a/src/auditordb/pg_get_coin_inconsistency.c +++ b/src/auditordb/pg_get_coin_inconsistency.c @@ -91,8 +91,6 @@ coin_inconsistency_cb (void *cls, dcc->qs = i + 1; - printf ("checkpoint pg_2\n"); - rval = dcc->cb (dcc->cb_cls, serial_id, &dc); @@ -112,15 +110,15 @@ TAH_PG_get_coin_inconsistency ( TALER_AUDITORDB_CoinInconsistencyCallback cb, void *cb_cls) { - printf ("checkpoint pg_0\n"); + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct CoinInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -128,7 +126,6 @@ TAH_PG_get_coin_inconsistency ( }; enum GNUNET_DB_QueryStatus qs; - printf ("checkpoint pg_1\n"); PREPARE (pg, "auditor_coin_inconsistency_select_desc", @@ -145,28 +142,30 @@ TAH_PG_get_coin_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_coin_inconsistency_select_asc", - "SELECT" - " row_id" - ",operation" - ",exchange_amount" - ",auditor_amount" - ",coin_pub" - ",profitable" - " FROM auditor_coin_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_coin_inconsistency_select_asc", + "SELECT" + " row_id" + ",operation" + ",exchange_amount" + ",auditor_amount" + ",coin_pub" + ",profitable" + " FROM auditor_coin_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_coin_inconsistency_select_asc" : "auditor_coin_inconsistency_select_desc", + (limit > 0) ? + "auditor_coin_inconsistency_select_asc" + : + "auditor_coin_inconsistency_select_desc", params, &coin_inconsistency_cb, &dcc); - printf ("checkpoint pg_5\n"); if (qs > 0) return dcc.qs; diff --git a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c index 94537b151..92bd38f2a 100644 --- a/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c +++ b/src/auditordb/pg_get_denomination_key_validity_withdraw_inconsistency.c @@ -104,14 +104,14 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct DenominationKeyValidityWithdrawInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -132,21 +132,24 @@ TAH_PG_get_denomination_key_validity_withdraw_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_denomination_key_validity_withdraw_inconsistency_get_asc", - "SELECT" - " row_id" - ",execution_date" - ",reserve_pub" - ",denompub_h" - " FROM auditor_denomination_key_validity_withdraw_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_denomination_key_validity_withdraw_inconsistency_get_asc", + "SELECT" + " row_id" + ",execution_date" + ",reserve_pub" + ",denompub_h" + " FROM auditor_denomination_key_validity_withdraw_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0 ) ? "auditor_denomination_key_validity_withdraw_inconsistency_get_asc" : "auditor_denomination_key_validity_withdraw_inconsistency_get_desc", + (limit > 0) ? + "auditor_denomination_key_validity_withdraw_inconsistency_get_asc" + : + "auditor_denomination_key_validity_withdraw_inconsistency_get_desc", params, & denomination_key_validity_withdraw_inconsistency_cb, diff --git a/src/auditordb/pg_get_denomination_pending.c b/src/auditordb/pg_get_denomination_pending.c index e7b82fe9b..a4b01d78f 100644 --- a/src/auditordb/pg_get_denomination_pending.c +++ b/src/auditordb/pg_get_denomination_pending.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct DenominationPendingContext */ static void denomination_pending_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct DenominationPendingContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,13 +76,14 @@ denomination_pending_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denom_pub_hash", &dc.denom_pub_hash), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_balance", &dc.denom_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_loss", &dc.denom_loss), -GNUNET_PQ_result_spec_int64("num_issued", &dc.num_issued), -TALER_PQ_RESULT_SPEC_AMOUNT("denom_risk", &dc.denom_risk), -TALER_PQ_RESULT_SPEC_AMOUNT("recoup_loss", &dc.recoup_loss), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", + &dc.denom_pub_hash), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_balance", &dc.denom_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_loss", &dc.denom_loss), + GNUNET_PQ_result_spec_int64 ("num_issued", &dc.num_issued), + TALER_PQ_RESULT_SPEC_AMOUNT ("denom_risk", &dc.denom_risk), + TALER_PQ_RESULT_SPEC_AMOUNT ("recoup_loss", &dc.recoup_loss), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -123,12 +121,12 @@ TAH_PG_get_denomination_pending ( TALER_AUDITORDB_DenominationPendingCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct DenominationPendingContext dcc = { @@ -141,13 +139,14 @@ TAH_PG_get_denomination_pending ( PREPARE (pg, "auditor_denomination_pending_get_desc", "SELECT" + " row_id, " " denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss," + " suppressed" " FROM auditor_denomination_pending" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -157,13 +156,14 @@ TAH_PG_get_denomination_pending ( PREPARE (pg, "auditor_denomination_pending_get_asc", "SELECT" + " row_id, " " denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss," + " suppressed" " FROM auditor_denomination_pending" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -172,8 +172,10 @@ TAH_PG_get_denomination_pending ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_denomination_pending_get_asc" - : "auditor_denomination_pending_get_desc", + ? + "auditor_denomination_pending_get_asc" + : + "auditor_denomination_pending_get_desc", params, &denomination_pending_cb, &dcc); @@ -183,6 +185,3 @@ TAH_PG_get_denomination_pending ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_denominations_without_sigs.c b/src/auditordb/pg_get_denominations_without_sigs.c index 227c00d45..8f38bec98 100644 --- a/src/auditordb/pg_get_denominations_without_sigs.c +++ b/src/auditordb/pg_get_denominations_without_sigs.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct DenominationsWithoutSigsContext */ static void denominations_without_sigs_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct DenominationsWithoutSigsContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,11 @@ denominations_without_sigs_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denompub_h", &dc.denompub_h), -TALER_PQ_RESULT_SPEC_AMOUNT("value", &dc.value), -GNUNET_PQ_result_spec_int64("start_time", &dc.start_time), -GNUNET_PQ_result_spec_int64("end_time", &dc.end_time), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denompub_h", &dc.denompub_h), + TALER_PQ_RESULT_SPEC_AMOUNT ("value", &dc.value), + GNUNET_PQ_result_spec_int64 ("start_time", &dc.start_time), + GNUNET_PQ_result_spec_int64 ("end_time", &dc.end_time), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -121,12 +118,12 @@ TAH_PG_get_denominations_without_sigs ( TALER_AUDITORDB_DenominationsWithoutSigsCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct DenominationsWithoutSigsContext dcc = { @@ -140,11 +137,11 @@ TAH_PG_get_denominations_without_sigs ( "auditor_denominations_without_sigs_get_desc", "SELECT" " row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" + " denompub_h," + " value," + " start_time," + " end_time," + " suppressed" " FROM auditor_denominations_without_sigs" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,11 +152,11 @@ TAH_PG_get_denominations_without_sigs ( "auditor_denominations_without_sigs_get_asc", "SELECT" " row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" + " denompub_h," + " value," + " start_time," + " end_time," + " suppressed" " FROM auditor_denominations_without_sigs" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -168,8 +165,10 @@ TAH_PG_get_denominations_without_sigs ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_denominations_without_sigs_get_asc" - : "auditor_denominations_without_sigs_get_desc", + ? + "auditor_denominations_without_sigs_get_asc" + : + "auditor_denominations_without_sigs_get_desc", params, &denominations_without_sigs_cb, &dcc); @@ -179,6 +178,3 @@ TAH_PG_get_denominations_without_sigs ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_emergency.c b/src/auditordb/pg_get_emergency.c index 33a8de1f0..7d12714c4 100644 --- a/src/auditordb/pg_get_emergency.c +++ b/src/auditordb/pg_get_emergency.c @@ -105,14 +105,14 @@ TAH_PG_get_emergency ( TALER_AUDITORDB_EmergencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct EmergencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -136,24 +136,26 @@ TAH_PG_get_emergency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_emergency_get_asc", - "SELECT" - " row_id" - ",denompub_h" - ",denom_risk" - ",denom_loss" - ",deposit_start" - ",deposit_end" - ",value" - " FROM auditor_emergency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_emergency_get_asc", + "SELECT" + " row_id" + ",denompub_h" + ",denom_risk" + ",denom_loss" + ",deposit_start" + ",deposit_end" + ",value" + " FROM auditor_emergency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_emergency_get_asc" : "auditor_emergency_get_desc", + (limit > 0) ? + "auditor_emergency_get_asc" : + "auditor_emergency_get_desc", params, &emergency_cb, &dcc); diff --git a/src/auditordb/pg_get_emergency_by_count.c b/src/auditordb/pg_get_emergency_by_count.c index b056683c1..589ca31e0 100644 --- a/src/auditordb/pg_get_emergency_by_count.c +++ b/src/auditordb/pg_get_emergency_by_count.c @@ -108,14 +108,14 @@ TAH_PG_get_emergency_by_count ( TALER_AUDITORDB_EmergenciesByCountCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct EmergencyByCountContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -140,25 +140,27 @@ TAH_PG_get_emergency_by_count ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_emergency_by_count_get_asc", - "SELECT" - " row_id" - ",denompub_h" - ",num_issued" - ",num_known" - ",risk" - ",start" - ",deposit_end" - ",value" - " FROM auditor_emergency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_emergency_by_count_get_asc", + "SELECT" + " row_id" + ",denompub_h" + ",num_issued" + ",num_known" + ",risk" + ",start" + ",deposit_end" + ",value" + " FROM auditor_emergency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_emergency_by_count_get_asc" : "auditor_emergency_by_count_get_desc", + (limit > 0) ? + "auditor_emergency_by_count_get_asc" + : "auditor_emergency_by_count_get_desc", params, &emergency_by_count_cb, &dcc); diff --git a/src/auditordb/pg_get_exchange_signkeys.c b/src/auditordb/pg_get_exchange_signkeys.c index 0d0ee64dd..1edf45e5c 100644 --- a/src/auditordb/pg_get_exchange_signkeys.c +++ b/src/auditordb/pg_get_exchange_signkeys.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ExchangeSignkeysContext */ static void exchange_signkeys_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ExchangeSignkeysContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,12 +76,12 @@ exchange_signkeys_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("exchange_pub", &dc.exchange_pub), -GNUNET_PQ_result_spec_auto_from_type("master_sig", &dc.master_sig), -GNUNET_PQ_result_spec_int64("ep_valid_from", &dc.ep_valid_from), -GNUNET_PQ_result_spec_int64("ep_expire_sign", &dc.ep_expire_sign), -GNUNET_PQ_result_spec_int64("ep_expire_legal", &dc.ep_expire_legal), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("exchange_pub", &dc.exchange_pub), + GNUNET_PQ_result_spec_auto_from_type ("master_sig", &dc.master_sig), + GNUNET_PQ_result_spec_int64 ("ep_valid_from", &dc.ep_valid_from), + GNUNET_PQ_result_spec_int64 ("ep_expire_sign", &dc.ep_expire_sign), + GNUNET_PQ_result_spec_int64 ("ep_expire_legal", &dc.ep_expire_legal), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -122,12 +119,12 @@ TAH_PG_get_exchange_signkeys ( TALER_AUDITORDB_ExchangeSignkeysCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ExchangeSignkeysContext dcc = { @@ -140,12 +137,13 @@ TAH_PG_get_exchange_signkeys ( PREPARE (pg, "auditor_exchange_signkeys_get_desc", "SELECT" + " row_id," " exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal," + " suppressed" " FROM auditor_exchange_signkeys" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,12 +153,13 @@ TAH_PG_get_exchange_signkeys ( PREPARE (pg, "auditor_exchange_signkeys_get_asc", "SELECT" + " row_id," " exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal," + " suppressed" " FROM auditor_exchange_signkeys" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -169,8 +168,10 @@ TAH_PG_get_exchange_signkeys ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_exchange_signkeys_get_asc" - : "auditor_exchange_signkeys_get_desc", + ? + "auditor_exchange_signkeys_get_asc" + : + "auditor_exchange_signkeys_get_desc", params, &exchange_signkeys_cb, &dcc); @@ -180,6 +181,3 @@ TAH_PG_get_exchange_signkeys ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_fee_time_inconsistency.c b/src/auditordb/pg_get_fee_time_inconsistency.c index 5b1a7aa3f..535bdb422 100644 --- a/src/auditordb/pg_get_fee_time_inconsistency.c +++ b/src/auditordb/pg_get_fee_time_inconsistency.c @@ -105,14 +105,14 @@ TAH_PG_get_fee_time_inconsistency ( TALER_AUDITORDB_FeeTimeInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct FeeTimeInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -133,21 +133,24 @@ TAH_PG_get_fee_time_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_fee_time_inconsistency_get_asc", - "SELECT" - " row_id" - ",type" - ",time" - ",diagnostic" - " FROM auditor_fee_time_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_fee_time_inconsistency_get_asc", + "SELECT" + " row_id" + ",type" + ",time" + ",diagnostic" + " FROM auditor_fee_time_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_fee_time_inconsistency_get_asc" : "auditor_fee_time_inconsistency_get_desc", + (limit > 0) ? + "auditor_fee_time_inconsistency_get_asc" + : + "auditor_fee_time_inconsistency_get_desc", params, &fee_time_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_historic_denomination_revenue.c b/src/auditordb/pg_get_historic_denomination_revenue.c index ca14e88a0..d09d66b4b 100644 --- a/src/auditordb/pg_get_historic_denomination_revenue.c +++ b/src/auditordb/pg_get_historic_denomination_revenue.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct HistoricDenominationRevenueContext */ static void historic_denomination_revenue_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct HistoricDenominationRevenueContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,12 @@ historic_denomination_revenue_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("denom_pub_hash", &dc.denom_pub_hash), -GNUNET_PQ_result_spec_int64("revenue_timestamp", &dc.revenue_timestamp), -TALER_PQ_RESULT_SPEC_AMOUNT("revenue_balance", &dc.revenue_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("loss_balance", &dc.loss_balance), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", + &dc.denom_pub_hash), + GNUNET_PQ_result_spec_int64 ("revenue_timestamp", &dc.revenue_timestamp), + TALER_PQ_RESULT_SPEC_AMOUNT ("revenue_balance", &dc.revenue_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("loss_balance", &dc.loss_balance), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -121,12 +119,12 @@ TAH_PG_get_historic_denomination_revenue ( TALER_AUDITORDB_HistoricDenominationRevenueCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct HistoricDenominationRevenueContext dcc = { @@ -139,11 +137,12 @@ TAH_PG_get_historic_denomination_revenue ( PREPARE (pg, "auditor_historic_denomination_revenue_get_desc", "SELECT" + " row_id, " " denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" + " revenue_timestamp," + " revenue_balance," + " loss_balance," + " suppressed" " FROM auditor_historic_denomination_revenue" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,11 +152,12 @@ TAH_PG_get_historic_denomination_revenue ( PREPARE (pg, "auditor_historic_denomination_revenue_get_asc", "SELECT" + " row_id, " " denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" + " revenue_timestamp," + " revenue_balance," + " loss_balance," + " suppressed" " FROM auditor_historic_denomination_revenue" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -166,8 +166,10 @@ TAH_PG_get_historic_denomination_revenue ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_historic_denomination_revenue_get_asc" - : "auditor_historic_denomination_revenue_get_desc", + ? + "auditor_historic_denomination_revenue_get_asc" + : + "auditor_historic_denomination_revenue_get_desc", params, &historic_denomination_revenue_cb, &dcc); @@ -177,6 +179,3 @@ TAH_PG_get_historic_denomination_revenue ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_historic_reserve_summary.c b/src/auditordb/pg_get_historic_reserve_summary.c index 454224533..a7e401607 100644 --- a/src/auditordb/pg_get_historic_reserve_summary.c +++ b/src/auditordb/pg_get_historic_reserve_summary.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct HistoricReserveSummaryContext */ static void historic_reserve_summary_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct HistoricReserveSummaryContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -78,11 +75,9 @@ historic_reserve_summary_cb (void *cls, struct GNUNET_PQ_ResultSpec rs[] = { GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - - GNUNET_PQ_result_spec_int64("start_date", &dc.start_date), -GNUNET_PQ_result_spec_int64("end_date", &dc.end_date), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_profits", &dc.reserve_profits), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("start_date", &dc.start_date), + GNUNET_PQ_result_spec_int64 ("end_date", &dc.end_date), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_profits", &dc.reserve_profits), GNUNET_PQ_result_spec_end @@ -120,12 +115,13 @@ TAH_PG_get_historic_reserve_summary ( TALER_AUDITORDB_HistoricReserveSummaryCallback cb, void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct HistoricReserveSummaryContext dcc = { @@ -138,10 +134,10 @@ TAH_PG_get_historic_reserve_summary ( PREPARE (pg, "auditor_historic_reserve_summary_get_desc", "SELECT" + " row_id," " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits" " FROM auditor_historic_reserve_summary" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -151,10 +147,10 @@ TAH_PG_get_historic_reserve_summary ( PREPARE (pg, "auditor_historic_reserve_summary_get_asc", "SELECT" + " row_id," " start_date," -" end_date," -" reserve_profits," -" suppressed" + " end_date," + " reserve_profits" " FROM auditor_historic_reserve_summary" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -163,8 +159,10 @@ TAH_PG_get_historic_reserve_summary ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_historic_reserve_summary_get_asc" - : "auditor_historic_reserve_summary_get_desc", + ? + "auditor_historic_reserve_summary_get_asc" + : + "auditor_historic_reserve_summary_get_desc", params, &historic_reserve_summary_cb, &dcc); @@ -174,6 +172,3 @@ TAH_PG_get_historic_reserve_summary ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_misattribution_in_inconsistency.c b/src/auditordb/pg_get_misattribution_in_inconsistency.c index a47b11306..f3edf9866 100644 --- a/src/auditordb/pg_get_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_get_misattribution_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct MisattributionInInconsistencyContext */ static void misattribution_in_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct MisattributionInInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ misattribution_in_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount", &dc.amount), -GNUNET_PQ_result_spec_int64("bank_row", &dc.bank_row), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), + GNUNET_PQ_result_spec_int64 ("bank_row", &dc.bank_row), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -120,12 +117,12 @@ TAH_PG_get_misattribution_in_inconsistency ( TALER_AUDITORDB_MisattributionInInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct MisattributionInInconsistencyContext dcc = { @@ -139,10 +136,10 @@ TAH_PG_get_misattribution_in_inconsistency ( "auditor_misattribution_in_inconsistency_get_desc", "SELECT" " row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" + " amount," + " bank_row," + " reserve_pub," + " suppressed" " FROM auditor_misattribution_in_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_misattribution_in_inconsistency ( "auditor_misattribution_in_inconsistency_get_asc", "SELECT" " row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" + " amount," + " bank_row," + " reserve_pub," + " suppressed" " FROM auditor_misattribution_in_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +162,10 @@ TAH_PG_get_misattribution_in_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_misattribution_in_inconsistency_get_asc" - : "auditor_misattribution_in_inconsistency_get_desc", + ? + "auditor_misattribution_in_inconsistency_get_asc" + : + "auditor_misattribution_in_inconsistency_get_desc", params, &misattribution_in_inconsistency_cb, &dcc); @@ -176,6 +175,3 @@ TAH_PG_get_misattribution_in_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_purse_not_closed_inconsistencies.c b/src/auditordb/pg_get_purse_not_closed_inconsistencies.c index 7489f7ccb..f1c5915c5 100644 --- a/src/auditordb/pg_get_purse_not_closed_inconsistencies.c +++ b/src/auditordb/pg_get_purse_not_closed_inconsistencies.c @@ -106,14 +106,14 @@ TAH_PG_get_purse_not_closed_inconsistencies ( TALER_AUDITORDB_PurseNotClosedInconsistenciesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct PurseNotClosedInconsistenciesContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -134,21 +134,24 @@ TAH_PG_get_purse_not_closed_inconsistencies ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_purse_not_closed_inconsistencies_get_asc", - "SELECT" - " row_id" - ",purse_pub" - ",amount" - ",expiration_date" - " FROM auditor_purse_not_closed_inconsistencies" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_purse_not_closed_inconsistencies_get_asc", + "SELECT" + " row_id" + ",purse_pub" + ",amount" + ",expiration_date" + " FROM auditor_purse_not_closed_inconsistencies" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_purse_not_closed_inconsistencies_get_asc" : "auditor_purse_not_closed_inconsistencies_get_desc", + (limit > 0) ? + "auditor_purse_not_closed_inconsistencies_get_asc" + : + "auditor_purse_not_closed_inconsistencies_get_desc", params, & purse_not_closed_inconsistencies_cb, diff --git a/src/auditordb/pg_get_purses.c b/src/auditordb/pg_get_purses.c index a977a1a94..b93084a29 100644 --- a/src/auditordb/pg_get_purses.c +++ b/src/auditordb/pg_get_purses.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct PursesContext */ static void purses_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct PursesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,12 +76,13 @@ purses_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_int64("auditor_purses_rowid", &dc.auditor_purses_rowid), -GNUNET_PQ_result_spec_auto_from_type("purse_pub", &dc.purse_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("balance", &dc.balance), -TALER_PQ_RESULT_SPEC_AMOUNT("target", &dc.target), -GNUNET_PQ_result_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("auditor_purses_rowid", + &dc.auditor_purses_rowid), + GNUNET_PQ_result_spec_auto_from_type ("purse_pub", &dc.purse_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", &dc.balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("target", &dc.target), + GNUNET_PQ_result_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -122,12 +120,12 @@ TAH_PG_get_purses ( TALER_AUDITORDB_PursesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct PursesContext dcc = { @@ -140,12 +138,13 @@ TAH_PG_get_purses ( PREPARE (pg, "auditor_purses_get_desc", "SELECT" + " row_id, " " auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" + " purse_pub," + " balance," + " target," + " expiration_date," + " suppressed" " FROM auditor_purses" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,12 +154,13 @@ TAH_PG_get_purses ( PREPARE (pg, "auditor_purses_get_asc", "SELECT" + " row_id, " " auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" + " purse_pub," + " balance," + " target," + " expiration_date," + " suppressed" " FROM auditor_purses" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -180,6 +180,3 @@ TAH_PG_get_purses ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_refreshes_hanging.c b/src/auditordb/pg_get_refreshes_hanging.c index d4dd83b67..904df0a42 100644 --- a/src/auditordb/pg_get_refreshes_hanging.c +++ b/src/auditordb/pg_get_refreshes_hanging.c @@ -105,13 +105,15 @@ TAH_PG_get_refreshes_hanging ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct RefreshesHangingContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -131,20 +133,22 @@ TAH_PG_get_refreshes_hanging ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_refreshes_hanging_get_asc", - "SELECT" - " row_id" - ",amount" - ",coin_pub" - " FROM auditor_refreshes_hanging" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_refreshes_hanging_get_asc", + "SELECT" + " row_id" + ",amount" + ",coin_pub" + " FROM auditor_refreshes_hanging" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_refreshes_hanging_get_asc" : "auditor_refreshes_hanging_get_desc", + (limit > 0) ? + "auditor_refreshes_hanging_get_asc" + : "auditor_refreshes_hanging_get_desc", params, &refreshes_hanging_cb, &dcc); diff --git a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c index 4182e5dc9..ddbe44c87 100644 --- a/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c +++ b/src/auditordb/pg_get_reserve_balance_insufficient_inconsistency.c @@ -107,13 +107,15 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( void *cb_cls) { + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); + struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct ReserveBalanceInsufficientInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -134,21 +136,24 @@ TAH_PG_get_reserve_balance_insufficient_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_reserve_balance_insufficient_inconsistency_get_asc", - "SELECT" - " row_id" - ",reserve_pub" - ",inconsistency_gain" - ",inconsistency_amount" - " FROM auditor_reserve_balance_insufficient_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id ASC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_reserve_balance_insufficient_inconsistency_get_asc", + "SELECT" + " row_id" + ",reserve_pub" + ",inconsistency_gain" + ",inconsistency_amount" + " FROM auditor_reserve_balance_insufficient_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id ASC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_reserve_balance_insufficient_inconsistency_get_asc" : "auditor_reserve_balance_insufficient_inconsistency_get_desc", + (limit > 0) ? + "auditor_reserve_balance_insufficient_inconsistency_get_asc" + : + "auditor_reserve_balance_insufficient_inconsistency_get_desc", params, & reserve_balance_insufficient_inconsistency_cb, diff --git a/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c b/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c index 5e7ac3533..e55aae76b 100644 --- a/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c +++ b/src/auditordb/pg_get_reserve_balance_summary_wrong_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveBalanceSummaryWrongInconsistencyContext */ static void reserve_balance_summary_wrong_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveBalanceSummaryWrongInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ reserve_balance_summary_wrong_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("exchange_amount", &dc.exchange_amount), -TALER_PQ_RESULT_SPEC_AMOUNT("auditor_amount", &dc.auditor_amount), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("exchange_amount", &dc.exchange_amount), + TALER_PQ_RESULT_SPEC_AMOUNT ("auditor_amount", &dc.auditor_amount), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -120,12 +117,12 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( TALER_AUDITORDB_ReserveBalanceSummaryWrongInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveBalanceSummaryWrongInconsistencyContext dcc = { @@ -139,10 +136,10 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", "SELECT" " row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" + " reserve_pub," + " exchange_amount," + " auditor_amount," + " suppressed" " FROM auditor_reserve_balance_summary_wrong_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( "auditor_reserve_balance_summary_wrong_inconsistency_get_asc", "SELECT" " row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" + " reserve_pub," + " exchange_amount," + " auditor_amount," + " suppressed" " FROM auditor_reserve_balance_summary_wrong_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,10 +162,13 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_balance_summary_wrong_inconsistency_get_asc" - : "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", + ? + "auditor_reserve_balance_summary_wrong_inconsistency_get_asc" + : + "auditor_reserve_balance_summary_wrong_inconsistency_get_desc", params, - &reserve_balance_summary_wrong_inconsistency_cb, + & + reserve_balance_summary_wrong_inconsistency_cb, &dcc); if (qs > 0) @@ -176,6 +176,3 @@ TAH_PG_get_reserve_balance_summary_wrong_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserve_in_inconsistency.c b/src/auditordb/pg_get_reserve_in_inconsistency.c index 22950f537..8763e4af0 100644 --- a/src/auditordb/pg_get_reserve_in_inconsistency.c +++ b/src/auditordb/pg_get_reserve_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveInInconsistencyContext */ static void reserve_in_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveInInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,13 +76,14 @@ reserve_in_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount_exchange_expected", &dc.amount_exchange_expected), -TALER_PQ_RESULT_SPEC_AMOUNT("amount_wired", &dc.amount_wired), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -GNUNET_PQ_result_spec_int64("timestamp", &dc.timestamp), -GNUNET_PQ_result_spec_auto_from_type("account", &dc.account), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount_exchange_expected", + &dc.amount_exchange_expected), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount_wired", &dc.amount_wired), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + GNUNET_PQ_result_spec_int64 ("timestamp", &dc.timestamp), + GNUNET_PQ_result_spec_string ("account", &dc.account), + GNUNET_PQ_result_spec_string ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -123,12 +121,12 @@ TAH_PG_get_reserve_in_inconsistency ( TALER_AUDITORDB_ReserveInInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveInInconsistencyContext dcc = { @@ -142,13 +140,13 @@ TAH_PG_get_reserve_in_inconsistency ( "auditor_reserve_in_inconsistency_get_desc", "SELECT" " row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" + " amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic," + " suppressed" " FROM auditor_reserve_in_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -159,13 +157,13 @@ TAH_PG_get_reserve_in_inconsistency ( "auditor_reserve_in_inconsistency_get_asc", "SELECT" " row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" + " amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic," + " suppressed" " FROM auditor_reserve_in_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -174,8 +172,10 @@ TAH_PG_get_reserve_in_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_in_inconsistency_get_asc" - : "auditor_reserve_in_inconsistency_get_desc", + ? + "auditor_reserve_in_inconsistency_get_asc" + : + "auditor_reserve_in_inconsistency_get_desc", params, &reserve_in_inconsistency_cb, &dcc); @@ -185,6 +185,3 @@ TAH_PG_get_reserve_in_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserve_not_closed_inconsistency.c b/src/auditordb/pg_get_reserve_not_closed_inconsistency.c index ebef6697f..6e0c06c46 100644 --- a/src/auditordb/pg_get_reserve_not_closed_inconsistency.c +++ b/src/auditordb/pg_get_reserve_not_closed_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReserveNotClosedInconsistencyContext */ static void reserve_not_closed_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReserveNotClosedInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,11 +76,11 @@ reserve_not_closed_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("balance", &dc.balance), -GNUNET_PQ_result_spec_int64("expiration_time", &dc.expiration_time), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", &dc.balance), + GNUNET_PQ_result_spec_int64 ("expiration_time", &dc.expiration_time), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -121,12 +118,12 @@ TAH_PG_get_reserve_not_closed_inconsistency ( TALER_AUDITORDB_ReserveNotClosedInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReserveNotClosedInconsistencyContext dcc = { @@ -140,11 +137,11 @@ TAH_PG_get_reserve_not_closed_inconsistency ( "auditor_reserve_not_closed_inconsistency_get_desc", "SELECT" " row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" + " reserve_pub," + " balance," + " expiration_time," + " diagnostic," + " suppressed" " FROM auditor_reserve_not_closed_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -155,11 +152,11 @@ TAH_PG_get_reserve_not_closed_inconsistency ( "auditor_reserve_not_closed_inconsistency_get_asc", "SELECT" " row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" + " reserve_pub," + " balance," + " expiration_time," + " diagnostic," + " suppressed" " FROM auditor_reserve_not_closed_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -168,10 +165,13 @@ TAH_PG_get_reserve_not_closed_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_reserve_not_closed_inconsistency_get_asc" - : "auditor_reserve_not_closed_inconsistency_get_desc", + ? + "auditor_reserve_not_closed_inconsistency_get_asc" + : + "auditor_reserve_not_closed_inconsistency_get_desc", params, - &reserve_not_closed_inconsistency_cb, + & + reserve_not_closed_inconsistency_cb, &dcc); if (qs > 0) @@ -179,6 +179,3 @@ TAH_PG_get_reserve_not_closed_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_reserves.c b/src/auditordb/pg_get_reserves.c index 8eefba898..5859612ec 100644 --- a/src/auditordb/pg_get_reserves.c +++ b/src/auditordb/pg_get_reserves.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct ReservesContext */ static void reserves_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct ReservesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,18 +76,21 @@ reserves_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_int64("auditor_reserves_rowid", &dc.auditor_reserves_rowid), -GNUNET_PQ_result_spec_auto_from_type("reserve_pub", &dc.reserve_pub), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_balance", &dc.reserve_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("reserve_loss", &dc.reserve_loss), -TALER_PQ_RESULT_SPEC_AMOUNT("withdraw_fee_balance", &dc.withdraw_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("close_fee_balance", &dc.close_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("purse_fee_balance", &dc.purse_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("open_fee_balance", &dc.open_fee_balance), -TALER_PQ_RESULT_SPEC_AMOUNT("history_fee_balance", &dc.history_fee_balance), -GNUNET_PQ_result_spec_int64("expiration_date", &dc.expiration_date), -GNUNET_PQ_result_spec_string("origin_account", &dc.origin_account), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_int64 ("auditor_reserves_rowid", + &dc.auditor_reserves_rowid), + GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &dc.reserve_pub), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_balance", &dc.reserve_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("reserve_loss", &dc.reserve_loss), + TALER_PQ_RESULT_SPEC_AMOUNT ("withdraw_fee_balance", + &dc.withdraw_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("close_fee_balance", &dc.close_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee_balance", &dc.purse_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("open_fee_balance", &dc.open_fee_balance), + TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee_balance", + &dc.history_fee_balance), + GNUNET_PQ_result_spec_int64 ("expiration_date", &dc.expiration_date), + GNUNET_PQ_result_spec_string ("origin_account", &dc.origin_account), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -128,12 +128,12 @@ TAH_PG_get_reserves ( TALER_AUDITORDB_ReservesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct ReservesContext dcc = { @@ -146,18 +146,19 @@ TAH_PG_get_reserves ( PREPARE (pg, "auditor_reserves_get_desc", "SELECT" + " row_id, " " auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" + " reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account," + " suppressed" " FROM auditor_reserves" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -167,18 +168,19 @@ TAH_PG_get_reserves ( PREPARE (pg, "auditor_reserves_get_asc", "SELECT" + " row_id, " " auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" + " reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account," + " suppressed" " FROM auditor_reserves" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -198,6 +200,3 @@ TAH_PG_get_reserves ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_row_inconsistency.c b/src/auditordb/pg_get_row_inconsistency.c index 67f83f6ed..ec9838d68 100644 --- a/src/auditordb/pg_get_row_inconsistency.c +++ b/src/auditordb/pg_get_row_inconsistency.c @@ -105,14 +105,14 @@ TAH_PG_get_row_inconsistency ( TALER_AUDITORDB_RowInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; - struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_uint64 (&offset), - GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), - GNUNET_PQ_query_param_end - }; + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&offset), + GNUNET_PQ_query_param_bool (return_suppressed), + GNUNET_PQ_query_param_uint64 (&plimit), + GNUNET_PQ_query_param_end + }; struct RowInconsistencyContext dcc = { .cb = cb, .cb_cls = cb_cls, @@ -133,20 +133,23 @@ TAH_PG_get_row_inconsistency ( " ORDER BY row_id DESC" " LIMIT $3" ); - PREPARE (pg, - "auditor_row_inconsistency_select_asc", - "SELECT" - " row_id" - ",row_table" - ",diagnostic" - " FROM auditor_row_inconsistency" - " WHERE (row_id > $1)" - " AND ($2 OR suppressed is false)" - " ORDER BY row_id DESC" - " LIMIT $3" - ); + PREPARE (pg, + "auditor_row_inconsistency_select_asc", + "SELECT" + " row_id" + ",row_table" + ",diagnostic" + " FROM auditor_row_inconsistency" + " WHERE (row_id > $1)" + " AND ($2 OR suppressed is false)" + " ORDER BY row_id DESC" + " LIMIT $3" + ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, - (limit > 0) ? "auditor_row_inconsistency_select_asc" : "auditor_row_inconsistency_select_desc", + (limit > 0) ? + "auditor_row_inconsistency_select_asc" + : + "auditor_row_inconsistency_select_desc", params, &row_inconsistency_cb, &dcc); diff --git a/src/auditordb/pg_get_row_minor_inconsistencies.c b/src/auditordb/pg_get_row_minor_inconsistencies.c index 002abbda3..e282f7ea3 100644 --- a/src/auditordb/pg_get_row_minor_inconsistencies.c +++ b/src/auditordb/pg_get_row_minor_inconsistencies.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct RowMinorInconsistenciesContext */ static void row_minor_inconsistencies_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct RowMinorInconsistenciesContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,9 +76,9 @@ row_minor_inconsistencies_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("row_table", &dc.row_table), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_auto_from_type ("row_table", &dc.row_table), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -119,12 +116,12 @@ TAH_PG_get_row_minor_inconsistencies ( TALER_AUDITORDB_RowMinorInconsistenciesCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct RowMinorInconsistenciesContext dcc = { @@ -138,9 +135,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_desc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -151,9 +148,9 @@ TAH_PG_get_row_minor_inconsistencies ( "auditor_row_minor_inconsistencies_get_asc", "SELECT" " row_id," -" row_table," -" diagnostic," -" suppressed" + " row_table," + " diagnostic," + " suppressed" " FROM auditor_row_minor_inconsistencies" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -162,8 +159,10 @@ TAH_PG_get_row_minor_inconsistencies ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_row_minor_inconsistencies_get_asc" - : "auditor_row_minor_inconsistencies_get_desc", + ? + "auditor_row_minor_inconsistencies_get_asc" + : + "auditor_row_minor_inconsistencies_get_desc", params, &row_minor_inconsistencies_cb, &dcc); @@ -173,6 +172,3 @@ TAH_PG_get_row_minor_inconsistencies ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_wire_format_inconsistency.c b/src/auditordb/pg_get_wire_format_inconsistency.c index ec443616e..42fcc064d 100644 --- a/src/auditordb/pg_get_wire_format_inconsistency.c +++ b/src/auditordb/pg_get_wire_format_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct WireFormatInconsistencyContext */ static void wire_format_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct WireFormatInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,10 @@ wire_format_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - TALER_PQ_RESULT_SPEC_AMOUNT("amount", &dc.amount), -GNUNET_PQ_result_spec_int64("wire_offset", &dc.wire_offset), -GNUNET_PQ_result_spec_auto_from_type("diagnostic", &dc.diagnostic), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + TALER_PQ_RESULT_SPEC_AMOUNT ("amount", &dc.amount), + GNUNET_PQ_result_spec_int64 ("wire_offset", &dc.wire_offset), + GNUNET_PQ_result_spec_auto_from_type ("diagnostic", &dc.diagnostic), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -120,12 +117,12 @@ TAH_PG_get_wire_format_inconsistency ( TALER_AUDITORDB_WireFormatInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct WireFormatInconsistencyContext dcc = { @@ -139,10 +136,10 @@ TAH_PG_get_wire_format_inconsistency ( "auditor_wire_format_inconsistency_get_desc", "SELECT" " row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" + " amount," + " wire_offset," + " diagnostic," + " suppressed" " FROM auditor_wire_format_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +150,10 @@ TAH_PG_get_wire_format_inconsistency ( "auditor_wire_format_inconsistency_get_asc", "SELECT" " row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" + " amount," + " wire_offset," + " diagnostic," + " suppressed" " FROM auditor_wire_format_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +162,10 @@ TAH_PG_get_wire_format_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_wire_format_inconsistency_get_asc" - : "auditor_wire_format_inconsistency_get_desc", + ? + "auditor_wire_format_inconsistency_get_asc" + : + "auditor_wire_format_inconsistency_get_desc", params, &wire_format_inconsistency_cb, &dcc); @@ -176,6 +175,3 @@ TAH_PG_get_wire_format_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_get_wire_out_inconsistency.c b/src/auditordb/pg_get_wire_out_inconsistency.c index f9394375d..5f63d8e57 100644 --- a/src/auditordb/pg_get_wire_out_inconsistency.c +++ b/src/auditordb/pg_get_wire_out_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -63,8 +60,8 @@ struct WireOutInconsistencyContext */ static void wire_out_inconsistency_cb (void *cls, - PGresult *result, - unsigned int num_results) + PGresult *result, + unsigned int num_results) { struct WireOutInconsistencyContext *dcc = cls; struct PostgresClosure *pg = dcc->pg; @@ -79,10 +76,11 @@ wire_out_inconsistency_cb (void *cls, GNUNET_PQ_result_spec_uint64 ("row_id", &serial_id), - GNUNET_PQ_result_spec_auto_from_type("destination_account", &dc.destination_account), -TALER_PQ_RESULT_SPEC_AMOUNT("expected", &dc.expected), -TALER_PQ_RESULT_SPEC_AMOUNT("claimed", &dc.claimed), -GNUNET_PQ_result_spec_bool("suppressed", &dc.suppressed), + GNUNET_PQ_result_spec_string ("destination_account", + &dc.destination_account), + TALER_PQ_RESULT_SPEC_AMOUNT ("expected", &dc.expected), + TALER_PQ_RESULT_SPEC_AMOUNT ("claimed", &dc.claimed), + GNUNET_PQ_result_spec_bool ("suppressed", &dc.suppressed), GNUNET_PQ_result_spec_end @@ -120,12 +118,12 @@ TAH_PG_get_wire_out_inconsistency ( TALER_AUDITORDB_WireOutInconsistencyCallback cb, void *cb_cls) { - + uint64_t plimit = (uint64_t) ((limit < 0) ? -limit : limit); struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&offset), GNUNET_PQ_query_param_bool (return_suppressed), - GNUNET_PQ_query_param_int64 (&limit), + GNUNET_PQ_query_param_uint64 (&plimit), GNUNET_PQ_query_param_end }; struct WireOutInconsistencyContext dcc = { @@ -139,10 +137,10 @@ TAH_PG_get_wire_out_inconsistency ( "auditor_wire_out_inconsistency_get_desc", "SELECT" " row_id," -" destination_account," -" expected," -" claimed," -" suppressed" + " destination_account," + " expected," + " claimed," + " suppressed" " FROM auditor_wire_out_inconsistency" " WHERE (row_id < $1)" " AND ($2 OR suppressed is false)" @@ -153,10 +151,10 @@ TAH_PG_get_wire_out_inconsistency ( "auditor_wire_out_inconsistency_get_asc", "SELECT" " row_id," -" destination_account," -" expected," -" claimed," -" suppressed" + " destination_account," + " expected," + " claimed," + " suppressed" " FROM auditor_wire_out_inconsistency" " WHERE (row_id > $1)" " AND ($2 OR suppressed is false)" @@ -165,8 +163,10 @@ TAH_PG_get_wire_out_inconsistency ( ); qs = GNUNET_PQ_eval_prepared_multi_select (pg->conn, (limit > 0) - ? "auditor_wire_out_inconsistency_get_asc" - : "auditor_wire_out_inconsistency_get_desc", + ? + "auditor_wire_out_inconsistency_get_asc" + : + "auditor_wire_out_inconsistency_get_desc", params, &wire_out_inconsistency_cb, &dcc); @@ -176,6 +176,3 @@ TAH_PG_get_wire_out_inconsistency ( GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; } - - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_denomination_pending.c b/src/auditordb/pg_insert_denomination_pending.c index 70a9981d7..673b94352 100644 --- a/src/auditordb/pg_insert_denomination_pending.c +++ b/src/auditordb/pg_insert_denomination_pending.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,13 +29,12 @@ TAH_PG_insert_denomination_pending ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denom_pub_hash), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_loss), -GNUNET_PQ_query_param_int64(&dc->num_issued), -TALER_PQ_query_param_amount(pg->conn, &dc->denom_risk), -TALER_PQ_query_param_amount(pg->conn, &dc->recoup_loss), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denom_pub_hash), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_loss), + GNUNET_PQ_query_param_int64 (&dc->num_issued), + TALER_PQ_query_param_amount (pg->conn, &dc->denom_risk), + TALER_PQ_query_param_amount (pg->conn, &dc->recoup_loss), GNUNET_PQ_query_param_end @@ -48,17 +44,14 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_denomination_pending_insert", "INSERT INTO auditor_denomination_pending " "( denom_pub_hash," -" denom_balance," -" denom_loss," -" num_issued," -" denom_risk," -" recoup_loss," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7);" + " denom_balance," + " denom_loss," + " num_issued," + " denom_risk," + " recoup_loss" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_denomination_pending_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_denominations_without_sigs.c b/src/auditordb/pg_insert_denominations_without_sigs.c index e22e4ffe9..9d93a653d 100644 --- a/src/auditordb/pg_insert_denominations_without_sigs.c +++ b/src/auditordb/pg_insert_denominations_without_sigs.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,10 @@ TAH_PG_insert_denominations_without_sigs ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denompub_h), -TALER_PQ_query_param_amount(pg->conn, &dc->value), -GNUNET_PQ_query_param_int64(&dc->start_time), -GNUNET_PQ_query_param_int64(&dc->end_time), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denompub_h), + TALER_PQ_query_param_amount (pg->conn, &dc->value), + GNUNET_PQ_query_param_int64 (&dc->start_time), + GNUNET_PQ_query_param_int64 (&dc->end_time), GNUNET_PQ_query_param_end @@ -45,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_denominations_without_sigs_insert", "INSERT INTO auditor_denominations_without_sigs " - "( row_id," -" denompub_h," -" value," -" start_time," -" end_time," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + "( denompub_h," + " value," + " start_time," + " end_time" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_denominations_without_sigs_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_exchange_signkeys.c b/src/auditordb/pg_insert_exchange_signkeys.c index 09ab0e941..356fdcd94 100644 --- a/src/auditordb/pg_insert_exchange_signkeys.c +++ b/src/auditordb/pg_insert_exchange_signkeys.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,12 +29,11 @@ TAH_PG_insert_exchange_signkeys ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->exchange_pub), -GNUNET_PQ_query_param_auto_from_type(&dc->master_sig), -GNUNET_PQ_query_param_int64(&dc->ep_valid_from), -GNUNET_PQ_query_param_int64(&dc->ep_expire_sign), -GNUNET_PQ_query_param_int64(&dc->ep_expire_legal), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->exchange_pub), + GNUNET_PQ_query_param_auto_from_type (&dc->master_sig), + GNUNET_PQ_query_param_int64 (&dc->ep_valid_from), + GNUNET_PQ_query_param_int64 (&dc->ep_expire_sign), + GNUNET_PQ_query_param_int64 (&dc->ep_expire_legal), GNUNET_PQ_query_param_end @@ -47,16 +43,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_exchange_signkeys_insert", "INSERT INTO auditor_exchange_signkeys " "( exchange_pub," -" master_sig," -" ep_valid_from," -" ep_expire_sign," -" ep_expire_legal," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + " master_sig," + " ep_valid_from," + " ep_expire_sign," + " ep_expire_legal" + ") VALUES ($1,$2,$3,$4,$5);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_exchange_signkeys_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_historic_denomination_revenue.c b/src/auditordb/pg_insert_historic_denomination_revenue.c index c7779c9b3..83f34e0f2 100644 --- a/src/auditordb/pg_insert_historic_denomination_revenue.c +++ b/src/auditordb/pg_insert_historic_denomination_revenue.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,10 @@ TAH_PG_insert_historic_denomination_revenue ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->denom_pub_hash), -GNUNET_PQ_query_param_int64(&dc->revenue_timestamp), -TALER_PQ_query_param_amount(pg->conn, &dc->revenue_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->loss_balance), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->denom_pub_hash), + GNUNET_PQ_query_param_int64 (&dc->revenue_timestamp), + TALER_PQ_query_param_amount (pg->conn, &dc->revenue_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->loss_balance), GNUNET_PQ_query_param_end @@ -46,15 +42,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_historic_denomination_revenue_insert", "INSERT INTO auditor_historic_denomination_revenue " "( denom_pub_hash," -" revenue_timestamp," -" revenue_balance," -" loss_balance," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + " revenue_timestamp," + " revenue_balance," + " loss_balance" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_historic_denomination_revenue_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_historic_reserve_summary.c b/src/auditordb/pg_insert_historic_reserve_summary.c index 420b6223c..1db619c04 100644 --- a/src/auditordb/pg_insert_historic_reserve_summary.c +++ b/src/auditordb/pg_insert_historic_reserve_summary.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_historic_reserve_summary ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->start_date), -GNUNET_PQ_query_param_int64(&dc->end_date), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_profits), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_int64 (&dc->start_date), + GNUNET_PQ_query_param_int64 (&dc->end_date), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_profits), GNUNET_PQ_query_param_end @@ -45,14 +41,11 @@ GNUNET_PQ_query_param_bool(dc->suppressed), "auditor_historic_reserve_summary_insert", "INSERT INTO auditor_historic_reserve_summary " "( start_date," -" end_date," -" reserve_profits," -" suppressed" -") VALUES ($1,$2,$3,$4);" + " end_date," + " reserve_profits" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_historic_reserve_summary_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_misattribution_in_inconsistency.c b/src/auditordb/pg_insert_misattribution_in_inconsistency.c index 45eb8c004..ed950a6c4 100644 --- a/src/auditordb/pg_insert_misattribution_in_inconsistency.c +++ b/src/auditordb/pg_insert_misattribution_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_misattribution_in_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount), -GNUNET_PQ_query_param_int64(&dc->bank_row), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount), + GNUNET_PQ_query_param_int64 (&dc->bank_row), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), GNUNET_PQ_query_param_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_misattribution_in_inconsistency_insert", "INSERT INTO auditor_misattribution_in_inconsistency " - "( row_id," -" amount," -" bank_row," -" reserve_pub," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + "( amount," + " bank_row," + " reserve_pub" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_misattribution_in_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_purses.c b/src/auditordb/pg_insert_purses.c index e32b33bd5..3606ae5e3 100644 --- a/src/auditordb/pg_insert_purses.c +++ b/src/auditordb/pg_insert_purses.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,12 +29,10 @@ TAH_PG_insert_purses ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->auditor_purses_rowid), -GNUNET_PQ_query_param_auto_from_type(&dc->purse_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->balance), -TALER_PQ_query_param_amount(pg->conn, &dc->target), -GNUNET_PQ_query_param_int64(&dc->expiration_date), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->purse_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->balance), + TALER_PQ_query_param_amount (pg->conn, &dc->target), + GNUNET_PQ_query_param_int64 (&dc->expiration_date), GNUNET_PQ_query_param_end @@ -46,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_purses_insert", "INSERT INTO auditor_purses " - "( auditor_purses_rowid," -" purse_pub," -" balance," -" target," -" expiration_date," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + "( purse_pub," + " balance," + " target," + " expiration_date" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_purses_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c b/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c index 34419d062..a2bb9ba9c 100644 --- a/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_balance_summary_wrong_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_reserve_balance_summary_wrong_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->exchange_amount), -TALER_PQ_query_param_amount(pg->conn, &dc->auditor_amount), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->exchange_amount), + TALER_PQ_query_param_amount (pg->conn, &dc->auditor_amount), GNUNET_PQ_query_param_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_reserve_balance_summary_wrong_inconsistency_insert", "INSERT INTO auditor_reserve_balance_summary_wrong_inconsistency " - "( row_id," -" reserve_pub," -" exchange_amount," -" auditor_amount," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + "( reserve_pub," + " exchange_amount," + " auditor_amount" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_balance_summary_wrong_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserve_in_inconsistency.c b/src/auditordb/pg_insert_reserve_in_inconsistency.c index 0b69f10e9..00716418e 100644 --- a/src/auditordb/pg_insert_reserve_in_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_in_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,13 +29,12 @@ TAH_PG_insert_reserve_in_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount_exchange_expected), -TALER_PQ_query_param_amount(pg->conn, &dc->amount_wired), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -GNUNET_PQ_query_param_int64(&dc->timestamp), -GNUNET_PQ_query_param_auto_from_type(&dc->account), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount_exchange_expected), + TALER_PQ_query_param_amount (pg->conn, &dc->amount_wired), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + GNUNET_PQ_query_param_int64 (&dc->timestamp), + GNUNET_PQ_query_param_string (dc->account), + GNUNET_PQ_query_param_string (dc->diagnostic), GNUNET_PQ_query_param_end @@ -47,19 +43,15 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_reserve_in_inconsistency_insert", "INSERT INTO auditor_reserve_in_inconsistency " - "( row_id," -" amount_exchange_expected," -" amount_wired," -" reserve_pub," -" timestamp," -" account," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7,$8);" + "(amount_exchange_expected," + " amount_wired," + " reserve_pub," + " timestamp," + " account," + " diagnostic" + ") VALUES ($1,$2,$3,$4,$5,$6);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_in_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c b/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c index 6f35e6f77..ff49957cf 100644 --- a/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c +++ b/src/auditordb/pg_insert_reserve_not_closed_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,11 +29,10 @@ TAH_PG_insert_reserve_not_closed_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->balance), -GNUNET_PQ_query_param_int64(&dc->expiration_time), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->balance), + GNUNET_PQ_query_param_int64 (&dc->expiration_time), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), GNUNET_PQ_query_param_end @@ -45,17 +41,13 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_reserve_not_closed_inconsistency_insert", "INSERT INTO auditor_reserve_not_closed_inconsistency " - "( row_id," -" reserve_pub," -" balance," -" expiration_time," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6);" + "( reserve_pub," + " balance," + " expiration_time," + " diagnostic" + ") VALUES ($1,$2,$3,$4);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserve_not_closed_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_reserves.c b/src/auditordb/pg_insert_reserves.c index 3bb73a73e..f2cbea738 100644 --- a/src/auditordb/pg_insert_reserves.c +++ b/src/auditordb/pg_insert_reserves.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,18 +29,16 @@ TAH_PG_insert_reserves ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_int64(&dc->auditor_reserves_rowid), -GNUNET_PQ_query_param_auto_from_type(&dc->reserve_pub), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->reserve_loss), -TALER_PQ_query_param_amount(pg->conn, &dc->withdraw_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->close_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->purse_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->open_fee_balance), -TALER_PQ_query_param_amount(pg->conn, &dc->history_fee_balance), -GNUNET_PQ_query_param_int64(&dc->expiration_date), -GNUNET_PQ_query_param_string(dc->origin_account), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->reserve_pub), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->reserve_loss), + TALER_PQ_query_param_amount (pg->conn, &dc->withdraw_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->close_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->purse_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->open_fee_balance), + TALER_PQ_query_param_amount (pg->conn, &dc->history_fee_balance), + GNUNET_PQ_query_param_int64 (&dc->expiration_date), + GNUNET_PQ_query_param_string (dc->origin_account), GNUNET_PQ_query_param_end @@ -52,23 +47,19 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_reserves_insert", "INSERT INTO auditor_reserves " - "( auditor_reserves_rowid," -" reserve_pub," -" reserve_balance," -" reserve_loss," -" withdraw_fee_balance," -" close_fee_balance," -" purse_fee_balance," -" open_fee_balance," -" history_fee_balance," -" expiration_date," -" origin_account," -" suppressed" -") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12);" + "( reserve_pub," + " reserve_balance," + " reserve_loss," + " withdraw_fee_balance," + " close_fee_balance," + " purse_fee_balance," + " open_fee_balance," + " history_fee_balance," + " expiration_date," + " origin_account" + ") VALUES ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_reserves_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_row_minor_inconsistencies.c b/src/auditordb/pg_insert_row_minor_inconsistencies.c index c60fdc3c5..452ae6762 100644 --- a/src/auditordb/pg_insert_row_minor_inconsistencies.c +++ b/src/auditordb/pg_insert_row_minor_inconsistencies.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,9 +29,8 @@ TAH_PG_insert_row_minor_inconsistencies ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->row_table), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_auto_from_type (&dc->row_table), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), GNUNET_PQ_query_param_end @@ -43,15 +39,11 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_row_minor_inconsistencies_insert", "INSERT INTO auditor_row_minor_inconsistencies " - "( row_id," -" row_table," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4);" + "( row_table," + " diagnostic" + ") VALUES ($1,$2);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_row_minor_inconsistencies_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_wire_format_inconsistency.c b/src/auditordb/pg_insert_wire_format_inconsistency.c index 210bcc5e8..a16e68b35 100644 --- a/src/auditordb/pg_insert_wire_format_inconsistency.c +++ b/src/auditordb/pg_insert_wire_format_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_wire_format_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - TALER_PQ_query_param_amount(pg->conn, &dc->amount), -GNUNET_PQ_query_param_int64(&dc->wire_offset), -GNUNET_PQ_query_param_auto_from_type(&dc->diagnostic), -GNUNET_PQ_query_param_bool(dc->suppressed), + TALER_PQ_query_param_amount (pg->conn, &dc->amount), + GNUNET_PQ_query_param_int64 (&dc->wire_offset), + GNUNET_PQ_query_param_auto_from_type (&dc->diagnostic), GNUNET_PQ_query_param_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_wire_format_inconsistency_insert", "INSERT INTO auditor_wire_format_inconsistency " - "( row_id," -" amount," -" wire_offset," -" diagnostic," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + "( amount," + " wire_offset," + " diagnostic" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_wire_format_inconsistency_insert", params); } - -
\ No newline at end of file diff --git a/src/auditordb/pg_insert_wire_out_inconsistency.c b/src/auditordb/pg_insert_wire_out_inconsistency.c index ea72a5fc1..828aa3293 100644 --- a/src/auditordb/pg_insert_wire_out_inconsistency.c +++ b/src/auditordb/pg_insert_wire_out_inconsistency.c @@ -1,6 +1,3 @@ - - - /* This file is part of TALER Copyright (C) 2024 Taler Systems SA @@ -32,10 +29,9 @@ TAH_PG_insert_wire_out_inconsistency ( struct PostgresClosure *pg = cls; struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type(&dc->destination_account), -TALER_PQ_query_param_amount(pg->conn, &dc->expected), -TALER_PQ_query_param_amount(pg->conn, &dc->claimed), -GNUNET_PQ_query_param_bool(dc->suppressed), + GNUNET_PQ_query_param_string (dc->destination_account), + TALER_PQ_query_param_amount (pg->conn, &dc->expected), + TALER_PQ_query_param_amount (pg->conn, &dc->claimed), GNUNET_PQ_query_param_end @@ -44,16 +40,12 @@ GNUNET_PQ_query_param_bool(dc->suppressed), PREPARE (pg, "auditor_wire_out_inconsistency_insert", "INSERT INTO auditor_wire_out_inconsistency " - "( row_id," -" destination_account," -" expected," -" claimed," -" suppressed" -") VALUES ($1,$2,$3,$4,$5);" + "( destination_account," + " expected," + " claimed" + ") VALUES ($1,$2,$3);" ); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "auditor_wire_out_inconsistency_insert", params); } - -
\ No newline at end of file |