donau

Donation authority for GNU Taler (experimental)
Log | Files | Refs | Submodules | README | LICENSE

commit 3a301269e75833a8fef636f8c19ab46f579ae4ab
parent 6af4959eff6e3756f9026551c0f510e87de2d513
Author: Matyja Lukas Adam <lukas.matyja@students.bfh.ch>
Date:   Wed,  5 Jun 2024 21:47:49 +0200

fix id hash to url parsing

Diffstat:
Msrc/donau/donau-httpd_donation-statement.c | 9---------
Msrc/donaudb/pg_iterate_submitted_receipts.c | 7++++---
Msrc/lib/donau_api_donation_statement_get.c | 8++------
Msrc/testing/testing_api_cmd_donation_statement_get.c | 3++-
4 files changed, 8 insertions(+), 19 deletions(-)

diff --git a/src/donau/donau-httpd_donation-statement.c b/src/donau/donau-httpd_donation-statement.c @@ -31,11 +31,6 @@ #include "donau-httpd_donation-statement.h" -/** - * Maximum number of records we return per request. - */ -#define MAX_RECORDS 1024 - MHD_RESULT DH_handler_donation_statement_get ( struct DH_RequestContext *rc, @@ -71,10 +66,6 @@ DH_handler_donation_statement_get ( "h_donor_tax_id"); } - for(unsigned int i = 0; i < 16; i++) - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "The parsed id hash part %d on server side: %d\n",i, h_donor_tax_id.hash.bits[i]); - { struct TALER_Amount total_donations; struct DONAU_DonauPublicKeyP donau_pub; diff --git a/src/donaudb/pg_iterate_submitted_receipts.c b/src/donaudb/pg_iterate_submitted_receipts.c @@ -36,9 +36,10 @@ DH_PG_iterate_submitted_receipts ( struct TALER_Amount *total_donations) { struct PostgresClosure *pg = cls; + struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&donation_year), - // GNUNET_PQ_query_param_auto_from_type (&h_donor_tax_id), + GNUNET_PQ_query_param_auto_from_type (h_donor_tax_id), GNUNET_PQ_query_param_end }; uint64_t valueSum = 0; @@ -59,8 +60,8 @@ DH_PG_iterate_submitted_receipts ( ",CAST(SUM(CAST((donation_units.value).frac AS INT8)) AS INT8) AS fractionSum" " FROM receipts_submitted ref" " JOIN donation_units USING (h_donation_unit_pub)" - " WHERE donation_year=$1"); - // " AND h_tax_number=$2"); + " WHERE donation_year=$1" + " AND h_tax_number=$2"); qs = GNUNET_PQ_eval_prepared_singleton_select (pg->conn, "lookup_submitted_receipts", params, diff --git a/src/lib/donau_api_donation_statement_get.c b/src/lib/donau_api_donation_statement_get.c @@ -52,7 +52,7 @@ struct DONAU_DonationStatementGetHandle /** * Salted and hashed donor id */ - const struct DONAU_HashDonorTaxId *h_donor_tax_id; + struct DONAU_HashDonorTaxId h_donor_tax_id; /** * year @@ -216,15 +216,11 @@ DONAU_donation_statement_get ( TALER_LOG_DEBUG ("Connecting to the donau (%s)\n", url); - for(unsigned int i = 0; i < 16; i++) - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "The parsed id hash part %d on client side: %d\n",i, h_donor_tax_id->hash.bits[i]); dsgh = GNUNET_new (struct DONAU_DonationStatementGetHandle); - // dsgh->url = GNUNET_strdup (url); dsgh->cb = cb; dsgh->cb_cls = cb_cls; dsgh->year = year; - dsgh->h_donor_tax_id = h_donor_tax_id; + dsgh->h_donor_tax_id = *h_donor_tax_id; if (GNUNET_OK != prepare_url (dsgh, url)) return NULL; diff --git a/src/testing/testing_api_cmd_donation_statement_get.c b/src/testing/testing_api_cmd_donation_statement_get.c @@ -95,9 +95,10 @@ donation_statement_status_cb (void *cls, &ss->donation_statement. donation_statement_sig)) { - GNUNET_break (0); GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Verify donation statement signature failed!"); + TALER_TESTING_interpreter_fail (ss->is); + return; } TALER_TESTING_interpreter_next (ss->is); }