From ac462b275300d28f939a9be83c5bd220fbb0d7cd Mon Sep 17 00:00:00 2001 From: Özgür Kesim Date: Wed, 26 Jul 2023 04:02:09 +0200 Subject: [pq] Added support for some Taler-specific array types Added array support for DB-query and -result for - denomination signatures - blinded envelope hases - denomination hashes --- src/include/taler_pq_lib.h | 75 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) (limited to 'src/include/taler_pq_lib.h') diff --git a/src/include/taler_pq_lib.h b/src/include/taler_pq_lib.h index fdc17ca5..7ea6bef3 100644 --- a/src/include/taler_pq_lib.h +++ b/src/include/taler_pq_lib.h @@ -126,6 +126,33 @@ struct GNUNET_PQ_QueryParam TALER_PQ_query_param_json (const json_t *x); +/** + * Generate query parameter for an array of blinded denomination signatures + * + * @param num number of elements in @e denom_sigs + * @param denom_sigs array of blinded denomination signatures + * @param db context for the db-connection + */ +struct GNUNET_PQ_QueryParam +TALER_PQ_query_param_array_blinded_denom_sig ( + size_t num, + const struct TALER_BlindedDenominationSignature *denom_sigs, + const struct GNUNET_PQ_Context *db + ); + +/** + * Generate query parameter for an array of blinded hashes of coin envelopes + * + * @param num number of elements in @e denom_sigs + * @param coin_evs array of blinded hashes of coin envelopes + * @param db context for the db-connection + */ +struct GNUNET_PQ_QueryParam +TALER_PQ_query_param_array_blinded_coin_hash ( + size_t num, + const struct TALER_BlindedCoinHashP *coin_evs, + const struct GNUNET_PQ_Context *db); + /** * Currency amount expected. * @@ -229,6 +256,54 @@ TALER_PQ_result_spec_json (const char *name, json_t **jp); +/** + * Array of blinded denomination signature expected + * + * @parma db context of the database connection + * @param name name of the field in the table + * @param[out] num number of elements in @e denom_sigs + * @param[out] denom_sigs where to store the result + * @return array entry for the result specification to use + */ +struct GNUNET_PQ_ResultSpec +TALER_PQ_result_spec_array_blinded_denom_sig ( + const struct GNUNET_PQ_Context *db, + const char *name, + size_t *num, + struct TALER_BlindedDenominationSignature **denom_sigs); + +/** + * Array of blinded hashes of coin envelopes + * + * @parma db context of the database connection + * @param name name of the field in the table + * @param[out] num number of elements in @e denom_sigs + * @param[out] h_coin_evs where to store the result + * @return array entry for the result specification to use + */ +struct GNUNET_PQ_ResultSpec +TALER_PQ_result_spec_array_blinded_coin_hash ( + const struct GNUNET_PQ_Context *db, + const char *name, + size_t *num, + struct TALER_BlindedCoinHashP **h_coin_evs); + +/** + * Array of hashes of denominations + * + * @parma db context of the database connection + * @param name name of the field in the table + * @param[out] num number of elements in @e denom_sigs + * @param[out] denom_hs where to store the result + * @return array entry for the result specification to use + */ +struct GNUNET_PQ_ResultSpec +TALER_PQ_result_spec_array_denom_hash ( + const struct GNUNET_PQ_Context *db, + const char *name, + size_t *num, + struct TALER_DenominationHashP **denom_hs); + #endif /* TALER_PQ_LIB_H_ */ /* end of include/taler_pq_lib.h */ -- cgit v1.2.3