From 300194f42a629ddbc24e59b7e16e906888afe905 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 30 May 2022 23:55:55 +0200 Subject: -towards p2p auditor sync implementation: SQL still missing --- src/exchangedb/common-0001.sql | 2 +- src/exchangedb/irbt_callbacks.c | 303 +++++++++++++- src/exchangedb/lrbt_callbacks.c | 604 +++++++++++++++++++++++++++- src/exchangedb/plugin_exchangedb_postgres.c | 70 ++++ 4 files changed, 961 insertions(+), 18 deletions(-) (limited to 'src/exchangedb') diff --git a/src/exchangedb/common-0001.sql b/src/exchangedb/common-0001.sql index cb64f446e..31c4b68e8 100644 --- a/src/exchangedb/common-0001.sql +++ b/src/exchangedb/common-0001.sql @@ -1186,7 +1186,7 @@ BEGIN table_name = concat_ws('_', table_name, shard_suffix); - -- FIXME: change to materialized index by marge_pub! + -- FIXME: change to materialized index by merge_pub! EXECUTE FORMAT ( 'CREATE INDEX IF NOT EXISTS ' || table_name || '_merge_pub ' 'ON ' || table_name || ' ' diff --git a/src/exchangedb/irbt_callbacks.c b/src/exchangedb/irbt_callbacks.c index 172dfcbeb..c1802b96b 100644 --- a/src/exchangedb/irbt_callbacks.c +++ b/src/exchangedb/irbt_callbacks.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet - Copyright (C) 2020, 2021 Taler Systems SA + Copyright (C) 2020, 2021, 2022 Taler Systems SA GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -150,7 +150,6 @@ irbt_cb_table_reserves (struct PostgresClosure *pg, struct GNUNET_PQ_QueryParam params[] = { GNUNET_PQ_query_param_uint64 (&td->serial), GNUNET_PQ_query_param_auto_from_type (&td->details.reserves.reserve_pub), - TALER_PQ_query_param_amount (&td->details.reserves.current_balance), GNUNET_PQ_query_param_timestamp (&td->details.reserves.expiration_date), GNUNET_PQ_query_param_timestamp (&td->details.reserves.gc_date), GNUNET_PQ_query_param_end @@ -383,8 +382,6 @@ irbt_cb_table_known_coins (struct PostgresClosure *pg, &td->details.known_coins.denom_sig), GNUNET_PQ_query_param_uint64 ( &td->details.known_coins.denominations_serial), - TALER_PQ_query_param_amount ( - &td->details.known_coins.remaining), GNUNET_PQ_query_param_end }; @@ -526,7 +523,6 @@ irbt_cb_table_deposits (struct PostgresClosure *pg, GNUNET_PQ_query_param_auto_from_type (&td->details.deposits.wire_salt), GNUNET_PQ_query_param_auto_from_type ( &td->details.deposits.wire_target_h_payto), - GNUNET_PQ_query_param_bool (td->details.deposits.done), GNUNET_PQ_query_param_bool (td->details.deposits.extension_blocked), 0 == td->details.deposits.extension_details_serial_id ? GNUNET_PQ_query_param_null () @@ -801,4 +797,301 @@ irbt_cb_table_extension_details (struct PostgresClosure *pg, } +/** + * Function called with purse_requests records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_purse_requests (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.purse_requests.merge_pub), + GNUNET_PQ_query_param_timestamp ( + &td->details.purse_requests.purse_creation), + GNUNET_PQ_query_param_timestamp ( + &td->details.purse_requests.purse_expiration), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.purse_requests.h_contract_terms), + GNUNET_PQ_query_param_uint32 (&td->details.purse_requests.age_limit), + GNUNET_PQ_query_param_uint32 (&td->details.purse_requests.flags), + TALER_PQ_query_param_amount (&td->details.purse_requests.amount_with_fee), + TALER_PQ_query_param_amount (&td->details.purse_requests.purse_fee), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.purse_requests.purse_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_purse_requests", + params); +} + + +/** + * Function called with purse_merges records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_purse_merges (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.purse_merges.reserve_pub), + GNUNET_PQ_query_param_auto_from_type (&td->details.purse_merges.purse_pub), + GNUNET_PQ_query_param_auto_from_type (&td->details.purse_merges.merge_sig), + GNUNET_PQ_query_param_timestamp (&td->details.purse_merges.merge_timestamp), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_purse_merges", + params); +} + + +/** + * Function called with purse_deposits records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_purse_deposits (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.purse_deposits.purse_pub), + GNUNET_PQ_query_param_auto_from_type (&td->details.purse_deposits.coin_pub), + TALER_PQ_query_param_amount (&td->details.purse_deposits.amount_with_fee), + GNUNET_PQ_query_param_auto_from_type (&td->details.purse_deposits.coin_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_purse_deposits", + params); +} + + +/** + * Function called with account_mergers records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_account_mergers (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.account_merges.reserve_pub), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.account_merges.reserve_sig), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.account_merges.purse_pub), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_account_mergers", + params); +} + + +/** + * Function called with history_requests records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_history_requests (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.history_requests.reserve_pub), + GNUNET_PQ_query_param_timestamp ( + &td->details.history_requests.request_timestamp), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.history_requests.reserve_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_history_requests", + params); +} + + +/** + * Function called with close_requests records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_close_requests (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.close_requests.reserve_pub), + GNUNET_PQ_query_param_timestamp ( + &td->details.close_requests.close_timestamp), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.close_requests.reserve_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_close_requests", + params); +} + + +/** + * Function called with wads_out records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_wads_out (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type (&td->details.wads_out.wad_id), + TALER_PQ_query_param_amount (&td->details.wads_out.amount), + GNUNET_PQ_query_param_timestamp (&td->details.wads_out.execution_time), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_wads_out", + params); +} + + +/** + * Function called with wads_out_entries records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_wads_out_entries (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_out_entries.reserve_pub), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_out_entries.purse_pub), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_out_entries.h_contract), + GNUNET_PQ_query_param_timestamp ( + &td->details.wads_out_entries.purse_expiration), + GNUNET_PQ_query_param_timestamp ( + &td->details.wads_out_entries.merge_timestamp), + TALER_PQ_query_param_amount ( + &td->details.wads_out_entries.amount_with_fee), + TALER_PQ_query_param_amount ( + &td->details.wads_out_entries.deposit_fees), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_out_entries.reserve_sig), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_out_entries.purse_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_wads_out_entries", + params); +} + + +/** + * Function called with wads_in records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_wads_in (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type (&td->details.wads_in.wad_id), + GNUNET_PQ_query_param_string (td->details.wads_in.origin_exchange_url), + TALER_PQ_query_param_amount (&td->details.wads_in.amount), + GNUNET_PQ_query_param_timestamp (&td->details.wads_in.arrival_time), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_wads_in", + params); +} + + +/** + * Function called with wads_in_entries records to insert into table. + * + * @param pg plugin context + * @param td record to insert + */ +static enum GNUNET_DB_QueryStatus +irbt_cb_table_wads_in_entries (struct PostgresClosure *pg, + const struct TALER_EXCHANGEDB_TableData *td) +{ + struct GNUNET_PQ_QueryParam params[] = { + GNUNET_PQ_query_param_uint64 (&td->serial), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_in_entries.reserve_pub), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_in_entries.purse_pub), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_in_entries.h_contract), + GNUNET_PQ_query_param_timestamp ( + &td->details.wads_in_entries.purse_expiration), + GNUNET_PQ_query_param_timestamp ( + &td->details.wads_in_entries.merge_timestamp), + TALER_PQ_query_param_amount ( + &td->details.wads_in_entries.amount_with_fee), + TALER_PQ_query_param_amount ( + &td->details.wads_in_entries.wad_fee), + TALER_PQ_query_param_amount ( + &td->details.wads_in_entries.deposit_fees), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_in_entries.reserve_sig), + GNUNET_PQ_query_param_auto_from_type ( + &td->details.wads_in_entries.purse_sig), + GNUNET_PQ_query_param_end + }; + + return GNUNET_PQ_eval_prepared_non_select (pg->conn, + "insert_into_table_wads_in_entries", + params); +} + + /* end of irbt_callbacks.c */ diff --git a/src/exchangedb/lrbt_callbacks.c b/src/exchangedb/lrbt_callbacks.c index 5451be761..b621b7b00 100644 --- a/src/exchangedb/lrbt_callbacks.c +++ b/src/exchangedb/lrbt_callbacks.c @@ -1,6 +1,6 @@ /* This file is part of GNUnet - Copyright (C) 2020, 2021 Taler Systems SA + Copyright (C) 2020, 2021, 2022 Taler Systems SA GNUnet is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published @@ -219,7 +219,6 @@ lrbt_cb_table_reserves (void *cls, unsigned int num_results) { struct LookupRecordsByTableContext *ctx = cls; - struct PostgresClosure *pg = ctx->pg; struct TALER_EXCHANGEDB_TableData td = { .table = TALER_EXCHANGEDB_RT_RESERVES }; @@ -231,8 +230,6 @@ lrbt_cb_table_reserves (void *cls, &td.serial), GNUNET_PQ_result_spec_auto_from_type ("reserve_pub", &td.details.reserves.reserve_pub), - TALER_PQ_RESULT_SPEC_AMOUNT ("current_balance", - &td.details.reserves.current_balance), GNUNET_PQ_result_spec_timestamp ("expiration_date", &td.details.reserves.expiration_date), GNUNET_PQ_result_spec_timestamp ("gc_date", @@ -659,7 +656,6 @@ lrbt_cb_table_known_coins (void *cls, unsigned int num_results) { struct LookupRecordsByTableContext *ctx = cls; - struct PostgresClosure *pg = ctx->pg; struct TALER_EXCHANGEDB_TableData td = { .table = TALER_EXCHANGEDB_RT_KNOWN_COINS }; @@ -679,9 +675,6 @@ lrbt_cb_table_known_coins (void *cls, GNUNET_PQ_result_spec_uint64 ( "denominations_serial", &td.details.known_coins.denominations_serial), - TALER_PQ_RESULT_SPEC_AMOUNT ( - "remaining", - &td.details.known_coins.remaining), GNUNET_PQ_result_spec_end }; @@ -953,9 +946,6 @@ lrbt_cb_table_deposits (void *cls, GNUNET_PQ_result_spec_auto_from_type ( "wire_target_h_payto", &td.details.deposits.wire_target_h_payto), - GNUNET_PQ_result_spec_bool ( - "done", - &td.details.deposits.done), GNUNET_PQ_result_spec_auto_from_type ( "extension_blocked", &td.details.deposits.extension_blocked), @@ -1455,10 +1445,10 @@ lrbt_cb_table_extension_details (void *cls, struct TALER_EXCHANGEDB_TableData td = { .table = TALER_EXCHANGEDB_RT_EXTENSION_DETAILS }; - bool no_config = false; for (unsigned int i = 0; ipg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_PURSE_REQUESTS + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with purse_merges table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_purse_merges (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_PURSE_MERGES + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with purse_deposits table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_purse_deposits (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_PURSE_DEPOSITS + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with account_merges table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_account_merges (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_ACCOUNT_MERGES + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with history_requests table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_history_requests (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_HISTORY_REQUESTS + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with close_requests table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_close_requests (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_CLOSE_REQUESTS + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with wads_out table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_wads_out (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_WADS_OUT + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with wads_out_entries table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_wads_out_entries (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_WADS_OUT_ENTRIES + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with wads_in table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_wads_in (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_WADS_IN + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + +/** + * Function called with wads_in_entries table entries. + * + * @param cls closure + * @param result the postgres result + * @param num_results the number of results in @a result + */ +static void +lrbt_cb_table_wads_in_entries (void *cls, + PGresult *result, + unsigned int num_results) +{ + struct LookupRecordsByTableContext *ctx = cls; + struct PostgresClosure *pg = ctx->pg; + struct TALER_EXCHANGEDB_TableData td = { + .table = TALER_EXCHANGEDB_RT_WADS_IN_ENTRIES + }; + + for (unsigned int i = 0; ierror = true; + return; + } + ctx->cb (ctx->cb_cls, + &td); + GNUNET_PQ_cleanup_result (rs); + } +} + + /* end of lrbt_callbacks.c */ diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index b2a727641..71338e5f4 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -12738,6 +12738,46 @@ postgres_lookup_records_by_table (void *cls, statement = "select_above_serial_by_table_extension_details"; rh = &lrbt_cb_table_extension_details; break; + case TALER_EXCHANGEDB_RT_PURSE_REQUESTS: + statement = "select_above_serial_by_table_purse_requests"; + rh = &lrbt_cb_table_purse_requests; + break; + case TALER_EXCHANGEDB_RT_PURSE_MERGES: + statement = "select_above_serial_by_table_purse_merges"; + rh = &lrbt_cb_table_purse_merges; + break; + case TALER_EXCHANGEDB_RT_PURSE_DEPOSITS: + statement = "select_above_serial_by_table_purse_deposits"; + rh = &lrbt_cb_table_purse_deposits; + break; + case TALER_EXCHANGEDB_RT_ACCOUNT_MERGES: + statement = "select_above_serial_by_table_account_merges"; + rh = &lrbt_cb_table_account_merges; + break; + case TALER_EXCHANGEDB_RT_HISTORY_REQUESTS: + statement = "select_above_serial_by_table_history_requests"; + rh = &lrbt_cb_table_history_requests; + break; + case TALER_EXCHANGEDB_RT_CLOSE_REQUESTS: + statement = "select_above_serial_by_table_close_requests"; + rh = &lrbt_cb_table_close_requests; + break; + case TALER_EXCHANGEDB_RT_WADS_OUT: + statement = "select_above_serial_by_table_wads_out"; + rh = &lrbt_cb_table_wads_out; + break; + case TALER_EXCHANGEDB_RT_WADS_OUT_ENTRIES: + statement = "select_above_serial_by_table_wads_out_entries"; + rh = &lrbt_cb_table_wads_out_entries; + break; + case TALER_EXCHANGEDB_RT_WADS_IN: + statement = "select_above_serial_by_table_wads_in"; + rh = &lrbt_cb_table_wads_in; + break; + case TALER_EXCHANGEDB_RT_WADS_IN_ENTRIES: + statement = "select_above_serial_by_table_wads_in_entries"; + rh = &lrbt_cb_table_wads_in_entries; + break; default: GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; @@ -12872,6 +12912,36 @@ postgres_insert_records_by_table (void *cls, case TALER_EXCHANGEDB_RT_EXTENSION_DETAILS: rh = &irbt_cb_table_extension_details; break; + case TALER_EXCHANGEDB_RT_PURSE_REQUESTS: + rh = &irbt_cb_table_purse_requests; + break; + case TALER_EXCHANGEDB_RT_PURSE_MERGES: + rh = &irbt_cb_table_purse_merges; + break; + case TALER_EXCHANGEDB_RT_PURSE_DEPOSITS: + rh = &irbt_cb_table_purse_deposits; + break; + case TALER_EXCHANGEDB_RT_ACCOUNT_MERGES: + rh = &irbt_cb_table_account_mergers; + break; + case TALER_EXCHANGEDB_RT_HISTORY_REQUESTS: + rh = &irbt_cb_table_history_requests; + break; + case TALER_EXCHANGEDB_RT_CLOSE_REQUESTS: + rh = &irbt_cb_table_close_requests; + break; + case TALER_EXCHANGEDB_RT_WADS_OUT: + rh = &irbt_cb_table_wads_out; + break; + case TALER_EXCHANGEDB_RT_WADS_OUT_ENTRIES: + rh = &irbt_cb_table_wads_out_entries; + break; + case TALER_EXCHANGEDB_RT_WADS_IN: + rh = &irbt_cb_table_wads_in; + break; + case TALER_EXCHANGEDB_RT_WADS_IN_ENTRIES: + rh = &irbt_cb_table_wads_in_entries; + break; default: GNUNET_break (0); return GNUNET_DB_STATUS_HARD_ERROR; -- cgit v1.2.3