aboutsummaryrefslogtreecommitdiff
path: root/src/exchangedb/pg_get_age_withdraw.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:04:02 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2023-07-26 04:04:02 +0200
commit1ce9312d0293444e55512bba69265f4671d387e9 (patch)
tree15b58dff705c54fa938cfc34e0a7a6173aee951f /src/exchangedb/pg_get_age_withdraw.c
parentac462b275300d28f939a9be83c5bd220fbb0d7cd (diff)
downloadexchange-1ce9312d0293444e55512bba69265f4671d387e9.tar.gz
exchange-1ce9312d0293444e55512bba69265f4671d387e9.tar.bz2
exchange-1ce9312d0293444e55512bba69265f4671d387e9.zip
[age-withdraw] WIP - database transaction during reveal works now
The test for age-restriction still fail, but the database transactions, including passing arrays in/out the PQ-helpers works.
Diffstat (limited to 'src/exchangedb/pg_get_age_withdraw.c')
-rw-r--r--src/exchangedb/pg_get_age_withdraw.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/exchangedb/pg_get_age_withdraw.c b/src/exchangedb/pg_get_age_withdraw.c
index 5e123ca9a..a66051c71 100644
--- a/src/exchangedb/pg_get_age_withdraw.c
+++ b/src/exchangedb/pg_get_age_withdraw.c
@@ -52,27 +52,26 @@ TEH_PG_get_age_withdraw (
&aw->amount_with_fee),
GNUNET_PQ_result_spec_uint16 ("noreveal_index",
&aw->noreveal_index),
- GNUNET_PQ_result_spec_array_fixed_size (
+ TALER_PQ_result_spec_array_blinded_coin_hash (
pg->conn,
- "h_coin_evs",
- sizeof(struct TALER_BlindedPlanchet),
+ "h_blind_evs",
&aw->num_coins,
- (void **) &aw->h_coin_evs),
- GNUNET_PQ_result_spec_array_fixed_size (
+ &aw->h_coin_evs),
+ TALER_PQ_result_spec_array_blinded_denom_sig (
pg->conn,
"denom_sigs",
- sizeof(struct TALER_DenominationSignature),
- NULL,
- (void **) &aw->denom_sigs),
- GNUNET_PQ_result_spec_array_fixed_size (
+ NULL, /* we assume that this is the same size as h_coin_evs */
+ &aw->denom_sigs),
+ TALER_PQ_result_spec_array_denom_hash (
pg->conn,
"denom_pub_hashes",
- sizeof(struct TALER_DenominationHashP),
- NULL,
- (void **) &aw->denom_pub_hashes),
+ NULL, /* we assume that this is the same size as h_coin_evs */
+ &aw->denom_pub_hashes),
GNUNET_PQ_result_spec_end
};
+ GNUNET_assert (NULL != aw);
+
/* Used in #postgres_get_age_withdraw() to
locate the response for a /reserve/$RESERVE_PUB/age-withdraw request
using the hash of the blinded message. Also needed to ensure
@@ -87,12 +86,12 @@ TEH_PG_get_age_withdraw (
",amount_with_fee_val"
",amount_with_fee_frac"
",noreveal_index"
- ",h_coin_evs"
+ ",h_blind_evs"
",denom_sigs"
",ARRAY("
" SELECT denominations.denom_pub_hash FROM ("
- " SELECT UNNEST(denomination_serials) AS id,"
- " generate_subscripts(denominations_serials, 1) AS nr" /* for order */
+ " SELECT UNNEST(denom_serials) AS id,"
+ " generate_subscripts(denom_serials, 1) AS nr" /* for order */
" ) AS denoms"
" LEFT JOIN denominations ON denominations.denominations_serial=denoms.id"
") AS denom_pub_hashes"