donau

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

commit 92122c17fd59c4259ff05a90b116074c98912c6a
parent e541516d3a6528ecea5861c3a8ea6d37f07f36ae
Author: Casaburi Johannes <johannes.casaburi@students.bfh.ch>
Date:   Mon, 13 May 2024 15:17:45 +0200

minor changes in donaudb

Diffstat:
Msrc/donaudb/0002-donation_units.sql | 4----
Msrc/donaudb/donau-0001.sql | 2+-
Msrc/donaudb/donau-0002.sql.in | 2+-
Msrc/donaudb/donau_do_amount_specific.sql | 2+-
Msrc/donaudb/pg_commit.c | 2+-
Msrc/donaudb/pg_commit.h | 2+-
Msrc/donaudb/pg_create_tables.c | 4++--
Msrc/donaudb/pg_create_tables.h | 4++--
Msrc/donaudb/pg_get_history.c | 2+-
Msrc/donaudb/pg_get_history.h | 8++++----
Msrc/donaudb/pg_insert_donation_unit.h | 4++--
Msrc/donaudb/pg_insert_submitted_receipts.h | 1+
Msrc/donaudb/pg_iterate_submitted_receipts.h | 3+--
Msrc/donaudb/pg_lookup_charity.h | 5+++--
Msrc/donaudb/pg_lookup_issued_receipts.h | 4+++-
Msrc/donaudb/test_donaudb.c | 22++++++++++------------
16 files changed, 34 insertions(+), 37 deletions(-)

diff --git a/src/donaudb/0002-donation_units.sql b/src/donaudb/0002-donation_units.sql @@ -25,7 +25,3 @@ COMMENT ON TABLE donation_units IS 'Main donation_unit table. All the valid donation units the Donau knows about.'; COMMENT ON COLUMN donation_units.value IS 'Value the donation unit has in Taler amount'; - --- CREATE INDEX IF NOT EXISTS donation_units_by_validity_year --- ON donation_units --- (validity_year); diff --git a/src/donaudb/donau-0001.sql b/src/donaudb/donau-0001.sql @@ -1,6 +1,6 @@ -- -- This file is part of TALER --- Copyright (C) 2014--2022 Taler Systems SA +-- Copyright (C) 2024 Taler Systems SA -- -- TALER is free software; you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software diff --git a/src/donaudb/donau-0002.sql.in b/src/donaudb/donau-0002.sql.in @@ -1,6 +1,6 @@ -- -- This file is part of TALER --- Copyright (C) 2014--2023 Taler Systems SA +-- Copyright (C) 2024 Taler Systems SA -- -- TALER is free software; you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software diff --git a/src/donaudb/donau_do_amount_specific.sql b/src/donaudb/donau_do_amount_specific.sql @@ -1,6 +1,6 @@ -- -- This file is part of TALER --- Copyright (C) 2014--2022 Taler Systems SA +-- Copyright (C) 2024 Taler Systems SA -- -- TALER is free software; you can redistribute it and/or modify it under the -- terms of the GNU General Public License as published by the Free Software diff --git a/src/donaudb/pg_commit.c b/src/donaudb/pg_commit.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff --git a/src/donaudb/pg_commit.h b/src/donaudb/pg_commit.h @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software diff --git a/src/donaudb/pg_create_tables.c b/src/donaudb/pg_create_tables.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -16,7 +16,7 @@ /** * @file donaudb/pg_create_tables.c * @brief Implementation of the create_tables function for Postgres - * @author Christian Grothoff + * @author Johannes Casaburi */ #include <taler/platform.h> #include <taler/taler_error_codes.h> diff --git a/src/donaudb/pg_create_tables.h b/src/donaudb/pg_create_tables.h @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2022 Taler Systems SA + Copyright (C) 2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -16,7 +16,7 @@ /** * @file donaudb/pg_create_tables.h * @brief implementation of the create_tables function for Postgres - * @author Christian Grothoff + * @author Johannes Casaburi */ #ifndef PG_CREATE_TABLES_H #define PG_CREATE_TABLES_H diff --git a/src/donaudb/pg_get_history.c b/src/donaudb/pg_get_history.c @@ -57,7 +57,7 @@ struct GetHistoryContext /** * Invoke the callback for each result. * - * @param cls a `struct MissingWireContext *` + * @param cls a `struct GetHistoryContext *` * @param result SQL result * @param num_results number of rows in @a result */ diff --git a/src/donaudb/pg_get_history.h b/src/donaudb/pg_get_history.h @@ -24,16 +24,16 @@ #include "donaudb_plugin.h" /** - * Obtain information about the enabled wire accounts of the exchange. + * Obtain history of charities. * * @param cls closure - * @param cb function to call on each account + * @param cb function to call on each result * @param cb_cls closure for @a cb * @return transaction status code */ enum GNUNET_DB_QueryStatus DH_PG_get_history (void *cls, - DONAUDB_GetHistoryCallback cb, - void *cb_cls); + DONAUDB_GetHistoryCallback cb, + void *cb_cls); #endif diff --git a/src/donaudb/pg_insert_donation_unit.h b/src/donaudb/pg_insert_donation_unit.h @@ -29,10 +29,10 @@ * Add donation unit key. * * @param cls closure - * @param donation_unit_pub the actual donation_unit key * @param donation_unit_hash hash of the public key - * @param value value that the donation unit represents + * @param donation_unit_pub the actual donation_unit key * @param validity_year validity year + * @param value value that the donation unit represents * @return transaction status code */ enum GNUNET_DB_QueryStatus diff --git a/src/donaudb/pg_insert_submitted_receipts.h b/src/donaudb/pg_insert_submitted_receipts.h @@ -31,6 +31,7 @@ * * @param cls closure * @param h_donor_tax_id salted hash of the donors tax number + * @param num_dr number of donation receipts * @param donation_receipts array of donation receipts * @param donation_year year of the donation * @return transaction status code diff --git a/src/donaudb/pg_iterate_submitted_receipts.h b/src/donaudb/pg_iterate_submitted_receipts.h @@ -29,8 +29,7 @@ * @param cls closure * @param donation_year donation year * @param h_donor_tax_id hash of donor tax id - * @param cb function to call on each account - * @param cb_cls closure for @a cb + * @param[out] total_donations amount of total donations * @return transaction status code */ enum GNUNET_DB_QueryStatus diff --git a/src/donaudb/pg_lookup_charity.h b/src/donaudb/pg_lookup_charity.h @@ -25,10 +25,11 @@ #include <taler/taler_json_lib.h> #include "donaudb_plugin.h" /** - * Fetch information about a donation unit key. + * Fetch information about a charity. * * @param cls the @e cls of this struct with the plugin-specific state - * @param[out] info information with value and other info about the coin + * @param charity_id the charity id + * @param meta charity meta data information * @return transaction status code */ enum GNUNET_DB_QueryStatus diff --git a/src/donaudb/pg_lookup_issued_receipts.h b/src/donaudb/pg_lookup_issued_receipts.h @@ -28,7 +28,8 @@ * Fetch information about an issued receipts request. * * @param cls the @e cls of this struct with the plugin-specific state - * @param[out] info information with value and other info about the issued receipts + * @param h_receipts hash over the issued receipt + * @param meta information with value and other info about the issued receipts * @return transaction status code */ enum GNUNET_DB_QueryStatus @@ -36,4 +37,5 @@ DH_PG_lookup_issued_receipts ( void *cls, struct DONAU_DonationReceiptHashP *h_receipts, struct DONAUDB_IssuedReceiptsMetaData *meta); + #endif diff --git a/src/donaudb/test_donaudb.c b/src/donaudb/test_donaudb.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2014-2023 Taler Systems SA + Copyright (C) 2024 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -16,9 +16,7 @@ /** * @file donaudb/test_donaudb.c * @brief test cases for DB interaction functions - * @author Sree Harsha Totakura - * @author Christian Grothoff - * @author Marcello Stanisci + * @author Johannes Casaburi */ #include <taler/platform.h> #include <taler/taler_json_lib.h> @@ -34,25 +32,25 @@ static int result; * Report line of error if @a cond is true, and jump to label "drop". */ #define FAILIF(cond) \ - do { \ - if (! (cond)) { break;} \ - GNUNET_break (0); \ - goto drop; \ - } while (0) + do { \ + if (! (cond)) { break;} \ + GNUNET_break (0); \ + goto drop; \ + } while (0) /** * Initializes @a ptr with random data. */ #define RND_BLK(ptr) \ - GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, ptr, sizeof (* \ - ptr)) + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, ptr, sizeof (* \ + ptr)) /** * Initializes @a ptr with zeros. */ #define ZR_BLK(ptr) \ - memset (ptr, 0, sizeof (*ptr)) + memset (ptr, 0, sizeof (*ptr)) /**