This commit is contained in:
Christian Grothoff 2022-11-21 14:56:46 +01:00
parent 3583885978
commit 9d43bf92c4
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
15 changed files with 43 additions and 56 deletions

View File

@ -994,6 +994,7 @@ TEH_RESPONSE_compile_reserve_history (
* requested withdraw operation. * requested withdraw operation.
* *
* @param connection connection to the client * @param connection connection to the client
* @param ec error code to return
* @param ebalance expected balance based on our database * @param ebalance expected balance based on our database
* @param withdraw_amount amount that the client requested to withdraw * @param withdraw_amount amount that the client requested to withdraw
* @param rh reserve history to return * @param rh reserve history to return

View File

@ -45,7 +45,7 @@ struct AuditorsIteratorContext
/** /**
* Helper function for #postgres_iterate_active_auditors(). * Helper function for #TEH_PG_iterate_active_auditors().
* Calls the callback with each auditor. * Calls the callback with each auditor.
* *
* @param cls a `struct SignkeysIteratorContext` * @param cls a `struct SignkeysIteratorContext`
@ -91,11 +91,10 @@ auditors_cb_helper (void *cls,
} }
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_iterate_active_auditors (void *cls, TEH_PG_iterate_active_auditors (void *cls,
TALER_EXCHANGEDB_AuditorsCallback cb, TALER_EXCHANGEDB_AuditorsCallback cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -105,7 +104,7 @@ TEH_PG_iterate_active_auditors (void *cls,
.cb = cb, .cb = cb,
.cb_cls = cb_cls, .cb_cls = cb_cls,
}; };
/* Used in #postgres_iterate_active_auditors() */
PREPARE (pg, PREPARE (pg,
"select_auditors", "select_auditors",
"SELECT" "SELECT"

View File

@ -26,7 +26,6 @@
#include "pg_helper.h" #include "pg_helper.h"
/** /**
* Closure for #signkeys_cb_helper() * Closure for #signkeys_cb_helper()
*/ */
@ -46,7 +45,7 @@ struct SignkeysIteratorContext
/** /**
* Helper function for #postgres_iterate_active_signkeys(). * Helper function for #TEH_PG_iterate_active_signkeys().
* Calls the callback with each signkey. * Calls the callback with each signkey.
* *
* @param cls a `struct SignkeysIteratorContext` * @param cls a `struct SignkeysIteratorContext`
@ -107,8 +106,8 @@ signkeys_cb_helper (void *cls,
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_iterate_active_signkeys (void *cls, TEH_PG_iterate_active_signkeys (void *cls,
TALER_EXCHANGEDB_ActiveSignkeysCallback cb, TALER_EXCHANGEDB_ActiveSignkeysCallback cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_TIME_Absolute now = {0}; struct GNUNET_TIME_Absolute now = {0};
@ -120,7 +119,7 @@ TEH_PG_iterate_active_signkeys (void *cls,
.cb = cb, .cb = cb,
.cb_cls = cb_cls, .cb_cls = cb_cls,
}; };
PREPARE (pg, PREPARE (pg,
"select_signkeys", "select_signkeys",
"SELECT" "SELECT"

View File

@ -43,7 +43,7 @@ struct AuditorDenomsIteratorContext
/** /**
* Helper function for #postgres_iterate_auditor_denominations(). * Helper function for #TEH_PG_iterate_auditor_denominations().
* Calls the callback with each auditor and denomination pair. * Calls the callback with each auditor and denomination pair.
* *
* @param cls a `struct AuditorDenomsIteratorContext` * @param cls a `struct AuditorDenomsIteratorContext`
@ -102,7 +102,7 @@ TEH_PG_iterate_auditor_denominations (
.cb = cb, .cb = cb,
.cb_cls = cb_cls, .cb_cls = cb_cls,
}; };
/* Used in #postgres_iterate_auditor_denominations() */ /* Used in #postgres_iterate_auditor_denominations() */
PREPARE (pg, PREPARE (pg,
"select_auditor_denoms", "select_auditor_denoms",
"SELECT" "SELECT"
@ -113,7 +113,7 @@ TEH_PG_iterate_auditor_denominations (
" JOIN auditors USING (auditor_uuid)" " JOIN auditors USING (auditor_uuid)"
" JOIN denominations USING (denominations_serial)" " JOIN denominations USING (denominations_serial)"
" WHERE auditors.is_active;"); " WHERE auditors.is_active;");
return GNUNET_PQ_eval_prepared_multi_select (pg->conn, return GNUNET_PQ_eval_prepared_multi_select (pg->conn,
"select_auditor_denoms", "select_auditor_denoms",
params, params,
&auditor_denoms_cb_helper, &auditor_denoms_cb_helper,

View File

@ -49,7 +49,7 @@ struct DenomIteratorContext
/** /**
* Helper function for #postgres_iterate_denomination_info(). * Helper function for #TEH_PG_iterate_denomination_info().
* Calls the callback with each denomination key. * Calls the callback with each denomination key.
* *
* @param cls a `struct DenomIteratorContext` * @param cls a `struct DenomIteratorContext`
@ -132,14 +132,6 @@ domination_cb_helper (void *cls,
} }
/** /**
* Fetch information about all known denomination keys. * Fetch information about all known denomination keys.
* *
@ -150,8 +142,8 @@ domination_cb_helper (void *cls,
*/ */
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_iterate_denomination_info (void *cls, TEH_PG_iterate_denomination_info (void *cls,
TALER_EXCHANGEDB_DenominationCallback cb, TALER_EXCHANGEDB_DenominationCallback cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -163,7 +155,7 @@ TEH_PG_iterate_denomination_info (void *cls,
.pg = pg .pg = pg
}; };
/* Used in #postgres_iterate_denomination_info() */ /* Used in #postgres_iterate_denomination_info() */
PREPARE (pg, PREPARE (pg,
"denomination_iterate", "denomination_iterate",
"SELECT" "SELECT"

View File

@ -26,8 +26,6 @@
#include "pg_helper.h" #include "pg_helper.h"
/** /**
* Closure for #dominations_cb_helper() * Closure for #dominations_cb_helper()
*/ */
@ -51,7 +49,7 @@ struct DenomsIteratorContext
/** /**
* Helper function for #postgres_iterate_denominations(). * Helper function for #TEH_PG_iterate_denominations().
* Calls the callback with each denomination key. * Calls the callback with each denomination key.
* *
* @param cls a `struct DenomsIteratorContext` * @param cls a `struct DenomsIteratorContext`
@ -130,8 +128,8 @@ dominations_cb_helper (void *cls,
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_iterate_denominations (void *cls, TEH_PG_iterate_denominations (void *cls,
TALER_EXCHANGEDB_DenominationsCallback cb, TALER_EXCHANGEDB_DenominationsCallback cb,
void *cb_cls) void *cb_cls)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_PQ_QueryParam params[] = { struct GNUNET_PQ_QueryParam params[] = {
@ -143,7 +141,7 @@ TEH_PG_iterate_denominations (void *cls,
.pg = pg .pg = pg
}; };
/* Used in #postgres_iterate_denominations() */ /* Used in #postgres_iterate_denominations() */
PREPARE (pg, PREPARE (pg,
"select_denominations", "select_denominations",
"SELECT" "SELECT"

View File

@ -60,7 +60,7 @@ struct GlobalFeeLookupContext
/** /**
* Helper function for #postgres_lookup_global_fee_by_time(). * Helper function for #TEH_PG_lookup_global_fee_by_time().
* Calls the callback with each denomination key. * Calls the callback with each denomination key.
* *
* @param cls a `struct GlobalFeeLookupContext` * @param cls a `struct GlobalFeeLookupContext`
@ -138,9 +138,6 @@ global_fee_by_time_helper (void *cls,
} }
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_lookup_global_fee_by_time ( TEH_PG_lookup_global_fee_by_time (
void *cls, void *cls,
@ -186,4 +183,3 @@ TEH_PG_lookup_global_fee_by_time (
&global_fee_by_time_helper, &global_fee_by_time_helper,
&wlc); &wlc);
} }

View File

@ -46,7 +46,7 @@ struct WireFeeLookupContext
/** /**
* Helper function for #postgres_lookup_wire_fee_by_time(). * Helper function for #TEH_PG_lookup_wire_fee_by_time().
* Calls the callback with the wire fee structure. * Calls the callback with the wire fee structure.
* *
* @param cls a `struct WireFeeLookupContext` * @param cls a `struct WireFeeLookupContext`
@ -138,7 +138,7 @@ TEH_PG_lookup_wire_fee_by_time (
.fees = fees, .fees = fees,
.pg = pg .pg = pg
}; };
/* used in #postgres_lookup_wire_fee_by_time() */ /* used in #postgres_lookup_wire_fee_by_time() */
PREPARE (pg, PREPARE (pg,
"lookup_wire_fee_by_time", "lookup_wire_fee_by_time",
"SELECT" "SELECT"

View File

@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_lookup_wire_tranfer.c * @file exchangedb/pg_lookup_wire_transfer.c
* @brief Implementation of the lookup_wire_tranfer function for Postgres * @brief Implementation of the lookup_wire_transfer function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#include "platform.h" #include "platform.h"
@ -128,6 +128,7 @@ handle_wt_result (void *cls,
} }
} }
enum GNUNET_DB_QueryStatus enum GNUNET_DB_QueryStatus
TEH_PG_lookup_wire_transfer ( TEH_PG_lookup_wire_transfer (
void *cls, void *cls,
@ -148,7 +149,7 @@ TEH_PG_lookup_wire_transfer (
ctx.pg = pg; ctx.pg = pg;
ctx.status = GNUNET_OK; ctx.status = GNUNET_OK;
/* check if the melt record exists and get it */ /* check if the melt record exists and get it */
/* Used in #postgres_lookup_wire_transfer */ /* Used in #postgres_lookup_wire_transfer */
PREPARE (pg, PREPARE (pg,
"lookup_transactions", "lookup_transactions",
"SELECT" "SELECT"

View File

@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_lookup_wire_tranfer.h * @file exchangedb/pg_lookup_wire_transfer.h
* @brief implementation of the lookup_wire_tranfer function for Postgres * @brief implementation of the lookup_wire_transfer function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#ifndef PG_LOOKUP_WIRE_TRANSFER_H #ifndef PG_LOOKUP_WIRE_TRANSFER_H

View File

@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_prefligth.c * @file exchangedb/pg_preflight.c
* @brief Implementation of the prefligth function for Postgres * @brief Implementation of the preflight function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#include "platform.h" #include "platform.h"

View File

@ -14,12 +14,12 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_prefligth.h * @file exchangedb/pg_preflight.h
* @brief implementation of the prefligth function for Postgres * @brief implementation of the preflight function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#ifndef PG_PREFLIGHT_H #ifndef PG_PREFLIGTH_H
#define PG_PREFLIGHT_H #define PG_PREFLIGTH_H
#include "taler_util.h" #include "taler_util.h"
#include "taler_json_lib.h" #include "taler_json_lib.h"
@ -40,4 +40,5 @@
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TEH_PG_preflight (void *cls); TEH_PG_preflight (void *cls);
#endif #endif

View File

@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_start_read_commited.c * @file exchangedb/pg_start_read_committed.c
* @brief Implementation of the start_read_commited function for Postgres * @brief Implementation of the start_read_committed function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#include "platform.h" #include "platform.h"
@ -28,7 +28,7 @@
enum GNUNET_GenericReturnValue enum GNUNET_GenericReturnValue
TEH_PG_start_read_committed (void *cls, TEH_PG_start_read_committed (void *cls,
const char *name) const char *name)
{ {
struct PostgresClosure *pg = cls; struct PostgresClosure *pg = cls;
struct GNUNET_PQ_ExecuteStatement es[] = { struct GNUNET_PQ_ExecuteStatement es[] = {

View File

@ -14,8 +14,8 @@
TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/>
*/ */
/** /**
* @file exchangedb/pg_start_read_commited.h * @file exchangedb/pg_start_read_committed.h
* @brief implementation of the start_read_commited function for Postgres * @brief implementation of the start_read_committed function for Postgres
* @author Christian Grothoff * @author Christian Grothoff
*/ */
#ifndef PG_START_READ_COMMITTED_H #ifndef PG_START_READ_COMMITTED_H

View File

@ -2519,7 +2519,7 @@ TALER_CRYPTO_helper_cs_sign (
* @param reqs information about the keys to sign with and the values to sign * @param reqs information about the keys to sign with and the values to sign
* @param reqs_length length of the @a reqs array * @param reqs_length length of the @a reqs array
* @param for_melt true if this is for a melt operation * @param for_melt true if this is for a melt operation
* @param[out] bs array set to the blind signatures, must be of length @a reqs_length! * @param[out] bss array set to the blind signatures, must be of length @a reqs_length!
* @return #TALER_EC_NONE on success * @return #TALER_EC_NONE on success
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode
@ -2606,7 +2606,7 @@ TALER_CRYPTO_helper_cs_r_derive (
* @param cdrs array with derivation input data * @param cdrs array with derivation input data
* @param cdrs_length length of the @a cdrs array * @param cdrs_length length of the @a cdrs array
* @param for_melt true if this is for a melt operation * @param for_melt true if this is for a melt operation
* @param[out] crp array set to the pair of R values, must be of length @a cdrs_length * @param[out] crps array set to the pair of R values, must be of length @a cdrs_length
* @return set to the error code (or #TALER_EC_NONE on success) * @return set to the error code (or #TALER_EC_NONE on success)
*/ */
enum TALER_ErrorCode enum TALER_ErrorCode