diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-10-03 17:05:29 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-10-03 17:05:29 +0200 |
commit | 2dbf8cefe0a11252758227bf4a3a7881fa663edc (patch) | |
tree | 31845026dca69ea8b708d2317a5add80d6656d33 /src/exchangedb/pg_select_reserve_close_info.c | |
parent | f4c8eb6a9c460a9a9b8ea1c4358e1ce87097a8f1 (diff) | |
download | exchange-2dbf8cefe0a11252758227bf4a3a7881fa663edc.tar.xz |
-work on DB logic
Diffstat (limited to 'src/exchangedb/pg_select_reserve_close_info.c')
-rw-r--r-- | src/exchangedb/pg_select_reserve_close_info.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/src/exchangedb/pg_select_reserve_close_info.c b/src/exchangedb/pg_select_reserve_close_info.c index 472ec27c9..a573f100d 100644 --- a/src/exchangedb/pg_select_reserve_close_info.c +++ b/src/exchangedb/pg_select_reserve_close_info.c @@ -34,29 +34,28 @@ TEH_PG_select_reserve_close_info ( char **payto_uri) { struct PostgresClosure *pg = cls; - // FIXME: everything from here is copy*paste! struct GNUNET_PQ_QueryParam params[] = { - GNUNET_PQ_query_param_auto_from_type (&cpi->coin_pub), - GNUNET_PQ_query_param_uint64 (&known_coin_id), - GNUNET_PQ_query_param_auto_from_type (coin_sig), - GNUNET_PQ_query_param_auto_from_type (reserve_sig), - TALER_PQ_query_param_amount (coin_total), + GNUNET_PQ_query_param_auto_from_type (reserve_pub), GNUNET_PQ_query_param_end }; struct GNUNET_PQ_ResultSpec rs[] = { - GNUNET_PQ_result_spec_bool ("insufficient_funds", - insufficient_funds), + TALER_PQ_RESULT_SPEC_AMOUNT ("balance", + balance), + GNUNET_PQ_result_spec_string ("payto_uri", + payto_uri), GNUNET_PQ_result_spec_end }; PREPARE (pg, - "insert_reserve_open_deposit", + "select_reserve_close_info", "SELECT " - " insufficient_funds" - " FROM exchange_do_reserve_open_deposit" - " ($1,$2,$3,$4,$5,$6);"); + " balance_frac" + ",balance_val" + ",payto_uri" + " FROM FIXME" + " WHERE reserve_pub=$1;"); return GNUNET_PQ_eval_prepared_singleton_select (pg->conn, - "insert_reserve_open_deposit", + "select_reserve_close_info", params, rs); } |