diff options
author | Christian Grothoff <grothoff@gnunet.org> | 2022-03-17 14:16:19 +0100 |
---|---|---|
committer | Christian Grothoff <grothoff@gnunet.org> | 2022-03-17 14:16:34 +0100 |
commit | 12809b28ec6fb7a9b5a846faa9c652f7c3fd63e1 (patch) | |
tree | e05399cfda8d2ae724120e7fb6c7686ea713f601 /src/exchangedb | |
parent | 63879d9d20986e66e847f1e19b16f5f2a60ee469 (diff) | |
download | exchange-12809b28ec6fb7a9b5a846faa9c652f7c3fd63e1.tar.xz |
-misc fixes
Diffstat (limited to 'src/exchangedb')
-rw-r--r-- | src/exchangedb/drop0001.sql | 4 | ||||
-rw-r--r-- | src/exchangedb/exchange-0001.sql | 2 | ||||
-rw-r--r-- | src/exchangedb/plugin_exchangedb_postgres.c | 22 |
3 files changed, 19 insertions, 9 deletions
diff --git a/src/exchangedb/drop0001.sql b/src/exchangedb/drop0001.sql index 7c138d9f5..2b510cbae 100644 --- a/src/exchangedb/drop0001.sql +++ b/src/exchangedb/drop0001.sql @@ -27,8 +27,8 @@ BEGIN; SELECT _v.unregister_patch('exchange-0001'); -- Drops for exchange-0001.sql -DROP TRIGGER IF EXISTS reserves_out_on_insert ON reserves_out_default; -DROP TRIGGER IF EXISTS reserves_out_on_delete ON reserves_out_default; +DROP TRIGGER IF EXISTS reserves_out_on_insert ON reserves_out; +DROP TRIGGER IF EXISTS reserves_out_on_delete ON reserves_out; DROP TABLE IF EXISTS revolving_work_shards CASCADE; DROP TABLE IF EXISTS extensions CASCADE; DROP TABLE IF EXISTS auditors CASCADE; diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/exchange-0001.sql index 77a9ba2a8..70e8462ab 100644 --- a/src/exchangedb/exchange-0001.sql +++ b/src/exchangedb/exchange-0001.sql @@ -455,7 +455,7 @@ COMMENT ON COLUMN refresh_commitments.rc COMMENT ON COLUMN refresh_commitments.old_coin_pub IS 'Coin being melted in the refresh process.'; COMMENT ON COLUMN refresh_commitments.h_age_commitment - IS 'The (optional) age commitment that was involved in the minting process of the coin, may be NULL.'; + IS 'The (optional) age commitment that was involved in the minting process of the coin, may be NULL. -- FIXME: Oec: this is in known_coins, why replicated here!??!'; CREATE TABLE IF NOT EXISTS refresh_commitments_default PARTITION OF refresh_commitments diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 34d3b9f9c..f9152d489 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -868,7 +868,7 @@ prepare_statements (struct PostgresClosure *pg) ",denoms.fee_refresh_frac" ",old_coin_pub" ",old_coin_sig" - ",h_age_commitment" + ",kc.age_commitment_hash" ",amount_with_fee_val" ",amount_with_fee_frac" ",noreveal_index" @@ -887,7 +887,7 @@ prepare_statements (struct PostgresClosure *pg) "SELECT" " denom.denom_pub" ",kc.coin_pub AS old_coin_pub" - ",h_age_commitment" + ",kc.age_commitment_hash" ",old_coin_sig" ",amount_with_fee_val" ",amount_with_fee_frac" @@ -913,7 +913,7 @@ prepare_statements (struct PostgresClosure *pg) ",denoms.denom_pub_hash" ",denoms.fee_refresh_val" ",denoms.fee_refresh_frac" - ",h_age_commitment" + ",kc.age_commitment_hash" ",melt_serial_id" " FROM refresh_commitments" " JOIN known_coins kc" @@ -1558,6 +1558,7 @@ prepare_statements (struct PostgresClosure *pg) ",ro.h_blind_ev" ",denoms.denom_pub_hash" ",coins.denom_sig" + ",coins.age_commitment_hash" ",denoms.denom_pub" ",amount_val" ",amount_frac" @@ -1581,6 +1582,7 @@ prepare_statements (struct PostgresClosure *pg) " recoup_refresh_uuid" ",recoup_timestamp" ",old_coins.coin_pub AS old_coin_pub" + ",old_coins.age_commitment_hash" ",old_denoms.denom_pub_hash AS old_denom_pub_hash" ",new_coins.coin_pub As coin_pub" ",coin_sig" @@ -6344,7 +6346,7 @@ postgres_get_melt (void *cls, GNUNET_PQ_result_spec_auto_from_type ("old_coin_sig", &melt->session.coin_sig), GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_auto_from_type ("h_age_commitment", + GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &melt->session.coin.h_age_commitment), &h_age_commitment_is_null), TALER_PQ_RESULT_SPEC_AMOUNT ("amount_with_fee", @@ -6964,7 +6966,7 @@ add_coin_melt (void *cls, TALER_PQ_RESULT_SPEC_AMOUNT ("fee_refresh", &melt->melt_fee), GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_auto_from_type ("h_age_commitment", + GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &melt->h_age_commitment), &melt->no_age_commitment), GNUNET_PQ_result_spec_uint64 ("melt_serial_id", @@ -8742,7 +8744,7 @@ refreshs_serial_helper_cb (void *cls, TALER_PQ_result_spec_denom_pub ("denom_pub", &denom_pub), GNUNET_PQ_result_spec_allow_null ( - GNUNET_PQ_result_spec_auto_from_type ("h_age_commitment", + GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", &h_age_commitment), &ac_isnull), GNUNET_PQ_result_spec_auto_from_type ("old_coin_pub", @@ -9525,6 +9527,10 @@ recoup_serial_helper_cb (void *cls, &h_blind_ev), GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &coin.denom_pub_hash), + GNUNET_PQ_result_spec_allow_null ( + GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", + &coin.h_age_commitment), + &coin.no_age_commitment), TALER_PQ_result_spec_denom_sig ("denom_sig", &coin.denom_sig), TALER_PQ_RESULT_SPEC_AMOUNT ("amount", @@ -9676,6 +9682,10 @@ recoup_refresh_serial_helper_cb (void *cls, &h_blind_ev), GNUNET_PQ_result_spec_auto_from_type ("denom_pub_hash", &coin.denom_pub_hash), + GNUNET_PQ_result_spec_allow_null ( + GNUNET_PQ_result_spec_auto_from_type ("age_commitment_hash", + &coin.h_age_commitment), + &coin.no_age_commitment), TALER_PQ_result_spec_denom_sig ("denom_sig", &coin.denom_sig), TALER_PQ_RESULT_SPEC_AMOUNT ("amount", |