exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit befa232c8831d25d526a39667655b6e999c06fb7
parent 90292e199af444f2f266924ed60b273f20c913a0
Author: Christian Grothoff <christian@grothoff.org>
Date:   Wed, 15 Apr 2026 22:56:03 +0200

organize exchangedb directory a bit

Diffstat:
Rsrc/exchangedb/exchange_do_batch_coin_known.sql -> src/exchangedb/batch_ensure_coin_known.sql | 0
Rsrc/exchangedb/exchange_do_check_deposit_idempotent.sql -> src/exchangedb/do_check_deposit_idempotent.sql | 0
Rsrc/exchangedb/exchange_do_deposit.sql -> src/exchangedb/do_deposit.sql | 0
Rsrc/exchangedb/exchange_do_purse_delete.sql -> src/exchangedb/do_purse_delete.sql | 0
Rsrc/exchangedb/exchange_do_purse_deposit.sql -> src/exchangedb/do_purse_deposit.sql | 0
Rsrc/exchangedb/exchange_do_purse_merge.sql -> src/exchangedb/do_purse_merge.sql | 0
Rsrc/exchangedb/exchange_do_recoup_to_reserve.sql -> src/exchangedb/do_recoup.sql | 0
Rsrc/exchangedb/exchange_do_recoup_to_coin.sql -> src/exchangedb/do_recoup_refresh.sql | 0
Rsrc/exchangedb/exchange_do_refresh.sql -> src/exchangedb/do_refresh.sql | 0
Rsrc/exchangedb/exchange_do_refund.sql -> src/exchangedb/do_refund.sql | 0
Rsrc/exchangedb/exchange_do_reserve_open.sql -> src/exchangedb/do_reserve_open.sql | 0
Rsrc/exchangedb/exchange_do_reserve_purse.sql -> src/exchangedb/do_reserve_purse.sql | 0
Rsrc/exchangedb/exchange_do_withdraw.sql -> src/exchangedb/do_withdraw.sql | 0
Dsrc/exchangedb/exchange_do_batch_reserves_update.sql | 72------------------------------------------------------------------------
Dsrc/exchangedb/exchange_do_reserves_in_insert.sql | 142-------------------------------------------------------------------------------
Rsrc/exchangedb/exchange_do_expire_purse.sql -> src/exchangedb/expire_purse.sql | 0
Rsrc/exchangedb/exchange_do_main_gc.sql -> src/exchangedb/gc.sql | 0
Rsrc/exchangedb/exchange_do_get_kyc_rules.sql -> src/exchangedb/get_kyc_rules.sql | 0
Rsrc/exchangedb/exchange_do_insert_active_legitimization_measure.sql -> src/exchangedb/insert_active_legitimization_measure.sql | 0
Rsrc/exchangedb/exchange_do_insert_aml_decision.sql -> src/exchangedb/insert_aml_decision.sql | 0
Rsrc/exchangedb/exchange_do_insert_aml_officer.sql -> src/exchangedb/insert_aml_officer.sql | 0
Rsrc/exchangedb/exchange_do_insert_aml_program_failure.sql -> src/exchangedb/insert_aml_program_failure.sql | 0
Rsrc/exchangedb/exchange_do_reserve_open_deposit.sql -> src/exchangedb/insert_reserve_open_deposit.sql | 0
Rsrc/exchangedb/exchange_do_insert_sanction_list_hit.sql -> src/exchangedb/insert_sanction_list_hit.sql | 0
Rsrc/exchangedb/exchange_do_insert_successor_measure.sql -> src/exchangedb/insert_successor_measure.sql | 0
Rsrc/exchangedb/exchange_do_kycauth_in_insert.sql -> src/exchangedb/kycauth_in_insert.sql | 0
Rsrc/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql -> src/exchangedb/lookup_kyc_requirement_by_row.sql | 0
Msrc/exchangedb/meson.build | 31+------------------------------
Dsrc/exchangedb/perf-exchangedb-reserves-in-insert-postgres | 210-------------------------------------------------------------------------------
Rsrc/exchangedb/exchange_do_persist_kyc_attributes.sql -> src/exchangedb/persist_kyc_attributes.sql | 0
Rsrc/exchangedb/exchange_do_insert_or_update_policy_details.sql -> src/exchangedb/persist_policy_details.sql | 0
Dsrc/exchangedb/procedures.sql.in | 84-------------------------------------------------------------------------------
Asrc/exchangedb/reserves_in_insert.sql | 200+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rsrc/exchangedb/exchange_do_select_aggregations_above_serial.sql -> src/exchangedb/select_aggregations_above_serial.sql | 0
Rsrc/exchangedb/exchange_do_select_deposits_missing_wire.sql -> src/exchangedb/select_batch_deposits_missing_wire.sql | 0
Rsrc/exchangedb/exchange_do_set_aml_lock.sql -> src/exchangedb/set_aml_lock.sql | 0
Rsrc/exchangedb/0002-account_merges.sql -> src/exchangedb/sql-schema/0002-account_merges.sql | 0
Rsrc/exchangedb/0002-aggregation_tracking.sql -> src/exchangedb/sql-schema/0002-aggregation_tracking.sql | 0
Rsrc/exchangedb/0002-aggregation_transient.sql -> src/exchangedb/sql-schema/0002-aggregation_transient.sql | 0
Rsrc/exchangedb/0002-aml_history.sql -> src/exchangedb/sql-schema/0002-aml_history.sql | 0
Rsrc/exchangedb/0002-aml_staff.sql -> src/exchangedb/sql-schema/0002-aml_staff.sql | 0
Rsrc/exchangedb/0002-auditor_denom_sigs.sql -> src/exchangedb/sql-schema/0002-auditor_denom_sigs.sql | 0
Rsrc/exchangedb/0002-auditors.sql -> src/exchangedb/sql-schema/0002-auditors.sql | 0
Rsrc/exchangedb/0002-batch_deposits.sql -> src/exchangedb/sql-schema/0002-batch_deposits.sql | 0
Rsrc/exchangedb/0002-close_requests.sql -> src/exchangedb/sql-schema/0002-close_requests.sql | 0
Rsrc/exchangedb/0002-coin_deposits.sql -> src/exchangedb/sql-schema/0002-coin_deposits.sql | 0
Rsrc/exchangedb/0002-coin_history.sql -> src/exchangedb/sql-schema/0002-coin_history.sql | 0
Rsrc/exchangedb/0002-contracts.sql -> src/exchangedb/sql-schema/0002-contracts.sql | 0
Rsrc/exchangedb/0002-cs_nonce_locks.sql -> src/exchangedb/sql-schema/0002-cs_nonce_locks.sql | 0
Rsrc/exchangedb/0002-denomination_revocations.sql -> src/exchangedb/sql-schema/0002-denomination_revocations.sql | 0
Rsrc/exchangedb/0002-denominations.sql -> src/exchangedb/sql-schema/0002-denominations.sql | 0
Rsrc/exchangedb/0002-exchange_sign_keys.sql -> src/exchangedb/sql-schema/0002-exchange_sign_keys.sql | 0
Rsrc/exchangedb/0002-extensions.sql -> src/exchangedb/sql-schema/0002-extensions.sql | 0
Rsrc/exchangedb/0002-global_fee.sql -> src/exchangedb/sql-schema/0002-global_fee.sql | 0
Rsrc/exchangedb/0002-history_requests.sql -> src/exchangedb/sql-schema/0002-history_requests.sql | 0
Rsrc/exchangedb/0002-known_coins.sql -> src/exchangedb/sql-schema/0002-known_coins.sql | 0
Rsrc/exchangedb/0002-kyc_alerts.sql -> src/exchangedb/sql-schema/0002-kyc_alerts.sql | 0
Rsrc/exchangedb/0002-kyc_attributes.sql -> src/exchangedb/sql-schema/0002-kyc_attributes.sql | 0
Rsrc/exchangedb/0002-kyc_events.sql -> src/exchangedb/sql-schema/0002-kyc_events.sql | 0
Rsrc/exchangedb/0002-kycauths_in.sql -> src/exchangedb/sql-schema/0002-kycauths_in.sql | 0
Rsrc/exchangedb/0002-legitimization_measures.sql -> src/exchangedb/sql-schema/0002-legitimization_measures.sql | 0
Rsrc/exchangedb/0002-legitimization_outcomes.sql -> src/exchangedb/sql-schema/0002-legitimization_outcomes.sql | 0
Rsrc/exchangedb/0002-legitimization_processes.sql -> src/exchangedb/sql-schema/0002-legitimization_processes.sql | 0
Rsrc/exchangedb/0002-partner_accounts.sql -> src/exchangedb/sql-schema/0002-partner_accounts.sql | 0
Rsrc/exchangedb/0002-partners.sql -> src/exchangedb/sql-schema/0002-partners.sql | 0
Rsrc/exchangedb/0002-policy_details.sql -> src/exchangedb/sql-schema/0002-policy_details.sql | 0
Rsrc/exchangedb/0002-policy_fulfillments.sql -> src/exchangedb/sql-schema/0002-policy_fulfillments.sql | 0
Rsrc/exchangedb/0002-prewire.sql -> src/exchangedb/sql-schema/0002-prewire.sql | 0
Rsrc/exchangedb/0002-profit_drains.sql -> src/exchangedb/sql-schema/0002-profit_drains.sql | 0
Rsrc/exchangedb/0002-purse_actions.sql -> src/exchangedb/sql-schema/0002-purse_actions.sql | 0
Rsrc/exchangedb/0002-purse_decision.sql -> src/exchangedb/sql-schema/0002-purse_decision.sql | 0
Rsrc/exchangedb/0002-purse_deletion.sql -> src/exchangedb/sql-schema/0002-purse_deletion.sql | 0
Rsrc/exchangedb/0002-purse_deposits.sql -> src/exchangedb/sql-schema/0002-purse_deposits.sql | 0
Rsrc/exchangedb/0002-purse_merges.sql -> src/exchangedb/sql-schema/0002-purse_merges.sql | 0
Rsrc/exchangedb/0002-purse_requests.sql -> src/exchangedb/sql-schema/0002-purse_requests.sql | 0
Rsrc/exchangedb/0002-recoup.sql -> src/exchangedb/sql-schema/0002-recoup.sql | 0
Rsrc/exchangedb/0002-recoup_refresh.sql -> src/exchangedb/sql-schema/0002-recoup_refresh.sql | 0
Rsrc/exchangedb/0002-refresh.sql -> src/exchangedb/sql-schema/0002-refresh.sql | 0
Rsrc/exchangedb/0002-refunds.sql -> src/exchangedb/sql-schema/0002-refunds.sql | 0
Rsrc/exchangedb/0002-reserve_history.sql -> src/exchangedb/sql-schema/0002-reserve_history.sql | 0
Rsrc/exchangedb/0002-reserves.sql -> src/exchangedb/sql-schema/0002-reserves.sql | 0
Rsrc/exchangedb/0002-reserves_close.sql -> src/exchangedb/sql-schema/0002-reserves_close.sql | 0
Rsrc/exchangedb/0002-reserves_in.sql -> src/exchangedb/sql-schema/0002-reserves_in.sql | 0
Rsrc/exchangedb/0002-reserves_open_deposits.sql -> src/exchangedb/sql-schema/0002-reserves_open_deposits.sql | 0
Rsrc/exchangedb/0002-reserves_open_requests.sql -> src/exchangedb/sql-schema/0002-reserves_open_requests.sql | 0
Rsrc/exchangedb/0002-revolving_work_shards.sql -> src/exchangedb/sql-schema/0002-revolving_work_shards.sql | 0
Rsrc/exchangedb/0002-signkey_revocations.sql -> src/exchangedb/sql-schema/0002-signkey_revocations.sql | 0
Rsrc/exchangedb/0002-statistics.sql -> src/exchangedb/sql-schema/0002-statistics.sql | 0
Rsrc/exchangedb/0002-unique_refresh_blinding_seed.sql -> src/exchangedb/sql-schema/0002-unique_refresh_blinding_seed.sql | 0
Rsrc/exchangedb/0002-unique_withdraw_blinding_seed.sql -> src/exchangedb/sql-schema/0002-unique_withdraw_blinding_seed.sql | 0
Rsrc/exchangedb/0002-wad_in_entries.sql -> src/exchangedb/sql-schema/0002-wad_in_entries.sql | 0
Rsrc/exchangedb/0002-wad_out_entries.sql -> src/exchangedb/sql-schema/0002-wad_out_entries.sql | 0
Rsrc/exchangedb/0002-wads_in.sql -> src/exchangedb/sql-schema/0002-wads_in.sql | 0
Rsrc/exchangedb/0002-wads_out.sql -> src/exchangedb/sql-schema/0002-wads_out.sql | 0
Rsrc/exchangedb/0002-wire_accounts.sql -> src/exchangedb/sql-schema/0002-wire_accounts.sql | 0
Rsrc/exchangedb/0002-wire_fee.sql -> src/exchangedb/sql-schema/0002-wire_fee.sql | 0
Rsrc/exchangedb/0002-wire_out.sql -> src/exchangedb/sql-schema/0002-wire_out.sql | 0
Rsrc/exchangedb/0002-wire_targets.sql -> src/exchangedb/sql-schema/0002-wire_targets.sql | 0
Rsrc/exchangedb/0002-withdraw.sql -> src/exchangedb/sql-schema/0002-withdraw.sql | 0
Rsrc/exchangedb/0002-work_shards.sql -> src/exchangedb/sql-schema/0002-work_shards.sql | 0
Rsrc/exchangedb/0003-kyc_targets.sql -> src/exchangedb/sql-schema/0003-kyc_targets.sql | 0
Rsrc/exchangedb/0003-legitimization_measures.sql -> src/exchangedb/sql-schema/0003-legitimization_measures.sql | 0
Rsrc/exchangedb/0003-legitimization_outcomes.sql -> src/exchangedb/sql-schema/0003-legitimization_outcomes.sql | 0
Rsrc/exchangedb/0003-legitimization_processes.sql -> src/exchangedb/sql-schema/0003-legitimization_processes.sql | 0
Rsrc/exchangedb/0003-reserves_out.sql -> src/exchangedb/sql-schema/0003-reserves_out.sql | 0
Rsrc/exchangedb/0003-wire_targets.sql -> src/exchangedb/sql-schema/0003-wire_targets.sql | 0
Rsrc/exchangedb/0004-kyc_attributes.sql -> src/exchangedb/sql-schema/0004-kyc_attributes.sql | 0
Rsrc/exchangedb/0004-refresh.sql -> src/exchangedb/sql-schema/0004-refresh.sql | 0
Rsrc/exchangedb/0009-batch_deposits.sql -> src/exchangedb/sql-schema/0009-batch_deposits.sql | 0
Rsrc/exchangedb/0010-wire_accounts.sql -> src/exchangedb/sql-schema/0010-wire_accounts.sql | 0
Rsrc/exchangedb/Makefile.sql -> src/exchangedb/sql-schema/Makefile.sql | 0
Rsrc/exchangedb/auditor-triggers-0001.sql -> src/exchangedb/sql-schema/auditor-triggers-0001.sql | 0
Rsrc/exchangedb/benchmark-0001.sql -> src/exchangedb/sql-schema/benchmark-0001.sql | 0
Rsrc/exchangedb/drop.sql -> src/exchangedb/sql-schema/drop.sql | 0
Rsrc/exchangedb/exchange-0001.sql -> src/exchangedb/sql-schema/exchange-0001.sql | 0
Rsrc/exchangedb/exchange-0002.sql.in -> src/exchangedb/sql-schema/exchange-0002.sql.in | 0
Rsrc/exchangedb/exchange-0003.sql.in -> src/exchangedb/sql-schema/exchange-0003.sql.in | 0
Rsrc/exchangedb/exchange-0004.sql.in -> src/exchangedb/sql-schema/exchange-0004.sql.in | 0
Rsrc/exchangedb/exchange-0005.sql -> src/exchangedb/sql-schema/exchange-0005.sql | 0
Rsrc/exchangedb/exchange-0006.sql -> src/exchangedb/sql-schema/exchange-0006.sql | 0
Rsrc/exchangedb/exchange-0007.sql -> src/exchangedb/sql-schema/exchange-0007.sql | 0
Rsrc/exchangedb/exchange-0008.sql -> src/exchangedb/sql-schema/exchange-0008.sql | 0
Rsrc/exchangedb/exchange-0009.sql.in -> src/exchangedb/sql-schema/exchange-0009.sql.in | 0
Rsrc/exchangedb/exchange-0010.sql.in -> src/exchangedb/sql-schema/exchange-0010.sql.in | 0
Rsrc/exchangedb/exchange_do_account_merge.sql -> src/exchangedb/sql-schema/exchange_do_account_merge.sql | 0
Rsrc/exchangedb/exchange_do_amount_specific.sql -> src/exchangedb/sql-schema/exchange_do_amount_specific.sql | 0
Rsrc/exchangedb/exchange_do_comment_partitioned_column.sql -> src/exchangedb/sql-schema/exchange_do_comment_partitioned_column.sql | 0
Rsrc/exchangedb/exchange_do_comment_partitioned_table.sql -> src/exchangedb/sql-schema/exchange_do_comment_partitioned_table.sql | 0
Rsrc/exchangedb/exchange_do_create_partitioned_table.sql -> src/exchangedb/sql-schema/exchange_do_create_partitioned_table.sql | 0
Rsrc/exchangedb/exchange_do_create_tables.sql -> src/exchangedb/sql-schema/exchange_do_create_tables.sql | 0
Rsrc/exchangedb/exchange_do_get_link_data.sql -> src/exchangedb/sql-schema/exchange_do_get_link_data.sql | 0
Rsrc/exchangedb/exchange_do_melt.sql -> src/exchangedb/sql-schema/exchange_do_melt.sql | 0
Rsrc/exchangedb/exchange_do_recoup_by_reserve.sql -> src/exchangedb/sql-schema/exchange_do_recoup_by_reserve.sql | 0
Rsrc/exchangedb/exchange_do_select_justification_for_missing_wire.sql -> src/exchangedb/sql-schema/exchange_do_select_justification_for_missing_wire.sql | 0
Rsrc/exchangedb/exchange_statistics_helpers.sql -> src/exchangedb/sql-schema/exchange_statistics_helpers.sql | 0
Rsrc/exchangedb/exchange_trigger_purse_decision_insert.sql -> src/exchangedb/sql-schema/exchange_trigger_purse_decision_insert.sql | 0
Rsrc/exchangedb/exchange_trigger_purse_requests_insert.sql -> src/exchangedb/sql-schema/exchange_trigger_purse_requests_insert.sql | 0
Rsrc/exchangedb/exchange_trigger_reserves_in_insert.sql -> src/exchangedb/sql-schema/exchange_trigger_reserves_in_insert.sql | 0
Rsrc/exchangedb/exchange_trigger_withdraw_delete.sql -> src/exchangedb/sql-schema/exchange_trigger_withdraw_delete.sql | 0
Rsrc/exchangedb/exchange_trigger_withdraw_insert.sql -> src/exchangedb/sql-schema/exchange_trigger_withdraw_insert.sql | 0
Asrc/exchangedb/sql-schema/meson.build | 30++++++++++++++++++++++++++++++
Asrc/exchangedb/sql-schema/procedures.sql.in | 86+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Rsrc/exchangedb/tops-0001.sql -> src/exchangedb/sql-schema/tops-0001.sql | 0
Rsrc/exchangedb/versioning.sql -> src/exchangedb/sql-schema/versioning.sql | 0
Dsrc/exchangedb/test-exchangedb-batch-reserves-in-insert-postgres | 210-------------------------------------------------------------------------------
Dsrc/exchangedb/test-exchangedb-by-j-postgres | 210-------------------------------------------------------------------------------
Dsrc/exchangedb/test-exchangedb-populate-link-data-postgres | 210-------------------------------------------------------------------------------
Dsrc/exchangedb/test-exchangedb-populate-ready-deposit-postgres | 210-------------------------------------------------------------------------------
Dsrc/exchangedb/test-exchangedb-populate-select-refunds-by-coin-postgres | 210-------------------------------------------------------------------------------
Rsrc/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql -> src/exchangedb/trigger_kyc_rule_for_account.sql | 0
150 files changed, 317 insertions(+), 1588 deletions(-)

diff --git a/src/exchangedb/exchange_do_batch_coin_known.sql b/src/exchangedb/batch_ensure_coin_known.sql diff --git a/src/exchangedb/exchange_do_check_deposit_idempotent.sql b/src/exchangedb/do_check_deposit_idempotent.sql diff --git a/src/exchangedb/exchange_do_deposit.sql b/src/exchangedb/do_deposit.sql diff --git a/src/exchangedb/exchange_do_purse_delete.sql b/src/exchangedb/do_purse_delete.sql diff --git a/src/exchangedb/exchange_do_purse_deposit.sql b/src/exchangedb/do_purse_deposit.sql diff --git a/src/exchangedb/exchange_do_purse_merge.sql b/src/exchangedb/do_purse_merge.sql diff --git a/src/exchangedb/exchange_do_recoup_to_reserve.sql b/src/exchangedb/do_recoup.sql diff --git a/src/exchangedb/exchange_do_recoup_to_coin.sql b/src/exchangedb/do_recoup_refresh.sql diff --git a/src/exchangedb/exchange_do_refresh.sql b/src/exchangedb/do_refresh.sql diff --git a/src/exchangedb/exchange_do_refund.sql b/src/exchangedb/do_refund.sql diff --git a/src/exchangedb/exchange_do_reserve_open.sql b/src/exchangedb/do_reserve_open.sql diff --git a/src/exchangedb/exchange_do_reserve_purse.sql b/src/exchangedb/do_reserve_purse.sql diff --git a/src/exchangedb/exchange_do_withdraw.sql b/src/exchangedb/do_withdraw.sql diff --git a/src/exchangedb/exchange_do_batch_reserves_update.sql b/src/exchangedb/exchange_do_batch_reserves_update.sql @@ -1,72 +0,0 @@ --- --- This file is part of TALER --- Copyright (C) 2014--2022 Taler Systems SA --- --- TALER is free software; you can redistribute it and/or modify it under the --- terms of the GNU General Public License as published by the Free Software --- Foundation; either version 3, or (at your option) any later version. --- --- TALER is distributed in the hope that it will be useful, but WITHOUT ANY --- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR --- A PARTICULAR PURPOSE. See the GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License along with --- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> --- - -CREATE OR REPLACE FUNCTION exchange_do_batch_reserves_update( - IN in_reserve_pub BYTEA, - IN in_expiration_date INT8, - IN in_wire_ref INT8, - IN in_credit taler_amount, - IN in_exchange_account_name TEXT, - IN in_wire_source_h_payto BYTEA, - IN in_notify text, - OUT out_duplicate BOOLEAN) -LANGUAGE plpgsql -AS $$ -BEGIN - INSERT INTO reserves_in - (reserve_pub - ,wire_reference - ,credit - ,exchange_account_section - ,wire_source_h_payto - ,execution_date) - VALUES - (in_reserve_pub - ,in_wire_ref - ,in_credit - ,in_exchange_account_name - ,in_wire_source_h_payto - ,in_expiration_date) - ON CONFLICT DO NOTHING; - IF FOUND - THEN - --IF THE INSERTION WAS A SUCCESS IT MEANS NO DUPLICATED TRANSACTION - out_duplicate = FALSE; - UPDATE reserves rs - SET - current_balance.frac = (rs.current_balance).frac+in_credit.frac - - CASE - WHEN (rs.current_balance).frac + in_credit.frac >= 100000000 - THEN 100000000 - ELSE 1 - END - ,current_balance.val = (rs.current_balance).val+in_credit.val - + CASE - WHEN (rs.current_balance).frac + in_credit.frac >= 100000000 - THEN 1 - ELSE 0 - END - ,expiration_date=GREATEST(expiration_date,in_expiration_date) - ,gc_date=GREATEST(gc_date,in_expiration_date) - WHERE reserve_pub=in_reserve_pub; - EXECUTE FORMAT ( - 'NOTIFY %s' - ,in_notify); - ELSE - out_duplicate = TRUE; - END IF; - RETURN; -END $$; diff --git a/src/exchangedb/exchange_do_reserves_in_insert.sql b/src/exchangedb/exchange_do_reserves_in_insert.sql @@ -1,142 +0,0 @@ --- --- This file is part of TALER --- Copyright (C) 2014--2024 Taler Systems SA --- --- TALER is free software; you can redistribute it and/or modify it under the --- terms of the GNU General Public License as published by the Free Software --- Foundation; either version 3, or (at your option) any later version. --- --- TALER is distributed in the hope that it will be useful, but WITHOUT ANY --- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR --- A PARTICULAR PURPOSE. See the GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License along with --- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> --- - - -DROP FUNCTION IF EXISTS exchange_do_array_reserves_insert; -CREATE FUNCTION exchange_do_array_reserves_insert( - IN in_gc_date INT8, - IN in_reserve_expiration INT8, - IN ina_reserve_pub BYTEA[], - IN ina_wire_ref INT8[], - IN ina_credit taler_amount[], - IN ina_exchange_account_name TEXT[], - IN ina_execution_date INT8[], - IN ina_wire_source_h_payto BYTEA[], - IN ina_h_normalized_payto BYTEA[], - IN ina_payto_uri TEXT[], - IN ina_notify TEXT[]) -RETURNS SETOF exchange_do_array_reserve_insert_return_type -LANGUAGE plpgsql -AS $$ -DECLARE - conflict BOOL; - dup BOOL; - uuid INT8; - i INT4; - my_is_wallet BOOL; - ini_reserve_pub BYTEA; - ini_wire_ref INT8; - ini_credit taler_amount; - ini_exchange_account_name TEXT; - ini_execution_date INT8; - ini_wire_source_h_payto BYTEA; - ini_h_normalized_payto BYTEA; - ini_payto_uri TEXT; - ini_notify TEXT; -BEGIN - - FOR i IN 1..array_length(ina_reserve_pub,1) - LOOP - ini_reserve_pub = ina_reserve_pub[i]; - ini_wire_ref = ina_wire_ref[i]; - ini_credit = ina_credit[i]; - ini_exchange_account_name = ina_exchange_account_name[i]; - ini_execution_date = ina_execution_date[i]; - ini_wire_source_h_payto = ina_wire_source_h_payto[i]; - ini_h_normalized_payto = ina_h_normalized_payto[i]; - ini_payto_uri = ina_payto_uri[i]; - ini_notify = ina_notify[i]; - --- RAISE WARNING 'Starting loop on %', ini_notify; - - my_is_wallet - = (LOWER (SUBSTRING (ini_payto_uri, 0, 23)) = - 'payto://taler-reserve/') OR - (LOWER (SUBSTRING (ini_payto_uri, 0, 28)) = - 'payto://taler-reserve-http/'); - INSERT INTO kyc_targets - (h_normalized_payto - ,is_wallet - ) VALUES ( - ini_h_normalized_payto - ,my_is_wallet - ) - ON CONFLICT DO NOTHING; - INSERT INTO wire_targets - (wire_target_h_payto - ,h_normalized_payto - ,payto_uri - ) VALUES ( - ini_wire_source_h_payto - ,ini_h_normalized_payto - ,ini_payto_uri - ) - ON CONFLICT DO NOTHING; - - INSERT INTO reserves - (reserve_pub - ,current_balance - ,expiration_date - ,gc_date - ) VALUES ( - ini_reserve_pub - ,ini_credit - ,in_reserve_expiration - ,in_gc_date - ) - ON CONFLICT DO NOTHING - RETURNING reserve_uuid - INTO uuid; - conflict = NOT FOUND; - - INSERT INTO reserves_in - (reserve_pub - ,wire_reference - ,credit - ,exchange_account_section - ,wire_source_h_payto - ,execution_date - ) VALUES ( - ini_reserve_pub - ,ini_wire_ref - ,ini_credit - ,ini_exchange_account_name - ,ini_wire_source_h_payto - ,ini_execution_date - ) - ON CONFLICT DO NOTHING; - - IF NOT FOUND - THEN - IF conflict - THEN - dup = TRUE; - else - dup = FALSE; - END IF; - ELSE - IF NOT conflict - THEN - EXECUTE FORMAT ( - 'NOTIFY %s' - ,ini_notify); - END IF; - dup = FALSE; - END IF; - RETURN NEXT (dup,uuid); - END LOOP; - RETURN; -END $$; diff --git a/src/exchangedb/exchange_do_expire_purse.sql b/src/exchangedb/expire_purse.sql diff --git a/src/exchangedb/exchange_do_main_gc.sql b/src/exchangedb/gc.sql diff --git a/src/exchangedb/exchange_do_get_kyc_rules.sql b/src/exchangedb/get_kyc_rules.sql diff --git a/src/exchangedb/exchange_do_insert_active_legitimization_measure.sql b/src/exchangedb/insert_active_legitimization_measure.sql diff --git a/src/exchangedb/exchange_do_insert_aml_decision.sql b/src/exchangedb/insert_aml_decision.sql diff --git a/src/exchangedb/exchange_do_insert_aml_officer.sql b/src/exchangedb/insert_aml_officer.sql diff --git a/src/exchangedb/exchange_do_insert_aml_program_failure.sql b/src/exchangedb/insert_aml_program_failure.sql diff --git a/src/exchangedb/exchange_do_reserve_open_deposit.sql b/src/exchangedb/insert_reserve_open_deposit.sql diff --git a/src/exchangedb/exchange_do_insert_sanction_list_hit.sql b/src/exchangedb/insert_sanction_list_hit.sql diff --git a/src/exchangedb/exchange_do_insert_successor_measure.sql b/src/exchangedb/insert_successor_measure.sql diff --git a/src/exchangedb/exchange_do_kycauth_in_insert.sql b/src/exchangedb/kycauth_in_insert.sql diff --git a/src/exchangedb/exchange_do_lookup_kyc_requirement_by_row.sql b/src/exchangedb/lookup_kyc_requirement_by_row.sql diff --git a/src/exchangedb/meson.build b/src/exchangedb/meson.build @@ -23,35 +23,7 @@ configure_file( copy: true, ) -sqldir = get_option('datadir') / 'taler-exchange' / 'sql' - -# FIXME possibly provide this output in the tgz through dist script -run_command('make', '-f', 'Makefile.sql', 'all', check: true) - -sqlfiles = [ - 'auditor-triggers-0001.sql', - 'benchmark-0001.sql', - 'drop.sql', - 'exchange-0001.sql', - 'exchange-0002.sql', - 'exchange-0003.sql', - 'exchange-0004.sql', - 'exchange-0005.sql', - 'exchange-0006.sql', - 'exchange-0007.sql', - 'exchange-0008.sql', - 'exchange-0009.sql', - 'exchange-0010.sql', - 'procedures.sql', - 'tops-0001.sql', - 'versioning.sql', -] -install_data(sources: sqlfiles, install_dir: sqldir) - -# This makes meson copy the files into the build directory for testing -foreach f : sqlfiles - configure_file(input: f, output: f, copy: true) -endforeach +subdir('sql-schema') test_idem = configure_file( input: 'test_idempotency.sh', @@ -354,4 +326,3 @@ executable( include_directories: [incdir, configuration_inc], install: false, ) - diff --git a/src/exchangedb/perf-exchangedb-reserves-in-insert-postgres b/src/exchangedb/perf-exchangedb-reserves-in-insert-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# perf-exchangedb-reserves-in-insert-postgres - temporary wrapper script for .libs/perf-exchangedb-reserves-in-insert-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The perf-exchangedb-reserves-in-insert-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "perf-exchangedb-reserves-in-insert-postgres:perf-exchangedb-reserves-in-insert-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "perf-exchangedb-reserves-in-insert-postgres:perf-exchangedb-reserves-in-insert-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "perf-exchangedb-reserves-in-insert-postgres:perf-exchangedb-reserves-in-insert-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='perf-exchangedb-reserves-in-insert-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/exchange_do_persist_kyc_attributes.sql b/src/exchangedb/persist_kyc_attributes.sql diff --git a/src/exchangedb/exchange_do_insert_or_update_policy_details.sql b/src/exchangedb/persist_policy_details.sql diff --git a/src/exchangedb/procedures.sql.in b/src/exchangedb/procedures.sql.in @@ -1,84 +0,0 @@ --- --- This file is part of TALER --- Copyright (C) 2014--2025 Taler Systems SA --- --- TALER is free software; you can redistribute it and/or modify it under the --- terms of the GNU General Public License as published by the Free Software --- Foundation; either version 3, or (at your option) any later version. --- --- TALER is distributed in the hope that it will be useful, but WITHOUT ANY --- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR --- A PARTICULAR PURPOSE. See the GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License along with --- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> --- - -BEGIN; - -SET search_path TO exchange; - -#include "exchange_do_create_partitioned_table.sql" -#include "exchange_do_comment_partitioned_table.sql" -#include "exchange_do_comment_partitioned_column.sql" -#include "exchange_do_create_tables.sql" -#include "exchange_do_amount_specific.sql" -#include "exchange_do_withdraw.sql" -#include "exchange_do_refresh.sql" -#include "exchange_do_deposit.sql" -#include "exchange_do_check_deposit_idempotent.sql" -#include "exchange_do_melt.sql" -#include "exchange_do_select_deposits_missing_wire.sql" -#include "exchange_do_select_justification_for_missing_wire.sql" -#include "exchange_do_refund.sql" -#include "exchange_do_recoup_to_reserve.sql" -#include "exchange_do_recoup_to_coin.sql" -#include "exchange_do_main_gc.sql" -#include "exchange_do_purse_delete.sql" -#include "exchange_do_purse_deposit.sql" -#include "exchange_do_purse_merge.sql" -#include "exchange_do_reserve_purse.sql" -#include "exchange_do_expire_purse.sql" -#include "exchange_do_reserve_open_deposit.sql" -#include "exchange_do_reserve_open.sql" -#include "exchange_do_insert_or_update_policy_details.sql" -#include "exchange_do_insert_aml_decision.sql" -#include "exchange_do_insert_successor_measure.sql" -#include "exchange_do_insert_aml_officer.sql" -#include "exchange_do_reserves_in_insert.sql" -#include "exchange_do_batch_reserves_update.sql" -#include "exchange_do_get_link_data.sql" -#include "exchange_do_batch_coin_known.sql" -#include "exchange_do_kycauth_in_insert.sql" -#include "exchange_do_trigger_kyc_rule_for_account.sql" -#include "exchange_do_lookup_kyc_requirement_by_row.sql" -#include "exchange_do_insert_active_legitimization_measure.sql" -#include "exchange_do_select_aggregations_above_serial.sql" -#include "exchange_do_persist_kyc_attributes.sql" -#include "exchange_do_insert_aml_program_failure.sql" -#include "exchange_do_set_aml_lock.sql" -#include "exchange_do_insert_sanction_list_hit.sql" -#include "exchange_statistics_helpers.sql" -#include "exchange_trigger_purse_requests_insert.sql" -#include "exchange_trigger_withdraw_delete.sql" -#include "exchange_trigger_withdraw_insert.sql" -#include "exchange_trigger_reserves_in_insert.sql" -#include "exchange_trigger_purse_decision_insert.sql" -#include "exchange_do_get_kyc_rules.sql" - -DROP PROCEDURE IF EXISTS exchange_do_gc; -CREATE PROCEDURE exchange_do_gc( - IN in_ancient_date INT8, - IN in_now INT8) -LANGUAGE plpgsql -AS $$ -BEGIN - CALL exchange_do_main_gc(in_ancient_date,in_now); - CALL exchange_statistic_amount_gc (); - CALL exchange_statistic_bucket_gc (); - CALL exchange_statistic_counter_gc (); -END $$; -COMMENT ON PROCEDURE exchange_do_gc - IS 'calls all other garbage collection subroutines'; - -COMMIT; diff --git a/src/exchangedb/reserves_in_insert.sql b/src/exchangedb/reserves_in_insert.sql @@ -0,0 +1,200 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2014--2024 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + + +DROP FUNCTION IF EXISTS exchange_do_array_reserves_insert; +CREATE FUNCTION exchange_do_array_reserves_insert( + IN in_gc_date INT8, + IN in_reserve_expiration INT8, + IN ina_reserve_pub BYTEA[], + IN ina_wire_ref INT8[], + IN ina_credit taler_amount[], + IN ina_exchange_account_name TEXT[], + IN ina_execution_date INT8[], + IN ina_wire_source_h_payto BYTEA[], + IN ina_h_normalized_payto BYTEA[], + IN ina_payto_uri TEXT[], + IN ina_notify TEXT[]) +RETURNS SETOF exchange_do_array_reserve_insert_return_type +LANGUAGE plpgsql +AS $$ +DECLARE + conflict BOOL; + dup BOOL; + uuid INT8; + i INT4; + my_is_wallet BOOL; + ini_reserve_pub BYTEA; + ini_wire_ref INT8; + ini_credit taler_amount; + ini_exchange_account_name TEXT; + ini_execution_date INT8; + ini_wire_source_h_payto BYTEA; + ini_h_normalized_payto BYTEA; + ini_payto_uri TEXT; + ini_notify TEXT; +BEGIN + + FOR i IN 1..array_length(ina_reserve_pub,1) + LOOP + ini_reserve_pub = ina_reserve_pub[i]; + ini_wire_ref = ina_wire_ref[i]; + ini_credit = ina_credit[i]; + ini_exchange_account_name = ina_exchange_account_name[i]; + ini_execution_date = ina_execution_date[i]; + ini_wire_source_h_payto = ina_wire_source_h_payto[i]; + ini_h_normalized_payto = ina_h_normalized_payto[i]; + ini_payto_uri = ina_payto_uri[i]; + ini_notify = ina_notify[i]; + +-- RAISE WARNING 'Starting loop on %', ini_notify; + + my_is_wallet + = (LOWER (SUBSTRING (ini_payto_uri, 0, 23)) = + 'payto://taler-reserve/') OR + (LOWER (SUBSTRING (ini_payto_uri, 0, 28)) = + 'payto://taler-reserve-http/'); + INSERT INTO kyc_targets + (h_normalized_payto + ,is_wallet + ) VALUES ( + ini_h_normalized_payto + ,my_is_wallet + ) + ON CONFLICT DO NOTHING; + INSERT INTO wire_targets + (wire_target_h_payto + ,h_normalized_payto + ,payto_uri + ) VALUES ( + ini_wire_source_h_payto + ,ini_h_normalized_payto + ,ini_payto_uri + ) + ON CONFLICT DO NOTHING; + + INSERT INTO reserves + (reserve_pub + ,current_balance + ,expiration_date + ,gc_date + ) VALUES ( + ini_reserve_pub + ,ini_credit + ,in_reserve_expiration + ,in_gc_date + ) + ON CONFLICT DO NOTHING + RETURNING reserve_uuid + INTO uuid; + conflict = NOT FOUND; + + INSERT INTO reserves_in + (reserve_pub + ,wire_reference + ,credit + ,exchange_account_section + ,wire_source_h_payto + ,execution_date + ) VALUES ( + ini_reserve_pub + ,ini_wire_ref + ,ini_credit + ,ini_exchange_account_name + ,ini_wire_source_h_payto + ,ini_execution_date + ) + ON CONFLICT DO NOTHING; + + IF NOT FOUND + THEN + IF conflict + THEN + dup = TRUE; + else + dup = FALSE; + END IF; + ELSE + IF NOT conflict + THEN + EXECUTE FORMAT ( + 'NOTIFY %s' + ,ini_notify); + END IF; + dup = FALSE; + END IF; + RETURN NEXT (dup,uuid); + END LOOP; + RETURN; +END $$; + + +CREATE OR REPLACE FUNCTION exchange_do_batch_reserves_update( + IN in_reserve_pub BYTEA, + IN in_expiration_date INT8, + IN in_wire_ref INT8, + IN in_credit taler_amount, + IN in_exchange_account_name TEXT, + IN in_wire_source_h_payto BYTEA, + IN in_notify text, + OUT out_duplicate BOOLEAN) +LANGUAGE plpgsql +AS $$ +BEGIN + INSERT INTO reserves_in + (reserve_pub + ,wire_reference + ,credit + ,exchange_account_section + ,wire_source_h_payto + ,execution_date) + VALUES + (in_reserve_pub + ,in_wire_ref + ,in_credit + ,in_exchange_account_name + ,in_wire_source_h_payto + ,in_expiration_date) + ON CONFLICT DO NOTHING; + IF FOUND + THEN + --IF THE INSERTION WAS A SUCCESS IT MEANS NO DUPLICATED TRANSACTION + out_duplicate = FALSE; + UPDATE reserves rs + SET + current_balance.frac = (rs.current_balance).frac+in_credit.frac + - CASE + WHEN (rs.current_balance).frac + in_credit.frac >= 100000000 + THEN 100000000 + ELSE 1 + END + ,current_balance.val = (rs.current_balance).val+in_credit.val + + CASE + WHEN (rs.current_balance).frac + in_credit.frac >= 100000000 + THEN 1 + ELSE 0 + END + ,expiration_date=GREATEST(expiration_date,in_expiration_date) + ,gc_date=GREATEST(gc_date,in_expiration_date) + WHERE reserve_pub=in_reserve_pub; + EXECUTE FORMAT ( + 'NOTIFY %s' + ,in_notify); + ELSE + out_duplicate = TRUE; + END IF; + RETURN; +END $$; diff --git a/src/exchangedb/exchange_do_select_aggregations_above_serial.sql b/src/exchangedb/select_aggregations_above_serial.sql diff --git a/src/exchangedb/exchange_do_select_deposits_missing_wire.sql b/src/exchangedb/select_batch_deposits_missing_wire.sql diff --git a/src/exchangedb/exchange_do_set_aml_lock.sql b/src/exchangedb/set_aml_lock.sql diff --git a/src/exchangedb/0002-account_merges.sql b/src/exchangedb/sql-schema/0002-account_merges.sql diff --git a/src/exchangedb/0002-aggregation_tracking.sql b/src/exchangedb/sql-schema/0002-aggregation_tracking.sql diff --git a/src/exchangedb/0002-aggregation_transient.sql b/src/exchangedb/sql-schema/0002-aggregation_transient.sql diff --git a/src/exchangedb/0002-aml_history.sql b/src/exchangedb/sql-schema/0002-aml_history.sql diff --git a/src/exchangedb/0002-aml_staff.sql b/src/exchangedb/sql-schema/0002-aml_staff.sql diff --git a/src/exchangedb/0002-auditor_denom_sigs.sql b/src/exchangedb/sql-schema/0002-auditor_denom_sigs.sql diff --git a/src/exchangedb/0002-auditors.sql b/src/exchangedb/sql-schema/0002-auditors.sql diff --git a/src/exchangedb/0002-batch_deposits.sql b/src/exchangedb/sql-schema/0002-batch_deposits.sql diff --git a/src/exchangedb/0002-close_requests.sql b/src/exchangedb/sql-schema/0002-close_requests.sql diff --git a/src/exchangedb/0002-coin_deposits.sql b/src/exchangedb/sql-schema/0002-coin_deposits.sql diff --git a/src/exchangedb/0002-coin_history.sql b/src/exchangedb/sql-schema/0002-coin_history.sql diff --git a/src/exchangedb/0002-contracts.sql b/src/exchangedb/sql-schema/0002-contracts.sql diff --git a/src/exchangedb/0002-cs_nonce_locks.sql b/src/exchangedb/sql-schema/0002-cs_nonce_locks.sql diff --git a/src/exchangedb/0002-denomination_revocations.sql b/src/exchangedb/sql-schema/0002-denomination_revocations.sql diff --git a/src/exchangedb/0002-denominations.sql b/src/exchangedb/sql-schema/0002-denominations.sql diff --git a/src/exchangedb/0002-exchange_sign_keys.sql b/src/exchangedb/sql-schema/0002-exchange_sign_keys.sql diff --git a/src/exchangedb/0002-extensions.sql b/src/exchangedb/sql-schema/0002-extensions.sql diff --git a/src/exchangedb/0002-global_fee.sql b/src/exchangedb/sql-schema/0002-global_fee.sql diff --git a/src/exchangedb/0002-history_requests.sql b/src/exchangedb/sql-schema/0002-history_requests.sql diff --git a/src/exchangedb/0002-known_coins.sql b/src/exchangedb/sql-schema/0002-known_coins.sql diff --git a/src/exchangedb/0002-kyc_alerts.sql b/src/exchangedb/sql-schema/0002-kyc_alerts.sql diff --git a/src/exchangedb/0002-kyc_attributes.sql b/src/exchangedb/sql-schema/0002-kyc_attributes.sql diff --git a/src/exchangedb/0002-kyc_events.sql b/src/exchangedb/sql-schema/0002-kyc_events.sql diff --git a/src/exchangedb/0002-kycauths_in.sql b/src/exchangedb/sql-schema/0002-kycauths_in.sql diff --git a/src/exchangedb/0002-legitimization_measures.sql b/src/exchangedb/sql-schema/0002-legitimization_measures.sql diff --git a/src/exchangedb/0002-legitimization_outcomes.sql b/src/exchangedb/sql-schema/0002-legitimization_outcomes.sql diff --git a/src/exchangedb/0002-legitimization_processes.sql b/src/exchangedb/sql-schema/0002-legitimization_processes.sql diff --git a/src/exchangedb/0002-partner_accounts.sql b/src/exchangedb/sql-schema/0002-partner_accounts.sql diff --git a/src/exchangedb/0002-partners.sql b/src/exchangedb/sql-schema/0002-partners.sql diff --git a/src/exchangedb/0002-policy_details.sql b/src/exchangedb/sql-schema/0002-policy_details.sql diff --git a/src/exchangedb/0002-policy_fulfillments.sql b/src/exchangedb/sql-schema/0002-policy_fulfillments.sql diff --git a/src/exchangedb/0002-prewire.sql b/src/exchangedb/sql-schema/0002-prewire.sql diff --git a/src/exchangedb/0002-profit_drains.sql b/src/exchangedb/sql-schema/0002-profit_drains.sql diff --git a/src/exchangedb/0002-purse_actions.sql b/src/exchangedb/sql-schema/0002-purse_actions.sql diff --git a/src/exchangedb/0002-purse_decision.sql b/src/exchangedb/sql-schema/0002-purse_decision.sql diff --git a/src/exchangedb/0002-purse_deletion.sql b/src/exchangedb/sql-schema/0002-purse_deletion.sql diff --git a/src/exchangedb/0002-purse_deposits.sql b/src/exchangedb/sql-schema/0002-purse_deposits.sql diff --git a/src/exchangedb/0002-purse_merges.sql b/src/exchangedb/sql-schema/0002-purse_merges.sql diff --git a/src/exchangedb/0002-purse_requests.sql b/src/exchangedb/sql-schema/0002-purse_requests.sql diff --git a/src/exchangedb/0002-recoup.sql b/src/exchangedb/sql-schema/0002-recoup.sql diff --git a/src/exchangedb/0002-recoup_refresh.sql b/src/exchangedb/sql-schema/0002-recoup_refresh.sql diff --git a/src/exchangedb/0002-refresh.sql b/src/exchangedb/sql-schema/0002-refresh.sql diff --git a/src/exchangedb/0002-refunds.sql b/src/exchangedb/sql-schema/0002-refunds.sql diff --git a/src/exchangedb/0002-reserve_history.sql b/src/exchangedb/sql-schema/0002-reserve_history.sql diff --git a/src/exchangedb/0002-reserves.sql b/src/exchangedb/sql-schema/0002-reserves.sql diff --git a/src/exchangedb/0002-reserves_close.sql b/src/exchangedb/sql-schema/0002-reserves_close.sql diff --git a/src/exchangedb/0002-reserves_in.sql b/src/exchangedb/sql-schema/0002-reserves_in.sql diff --git a/src/exchangedb/0002-reserves_open_deposits.sql b/src/exchangedb/sql-schema/0002-reserves_open_deposits.sql diff --git a/src/exchangedb/0002-reserves_open_requests.sql b/src/exchangedb/sql-schema/0002-reserves_open_requests.sql diff --git a/src/exchangedb/0002-revolving_work_shards.sql b/src/exchangedb/sql-schema/0002-revolving_work_shards.sql diff --git a/src/exchangedb/0002-signkey_revocations.sql b/src/exchangedb/sql-schema/0002-signkey_revocations.sql diff --git a/src/exchangedb/0002-statistics.sql b/src/exchangedb/sql-schema/0002-statistics.sql diff --git a/src/exchangedb/0002-unique_refresh_blinding_seed.sql b/src/exchangedb/sql-schema/0002-unique_refresh_blinding_seed.sql diff --git a/src/exchangedb/0002-unique_withdraw_blinding_seed.sql b/src/exchangedb/sql-schema/0002-unique_withdraw_blinding_seed.sql diff --git a/src/exchangedb/0002-wad_in_entries.sql b/src/exchangedb/sql-schema/0002-wad_in_entries.sql diff --git a/src/exchangedb/0002-wad_out_entries.sql b/src/exchangedb/sql-schema/0002-wad_out_entries.sql diff --git a/src/exchangedb/0002-wads_in.sql b/src/exchangedb/sql-schema/0002-wads_in.sql diff --git a/src/exchangedb/0002-wads_out.sql b/src/exchangedb/sql-schema/0002-wads_out.sql diff --git a/src/exchangedb/0002-wire_accounts.sql b/src/exchangedb/sql-schema/0002-wire_accounts.sql diff --git a/src/exchangedb/0002-wire_fee.sql b/src/exchangedb/sql-schema/0002-wire_fee.sql diff --git a/src/exchangedb/0002-wire_out.sql b/src/exchangedb/sql-schema/0002-wire_out.sql diff --git a/src/exchangedb/0002-wire_targets.sql b/src/exchangedb/sql-schema/0002-wire_targets.sql diff --git a/src/exchangedb/0002-withdraw.sql b/src/exchangedb/sql-schema/0002-withdraw.sql diff --git a/src/exchangedb/0002-work_shards.sql b/src/exchangedb/sql-schema/0002-work_shards.sql diff --git a/src/exchangedb/0003-kyc_targets.sql b/src/exchangedb/sql-schema/0003-kyc_targets.sql diff --git a/src/exchangedb/0003-legitimization_measures.sql b/src/exchangedb/sql-schema/0003-legitimization_measures.sql diff --git a/src/exchangedb/0003-legitimization_outcomes.sql b/src/exchangedb/sql-schema/0003-legitimization_outcomes.sql diff --git a/src/exchangedb/0003-legitimization_processes.sql b/src/exchangedb/sql-schema/0003-legitimization_processes.sql diff --git a/src/exchangedb/0003-reserves_out.sql b/src/exchangedb/sql-schema/0003-reserves_out.sql diff --git a/src/exchangedb/0003-wire_targets.sql b/src/exchangedb/sql-schema/0003-wire_targets.sql diff --git a/src/exchangedb/0004-kyc_attributes.sql b/src/exchangedb/sql-schema/0004-kyc_attributes.sql diff --git a/src/exchangedb/0004-refresh.sql b/src/exchangedb/sql-schema/0004-refresh.sql diff --git a/src/exchangedb/0009-batch_deposits.sql b/src/exchangedb/sql-schema/0009-batch_deposits.sql diff --git a/src/exchangedb/0010-wire_accounts.sql b/src/exchangedb/sql-schema/0010-wire_accounts.sql diff --git a/src/exchangedb/Makefile.sql b/src/exchangedb/sql-schema/Makefile.sql diff --git a/src/exchangedb/auditor-triggers-0001.sql b/src/exchangedb/sql-schema/auditor-triggers-0001.sql diff --git a/src/exchangedb/benchmark-0001.sql b/src/exchangedb/sql-schema/benchmark-0001.sql diff --git a/src/exchangedb/drop.sql b/src/exchangedb/sql-schema/drop.sql diff --git a/src/exchangedb/exchange-0001.sql b/src/exchangedb/sql-schema/exchange-0001.sql diff --git a/src/exchangedb/exchange-0002.sql.in b/src/exchangedb/sql-schema/exchange-0002.sql.in diff --git a/src/exchangedb/exchange-0003.sql.in b/src/exchangedb/sql-schema/exchange-0003.sql.in diff --git a/src/exchangedb/exchange-0004.sql.in b/src/exchangedb/sql-schema/exchange-0004.sql.in diff --git a/src/exchangedb/exchange-0005.sql b/src/exchangedb/sql-schema/exchange-0005.sql diff --git a/src/exchangedb/exchange-0006.sql b/src/exchangedb/sql-schema/exchange-0006.sql diff --git a/src/exchangedb/exchange-0007.sql b/src/exchangedb/sql-schema/exchange-0007.sql diff --git a/src/exchangedb/exchange-0008.sql b/src/exchangedb/sql-schema/exchange-0008.sql diff --git a/src/exchangedb/exchange-0009.sql.in b/src/exchangedb/sql-schema/exchange-0009.sql.in diff --git a/src/exchangedb/exchange-0010.sql.in b/src/exchangedb/sql-schema/exchange-0010.sql.in diff --git a/src/exchangedb/exchange_do_account_merge.sql b/src/exchangedb/sql-schema/exchange_do_account_merge.sql diff --git a/src/exchangedb/exchange_do_amount_specific.sql b/src/exchangedb/sql-schema/exchange_do_amount_specific.sql diff --git a/src/exchangedb/exchange_do_comment_partitioned_column.sql b/src/exchangedb/sql-schema/exchange_do_comment_partitioned_column.sql diff --git a/src/exchangedb/exchange_do_comment_partitioned_table.sql b/src/exchangedb/sql-schema/exchange_do_comment_partitioned_table.sql diff --git a/src/exchangedb/exchange_do_create_partitioned_table.sql b/src/exchangedb/sql-schema/exchange_do_create_partitioned_table.sql diff --git a/src/exchangedb/exchange_do_create_tables.sql b/src/exchangedb/sql-schema/exchange_do_create_tables.sql diff --git a/src/exchangedb/exchange_do_get_link_data.sql b/src/exchangedb/sql-schema/exchange_do_get_link_data.sql diff --git a/src/exchangedb/exchange_do_melt.sql b/src/exchangedb/sql-schema/exchange_do_melt.sql diff --git a/src/exchangedb/exchange_do_recoup_by_reserve.sql b/src/exchangedb/sql-schema/exchange_do_recoup_by_reserve.sql diff --git a/src/exchangedb/exchange_do_select_justification_for_missing_wire.sql b/src/exchangedb/sql-schema/exchange_do_select_justification_for_missing_wire.sql diff --git a/src/exchangedb/exchange_statistics_helpers.sql b/src/exchangedb/sql-schema/exchange_statistics_helpers.sql diff --git a/src/exchangedb/exchange_trigger_purse_decision_insert.sql b/src/exchangedb/sql-schema/exchange_trigger_purse_decision_insert.sql diff --git a/src/exchangedb/exchange_trigger_purse_requests_insert.sql b/src/exchangedb/sql-schema/exchange_trigger_purse_requests_insert.sql diff --git a/src/exchangedb/exchange_trigger_reserves_in_insert.sql b/src/exchangedb/sql-schema/exchange_trigger_reserves_in_insert.sql diff --git a/src/exchangedb/exchange_trigger_withdraw_delete.sql b/src/exchangedb/sql-schema/exchange_trigger_withdraw_delete.sql diff --git a/src/exchangedb/exchange_trigger_withdraw_insert.sql b/src/exchangedb/sql-schema/exchange_trigger_withdraw_insert.sql diff --git a/src/exchangedb/sql-schema/meson.build b/src/exchangedb/sql-schema/meson.build @@ -0,0 +1,30 @@ +sqldir = get_option('datadir') / 'taler-exchange' / 'sql' + +# FIXME possibly provide this output in the tgz through dist script +run_command('make', '-f', 'Makefile.sql', 'all', check: true) + +sqlfiles = [ + 'auditor-triggers-0001.sql', + 'benchmark-0001.sql', + 'drop.sql', + 'exchange-0001.sql', + 'exchange-0002.sql', + 'exchange-0003.sql', + 'exchange-0004.sql', + 'exchange-0005.sql', + 'exchange-0006.sql', + 'exchange-0007.sql', + 'exchange-0008.sql', + 'exchange-0009.sql', + 'exchange-0010.sql', + 'procedures.sql', + 'tops-0001.sql', + 'versioning.sql', +] +install_data(sources: sqlfiles, install_dir: sqldir) + + +# This makes meson copy the files into the build directory for testing +foreach f : sqlfiles + configure_file(input: f, output: f, copy: true) +endforeach diff --git a/src/exchangedb/sql-schema/procedures.sql.in b/src/exchangedb/sql-schema/procedures.sql.in @@ -0,0 +1,86 @@ +-- +-- This file is part of TALER +-- Copyright (C) 2014--2025 Taler Systems SA +-- +-- TALER is free software; you can redistribute it and/or modify it under the +-- terms of the GNU General Public License as published by the Free Software +-- Foundation; either version 3, or (at your option) any later version. +-- +-- TALER is distributed in the hope that it will be useful, but WITHOUT ANY +-- WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +-- A PARTICULAR PURPOSE. See the GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License along with +-- TALER; see the file COPYING. If not, see <http://www.gnu.org/licenses/> +-- + +BEGIN; + +SET search_path TO exchange; + +#include "exchange_do_create_partitioned_table.sql" +#include "exchange_do_comment_partitioned_table.sql" +#include "exchange_do_comment_partitioned_column.sql" +#include "exchange_do_create_tables.sql" +#include "exchange_do_amount_specific.sql" +#include "../do_withdraw.sql" +#include "../do_refresh.sql" +#include "../do_deposit.sql" +#include "../do_check_deposit_idempotent.sql" +-- dead!? +#include "exchange_do_melt.sql" +#include "../select_batch_deposits_missing_wire.sql" +-- dead!? +#include "exchange_do_select_justification_for_missing_wire.sql" +#include "../do_refund.sql" +#include "../do_recoup.sql" +#include "../do_recoup_refresh.sql" +#include "../gc.sql" +#include "../do_purse_delete.sql" +#include "../do_purse_deposit.sql" +#include "../do_purse_merge.sql" +#include "../do_reserve_purse.sql" +#include "../expire_purse.sql" +#include "../insert_reserve_open_deposit.sql" +#include "../do_reserve_open.sql" +#include "../persist_policy_details.sql" +#include "../insert_aml_decision.sql" +#include "../insert_successor_measure.sql" +#include "../insert_aml_officer.sql" +#include "../reserves_in_insert.sql" +-- semi-dead... +#include "exchange_do_get_link_data.sql" +#include "../batch_ensure_coin_known.sql" +#include "../kycauth_in_insert.sql" +#include "../trigger_kyc_rule_for_account.sql" +#include "../lookup_kyc_requirement_by_row.sql" +#include "../insert_active_legitimization_measure.sql" +#include "../select_aggregations_above_serial.sql" +#include "../persist_kyc_attributes.sql" +#include "../insert_aml_program_failure.sql" +#include "../set_aml_lock.sql" +#include "../insert_sanction_list_hit.sql" +#include "exchange_statistics_helpers.sql" +#include "exchange_trigger_purse_requests_insert.sql" +#include "exchange_trigger_withdraw_delete.sql" +#include "exchange_trigger_withdraw_insert.sql" +#include "exchange_trigger_reserves_in_insert.sql" +#include "exchange_trigger_purse_decision_insert.sql" +#include "../get_kyc_rules.sql" + +DROP PROCEDURE IF EXISTS exchange_do_gc; +CREATE PROCEDURE exchange_do_gc( + IN in_ancient_date INT8, + IN in_now INT8) +LANGUAGE plpgsql +AS $$ +BEGIN + CALL exchange_do_main_gc(in_ancient_date,in_now); + CALL exchange_statistic_amount_gc (); + CALL exchange_statistic_bucket_gc (); + CALL exchange_statistic_counter_gc (); +END $$; +COMMENT ON PROCEDURE exchange_do_gc + IS 'calls all other garbage collection subroutines'; + +COMMIT; diff --git a/src/exchangedb/tops-0001.sql b/src/exchangedb/sql-schema/tops-0001.sql diff --git a/src/exchangedb/versioning.sql b/src/exchangedb/sql-schema/versioning.sql diff --git a/src/exchangedb/test-exchangedb-batch-reserves-in-insert-postgres b/src/exchangedb/test-exchangedb-batch-reserves-in-insert-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# test-exchangedb-batch-reserves-in-insert-postgres - temporary wrapper script for .libs/test-exchangedb-batch-reserves-in-insert-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The test-exchangedb-batch-reserves-in-insert-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test-exchangedb-batch-reserves-in-insert-postgres:test-exchangedb-batch-reserves-in-insert-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test-exchangedb-batch-reserves-in-insert-postgres:test-exchangedb-batch-reserves-in-insert-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test-exchangedb-batch-reserves-in-insert-postgres:test-exchangedb-batch-reserves-in-insert-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test-exchangedb-batch-reserves-in-insert-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/test-exchangedb-by-j-postgres b/src/exchangedb/test-exchangedb-by-j-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# test-exchangedb-by-j-postgres - temporary wrapper script for .libs/test-exchangedb-by-j-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The test-exchangedb-by-j-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test-exchangedb-by-j-postgres:test-exchangedb-by-j-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test-exchangedb-by-j-postgres:test-exchangedb-by-j-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test-exchangedb-by-j-postgres:test-exchangedb-by-j-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test-exchangedb-by-j-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/test-exchangedb-populate-link-data-postgres b/src/exchangedb/test-exchangedb-populate-link-data-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# test-exchangedb-populate-link-data-postgres - temporary wrapper script for .libs/test-exchangedb-populate-link-data-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The test-exchangedb-populate-link-data-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test-exchangedb-populate-link-data-postgres:test-exchangedb-populate-link-data-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test-exchangedb-populate-link-data-postgres:test-exchangedb-populate-link-data-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test-exchangedb-populate-link-data-postgres:test-exchangedb-populate-link-data-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test-exchangedb-populate-link-data-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/test-exchangedb-populate-ready-deposit-postgres b/src/exchangedb/test-exchangedb-populate-ready-deposit-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# test-exchangedb-populate-ready-deposit-postgres - temporary wrapper script for .libs/test-exchangedb-populate-ready-deposit-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The test-exchangedb-populate-ready-deposit-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test-exchangedb-populate-ready-deposit-postgres:test-exchangedb-populate-ready-deposit-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test-exchangedb-populate-ready-deposit-postgres:test-exchangedb-populate-ready-deposit-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test-exchangedb-populate-ready-deposit-postgres:test-exchangedb-populate-ready-deposit-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test-exchangedb-populate-ready-deposit-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/test-exchangedb-populate-select-refunds-by-coin-postgres b/src/exchangedb/test-exchangedb-populate-select-refunds-by-coin-postgres @@ -1,210 +0,0 @@ -#! /bin/bash - -# test-exchangedb-populate-select-refunds-by-coin-postgres - temporary wrapper script for .libs/test-exchangedb-populate-select-refunds-by-coin-postgres -# Generated by libtool (GNU libtool) 2.4.6 Debian-2.4.6-15 -# -# The test-exchangedb-populate-select-refunds-by-coin-postgres program cannot be directly executed until all the libtool -# libraries that it depends on are installed. -# -# This wrapper script should never be moved out of the build directory. -# If it is, it will not operate correctly. - -# Sed substitution that helps us do robust quoting. It backslashifies -# metacharacters that are still active within double-quoted strings. -sed_quote_subst='s|\([`"$\\]\)|\\\1|g' - -# Be Bourne compatible -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac -fi -BIN_SH=xpg4; export BIN_SH # for Tru64 -DUALCASE=1; export DUALCASE # for MKS sh - -# The HP-UX ksh and POSIX shell print the target directory to stdout -# if CDPATH is set. -(unset CDPATH) >/dev/null 2>&1 && unset CDPATH - -relink_command="" - -# This environment variable determines our operation mode. -if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variables: - generated_by_libtool_version='2.4.6' - notinst_deplibs=' libtalerexchangedb.la ../../src/json/libtalerjson.la ../../src/util/libtalerutil.la ../../src/pq/libtalerpq.la' -else - # When we are sourced in execute mode, $file and $ECHO are already set. - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - file="$0" - -# A function that is used when there is no print builtin or printf. -func_fallback_echo () -{ - eval 'cat <<_LTECHO_EOF -$1 -_LTECHO_EOF' -} - ECHO="printf %s\\n" - fi - -# Very basic option parsing. These options are (a) specific to -# the libtool wrapper, (b) are identical between the wrapper -# /script/ and the wrapper /executable/ that is used only on -# windows platforms, and (c) all begin with the string --lt- -# (application programs are unlikely to have options that match -# this pattern). -# -# There are only two supported options: --lt-debug and -# --lt-dump-script. There is, deliberately, no --lt-help. -# -# The first argument to this parsing function should be the -# script's ../../libtool value, followed by no. -lt_option_debug= -func_parse_lt_options () -{ - lt_script_arg0=$0 - shift - for lt_opt - do - case "$lt_opt" in - --lt-debug) lt_option_debug=1 ;; - --lt-dump-script) - lt_dump_D=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%/[^/]*$%%'` - test "X$lt_dump_D" = "X$lt_script_arg0" && lt_dump_D=. - lt_dump_F=`$ECHO "X$lt_script_arg0" | /usr/bin/sed -e 's/^X//' -e 's%^.*/%%'` - cat "$lt_dump_D/$lt_dump_F" - exit 0 - ;; - --lt-*) - $ECHO "Unrecognized --lt- option: '$lt_opt'" 1>&2 - exit 1 - ;; - esac - done - - # Print the debug banner immediately: - if test -n "$lt_option_debug"; then - echo "test-exchangedb-populate-select-refunds-by-coin-postgres:test-exchangedb-populate-select-refunds-by-coin-postgres:$LINENO: libtool wrapper (GNU libtool) 2.4.6 Debian-2.4.6-15" 1>&2 - fi -} - -# Used when --lt-debug. Prints its arguments to stdout -# (redirection is the responsibility of the caller) -func_lt_dump_args () -{ - lt_dump_args_N=1; - for lt_arg - do - $ECHO "test-exchangedb-populate-select-refunds-by-coin-postgres:test-exchangedb-populate-select-refunds-by-coin-postgres:$LINENO: newargv[$lt_dump_args_N]: $lt_arg" - lt_dump_args_N=`expr $lt_dump_args_N + 1` - done -} - -# Core function for launching the target application -func_exec_program_core () -{ - - if test -n "$lt_option_debug"; then - $ECHO "test-exchangedb-populate-select-refunds-by-coin-postgres:test-exchangedb-populate-select-refunds-by-coin-postgres:$LINENO: newargv[0]: $progdir/$program" 1>&2 - func_lt_dump_args ${1+"$@"} 1>&2 - fi - exec "$progdir/$program" ${1+"$@"} - - $ECHO "$0: cannot exec $program $*" 1>&2 - exit 1 -} - -# A function to encapsulate launching the target application -# Strips options in the --lt-* namespace from $@ and -# launches target application with the remaining arguments. -func_exec_program () -{ - case " $* " in - *\ --lt-*) - for lt_wr_arg - do - case $lt_wr_arg in - --lt-*) ;; - *) set x "$@" "$lt_wr_arg"; shift;; - esac - shift - done ;; - esac - func_exec_program_core ${1+"$@"} -} - - # Parse options - func_parse_lt_options "$0" ${1+"$@"} - - # Find the directory that this script lives in. - thisdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - test "x$thisdir" = "x$file" && thisdir=. - - # Follow symbolic links until we get to the real thisdir. - file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` - while test -n "$file"; do - destdir=`$ECHO "$file" | /usr/bin/sed 's%/[^/]*$%%'` - - # If there was a directory component, then change thisdir. - if test "x$destdir" != "x$file"; then - case "$destdir" in - [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; - *) thisdir="$thisdir/$destdir" ;; - esac - fi - - file=`$ECHO "$file" | /usr/bin/sed 's%^.*/%%'` - file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` - done - - # Usually 'no', except on cygwin/mingw when embedded into - # the cwrapper. - WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no - if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then - # special case for '.' - if test "$thisdir" = "."; then - thisdir=`pwd` - fi - # remove .libs from thisdir - case "$thisdir" in - *[\\/].libs ) thisdir=`$ECHO "$thisdir" | /usr/bin/sed 's%[\\/][^\\/]*$%%'` ;; - .libs ) thisdir=. ;; - esac - fi - - # Try to get the absolute directory name. - absdir=`cd "$thisdir" && pwd` - test -n "$absdir" && thisdir="$absdir" - - program='test-exchangedb-populate-select-refunds-by-coin-postgres' - progdir="$thisdir/.libs" - - - if test -f "$progdir/$program"; then - # Add our own library path to LD_LIBRARY_PATH - LD_LIBRARY_PATH="/home/priscilla/exchange/src/exchangedb/.libs:/home/priscilla/exchange/src/json/.libs:/home/priscilla/exchange/src/util/.libs:/home/priscilla/exchange/src/pq/.libs:$LD_LIBRARY_PATH" - - # Some systems cannot cope with colon-terminated LD_LIBRARY_PATH - # The second colon is a workaround for a bug in BeOS R4 sed - LD_LIBRARY_PATH=`$ECHO "$LD_LIBRARY_PATH" | /usr/bin/sed 's/::*$//'` - - export LD_LIBRARY_PATH - - if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - # Run the actual program with our arguments. - func_exec_program ${1+"$@"} - fi - else - # The program doesn't exist. - $ECHO "$0: error: '$progdir/$program' does not exist" 1>&2 - $ECHO "This script is just a wrapper for $program." 1>&2 - $ECHO "See the libtool documentation for more information." 1>&2 - exit 1 - fi -fi diff --git a/src/exchangedb/exchange_do_trigger_kyc_rule_for_account.sql b/src/exchangedb/trigger_kyc_rule_for_account.sql