commit 9e40d0077404c225a81cba01a4d9669a4f2da1a9 parent d8fc33c877f40f1be8fb9c10778c89eb2fd8adff Author: Christian Grothoff <grothoff@gnunet.org> Date: Sun, 16 Aug 2026 23:24:54 +0200 document primary table where each query is tested Diffstat:
210 files changed, 455 insertions(+), 0 deletions(-)
diff --git a/src/include/exchange-database/abort_shard.h b/src/include/exchange-database/abort_shard.h @@ -27,6 +27,8 @@ /** * Function called to abort work on a shard. * + * Primary test table: `work_shards` (see test_work_shards.c). + * * @param pg the database context * @param job_name name of the operation to abort a word shard for * @param start_row inclusive start row of the shard diff --git a/src/include/exchange-database/account_history.h b/src/include/exchange-database/account_history.h @@ -57,6 +57,8 @@ struct TALER_EXCHANGEDB_HistoryBuilderContext * Function called to obtain an AML * history in JSON on-demand if needed. * + * Primary test table: `aml_history` (see test_aml_history.c). + * * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` * @return AML history in JSON format, NULL on error */ @@ -68,6 +70,8 @@ TALER_EXCHANGEDB_aml_history_builder (void *cls); * Function called to obtain a KYC * history in JSON on-demand if needed. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` * @return KYC history in JSON format, NULL on error */ @@ -79,6 +83,8 @@ TALER_EXCHANGEDB_kyc_history_builder (void *cls); * Function called to obtain the current ``LegitimizationRuleSet`` * in JSON for an account on-demand if needed. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` * @return KYC history in JSON format, NULL on error */ @@ -90,6 +96,8 @@ TALER_EXCHANGEDB_current_rule_builder (void *cls); * Function called to obtain the latest KYC attributes * in JSON for an account on-demand if needed. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param cls must be a `struct TALER_EXCHANGEDB_HistoryBuilderContext *` * @return KYC attributes in JSON format, NULL on error */ diff --git a/src/include/exchange-database/begin_revolving_shard.h b/src/include/exchange-database/begin_revolving_shard.h @@ -28,6 +28,8 @@ * Function called to grab a revolving work shard on an operation @a op. Runs * in its own transaction. Returns the oldest inactive shard. * + * Primary test table: `revolving_work_shards` (see test_revolving_work_shards.c). + * * @param pg the database context * @param job_name name of the operation to grab a revolving shard for * @param shard_size desired shard size diff --git a/src/include/exchange-database/begin_rule_update.h b/src/include/exchange-database/begin_rule_update.h @@ -96,6 +96,8 @@ typedef void * Calling it while a transaction is already running risks aborting * that transaction. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg database plugin to use * @param attribute_key key to use to decrypt attributes * @param account account to get the rule set for @@ -117,6 +119,8 @@ TALER_EXCHANGEDB_begin_rule_update ( /** * Cancel operation to get the current legitimization rule set. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param[in] ru operation to cancel */ void diff --git a/src/include/exchange-database/begin_shard.h b/src/include/exchange-database/begin_shard.h @@ -28,6 +28,8 @@ * abandoned shard if there is one, and opens a fresh one otherwise. Runs as * a single statement, so it needs no transaction of its own. * + * Primary test table: `work_shards` (see test_work_shards.c). + * * @param pg the database context * @param job_name name of the operation to grab a word shard for * @param delay how long we intend to hold the shard; also the minimum age of diff --git a/src/include/exchange-database/commit.h b/src/include/exchange-database/commit.h @@ -27,6 +27,8 @@ /** * Commit the current transaction of a database connection. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @return final transaction status */ diff --git a/src/include/exchange-database/compute_shard.h b/src/include/exchange-database/compute_shard.h @@ -27,6 +27,8 @@ /** * Compute the shard number of a given @a merchant_pub. * + * No primary test table; exercised by test_misc.c. + * * @param merchant_pub merchant public key to compute shard for * @return shard number */ diff --git a/src/include/exchange-database/create_tables.h b/src/include/exchange-database/create_tables.h @@ -29,6 +29,8 @@ /** * Create the necessary tables if they are not present * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param support_partitions true to enable partitioning support (disables foreign key constraints) * @param num_partitions number of partitions to create, diff --git a/src/include/exchange-database/delete_aggregation_transient.h b/src/include/exchange-database/delete_aggregation_transient.h @@ -28,6 +28,8 @@ * Delete existing entry in the transient aggregation table. * @a h_payto is only needed for query performance. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param wtid the raw wire transfer identifier to update diff --git a/src/include/exchange-database/delete_shard_locks.h b/src/include/exchange-database/delete_shard_locks.h @@ -30,6 +30,9 @@ * To be used after a crash or when the shard size is * changed. * + * Primary test tables: `work_shards` (see test_work_shards.c) and + * `revolving_work_shards` (see test_revolving_work_shards.c). + * * @param pg the database context * @return transaction status code */ diff --git a/src/include/exchange-database/disable_rules.h b/src/include/exchange-database/disable_rules.h @@ -27,6 +27,8 @@ /** * Disable (delete/drop) customization rule schema from a deployment. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param schema name of the schema with customization rules to remove * @return transaction status diff --git a/src/include/exchange-database/do_aggregate.h b/src/include/exchange-database/do_aggregate.h @@ -29,6 +29,8 @@ * Aggregate all matching deposits for @a h_payto and * @a merchant_pub, returning the total amounts. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param merchant_pub public key of the merchant diff --git a/src/include/exchange-database/do_check_deposit_idempotent.h b/src/include/exchange-database/do_check_deposit_idempotent.h @@ -28,6 +28,8 @@ /** * Check ifdeposit operation is idempotent to existing one. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param bd batch deposit operation details * @param[in,out] exchange_timestamp time to use for the deposit (possibly updated) diff --git a/src/include/exchange-database/do_deposit.h b/src/include/exchange-database/do_deposit.h @@ -30,6 +30,8 @@ * Perform deposit operation, checking for sufficient balance * of the coins and possibly persisting the deposit details. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param bd batch deposit operation details * @param deposit_fees array of "bd->num_cids" deposit fees diff --git a/src/include/exchange-database/do_drain_kyc_alert.h b/src/include/exchange-database/do_drain_kyc_alert.h @@ -27,6 +27,8 @@ /** * Extract next KYC alert. Deletes the alert. * + * Primary test table: `kyc_alerts` (see test_kyc_alerts.c). + * * @param pg the database context * @param trigger_type which type of alert to drain * @param[out] h_payto set to hash of payto-URI where KYC status changed diff --git a/src/include/exchange-database/do_expire_purse.h b/src/include/exchange-database/do_expire_purse.h @@ -27,6 +27,8 @@ /** * Function called to clean up one expired purse. * + * Primary test table: `purse_decision` (see test_purse_decision.c). + * * @param pg the database context * @param start_time select purse expired after this time * @param end_time select purse expired before this time diff --git a/src/include/exchange-database/do_import_credits.h b/src/include/exchange-database/do_import_credits.h @@ -143,6 +143,9 @@ struct TALER_EXCHANGEDB_CreditBatch * neither does. That is what lets a caller commit as soon as the bank * answers, rather than holding everything open until the shard is finished. * + * Primary test tables: `reserves_in` (see test_reserves_in.c) and + * `kycauths_in` (see test_kycauths_in.c). + * * @param pg the database context * @param batch the transfers to import and the shard they belong to * @param[out] reserve_results set to the query status per entry of diff --git a/src/include/exchange-database/do_insert_known_coin.h b/src/include/exchange-database/do_insert_known_coin.h @@ -74,6 +74,8 @@ enum TALER_EXCHANGEDB_CoinKnownStatus /** * Make sure the given @a coin is known to the database. * + * Primary test table: `known_coins` (see test_known_coins.c). + * * @param pg the database context * @param coin the coin that must be made known * @param[out] known_coin_id set to the unique row of the coin diff --git a/src/include/exchange-database/do_insert_kyc_attributes.h b/src/include/exchange-database/do_insert_kyc_attributes.h @@ -29,6 +29,8 @@ /** * Store KYC attribute data. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param pg the database context * @param process_row KYC process row to update * @param h_payto account for which the attribute data is stored diff --git a/src/include/exchange-database/do_persist_aml_program_result.h b/src/include/exchange-database/do_persist_aml_program_result.h @@ -33,6 +33,8 @@ * into the database via @a pg. Called within an open * database transaction. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg database API handle * @param process_row row identifying the legitimization process that was run, * 0 if there was no legi process (for example, due to rule diff --git a/src/include/exchange-database/do_purse_delete.h b/src/include/exchange-database/do_purse_delete.h @@ -27,6 +27,8 @@ /** * Function called to explicitly delete a purse. * + * Primary test table: `purse_deletion` (see test_purse_deletion.c). + * * @param pg the database context * @param purse_pub purse to delete * @param purse_sig signature affirming the deletion diff --git a/src/include/exchange-database/do_purse_deposit.h b/src/include/exchange-database/do_purse_deposit.h @@ -34,6 +34,8 @@ * target amount and the purse has been merged, triggers * the updates of the reserve/account balance. * + * Primary test table: `purse_deposits` (see test_purse_deposits.c). + * * @param pg the database context * @param purse_pub purse to credit * @param coin_pub coin to deposit (debit) diff --git a/src/include/exchange-database/do_purse_merge.h b/src/include/exchange-database/do_purse_merge.h @@ -29,6 +29,8 @@ * Function called to approve merging a purse into a * reserve by the respective purse merge key. * + * Primary test table: `purse_merges` (see test_purse_merges.c). + * * @param pg the database context * @param purse_pub purse to merge * @param merge_sig signature affirming the merge diff --git a/src/include/exchange-database/do_recoup.h b/src/include/exchange-database/do_recoup.h @@ -28,6 +28,8 @@ * Perform recoup operation, checking for sufficient deposits * of the coin and possibly persisting the recoup details. * + * Primary test table: `recoup` (see test_recoup.c). + * * @param pg the database context * @param reserve_pub public key of the reserve to credit * @param withdraw_serial_id row in the withdraw table justifying the recoup diff --git a/src/include/exchange-database/do_recoup_refresh.h b/src/include/exchange-database/do_recoup_refresh.h @@ -29,6 +29,8 @@ * Perform recoup-refresh operation, checking for sufficient deposits of the * coin and possibly persisting the recoup-refresh details. * + * Primary test table: `recoup_refresh` (see test_recoup_refresh.c). + * * @param pg the database context * @param old_coin_pub public key of the old coin to credit * @param rrc_serial row in the refresh_revealed_coins table justifying the recoup-refresh diff --git a/src/include/exchange-database/do_refresh.h b/src/include/exchange-database/do_refresh.h @@ -29,6 +29,8 @@ * Perform refresh operation--introduced with v26 of the API--, * checking for sufficient balance of the coin and possibly persisting the melt/refresh details. * + * Primary test table: `refresh` (see test_refresh.c). + * * @param pg the database context * @param[in,out] refresh refresh operation details; the noreveal_index * is set in case the coin was already melted before diff --git a/src/include/exchange-database/do_refund.h b/src/include/exchange-database/do_refund.h @@ -54,6 +54,8 @@ struct TALER_EXCHANGEDB_Refund * Perform refund operation, checking for sufficient deposits * of the coin and possibly persisting the refund details. * + * Primary test table: `refunds` (see test_refunds.c). + * * @param pg the database context * @param refund refund operation details * @param deposit_fee deposit fee applicable for the coin, possibly refunded diff --git a/src/include/exchange-database/do_reserve_open.h b/src/include/exchange-database/do_reserve_open.h @@ -29,6 +29,8 @@ /** * Perform reserve open operation on database. * + * Primary test table: `reserves_open_requests` (see test_reserves_open_requests.c). + * * @param pg the database context * @param reserve_pub which reserve is this about? * @param total_paid total amount paid (coins and reserve) diff --git a/src/include/exchange-database/do_reserve_purse.h b/src/include/exchange-database/do_reserve_purse.h @@ -30,6 +30,8 @@ * respective purse merge key. The purse must not have been merged into a * different reserve. * + * Primary test table: `account_merges` (see test_account_merges.c). + * * @param pg the database context * @param purse_pub purse to merge * @param merge_sig signature affirming the merge diff --git a/src/include/exchange-database/do_trigger_kyc_rule_for_account.h b/src/include/exchange-database/do_trigger_kyc_rule_for_account.h @@ -29,6 +29,8 @@ /** * Insert KYC requirement for @a h_payto account into table. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param payto_uri account that must be KYC'ed, * can be NULL if @a h_payto is already diff --git a/src/include/exchange-database/do_withdraw.h b/src/include/exchange-database/do_withdraw.h @@ -30,6 +30,8 @@ * sufficient balance and fulfillment of age requirements. Finally persisting * the withdrawal details. * + * Primary test table: `withdraw` (see test_withdraw.c). + * * @param pg the database context * @param withdraw the withdraw data * @param now the timestamp of the withdraw diff --git a/src/include/exchange-database/drop_tables.h b/src/include/exchange-database/drop_tables.h @@ -29,6 +29,8 @@ /** * Drop all Taler tables. This should only be used by testcases. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @return #GNUNET_OK upon success; #GNUNET_SYSERR upon failure */ diff --git a/src/include/exchange-database/enable_rules.h b/src/include/exchange-database/enable_rules.h @@ -29,6 +29,8 @@ /** * Enable (create/insert) customization rule schema from a deployment. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param schema name of the schema with customization rules to remove * @return transaction status diff --git a/src/include/exchange-database/event_listen.h b/src/include/exchange-database/event_listen.h @@ -27,6 +27,8 @@ /** * Register callback to be invoked on events of type @a es. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param timeout how long until to generate a timeout event * @param es specification of the event to listen for diff --git a/src/include/exchange-database/event_listen_cancel.h b/src/include/exchange-database/event_listen_cancel.h @@ -28,6 +28,8 @@ /** * Stop notifications. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param eh handle to unregister. */ diff --git a/src/include/exchange-database/event_notify.h b/src/include/exchange-database/event_notify.h @@ -28,6 +28,8 @@ /** * Notify all that listen on @a es of an event. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param es specification of the event to generate * @param extra additional event data provided diff --git a/src/include/exchange-database/free_coin_transaction_list.h b/src/include/exchange-database/free_coin_transaction_list.h @@ -617,6 +617,8 @@ struct TALER_EXCHANGEDB_TransactionList * Stores @a off plus the cost of all transactions in @a tl * in @a ret. * + * No primary test table; exercised by test_misc.c. + * * @param tl transaction list to process * @param off offset to use as the starting value * @param[out] ret where the resulting total is to be stored @@ -632,6 +634,8 @@ TALER_EXCHANGEDB_calculate_transaction_list_totals ( /** * Free linked list of transactions. * + * No primary test table; exercised by test_misc.c. + * * @param[in] tl list to free */ void diff --git a/src/include/exchange-database/free_reserve_history.h b/src/include/exchange-database/free_reserve_history.h @@ -567,6 +567,8 @@ struct TALER_EXCHANGEDB_ReserveHistory /** * Free memory associated with the given reserve history. * + * No primary test table; exercised by test_misc.c. + * * @param[in] rh history to free. */ void diff --git a/src/include/exchange-database/gc.h b/src/include/exchange-database/gc.h @@ -30,6 +30,8 @@ * Function called to perform "garbage collection" on the * database, expiring records we no longer require. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @return #GNUNET_OK on success, * #GNUNET_SYSERR on DB errors diff --git a/src/include/exchange-database/get_active_legitimization.h b/src/include/exchange-database/get_active_legitimization.h @@ -27,6 +27,8 @@ /** * Lookup measure data for an active legitimization process. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param legitimization_process_serial_id * row in legitimization_processes table to access diff --git a/src/include/exchange-database/get_aggregation_deferral_by_wtid.h b/src/include/exchange-database/get_aggregation_deferral_by_wtid.h @@ -34,6 +34,8 @@ * anything about @a wtid, which for a transfer that is still pending means * the exchange is simply not paying. * + * Primary test table: `aggregation_deferrals` (see test_aggregation_deferrals.c). + * * @param pg the database context * @param wtid wire transfer to look up * @param[out] amount set to the amount the exchange said it was withholding diff --git a/src/include/exchange-database/get_aggregation_transient.h b/src/include/exchange-database/get_aggregation_transient.h @@ -29,6 +29,8 @@ /** * Find existing entry in the transient aggregation table. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param merchant_pub public key of the merchant receiving the transfer diff --git a/src/include/exchange-database/get_aggregation_transient_by_normalized_payto.h b/src/include/exchange-database/get_aggregation_transient_by_normalized_payto.h @@ -28,6 +28,8 @@ /** * Find existing entry in the transient aggregation table. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param[out] payto_uri corresponding payto URI, to be freed by caller diff --git a/src/include/exchange-database/get_aggregation_transient_by_wtid.h b/src/include/exchange-database/get_aggregation_transient_by_wtid.h @@ -36,6 +36,8 @@ * to check the auditor's own inference about the account against the reason * the exchange actually recorded. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param wire_target_h_payto account the transfer should go to * @param wtid wire transfer identifier to look up diff --git a/src/include/exchange-database/get_aml_file_number.h b/src/include/exchange-database/get_aml_file_number.h @@ -28,6 +28,8 @@ /** * Lookup AML file number by the payto address. * + * Primary test table: `kyc_targets` (see test_kyc_targets.c). + * * @param pg the database context * @param h_payto account for which to find the row ID * @param[out] kyc_target_row set to row in the kyc_targets table for @a h_payto diff --git a/src/include/exchange-database/get_aml_officer.h b/src/include/exchange-database/get_aml_officer.h @@ -28,6 +28,8 @@ /** * Fetch AML staff record. * + * Primary test table: `aml_staff` (see test_aml_staff.c). + * * @param pg the database context * @param decider_pub public key of the staff member * @param[out] master_sig offline signature affirming the AML officer diff --git a/src/include/exchange-database/get_auditor_denom_sig.h b/src/include/exchange-database/get_auditor_denom_sig.h @@ -27,6 +27,8 @@ /** * Select information about an auditor auditing a denomination key. * + * Primary test table: `auditor_denom_sigs` (see test_auditor_denom_sigs.c). + * * @param pg the database context * @param h_denom_pub the audited denomination * @param auditor_pub the auditor's key diff --git a/src/include/exchange-database/get_auditor_status.h b/src/include/exchange-database/get_auditor_status.h @@ -26,6 +26,8 @@ /** * Lookup current state of an auditor. * + * Primary test table: `auditors` (see test_auditors.c). + * * @param pg the database context * @param auditor_pub key to look up information for * @param[out] auditor_url set to the base URL of the auditor's REST API; memory to be diff --git a/src/include/exchange-database/get_auditor_timestamp.h b/src/include/exchange-database/get_auditor_timestamp.h @@ -28,6 +28,8 @@ /** * Check the last date an auditor was modified. * + * Primary test table: `auditors` (see test_auditors.c). + * * @param pg the database context * @param auditor_pub key to look up information for * @param[out] last_date last modification date to auditor status diff --git a/src/include/exchange-database/get_coin_denomination.h b/src/include/exchange-database/get_coin_denomination.h @@ -27,6 +27,8 @@ /** * Retrieve the denomination of a known coin. * + * Primary test table: `known_coins` (see test_known_coins.c). + * * @param pg the database context * @param coin_pub the public key of the coin to search for * @param[out] known_coin_id set to the ID of the coin in the known_coins table diff --git a/src/include/exchange-database/get_coin_transactions.h b/src/include/exchange-database/get_coin_transactions.h @@ -33,6 +33,8 @@ * etag_in return the history after @a start_off. @a etag_out should be set * to the last row ID of the given @a coin_pub in the coin history table. * + * Primary test table: `coin_history` (see test_coin_history.c). + * * @param pg the database context * @param begin_transaction true to run this in its own transaction(s) * @param coin_pub coin to investigate diff --git a/src/include/exchange-database/get_completed_legitimization.h b/src/include/exchange-database/get_completed_legitimization.h @@ -29,6 +29,8 @@ /** * Lookup measure data for a legitimization process. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param legitimization_measure_serial_id * row in legitimization_measures table to access diff --git a/src/include/exchange-database/get_contract.h b/src/include/exchange-database/get_contract.h @@ -28,6 +28,8 @@ /** * Function called to retrieve an encrypted contract. * + * Primary test table: `contracts` (see test_contracts.c). + * * @param pg the database context * @param pub_ckey ephemeral DH key to look the contract up by * @param[out] purse_pub set to the purse the contract belongs to diff --git a/src/include/exchange-database/get_contract_by_purse.h b/src/include/exchange-database/get_contract_by_purse.h @@ -28,6 +28,8 @@ /** * Function called to retrieve an encrypted contract. * + * Primary test table: `contracts` (see test_contracts.c). + * * @param pg the database context * @param purse_pub key to lookup the contract by * @param[out] econtract set to the encrypted contract on success, to be freed by the caller diff --git a/src/include/exchange-database/get_count_known_coins.h b/src/include/exchange-database/get_count_known_coins.h @@ -27,6 +27,8 @@ /** * Count the number of known coins by denomination. * + * Primary test table: `known_coins` (see test_known_coins.c). + * * @param pg the database context * @param denom_pub_hash denomination to count by * @return number of coins if non-negative, otherwise an `enum GNUNET_DB_QueryStatus` diff --git a/src/include/exchange-database/get_denomination_by_serial.h b/src/include/exchange-database/get_denomination_by_serial.h @@ -26,6 +26,8 @@ /** * Fetch information about a denomination for a given serial. * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param denom_serial row in the denomination table * @param[out] issue set to issue information with value, fees and other info about the coin diff --git a/src/include/exchange-database/get_denomination_info.h b/src/include/exchange-database/get_denomination_info.h @@ -28,6 +28,8 @@ /** * Fetch information about a denomination key. * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param denom_pub_hash hash of the public key used for signing coins of this denomination * @param[out] denom_serial row in the denomination table, might be NULL diff --git a/src/include/exchange-database/get_denomination_meta.h b/src/include/exchange-database/get_denomination_meta.h @@ -27,6 +27,8 @@ /** * Lookup information about current denomination key. * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param h_denom_pub hash of the denomination public key * @param[out] meta set to various meta data about the key diff --git a/src/include/exchange-database/get_denomination_revocation.h b/src/include/exchange-database/get_denomination_revocation.h @@ -29,6 +29,8 @@ * Obtain information about a denomination key's revocation from * the database. * + * Primary test table: `denomination_revocations` (see test_denomination_revocations.c). + * * @param pg the database context * @param denom_pub_hash hash of the revoked denomination key * @param[out] master_sig signature affirming the revocation diff --git a/src/include/exchange-database/get_exists_aml_officer.h b/src/include/exchange-database/get_exists_aml_officer.h @@ -28,6 +28,8 @@ * Test if the given AML staff member is active * (at least read-only). * + * Primary test table: `aml_staff` (see test_aml_staff.c). + * * @param pg the database context * @param decider_pub public key of the staff member * @param[out] read_only set to true if the member is read-only diff --git a/src/include/exchange-database/get_exists_deposit.h b/src/include/exchange-database/get_exists_deposit.h @@ -29,6 +29,8 @@ /** * Check if we have the specified deposit already in the database. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param h_contract_terms contract to check for * @param h_wire wire hash to check for diff --git a/src/include/exchange-database/get_global_fee.h b/src/include/exchange-database/get_global_fee.h @@ -28,6 +28,8 @@ /** * Obtain global fees from database. * + * Primary test table: `global_fee` (see test_global_fee.c). + * * @param pg the database context * @param date for which date do we want the fee? * @param[out] start_date when does the fee go into effect diff --git a/src/include/exchange-database/get_global_fee_by_time.h b/src/include/exchange-database/get_global_fee_by_time.h @@ -29,6 +29,8 @@ /** * Lookup information about known global fees. * + * Primary test table: `global_fee` (see test_global_fee.c). + * * @param pg the database context * @param start_time starting time of fee * @param end_time end time of fee diff --git a/src/include/exchange-database/get_h_payto_by_access_token.h b/src/include/exchange-database/get_h_payto_by_access_token.h @@ -28,6 +28,8 @@ /** * Lookup @a h_payto based on an @a access_token. * + * Primary test table: `kyc_targets` (see test_kyc_targets.c). + * * @param pg the database context * @param access_token * set to token for access control diff --git a/src/include/exchange-database/get_known_coin.h b/src/include/exchange-database/get_known_coin.h @@ -26,6 +26,8 @@ /** * Retrieve the record for a known coin. * + * Primary test table: `known_coins` (see test_known_coins.c). + * * @param pg the database context * @param coin_pub the public key of the coin to search for * @param coin_info place holder for the returned coin information object diff --git a/src/include/exchange-database/get_kyc_provider_account.h b/src/include/exchange-database/get_kyc_provider_account.h @@ -29,6 +29,8 @@ * Lookup an * @a h_payto by @a provider_legitimization_id. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param provider_name * @param provider_legitimization_id legi to look up diff --git a/src/include/exchange-database/get_kyc_rules.h b/src/include/exchange-database/get_kyc_rules.h @@ -28,6 +28,8 @@ /** * Return KYC rules that apply to the given account. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg the database context * @param h_payto account identifier * @param merchant_pub merchant public key used by the client, or NULL @@ -66,6 +68,8 @@ TALER_EXCHANGEDB_get_kyc_rules_with_account (struct /** * Return only the KYC rules that apply to the given account. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg the database context * @param h_payto account identifier * @param[out] jrules set to the active KYC rules for the diff --git a/src/include/exchange-database/get_kyc_status_by_token.h b/src/include/exchange-database/get_kyc_status_by_token.h @@ -27,6 +27,8 @@ /** * Lookup KYC status by account access token. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param access_token key to look under * @param[out] row set to requirement row that matches diff --git a/src/include/exchange-database/get_legitimization_process_by_account.h b/src/include/exchange-database/get_legitimization_process_by_account.h @@ -29,6 +29,8 @@ /** * Lookup KYC provider meta data. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param provider_name provider that must be checked * @param h_payto account that must be KYC'ed diff --git a/src/include/exchange-database/get_legitimization_requirement_by_row.h b/src/include/exchange-database/get_legitimization_requirement_by_row.h @@ -29,6 +29,8 @@ /** * Lookup KYC requirement. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param h_payto identifies account to look up requirement for * @param account_pub set to public key of the account diff --git a/src/include/exchange-database/get_old_coin_by_h_blind.h b/src/include/exchange-database/get_old_coin_by_h_blind.h @@ -28,6 +28,8 @@ * Obtain information about which old coin a coin was refreshed * given the hash of the blinded (fresh) coin. * + * Primary test table: `refresh` (see test_refresh.c). + * * @param pg the database context * @param h_blind_ev hash of the blinded coin * @param[out] old_coin_pub set to information about the old coin (on success only) diff --git a/src/include/exchange-database/get_open_legitimization_measure.h b/src/include/exchange-database/get_open_legitimization_measure.h @@ -41,6 +41,8 @@ * particular it cannot look at `legitimization_measures.is_finished` or * `legitimization_processes.finished`, neither of which is replicated. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param h_payto normalized hash of the payto URI of the account * @param[out] legitimization_measure_serial_id set to the lowest such measure diff --git a/src/include/exchange-database/get_pending_aggregation.h b/src/include/exchange-database/get_pending_aggregation.h @@ -36,6 +36,8 @@ * still owes is @a total_deposited - @a total_refunded - @a total_deposit_fee, * where the deposit fee is *not* charged for coins that were refunded in full. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param wtid wire transfer identifier to look up * @param[out] wire_target_h_payto set to the account the transfer should go to diff --git a/src/include/exchange-database/get_pending_legitimization.h b/src/include/exchange-database/get_pending_legitimization.h @@ -28,6 +28,8 @@ /** * Lookup measure data for a legitimization process. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param legitimization_measure_serial_id * row in legitimization_measures table to access diff --git a/src/include/exchange-database/get_pending_legitimization_process.h b/src/include/exchange-database/get_pending_legitimization_process.h @@ -28,6 +28,8 @@ /** * Fetch information about pending KYC requirement process. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param h_payto account that must be KYC'ed * @param provider_name provider that must be checked diff --git a/src/include/exchange-database/get_pending_profit_drain.h b/src/include/exchange-database/get_pending_profit_drain.h @@ -29,6 +29,8 @@ /** * Get profit drain operation ready to execute. * + * Primary test table: `profit_drains` (see test_profit_drains.c). + * * @param pg the database context * @param[out] serial set to serial ID of the entry * @param[out] wtid set set to wire transfer ID to use diff --git a/src/include/exchange-database/get_profit_drain.h b/src/include/exchange-database/get_profit_drain.h @@ -29,6 +29,8 @@ /** * Function called to get information about a profit drain event. * + * Primary test table: `profit_drains` (see test_profit_drains.c). + * * @param pg the database context * @param wtid wire transfer ID to look up drain event for * @param[out] serial set to serial ID of the entry diff --git a/src/include/exchange-database/get_purse.h b/src/include/exchange-database/get_purse.h @@ -29,6 +29,8 @@ /** * Function called to obtain information about a purse. * + * Primary test table: `purse_requests` (see test_purse_requests.c). + * * @param pg the database context * @param purse_pub public key of the new purse * @param[out] purse_creation set to time when the purse was created diff --git a/src/include/exchange-database/get_purse_by_merge_pub.h b/src/include/exchange-database/get_purse_by_merge_pub.h @@ -30,6 +30,8 @@ * Function called to return meta data about a purse by the * merge capability key. * + * Primary test table: `purse_requests` (see test_purse_requests.c). + * * @param pg the database context * @param merge_pub public key representing the merge capability * @param[out] purse_pub public key of the purse diff --git a/src/include/exchange-database/get_purse_deposit.h b/src/include/exchange-database/get_purse_deposit.h @@ -30,6 +30,8 @@ * Function called to obtain a coin deposit data from * depositing the coin into a purse. * + * Primary test table: `purse_deposits` (see test_purse_deposits.c). + * * @param pg the database context * @param purse_pub purse to credit * @param coin_pub coin to deposit (debit) diff --git a/src/include/exchange-database/get_purse_merge.h b/src/include/exchange-database/get_purse_merge.h @@ -29,6 +29,8 @@ * Function called to approve merging of a purse with * an account, made by the receiving account. * + * Primary test table: `purse_merges` (see test_purse_merges.c). + * * @param pg the database context * @param purse_pub public key of the purse * @param[out] merge_sig set to the signature confirming the merge diff --git a/src/include/exchange-database/get_purse_request.h b/src/include/exchange-database/get_purse_request.h @@ -32,6 +32,8 @@ * Function called to return meta data about a purse by the * purse public key. * + * Primary test table: `purse_requests` (see test_purse_requests.c). + * * @param pg the database context * @param purse_pub public key of the purse * @param[out] merge_pub public key representing the merge capability diff --git a/src/include/exchange-database/get_ready_deposit.h b/src/include/exchange-database/get_ready_deposit.h @@ -41,6 +41,8 @@ * the instant its wire deadline passes; it becomes ready at the next * shift boundary, which is precisely what AGGREGATOR_SHIFT asks for. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param start_shard_row minimum shard row to select * @param end_shard_row maximum shard row to select (inclusive) diff --git a/src/include/exchange-database/get_refresh.h b/src/include/exchange-database/get_refresh.h @@ -26,6 +26,8 @@ /** * Lookup refresh refresh commitment data under the given @a rc. * + * Primary test table: `refresh` (see test_refresh.c). + * * @param pg the database context * @param rc commitment hash to use to locate the operation * @param[out] refresh where to store the result; note that diff --git a/src/include/exchange-database/get_reserve.h b/src/include/exchange-database/get_reserve.h @@ -27,6 +27,8 @@ /** * Get the summary of a reserve. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @param[in,out] reserve the reserve data. The public key of the reserve should be * set in this structure; it is used to query the database. The balance diff --git a/src/include/exchange-database/get_reserve_balance.h b/src/include/exchange-database/get_reserve_balance.h @@ -28,6 +28,8 @@ /** * Get the balance of the specified reserve. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @param reserve_pub public key of the reserve * @param[out] balance set to the reserve balance diff --git a/src/include/exchange-database/get_reserve_by_h_planchets.h b/src/include/exchange-database/get_reserve_by_h_planchets.h @@ -29,6 +29,8 @@ * Obtain information about which reserve a coin was generated * from given the hash of the blinded coin. * + * Primary test table: `withdraw` (see test_withdraw.c). + * * @param pg the database context * @param h_planchets hash that uniquely identifies the withdraw request * @param[out] reserve_pub set to information about the reserve (on success only) diff --git a/src/include/exchange-database/get_reserve_close_info.h b/src/include/exchange-database/get_reserve_close_info.h @@ -30,6 +30,8 @@ * Select information needed to see if we can close * a reserve. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @param reserve_pub which reserve is this about? * @param[out] balance current reserve balance diff --git a/src/include/exchange-database/get_reserve_close_request_info.h b/src/include/exchange-database/get_reserve_close_request_info.h @@ -29,6 +29,8 @@ /** * Select information about reserve close requests. * + * Primary test table: `close_requests` (see test_close_requests.c). + * * @param pg the database context * @param reserve_pub which reserve is this about? * @param rowid row ID of the close request diff --git a/src/include/exchange-database/get_reserve_history.h b/src/include/exchange-database/get_reserve_history.h @@ -33,6 +33,8 @@ * etag_in return the history after @a start_off. @a etag_out should be set * to the last row ID of the given @a reserve_pub in the reserve history table. * + * Primary test table: `reserve_history` (see test_reserve_history.c). + * * @param pg the database context * @param reserve_pub public key of the reserve * @param start_off maximum starting offset in history to exclude from returning diff --git a/src/include/exchange-database/get_reserve_origin.h b/src/include/exchange-database/get_reserve_origin.h @@ -28,6 +28,8 @@ /** * Get the origin of funds of a reserve. * + * Primary test table: `reserves_in` (see test_reserves_in.c). + * * @param pg the database context * @param reserve_pub public key of the reserve * @param[out] h_payto set to hash of the wire source payto://-URI diff --git a/src/include/exchange-database/get_rules_by_access_token.h b/src/include/exchange-database/get_rules_by_access_token.h @@ -28,6 +28,8 @@ /** * Lookup KYC rules by account access token. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg the database context * @param h_payto account hash to look under * @param[out] jnew_rules set to active LegitimizationRuleSet diff --git a/src/include/exchange-database/get_serial_by_table.h b/src/include/exchange-database/get_serial_by_table.h @@ -28,6 +28,8 @@ * Lookup the latest serial number of @a table. Used in * exchange-auditor database replication. * + * No primary test table; exercised by test_replication.c. + * * @param pg the database context * @param table table for which we should return the serial * @param[out] serial latest serial number in use diff --git a/src/include/exchange-database/get_signature_for_known_coin.h b/src/include/exchange-database/get_signature_for_known_coin.h @@ -27,6 +27,8 @@ /** * Retrieve the denomination and the corresponding signature for a known coin. * + * Primary test table: `known_coins` (see test_known_coins.c). + * * @param pg the database context * @param coin_pub the public key of the coin to search for * @param[out] denom_pub the denomination of the public key, if coin was present diff --git a/src/include/exchange-database/get_signkey.h b/src/include/exchange-database/get_signkey.h @@ -27,6 +27,8 @@ /** * Lookup signing key meta data. * + * Primary test table: `exchange_sign_keys` (see test_exchange_sign_keys.c). + * * @param pg the database context * @param exchange_pub the exchange online signing public key * @param[out] meta meta data about @a exchange_pub diff --git a/src/include/exchange-database/get_signkey_revocation.h b/src/include/exchange-database/get_signkey_revocation.h @@ -27,6 +27,8 @@ /** * Obtain information about a revoked online signing key. * + * Primary test table: `signkey_revocations` (see test_signkey_revocations.c). + * * @param pg the database context * @param exchange_pub exchange online signing key * @param[out] master_sig set to signature affirming the revocation (if revoked) diff --git a/src/include/exchange-database/get_transfer_by_deposit.h b/src/include/exchange-database/get_transfer_by_deposit.h @@ -31,6 +31,8 @@ * If we did not execute the deposit yet, return when it is supposed * to be executed. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param h_contract_terms hash of the proposal data * @param h_wire hash of merchant wire details diff --git a/src/include/exchange-database/get_wire_fee.h b/src/include/exchange-database/get_wire_fee.h @@ -28,6 +28,8 @@ /** * Obtain wire fee from database. * + * Primary test table: `wire_fee` (see test_wire_fee.c). + * * @param pg the database context * @param type type of wire transfer the fee applies for * @param date for which date do we want the fee? diff --git a/src/include/exchange-database/get_wire_fee_by_time.h b/src/include/exchange-database/get_wire_fee_by_time.h @@ -32,6 +32,8 @@ * differ between @a start_time and @a end_time, the transaction * succeeds BUT returns an invalid amount for both fees. * + * Primary test table: `wire_fee` (see test_wire_fee.c). + * * @param pg the database context * @param wire_method the wire method to lookup fees for * @param start_time starting time of fee diff --git a/src/include/exchange-database/get_wire_hash_for_contract.h b/src/include/exchange-database/get_wire_hash_for_contract.h @@ -30,6 +30,8 @@ * contract. This is necessary in the event of a conflict with a given * (merchant_pub, h_contract_terms) during deposit. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param merchant_pub merchant public key * @param h_contract_terms hash of the proposal data diff --git a/src/include/exchange-database/get_wire_timestamp.h b/src/include/exchange-database/get_wire_timestamp.h @@ -29,6 +29,8 @@ /** * Check the last date an exchange wire account was modified. * + * Primary test table: `wire_accounts` (see test_wire_accounts.c). + * * @param pg the database context * @param payto_uri key to look up information for * @param[out] last_date last modification date to auditor status diff --git a/src/include/exchange-database/get_withdraw.h b/src/include/exchange-database/get_withdraw.h @@ -30,6 +30,8 @@ * identifies the withdraw operation. Used to ensure idempotency of the * request. * + * Primary test table: `withdraw` (see test_withdraw.c). + * * @param pg the database context * @param wch hash over all hashes of blinded planchets that uniquely identifies the withdraw operation * @param[out] wd corresponding details of the previous withdraw request if an entry was found diff --git a/src/include/exchange-database/inject_auditor_triggers.h b/src/include/exchange-database/inject_auditor_triggers.h @@ -31,6 +31,8 @@ * database, triggering the real-time auditor upon * relevant INSERTs. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @return #GNUNET_OK on success, * #GNUNET_SYSERR on DB errors diff --git a/src/include/exchange-database/insert_active_legitimization_measure.h b/src/include/exchange-database/insert_active_legitimization_measure.h @@ -28,6 +28,8 @@ * Create new active legitimization measure. * * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param access_token access token that identifies the * account the legitimization measures apply to diff --git a/src/include/exchange-database/insert_aggregation_deferral.h b/src/include/exchange-database/insert_aggregation_deferral.h @@ -37,6 +37,8 @@ * `aggregation_tracking` rows for @a wtid have been written; the statement * inserts nothing in that case. * + * Primary test table: `aggregation_deferrals` (see test_aggregation_deferrals.c). + * * @param pg the database context * @param wtid the wire transfer that was not executed * @param h_payto destination that was not paid diff --git a/src/include/exchange-database/insert_aggregation_transient.h b/src/include/exchange-database/insert_aggregation_transient.h @@ -28,6 +28,8 @@ /** * Create a new entry in the transient aggregation table. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param exchange_account_section exchange account to use diff --git a/src/include/exchange-database/insert_aml_officer.h b/src/include/exchange-database/insert_aml_officer.h @@ -31,6 +31,8 @@ * database, only @e previous_change is returned and * no actual change is committed to the database. * + * Primary test table: `aml_staff` (see test_aml_staff.c). + * * @param pg the database context * @param decider_pub public key of the staff member * @param master_sig offline signature affirming the AML officer diff --git a/src/include/exchange-database/insert_aml_program_failure.h b/src/include/exchange-database/insert_aml_program_failure.h @@ -29,6 +29,8 @@ /** * Update AML program status to finished (and failed). * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param process_row KYC process row to update * @param h_payto account for which the attribute data is stored diff --git a/src/include/exchange-database/insert_auditor.h b/src/include/exchange-database/insert_auditor.h @@ -28,6 +28,8 @@ /** * Insert information about an auditor that will audit this exchange. * + * Primary test table: `auditors` (see test_auditors.c). + * * @param pg the database context * @param auditor_pub key of the auditor * @param auditor_url base URL of the auditor's REST service diff --git a/src/include/exchange-database/insert_auditor_denom_sig.h b/src/include/exchange-database/insert_auditor_denom_sig.h @@ -28,6 +28,8 @@ /** * Insert information about an auditor auditing a denomination key. * + * Primary test table: `auditor_denom_sigs` (see test_auditor_denom_sigs.c). + * * @param pg the database context * @param h_denom_pub the audited denomination * @param auditor_pub the auditor's key diff --git a/src/include/exchange-database/insert_close_request.h b/src/include/exchange-database/insert_close_request.h @@ -29,6 +29,8 @@ /** * Function called to initiate closure of an account. * + * Primary test table: `close_requests` (see test_close_requests.c). + * * @param pg the database context * @param reserve_pub public key of the account to close * @param payto_uri where to wire the funds diff --git a/src/include/exchange-database/insert_contract.h b/src/include/exchange-database/insert_contract.h @@ -28,6 +28,8 @@ /** * Function called to persist an encrypted contract associated with a reserve. * + * Primary test table: `contracts` (see test_contracts.c). + * * @param pg the database context * @param purse_pub the purse the contract is associated with (must exist) * @param econtract the encrypted contract diff --git a/src/include/exchange-database/insert_denomination_info.h b/src/include/exchange-database/insert_denomination_info.h @@ -28,6 +28,8 @@ * Insert a denomination key's public information into the database for * reference by auditors and other consistency checks. * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param denom_pub the public key used for signing coins of this denomination * @param issue issuing information with value, fees and other info about the coin diff --git a/src/include/exchange-database/insert_denomination_revocation.h b/src/include/exchange-database/insert_denomination_revocation.h @@ -29,6 +29,8 @@ * Store information that a denomination key was revoked * in the database. * + * Primary test table: `denomination_revocations` (see test_denomination_revocations.c). + * * @param pg the database context * @param denom_pub_hash hash of the revoked denomination key * @param master_sig signature affirming the revocation diff --git a/src/include/exchange-database/insert_global_fee.h b/src/include/exchange-database/insert_global_fee.h @@ -29,6 +29,8 @@ /** * Insert global fee data into database. * + * Primary test table: `global_fee` (see test_global_fee.c). + * * @param pg the database context * @param start_date when does the fees go into effect * @param end_date when does the fees end being valid diff --git a/src/include/exchange-database/insert_kyc_failure.h b/src/include/exchange-database/insert_kyc_failure.h @@ -29,6 +29,8 @@ /** * Update KYC process status to finished (and failed). * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param process_row KYC process row to update * @param h_payto account for which the attribute data is stored diff --git a/src/include/exchange-database/insert_legitimization_process.h b/src/include/exchange-database/insert_legitimization_process.h @@ -28,6 +28,8 @@ /** * Begin KYC requirement process. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param h_payto account that must be KYC'ed * @param measure_index which of the measures in diff --git a/src/include/exchange-database/insert_partner.h b/src/include/exchange-database/insert_partner.h @@ -29,6 +29,8 @@ * Function called to store configuration data about a partner * exchange that we are federated with. * + * Primary test table: `partners` (see test_partners.c). + * * @param pg the database context * @param master_pub public offline signing key of the partner exchange * @param start_date when does the following data start to be valid diff --git a/src/include/exchange-database/insert_prewire.h b/src/include/exchange-database/insert_prewire.h @@ -27,6 +27,8 @@ /** * Function called to insert wire transfer commit data into the DB. * + * Primary test table: `prewire` (see test_prewire.c). + * * @param pg the database context * @param type type of the wire transfer (i.e. "iban") * @param buf buffer with wire transfer preparation data diff --git a/src/include/exchange-database/insert_profit_drain.h b/src/include/exchange-database/insert_profit_drain.h @@ -29,6 +29,8 @@ /** * Function called to persist a request to drain profits. * + * Primary test table: `profit_drains` (see test_profit_drains.c). + * * @param pg the database context * @param wtid wire transfer ID to use * @param account_section account to drain diff --git a/src/include/exchange-database/insert_purse_request.h b/src/include/exchange-database/insert_purse_request.h @@ -29,6 +29,8 @@ /** * Function called to create a new purse with certain meta data. * + * Primary test table: `purse_requests` (see test_purse_requests.c). + * * @param pg the database context * @param purse_pub public key of the new purse * @param merge_pub public key providing the merge capability diff --git a/src/include/exchange-database/insert_records_by_table.h b/src/include/exchange-database/insert_records_by_table.h @@ -29,6 +29,8 @@ * Insert record set into @a table. Used in exchange-auditor database * replication. * + * No primary test table; exercised by test_replication.c. + * * @param pg the database context * @param td table data to insert * @return transaction status code, #GNUNET_DB_STATUS_HARD_ERROR if diff --git a/src/include/exchange-database/insert_refund.h b/src/include/exchange-database/insert_refund.h @@ -27,6 +27,8 @@ /** * Insert information about refunded coin into the database. * + * Primary test table: `refunds` (see test_refunds.c). + * * @param pg the database context * @param refund refund information to store * @return query result status diff --git a/src/include/exchange-database/insert_reserve_closed.h b/src/include/exchange-database/insert_reserve_closed.h @@ -29,6 +29,8 @@ /** * Insert reserve close operation into database. * + * Primary test table: `reserves_close` (see test_reserves_close.c). + * * @param pg the database context * @param reserve_pub which reserve is this about? * @param execution_date when did we perform the transfer? diff --git a/src/include/exchange-database/insert_reserve_open_deposit.h b/src/include/exchange-database/insert_reserve_open_deposit.h @@ -30,6 +30,8 @@ * Insert reserve open coin deposit data into database. * Subtracts the @a coin_total from the coin's balance. * + * Primary test table: `reserves_open_deposits` (see test_reserves_open_deposits.c). + * * @param pg the database context * @param cpi public information about the coin * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_RESERVE_OPEN_DEPOSIT diff --git a/src/include/exchange-database/insert_sanction_list_hit.h b/src/include/exchange-database/insert_sanction_list_hit.h @@ -28,6 +28,8 @@ /** * Update sanction list hit status of the given account. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg the database context * @param h_payto account for which the hit is to be stored * @param to_investigate true to flag account for investigation, diff --git a/src/include/exchange-database/insert_signkey.h b/src/include/exchange-database/insert_signkey.h @@ -27,6 +27,8 @@ /** * Add signing key. * + * Primary test table: `exchange_sign_keys` (see test_exchange_sign_keys.c). + * * @param pg the database context * @param exchange_pub the exchange online signing public key * @param meta meta data about @a exchange_pub diff --git a/src/include/exchange-database/insert_signkey_revocation.h b/src/include/exchange-database/insert_signkey_revocation.h @@ -27,6 +27,8 @@ /** * Store information about a revoked online signing key. * + * Primary test table: `signkey_revocations` (see test_signkey_revocations.c). + * * @param pg the database context * @param exchange_pub exchange online signing key that was revoked * @param master_sig signature affirming the revocation diff --git a/src/include/exchange-database/insert_successor_measure.h b/src/include/exchange-database/insert_successor_measure.h @@ -25,6 +25,25 @@ #include "exchangedb_lib.h" +/** + * Insert a successor measure for an account, replacing whatever + * legitimization measures and outcome are currently active for it. + * A decision that is older than the currently active one is ignored. + * + * Primary test table: `legitimization_measures` + * (see test_legitimization_measures.c). + * + * @param pg the database context + * @param h_payto normalized payto hash of the account to change + * @param decision_time when was the decision made + * @param new_measure_name name of the successor measure, NULL to + * revert the account to the default rules + * @param jmeasures measures to apply, NULL to revert to the default rules + * @param[out] unknown_account set to true if @a h_payto is not known + * @param[out] last_date set to the time of the most recent decision that + * is already on file for the account + * @return transaction status + */ enum GNUNET_DB_QueryStatus TALER_EXCHANGEDB_insert_successor_measure ( struct TALER_EXCHANGEDB_PostgresContext *pg, diff --git a/src/include/exchange-database/insert_wire.h b/src/include/exchange-database/insert_wire.h @@ -29,6 +29,8 @@ /** * Insert information about an wire account used by this exchange. * + * Primary test table: `wire_accounts` (see test_wire_accounts.c). + * * @param pg the database context * @param payto_uri wire account of the exchange * @param conversion_url URL of a conversion service, NULL if there is no conversion diff --git a/src/include/exchange-database/insert_wire_fee.h b/src/include/exchange-database/insert_wire_fee.h @@ -28,6 +28,8 @@ /** * Insert wire transfer fee into database. * + * Primary test table: `wire_fee` (see test_wire_fee.c). + * * @param pg the database context * @param type type of wire transfer this fee applies for * @param start_date when does the fee go into effect diff --git a/src/include/exchange-database/insert_wire_out.h b/src/include/exchange-database/insert_wire_out.h @@ -28,6 +28,8 @@ /** * Store information about an outgoing wire transfer that was executed. * + * Primary test table: `wire_out` (see test_wire_out.c). + * * @param pg the database context * @param date time of the wire transfer * @param wtid subject of the wire transfer diff --git a/src/include/exchange-database/iterate_account_merges_above_serial_id.h b/src/include/exchange-database/iterate_account_merges_above_serial_id.h @@ -69,6 +69,8 @@ typedef enum GNUNET_GenericReturnValue * Select account merges above @a serial_id in monotonically increasing * order. * + * Primary test table: `account_merges` (see test_account_merges.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_active_auditors.h b/src/include/exchange-database/iterate_active_auditors.h @@ -67,6 +67,8 @@ typedef void * Function called to invoke @a cb on every active auditor. Disabled * auditors are skipped. Runs in its own read-only transaction. * + * Primary test table: `auditors` (see test_auditors.c). + * * @param pg the database context * @param cb function to call on each active auditor * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_active_signkeys.h b/src/include/exchange-database/iterate_active_signkeys.h @@ -70,6 +70,8 @@ typedef void * that has been signed by the master key. Revoked and (for signing!) * expired keys are skipped. Runs in its own read-only transaction. * + * Primary test table: `exchange_sign_keys` (see test_exchange_sign_keys.c). + * * @param pg the database context * @param cb function to call on each signing key * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_aggregation_amounts_for_kyc_check.h b/src/include/exchange-database/iterate_aggregation_amounts_for_kyc_check.h @@ -30,6 +30,8 @@ * Call @a kac on deposited amounts after @a time_limit which are relevant for a * KYC trigger for a the (credited) account identified by @a h_payto. * + * Primary test table: `wire_out` (see test_wire_out.c). + * * @param pg the database context * @param h_payto account identifier * @param time_limit oldest transaction that could be relevant diff --git a/src/include/exchange-database/iterate_aggregation_wtids_above_serial_id.h b/src/include/exchange-database/iterate_aggregation_wtids_above_serial_id.h @@ -60,6 +60,8 @@ typedef enum GNUNET_GenericReturnValue /** * Select all aggregations at or above @a serial_id, in ascending order. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_aggregations_above_serial_id.h b/src/include/exchange-database/iterate_aggregations_above_serial_id.h @@ -70,6 +70,8 @@ typedef void * Select all aggregation tracking IDs in the database * above a given @a min_tracking_serial_id. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param min_tracking_serial_id only return entries strictly above this row (and in order) * @param cb function to call on all such aggregations diff --git a/src/include/exchange-database/iterate_all_kyc_attributes.h b/src/include/exchange-database/iterate_all_kyc_attributes.h @@ -89,6 +89,8 @@ typedef bool /** * Lookup all KYC attributes above @a min_row_id. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param pg the database context * @param min_row_id minimum row ID to return (exclusive) * @param cb callback to invoke on each match diff --git a/src/include/exchange-database/iterate_all_purse_decisions_above_serial_id.h b/src/include/exchange-database/iterate_all_purse_decisions_above_serial_id.h @@ -72,6 +72,8 @@ typedef enum GNUNET_GenericReturnValue * Select purse decisions above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_decision` (see test_purse_decision.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_all_purse_deletions_above_serial_id.h b/src/include/exchange-database/iterate_all_purse_deletions_above_serial_id.h @@ -72,6 +72,8 @@ typedef enum GNUNET_GenericReturnValue * Select all purse deletions above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_deletion` (see test_purse_deletion.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_aml_attributes.h b/src/include/exchange-database/iterate_aml_attributes.h @@ -79,6 +79,8 @@ typedef void /** * Lookup AML attributes of a particular account. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param pg the database context * @param h_payto which account should we return attributes for * @param offset row to start from diff --git a/src/include/exchange-database/iterate_aml_decisions.h b/src/include/exchange-database/iterate_aml_decisions.h @@ -101,6 +101,8 @@ typedef void /** * Lookup AML decisions that have a particular state. * + * Primary test table: `aml_history` (see test_aml_history.c). + * * @param pg the database context * @param h_payto which account should we return the AML decision history for, NULL to return all accounts * @param investigation_only filter by investigation state diff --git a/src/include/exchange-database/iterate_aml_history.h b/src/include/exchange-database/iterate_aml_history.h @@ -92,6 +92,8 @@ typedef void * Lookup AML history for an account identified via * @a h_payto. * + * Primary test table: `aml_history` (see test_aml_history.c). + * * @param pg the database context * @param h_payto hash of account to lookup history for * @param offset row ID to start returning results from diff --git a/src/include/exchange-database/iterate_aml_measures.h b/src/include/exchange-database/iterate_aml_measures.h @@ -75,6 +75,8 @@ typedef void /** * Lookup legitimization measures. * + * Primary test table: `legitimization_measures` (see test_legitimization_measures.c). + * * @param pg the database context * @param h_payto account for which the attribute data is stored, * NULL to select for all accounts diff --git a/src/include/exchange-database/iterate_aml_staff_above_serial_id.h b/src/include/exchange-database/iterate_aml_staff_above_serial_id.h @@ -68,6 +68,8 @@ typedef enum GNUNET_GenericReturnValue * resume from where it stopped and will still see every change. The rows an * officer accumulates are that officer's history, oldest first. * + * Primary test table: `aml_staff` (see test_aml_staff.c). + * * @param pg the database context * @param serial_id lowest serial ID to include * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_aml_statistics.h b/src/include/exchange-database/iterate_aml_statistics.h @@ -64,6 +64,8 @@ typedef void * Obtain the AML statistics for a given set of @a names and * timeframe. * + * Primary test table: `kyc_events` (see test_kyc_events.c). + * * @param pg the database context * @param num_names length of the @e names array * @param names array of names of the statistics to fetch diff --git a/src/include/exchange-database/iterate_auditor_denominations.h b/src/include/exchange-database/iterate_auditor_denominations.h @@ -70,6 +70,8 @@ typedef void * auditor. Disabled auditors and denominations without auditor are * skipped. Runs in its own read-only transaction. * + * Primary test table: `auditor_denom_sigs` (see test_auditor_denom_sigs.c). + * * @param pg the database context * @param cb function to call on each active auditor * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_batch_deposits_missing_wire.h b/src/include/exchange-database/iterate_batch_deposits_missing_wire.h @@ -74,6 +74,8 @@ typedef void * Select all of those batch deposits in the database * above the given serial ID. * + * Primary test table: `batch_deposits` (see test_batch_deposits.c). + * * @param pg the database context * @param min_batch_deposit_serial_id select all batch deposits above this ID * @param cb function to call on all such deposits diff --git a/src/include/exchange-database/iterate_coin_deposits_above_serial_id.h b/src/include/exchange-database/iterate_coin_deposits_above_serial_id.h @@ -80,6 +80,8 @@ typedef enum GNUNET_GenericReturnValue * Select deposits above @a serial_id in monotonically increasing * order. * + * Primary test table: `coin_deposits` (see test_coin_deposits.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_denomination_info.h b/src/include/exchange-database/iterate_denomination_info.h @@ -70,6 +70,8 @@ typedef void /** * Fetch information about all known denomination keys. * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param cb function to call on each denomination key * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_denominations.h b/src/include/exchange-database/iterate_denominations.h @@ -59,6 +59,8 @@ typedef void * read-only transaction. * * + * Primary test table: `denominations` (see test_denominations.c). + * * @param pg the database context * @param cb function to call on each denomination key * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_deposit_amounts_for_kyc_check.h b/src/include/exchange-database/iterate_deposit_amounts_for_kyc_check.h @@ -30,6 +30,8 @@ * Call @a kac on deposited amounts after @a time_limit which are relevant for a * KYC trigger for a merchant identified by @a h_payto. * + * Primary test table: `coin_deposits` (see test_coin_deposits.c). + * * @param pg the database context * @param h_payto account identifier * @param time_limit oldest transaction that could be relevant diff --git a/src/include/exchange-database/iterate_exchange_credit_transfers.h b/src/include/exchange-database/iterate_exchange_credit_transfers.h @@ -29,6 +29,8 @@ /** * Return AML-relevant wire transfer credit data. * + * Primary test table: `reserves_in` (see test_reserves_in.c). + * * @param pg the database context * @param threshold minimum wire amount to return data for * @param offset offset in table to filter by diff --git a/src/include/exchange-database/iterate_exchange_debit_transfers.h b/src/include/exchange-database/iterate_exchange_debit_transfers.h @@ -53,6 +53,8 @@ typedef void /** * Return AML-relevant wire transfer debit data. * + * Primary test table: `wire_out` (see test_wire_out.c). + * * @param pg the database context * @param threshold minimum wire amount to return data for * @param offset offset in table to filter by diff --git a/src/include/exchange-database/iterate_exchange_kycauth_transfers.h b/src/include/exchange-database/iterate_exchange_kycauth_transfers.h @@ -53,6 +53,8 @@ typedef void /** * Return wire transfer kycauth data. * + * Primary test table: `kycauths_in` (see test_kycauths_in.c). + * * @param pg the database context * @param threshold minimum wire amount to return data for * @param offset offset in table to filter by diff --git a/src/include/exchange-database/iterate_expired_reserves.h b/src/include/exchange-database/iterate_expired_reserves.h @@ -60,6 +60,8 @@ typedef enum GNUNET_GenericReturnValue * Obtain information about expired reserves and their * remaining balances. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @param now timestamp based on which we decide expiration * @param rec function to call on expired reserves diff --git a/src/include/exchange-database/iterate_global_fees.h b/src/include/exchange-database/iterate_global_fees.h @@ -85,6 +85,12 @@ typedef void /** * Obtain global fees from database. * + * Only fee periods that started within the last year are reported; older + * ones are skipped even though they are still on file. Note that + * #TALER_EXCHANGEDB_iterate_wire_fees() has no such cut-off. + * + * Primary test table: `global_fee` (see test_global_fee.c). + * * @param pg the database context * @param cb function to call on each fee entry * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_kyc_accounts.h b/src/include/exchange-database/iterate_kyc_accounts.h @@ -91,6 +91,8 @@ typedef void /** * List accounts managed by the exchange (for AML/KYC). * + * Primary test table: `kyc_targets` (see test_kyc_targets.c). + * * @param pg the database context * @param investigation_only filter by investigation state * @param open_only filter for only open accounts diff --git a/src/include/exchange-database/iterate_kyc_attributes.h b/src/include/exchange-database/iterate_kyc_attributes.h @@ -79,6 +79,8 @@ typedef void /** * Lookup KYC attribute data for a specific account. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param pg the database context * @param h_payto account for which the attribute data is stored * @param cb callback to invoke on each match diff --git a/src/include/exchange-database/iterate_kyc_history.h b/src/include/exchange-database/iterate_kyc_history.h @@ -104,6 +104,8 @@ typedef void * Lookup KYC history for an account identified via * @a h_payto. * + * Primary test table: `kyc_attributes` (see test_kyc_attributes.c). + * * @param pg the database context * @param h_payto hash of account to lookup history for * @param cb function to call on results diff --git a/src/include/exchange-database/iterate_kyc_references.h b/src/include/exchange-database/iterate_kyc_references.h @@ -74,6 +74,8 @@ typedef void * Call us on KYC legitimization processes satisfied and not expired for the * given account. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param h_payto account identifier * @param lpc function to call for each satisfied KYC legitimization process diff --git a/src/include/exchange-database/iterate_kycauth_in_above_serial_id_by_account.h b/src/include/exchange-database/iterate_kycauth_in_above_serial_id_by_account.h @@ -62,6 +62,8 @@ typedef enum GNUNET_GenericReturnValue * Select inbound wire transfers into kycauths_in above @a serial_id * in monotonically increasing order by account. * + * Primary test table: `kycauths_in` (see test_kycauths_in.c). + * * @param pg the database context * @param account_name name of the account to select by * @param serial_id lowest serial ID to include (the row itself is returned, diff --git a/src/include/exchange-database/iterate_legitimization_outcomes_above_serial_id.h b/src/include/exchange-database/iterate_legitimization_outcomes_above_serial_id.h @@ -74,6 +74,8 @@ typedef enum GNUNET_GenericReturnValue * increasing order, each with flags saying what in the database could * account for it. * + * Primary test table: `legitimization_outcomes` (see test_legitimization_outcomes.c). + * * @param pg the database context * @param serial_id lowest serial ID to include (the row itself is returned, * so callers resuming from a progress point pass last seen + 1) diff --git a/src/include/exchange-database/iterate_merge_amounts_for_kyc_check.h b/src/include/exchange-database/iterate_merge_amounts_for_kyc_check.h @@ -30,6 +30,8 @@ * Call @a kac on merged reserve amounts after @a time_limit which are relevant for a * KYC trigger for a the wallet identified by @a h_payto. * + * Primary test table: `account_merges` (see test_account_merges.c). + * * @param pg the database context * @param h_payto account identifier * @param time_limit oldest transaction that could be relevant diff --git a/src/include/exchange-database/iterate_prewires.h b/src/include/exchange-database/iterate_prewires.h @@ -45,6 +45,8 @@ typedef void * Function called to get an unfinished wire transfer * preparation data. Fetches at most one item. * + * Primary test table: `prewire` (see test_prewire.c). + * * @param pg the database context * @param start_row offset to query table at * @param limit maximum number of results to return diff --git a/src/include/exchange-database/iterate_purse_decisions_above_serial_id.h b/src/include/exchange-database/iterate_purse_decisions_above_serial_id.h @@ -76,6 +76,8 @@ typedef enum GNUNET_GenericReturnValue * Select purse decisions above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_decision` (see test_purse_decision.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param refunded which refund status to select for diff --git a/src/include/exchange-database/iterate_purse_deposits_above_serial_id.h b/src/include/exchange-database/iterate_purse_deposits_above_serial_id.h @@ -90,6 +90,8 @@ typedef enum GNUNET_GenericReturnValue * Select deposits above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_deposits` (see test_purse_deposits.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_purse_deposits_by_purse.h b/src/include/exchange-database/iterate_purse_deposits_by_purse.h @@ -75,6 +75,8 @@ typedef enum GNUNET_GenericReturnValue /** * Select coin affected by purse refund. * + * Primary test table: `purse_deposits` (see test_purse_deposits.c). + * * @param pg the database context * @param purse_pub purse that was refunded * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_purse_merges_above_serial_id.h b/src/include/exchange-database/iterate_purse_merges_above_serial_id.h @@ -102,6 +102,8 @@ typedef enum GNUNET_GenericReturnValue * Select purse merges deposits above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_merges` (see test_purse_merges.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_purse_requests_above_serial_id.h b/src/include/exchange-database/iterate_purse_requests_above_serial_id.h @@ -94,6 +94,8 @@ typedef enum GNUNET_GenericReturnValue * Select purse requestss deposits above @a serial_id in monotonically increasing * order. * + * Primary test table: `purse_requests` (see test_purse_requests.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_records_by_table.h b/src/include/exchange-database/iterate_records_by_table.h @@ -628,6 +628,8 @@ typedef int * Lookup records above @a serial number in @a table. Used in * exchange-auditor database replication. * + * No primary test table; exercised by test_replication.c. + * * @param pg the database context * @param table table for which we should return the serial * @param serial largest serial number to exclude diff --git a/src/include/exchange-database/iterate_recoup_refreshes_above_serial_id.h b/src/include/exchange-database/iterate_recoup_refreshes_above_serial_id.h @@ -96,6 +96,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select recoup requests the exchange received for * refreshed coins, ordered by serial ID (monotonically increasing). * + * Primary test table: `recoup_refresh` (see test_recoup_refresh.c). + * * @param pg the database context * @param serial_id lowest serial ID to include (select larger or equal) * @param cb function to call for ONE unfinished item diff --git a/src/include/exchange-database/iterate_recoups_above_serial_id.h b/src/include/exchange-database/iterate_recoups_above_serial_id.h @@ -90,6 +90,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select recoup requests the exchange * received, ordered by serial ID (monotonically increasing). * + * Primary test table: `recoup` (see test_recoup.c). + * * @param pg the database context * @param serial_id lowest serial ID to include (select larger or equal) * @param cb function to call for ONE unfinished item diff --git a/src/include/exchange-database/iterate_refreshes_above_serial_id.h b/src/include/exchange-database/iterate_refreshes_above_serial_id.h @@ -96,6 +96,8 @@ typedef enum GNUNET_GenericReturnValue * Select refresh sessions above @a serial_id in monotonically increasing * order. * + * Primary test table: `refresh` (see test_refresh.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_refunds_above_serial_id.h b/src/include/exchange-database/iterate_refunds_above_serial_id.h @@ -96,6 +96,8 @@ typedef enum GNUNET_GenericReturnValue * Select refunds above @a serial_id in monotonically increasing * order. * + * Primary test table: `refunds` (see test_refunds.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_refunds_by_coin.h b/src/include/exchange-database/iterate_refunds_by_coin.h @@ -63,6 +63,8 @@ typedef enum GNUNET_GenericReturnValue /** * Select refunds by @a coin_pub, @a merchant_pub and @a h_contract. * + * Primary test table: `refunds` (see test_refunds.c). + * * @param pg the database context * @param coin_pub coin to get refunds for * @param merchant_pub merchant to get refunds for diff --git a/src/include/exchange-database/iterate_reserve_close_info.h b/src/include/exchange-database/iterate_reserve_close_info.h @@ -30,6 +30,8 @@ * Select information needed for KYC checks on reserve close: historic * reserve closures going to the same account. * + * Primary test table: `reserves_close` (see test_reserves_close.c). + * * @param pg the database context * @param h_payto which target account is this about? * @param time_limit oldest transaction that could be relevant diff --git a/src/include/exchange-database/iterate_reserve_closed_above_serial_id.h b/src/include/exchange-database/iterate_reserve_closed_above_serial_id.h @@ -94,6 +94,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select reserve close operations the aggregator * triggered, ordered by serial ID (monotonically increasing). * + * Primary test table: `reserves_close` (see test_reserves_close.c). + * * @param pg the database context * @param serial_id lowest serial ID to include (select larger or equal) * @param cb function to call for ONE unfinished item diff --git a/src/include/exchange-database/iterate_reserve_open_above_serial_id.h b/src/include/exchange-database/iterate_reserve_open_above_serial_id.h @@ -90,6 +90,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select reserve open operations, ordered by serial ID * (monotonically increasing). * + * Primary test table: `reserves_open_requests` (see test_reserves_open_requests.c). + * * @param pg the database context * @param serial_id lowest serial ID to include (select larger or equal) * @param cb function to call for ONE unfinished item diff --git a/src/include/exchange-database/iterate_reserves_in_above_serial_id.h b/src/include/exchange-database/iterate_reserves_in_above_serial_id.h @@ -59,6 +59,8 @@ typedef enum GNUNET_GenericReturnValue * Select inbound wire transfers into reserves_in above @a serial_id * in monotonically increasing order. * + * Primary test table: `reserves_in` (see test_reserves_in.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/iterate_reserves_in_above_serial_id_by_account.h b/src/include/exchange-database/iterate_reserves_in_above_serial_id_by_account.h @@ -59,6 +59,8 @@ typedef enum GNUNET_GenericReturnValue * Select inbound wire transfers into reserves_in above @a serial_id * in monotonically increasing order by account. * + * Primary test table: `reserves_in` (see test_reserves_in.c). + * * @param pg the database context * @param account_name name of the account to select by * @param serial_id highest serial ID to exclude (select strictly larger) diff --git a/src/include/exchange-database/iterate_unfinished_close_requests.h b/src/include/exchange-database/iterate_unfinished_close_requests.h @@ -62,6 +62,8 @@ typedef enum GNUNET_GenericReturnValue * balances). Updates the returned reserve's close * status to "done". * + * Primary test table: `close_requests` (see test_close_requests.c). + * * @param pg the database context * @param rec function to call on expired reserves * @param rec_cls closure for @a rec diff --git a/src/include/exchange-database/iterate_wallet_merges.h b/src/include/exchange-database/iterate_wallet_merges.h @@ -53,6 +53,8 @@ typedef void /** * Return AML-relevant merges (credits) into a wallet. * + * Primary test table: `purse_merges` (see test_purse_merges.c). + * * @param pg the database context * @param threshold minimum wire amount to return data for * @param offset offset in table to filter by diff --git a/src/include/exchange-database/iterate_wire_accounts.h b/src/include/exchange-database/iterate_wire_accounts.h @@ -93,6 +93,8 @@ typedef void /** * Obtain information about the enabled wire accounts of the exchange. * + * Primary test table: `wire_accounts` (see test_wire_accounts.c). + * * @param pg the database context * @param cb function to call on each account * @param cb_cls closure for @a cb diff --git a/src/include/exchange-database/iterate_wire_fees.h b/src/include/exchange-database/iterate_wire_fees.h @@ -74,6 +74,8 @@ typedef void * Obtain information about the fee structure of the exchange for * a given @a wire_method * + * Primary test table: `wire_fee` (see test_wire_fee.c). + * * @param pg the database context * @param wire_method which wire method to obtain fees for * @param cb function to call on each account diff --git a/src/include/exchange-database/iterate_wire_outs_above_serial_id.h b/src/include/exchange-database/iterate_wire_outs_above_serial_id.h @@ -58,6 +58,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select all wire transfers the exchange * executed. * + * Primary test table: `wire_out` (see test_wire_out.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call for ONE unfinished item diff --git a/src/include/exchange-database/iterate_wire_outs_above_serial_id_by_account.h b/src/include/exchange-database/iterate_wire_outs_above_serial_id_by_account.h @@ -58,6 +58,8 @@ typedef enum GNUNET_GenericReturnValue * Function called to select all wire transfers the exchange * executed by account. * + * Primary test table: `wire_out` (see test_wire_out.c). + * * @param pg the database context * @param account_name account to select * @param serial_id highest serial ID to exclude (select strictly larger) diff --git a/src/include/exchange-database/iterate_wire_transfers.h b/src/include/exchange-database/iterate_wire_transfers.h @@ -106,6 +106,8 @@ typedef void * Lookup the list of Taler transactions that were aggregated * into a wire transfer by the respective @a wtid. * + * Primary test table: `aggregation_tracking` (see test_aggregation_tracking.c). + * * @param pg the database context * @param wtid the raw wire transfer identifier we used * @param cb function to call on each transaction found diff --git a/src/include/exchange-database/iterate_withdraw_amounts_for_kyc_check.h b/src/include/exchange-database/iterate_withdraw_amounts_for_kyc_check.h @@ -30,6 +30,8 @@ * Call @a kac on withdrawn amounts after @a time_limit which are relevant * for a KYC trigger for a the (debited) account identified by @a h_payto. * + * Primary test table: `withdraw` (see test_withdraw.c). + * * @param pg the database context * @param h_payto account identifier * @param time_limit oldest transaction that could be relevant diff --git a/src/include/exchange-database/iterate_withdrawals_above_serial_id.h b/src/include/exchange-database/iterate_withdrawals_above_serial_id.h @@ -110,6 +110,8 @@ typedef enum GNUNET_GenericReturnValue * Select withdraw operations from reserves_out above @a serial_id * in monotonically increasing order. * + * Primary test table: `withdraw` (see test_withdraw.c). + * * @param pg the database context * @param serial_id highest serial ID to exclude (select strictly larger) * @param cb function to call on each result diff --git a/src/include/exchange-database/preflight.h b/src/include/exchange-database/preflight.h @@ -31,6 +31,8 @@ * If we are, try to commit the previous transaction and output a warning. * Does not return anything, as we will continue regardless of the outcome. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @return #GNUNET_OK if everything is fine * #GNUNET_NO if a transaction was rolled back diff --git a/src/include/exchange-database/release_revolving_shard.h b/src/include/exchange-database/release_revolving_shard.h @@ -28,6 +28,8 @@ * back into the work pool. Clears the * "active" flag. * + * Primary test table: `revolving_work_shards` (see test_revolving_work_shards.c). + * * @param pg the database context * @param job_name name of the operation the shard belongs to * @param start_row inclusive start row of the shard diff --git a/src/include/exchange-database/rollback.h b/src/include/exchange-database/rollback.h @@ -28,6 +28,8 @@ /** * Roll back the current transaction of a database connection. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context */ void diff --git a/src/include/exchange-database/start.h b/src/include/exchange-database/start.h @@ -29,6 +29,8 @@ /** * Start a transaction. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param name unique name identifying the transaction (for debugging) * must point to a constant diff --git a/src/include/exchange-database/start_deferred_wire_out.h b/src/include/exchange-database/start_deferred_wire_out.h @@ -31,6 +31,8 @@ * constraints on the "wire_out" table as we insert aggregations * and only add the wire transfer out at the end. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @return #GNUNET_OK on success */ diff --git a/src/include/exchange-database/start_read_committed.h b/src/include/exchange-database/start_read_committed.h @@ -28,6 +28,8 @@ /** * Start a READ COMMITTED transaction. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param name unique name identifying the transaction (for debugging) * must point to a constant diff --git a/src/include/exchange-database/start_read_only.h b/src/include/exchange-database/start_read_only.h @@ -29,6 +29,8 @@ /** * Start a READ ONLY serializable transaction. * + * No primary test table; exercised by test_misc.c. + * * @param pg the database context * @param name unique name identifying the transaction (for debugging) * must point to a constant diff --git a/src/include/exchange-database/update_aggregation_transient.h b/src/include/exchange-database/update_aggregation_transient.h @@ -30,6 +30,8 @@ * Update existing entry in the transient aggregation table. * @a h_payto is only needed for query performance. * + * Primary test table: `aggregation_transient` (see test_aggregation_transient.c). + * * @param pg the database context * @param h_payto destination of the wire transfer * @param wtid the raw wire transfer identifier to update diff --git a/src/include/exchange-database/update_auditor.h b/src/include/exchange-database/update_auditor.h @@ -27,6 +27,8 @@ /** * Update information about an auditor that will audit this exchange. * + * Primary test table: `auditors` (see test_auditors.c). + * * @param pg the database context * @param auditor_pub key of the auditor (primary key for the existing record) * @param auditor_url base URL of the auditor's REST service, to be updated diff --git a/src/include/exchange-database/update_legitimization_process_by_row.h b/src/include/exchange-database/update_legitimization_process_by_row.h @@ -30,6 +30,8 @@ * Update KYC requirement check with provider-linkage and/or * expiration data. * + * Primary test table: `legitimization_processes` (see test_legitimization_processes.c). + * * @param pg the database context * @param process_row row to select by * @param provider_name provider that must be checked (technically redundant) diff --git a/src/include/exchange-database/update_reserve.h b/src/include/exchange-database/update_reserve.h @@ -28,6 +28,8 @@ /** * Updates a reserve with the data from the given reserve structure. * + * Primary test table: `reserves` (see test_reserves.c). + * * @param pg the database context * @param reserve the reserve structure whose data will be used to update the * corresponding record in the database. diff --git a/src/include/exchange-database/update_shard_progress.h b/src/include/exchange-database/update_shard_progress.h @@ -38,6 +38,8 @@ * shard (because our lease ran out while we were still going) therefore * cannot rewind what we already recorded. * + * Primary test table: `work_shards` (see test_work_shards.c). + * * @param pg the database context * @param job_name name of the job the shard belongs to * @param start_row inclusive start row of the shard diff --git a/src/include/exchange-database/update_to_aml_locked.h b/src/include/exchange-database/update_to_aml_locked.h @@ -31,6 +31,8 @@ * account. If a lock already exists, returns the timeout of the * @a existing_lock. Returns 0 if @a h_payto is not known. * + * Primary test table: `kyc_targets` (see test_kyc_targets.c). + * * @param pg the database context * @param h_payto account to lock * @param lock_duration how long to lock the account diff --git a/src/include/exchange-database/update_to_aml_unlocked.h b/src/include/exchange-database/update_to_aml_unlocked.h @@ -33,6 +33,8 @@ * notification the caller must do separately after finishing * the database update. * + * Primary test table: `kyc_targets` (see test_kyc_targets.c). + * * @param pg the database context * @param h_payto account to clear the lock for * @return transaction status diff --git a/src/include/exchange-database/update_to_prewire_failed.h b/src/include/exchange-database/update_to_prewire_failed.h @@ -27,6 +27,8 @@ /** * Function called to mark wire transfer commit data as failed. * + * Primary test table: `prewire` (see test_prewire.c). + * * @param pg the database context * @param rowid which entry to mark as failed * @return transaction status code diff --git a/src/include/exchange-database/update_to_prewire_finished.h b/src/include/exchange-database/update_to_prewire_finished.h @@ -27,6 +27,8 @@ /** * Function called to mark wire transfer commit data as finished. * + * Primary test table: `prewire` (see test_prewire.c). + * * @param pg the database context * @param rowid which entry to mark as finished * @return transaction status code diff --git a/src/include/exchange-database/update_to_profit_drain_finished.h b/src/include/exchange-database/update_to_profit_drain_finished.h @@ -27,6 +27,8 @@ /** * Set profit drain operation to finished. * + * Primary test table: `profit_drains` (see test_profit_drains.c). + * * @param pg the database context * @param serial serial ID of the entry to mark finished * @return transaction status code diff --git a/src/include/exchange-database/update_to_refresh_revealed.h b/src/include/exchange-database/update_to_refresh_revealed.h @@ -27,6 +27,8 @@ /** * Mark a refresh, given by the commitment, as successfully revealed. * + * Primary test table: `refresh` (see test_refresh.c). + * * @param pg the database context * @param rc commitment for the refresh * @return transaction status code diff --git a/src/include/exchange-database/update_wire.h b/src/include/exchange-database/update_wire.h @@ -29,6 +29,8 @@ /** * Update information about a wire account of the exchange. * + * Primary test table: `wire_accounts` (see test_wire_accounts.c). + * * @param pg the database context * @param payto_uri account the update is about * @param conversion_url URL of a conversion service, NULL if there is no conversion