From 481ffc1a0a2c808316877a76d74262aa61274a26 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 1 Nov 2022 16:43:59 +0100 Subject: remove wad fee, kyc fee and kyc-timeout --- src/exchangedb/exchange-0001-part.sql | 5 --- src/exchangedb/pg_insert_records_by_table.c | 10 +---- src/exchangedb/pg_lookup_records_by_table.c | 11 ----- src/exchangedb/plugin_exchangedb_postgres.c | 69 +---------------------------- src/exchangedb/test_exchangedb.c | 3 -- 5 files changed, 3 insertions(+), 95 deletions(-) (limited to 'src/exchangedb') diff --git a/src/exchangedb/exchange-0001-part.sql b/src/exchangedb/exchange-0001-part.sql index 4903b8879..99883a279 100644 --- a/src/exchangedb/exchange-0001-part.sql +++ b/src/exchangedb/exchange-0001-part.sql @@ -813,8 +813,6 @@ CREATE TABLE IF NOT EXISTS wire_fee ,wire_fee_frac INT4 NOT NULL ,closing_fee_val INT8 NOT NULL ,closing_fee_frac INT4 NOT NULL - ,wad_fee_val INT8 NOT NULL - ,wad_fee_frac INT4 NOT NULL ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) ,PRIMARY KEY (wire_method, start_date) ); @@ -836,14 +834,11 @@ CREATE TABLE IF NOT EXISTS global_fee ,end_date INT8 NOT NULL ,history_fee_val INT8 NOT NULL ,history_fee_frac INT4 NOT NULL - ,kyc_fee_val INT8 NOT NULL - ,kyc_fee_frac INT4 NOT NULL ,account_fee_val INT8 NOT NULL ,account_fee_frac INT4 NOT NULL ,purse_fee_val INT8 NOT NULL ,purse_fee_frac INT4 NOT NULL ,purse_timeout INT8 NOT NULL - ,kyc_timeout INT8 NOT NULL ,history_expiration INT8 NOT NULL ,purse_account_limit INT4 NOT NULL ,master_sig BYTEA NOT NULL CHECK (LENGTH(master_sig)=64) diff --git a/src/exchangedb/pg_insert_records_by_table.c b/src/exchangedb/pg_insert_records_by_table.c index 99173cc60..47b368318 100644 --- a/src/exchangedb/pg_insert_records_by_table.c +++ b/src/exchangedb/pg_insert_records_by_table.c @@ -1037,7 +1037,6 @@ irbt_cb_table_wire_fee (struct PostgresClosure *pg, GNUNET_PQ_query_param_timestamp (&td->details.wire_fee.end_date), TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wire), TALER_PQ_query_param_amount (&td->details.wire_fee.fees.closing), - TALER_PQ_query_param_amount (&td->details.wire_fee.fees.wad), GNUNET_PQ_query_param_auto_from_type (&td->details.wire_fee.master_sig), GNUNET_PQ_query_param_end }; @@ -1083,16 +1082,12 @@ irbt_cb_table_global_fee (struct PostgresClosure *pg, &td->details.global_fee.end_date), TALER_PQ_query_param_amount ( &td->details.global_fee.fees.history), - TALER_PQ_query_param_amount ( - &td->details.global_fee.fees.kyc), TALER_PQ_query_param_amount ( &td->details.global_fee.fees.account), TALER_PQ_query_param_amount ( &td->details.global_fee.fees.purse), GNUNET_PQ_query_param_relative_time ( &td->details.global_fee.purse_timeout), - GNUNET_PQ_query_param_relative_time ( - &td->details.global_fee.kyc_timeout), GNUNET_PQ_query_param_relative_time ( &td->details.global_fee.history_expiration), GNUNET_PQ_query_param_uint32 ( @@ -1110,19 +1105,16 @@ irbt_cb_table_global_fee (struct PostgresClosure *pg, ",end_date" ",history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" ",master_sig" ") VALUES " - "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16);"); + "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13);"); return GNUNET_PQ_eval_prepared_non_select (pg->conn, "insert_into_table_global_fee", params); diff --git a/src/exchangedb/pg_lookup_records_by_table.c b/src/exchangedb/pg_lookup_records_by_table.c index b7435bc2b..e28edef07 100644 --- a/src/exchangedb/pg_lookup_records_by_table.c +++ b/src/exchangedb/pg_lookup_records_by_table.c @@ -1194,8 +1194,6 @@ lrbt_cb_table_wire_fee (void *cls, &td.details.wire_fee.fees.wire), TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee", &td.details.wire_fee.fees.closing), - TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee", - &td.details.wire_fee.fees.wad), GNUNET_PQ_result_spec_auto_from_type ("master_sig", &td.details.wire_fee.master_sig), GNUNET_PQ_result_spec_end @@ -1250,9 +1248,6 @@ lrbt_cb_table_global_fee (void *cls, TALER_PQ_RESULT_SPEC_AMOUNT ( "history_fee", &td.details.global_fee.fees.history), - TALER_PQ_RESULT_SPEC_AMOUNT ( - "kyc_fee", - &td.details.global_fee.fees.kyc), TALER_PQ_RESULT_SPEC_AMOUNT ( "account_fee", &td.details.global_fee.fees.account), @@ -1262,9 +1257,6 @@ lrbt_cb_table_global_fee (void *cls, GNUNET_PQ_result_spec_relative_time ( "purse_timeout", &td.details.global_fee.purse_timeout), - GNUNET_PQ_result_spec_relative_time ( - "kyc_timeout", - &td.details.global_fee.kyc_timeout), GNUNET_PQ_result_spec_relative_time ( "history_expiration", &td.details.global_fee.history_expiration), @@ -2567,14 +2559,11 @@ TEH_PG_lookup_records_by_table (void *cls, ",end_date" ",history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" ",master_sig" diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 5ccb71127..9f14cc289 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -1598,8 +1598,6 @@ prepare_statements (struct PostgresClosure *pg) ",wire_fee_frac" ",closing_fee_val" ",closing_fee_frac" - ",wad_fee_val" - ",wad_fee_frac" ",master_sig" " FROM wire_fee" " WHERE wire_method=$1" @@ -1613,14 +1611,11 @@ prepare_statements (struct PostgresClosure *pg) ",end_date" ",history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" ",master_sig" @@ -1635,14 +1630,11 @@ prepare_statements (struct PostgresClosure *pg) ",end_date" ",history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" ",master_sig" @@ -1659,11 +1651,9 @@ prepare_statements (struct PostgresClosure *pg) ",wire_fee_frac" ",closing_fee_val" ",closing_fee_frac" - ",wad_fee_val" - ",wad_fee_frac" ",master_sig" ") VALUES " - "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10);"), + "($1, $2, $3, $4, $5, $6, $7, $8);"), /* Used in #postgres_insert_global_fee */ GNUNET_PQ_make_prepare ( "insert_global_fee", @@ -1672,19 +1662,16 @@ prepare_statements (struct PostgresClosure *pg) ",end_date" ",history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" ",master_sig" ") VALUES " - "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15);"), + "($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12);"), /* Used in #postgres_store_wire_transfer_out */ GNUNET_PQ_make_prepare ( "insert_wire_out", @@ -1953,8 +1940,6 @@ prepare_statements (struct PostgresClosure *pg) ",wire_fee_frac" ",closing_fee_val" ",closing_fee_frac" - ",wad_fee_val" - ",wad_fee_frac" ",start_date" ",end_date" ",master_sig" @@ -2057,8 +2042,6 @@ prepare_statements (struct PostgresClosure *pg) ",wire_fee_frac" ",closing_fee_val" ",closing_fee_frac" - ",wad_fee_val" - ",wad_fee_frac" " FROM wire_fee" " WHERE wire_method=$1" " AND end_date > $2" @@ -2069,14 +2052,11 @@ prepare_statements (struct PostgresClosure *pg) "SELECT" " history_fee_val" ",history_fee_frac" - ",kyc_fee_val" - ",kyc_fee_frac" ",account_fee_val" ",account_fee_frac" ",purse_fee_val" ",purse_fee_frac" ",purse_timeout" - ",kyc_timeout" ",history_expiration" ",purse_account_limit" " FROM global_fee" @@ -6290,8 +6270,6 @@ postgres_get_wire_fee (void *cls, end_date), TALER_PQ_RESULT_SPEC_AMOUNT ("wire_fee", &fees->wire), - TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee", - &fees->wad), TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee", &fees->closing), GNUNET_PQ_result_spec_auto_from_type ("master_sig", @@ -6315,7 +6293,6 @@ postgres_get_wire_fee (void *cls, * @param[out] end_date when does the fee end being valid * @param[out] fees how high are the wire fees * @param[out] purse_timeout set to how long we keep unmerged purses - * @param[out] kyc_timeout set to how long we keep accounts without KYC * @param[out] history_expiration set to how long we keep account histories * @param[out] purse_account_limit set to the number of free purses per account * @param[out] master_sig signature over the above by the exchange master key @@ -6328,7 +6305,6 @@ postgres_get_global_fee (void *cls, struct GNUNET_TIME_Timestamp *end_date, struct TALER_GlobalFeeSet *fees, struct GNUNET_TIME_Relative *purse_timeout, - struct GNUNET_TIME_Relative *kyc_timeout, struct GNUNET_TIME_Relative *history_expiration, uint32_t *purse_account_limit, struct TALER_MasterSignatureP *master_sig) @@ -6345,16 +6321,12 @@ postgres_get_global_fee (void *cls, end_date), TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee", &fees->history), - TALER_PQ_RESULT_SPEC_AMOUNT ("kyc_fee", - &fees->kyc), TALER_PQ_RESULT_SPEC_AMOUNT ("account_fee", &fees->account), TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee", &fees->purse), GNUNET_PQ_result_spec_relative_time ("purse_timeout", purse_timeout), - GNUNET_PQ_result_spec_relative_time ("kyc_timeout", - kyc_timeout), GNUNET_PQ_result_spec_relative_time ("history_expiration", history_expiration), GNUNET_PQ_result_spec_uint32 ("purse_account_limit", @@ -6418,7 +6390,6 @@ global_fees_cb (void *cls, { struct TALER_GlobalFeeSet fees; struct GNUNET_TIME_Relative purse_timeout; - struct GNUNET_TIME_Relative kyc_timeout; struct GNUNET_TIME_Relative history_expiration; uint32_t purse_account_limit; struct GNUNET_TIME_Timestamp start_date; @@ -6431,16 +6402,12 @@ global_fees_cb (void *cls, &end_date), TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee", &fees.history), - TALER_PQ_RESULT_SPEC_AMOUNT ("kyc_fee", - &fees.kyc), TALER_PQ_RESULT_SPEC_AMOUNT ("account_fee", &fees.account), TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee", &fees.purse), GNUNET_PQ_result_spec_relative_time ("purse_timeout", &purse_timeout), - GNUNET_PQ_result_spec_relative_time ("kyc_timeout", - &kyc_timeout), GNUNET_PQ_result_spec_relative_time ("history_expiration", &history_expiration), GNUNET_PQ_result_spec_uint32 ("purse_account_limit", @@ -6461,7 +6428,6 @@ global_fees_cb (void *cls, gctx->cb (gctx->cb_cls, &fees, purse_timeout, - kyc_timeout, history_expiration, purse_account_limit, start_date, @@ -6536,7 +6502,6 @@ postgres_insert_wire_fee (void *cls, GNUNET_PQ_query_param_timestamp (&end_date), TALER_PQ_query_param_amount (&fees->wire), TALER_PQ_query_param_amount (&fees->closing), - TALER_PQ_query_param_amount (&fees->wad), GNUNET_PQ_query_param_auto_from_type (master_sig), GNUNET_PQ_query_param_end }; @@ -6598,7 +6563,6 @@ postgres_insert_wire_fee (void *cls, * @param end_date when does the fees end being valid * @param fees how high is are the global fees * @param purse_timeout when do purses time out - * @param kyc_timeout when do reserves without KYC time out * @param history_expiration how long are account histories preserved * @param purse_account_limit how many purses are free per account * @param master_sig signature over the above by the exchange master key @@ -6610,7 +6574,6 @@ postgres_insert_global_fee (void *cls, struct GNUNET_TIME_Timestamp end_date, const struct TALER_GlobalFeeSet *fees, struct GNUNET_TIME_Relative purse_timeout, - struct GNUNET_TIME_Relative kyc_timeout, struct GNUNET_TIME_Relative history_expiration, uint32_t purse_account_limit, const struct TALER_MasterSignatureP *master_sig) @@ -6620,11 +6583,9 @@ postgres_insert_global_fee (void *cls, GNUNET_PQ_query_param_timestamp (&start_date), GNUNET_PQ_query_param_timestamp (&end_date), TALER_PQ_query_param_amount (&fees->history), - TALER_PQ_query_param_amount (&fees->kyc), TALER_PQ_query_param_amount (&fees->account), TALER_PQ_query_param_amount (&fees->purse), GNUNET_PQ_query_param_relative_time (&purse_timeout), - GNUNET_PQ_query_param_relative_time (&kyc_timeout), GNUNET_PQ_query_param_relative_time (&history_expiration), GNUNET_PQ_query_param_uint32 (&purse_account_limit), GNUNET_PQ_query_param_auto_from_type (master_sig), @@ -6636,7 +6597,6 @@ postgres_insert_global_fee (void *cls, struct GNUNET_TIME_Timestamp ed; enum GNUNET_DB_QueryStatus qs; struct GNUNET_TIME_Relative pt; - struct GNUNET_TIME_Relative kt; struct GNUNET_TIME_Relative he; uint32_t pal; @@ -6646,7 +6606,6 @@ postgres_insert_global_fee (void *cls, &ed, &wx, &pt, - &kt, &he, &pal, &sig); @@ -6680,9 +6639,6 @@ postgres_insert_global_fee (void *cls, if ( (GNUNET_TIME_relative_cmp (purse_timeout, !=, pt)) || - (GNUNET_TIME_relative_cmp (kyc_timeout, - !=, - kt)) || (GNUNET_TIME_relative_cmp (history_expiration, !=, he)) ) @@ -10017,8 +9973,6 @@ get_wire_fees_cb (void *cls, &fees.wire), TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee", &fees.closing), - TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee", - &fees.wad), GNUNET_PQ_result_spec_timestamp ("start_date", &start_date), GNUNET_PQ_result_spec_timestamp ("end_date", @@ -10419,8 +10373,6 @@ wire_fee_by_time_helper (void *cls, &fs.wire), TALER_PQ_RESULT_SPEC_AMOUNT ("closing_fee", &fs.closing), - TALER_PQ_RESULT_SPEC_AMOUNT ("wad_fee", - &fs.wad), GNUNET_PQ_result_spec_end }; @@ -10516,11 +10468,6 @@ struct GlobalFeeLookupContext */ struct GNUNET_TIME_Relative *purse_timeout; - /** - * Set to timeout of accounts without kyc. - */ - struct GNUNET_TIME_Relative *kyc_timeout; - /** * Set to history expiration for reserves. */ @@ -10558,22 +10505,17 @@ global_fee_by_time_helper (void *cls, { struct TALER_GlobalFeeSet fs; struct GNUNET_TIME_Relative purse_timeout; - struct GNUNET_TIME_Relative kyc_timeout; struct GNUNET_TIME_Relative history_expiration; uint32_t purse_account_limit; struct GNUNET_PQ_ResultSpec rs[] = { TALER_PQ_RESULT_SPEC_AMOUNT ("history_fee", &fs.history), - TALER_PQ_RESULT_SPEC_AMOUNT ("kyc_fee", - &fs.kyc), TALER_PQ_RESULT_SPEC_AMOUNT ("account_fee", &fs.account), TALER_PQ_RESULT_SPEC_AMOUNT ("purse_fee", &fs.purse), GNUNET_PQ_result_spec_relative_time ("purse_timeout", &purse_timeout), - GNUNET_PQ_result_spec_relative_time ("kyc_timeout", - &kyc_timeout), GNUNET_PQ_result_spec_relative_time ("history_expiration", &history_expiration), GNUNET_PQ_result_spec_uint32 ("purse_account_limit", @@ -10597,7 +10539,6 @@ global_fee_by_time_helper (void *cls, { *wlc->fees = fs; *wlc->purse_timeout = purse_timeout; - *wlc->kyc_timeout = kyc_timeout; *wlc->history_expiration = history_expiration; *wlc->purse_account_limit = purse_account_limit; continue; @@ -10609,9 +10550,6 @@ global_fee_by_time_helper (void *cls, (GNUNET_TIME_relative_cmp (purse_timeout, !=, *wlc->purse_timeout)) || - (GNUNET_TIME_relative_cmp (kyc_timeout, - !=, - *wlc->kyc_timeout)) || (GNUNET_TIME_relative_cmp (history_expiration, !=, *wlc->history_expiration)) ) @@ -10636,7 +10574,6 @@ global_fee_by_time_helper (void *cls, * different global fee exists within this time * period, an 'invalid' amount is returned. * @param[out] purse_timeout set to when unmerged purses expire - * @param[out] kyc_timeout set to when reserves without kyc expire * @param[out] history_expiration set to when we expire reserve histories * @param[out] purse_account_limit set to number of free purses * @return transaction status code @@ -10648,7 +10585,6 @@ postgres_lookup_global_fee_by_time ( struct GNUNET_TIME_Timestamp end_time, struct TALER_GlobalFeeSet *fees, struct GNUNET_TIME_Relative *purse_timeout, - struct GNUNET_TIME_Relative *kyc_timeout, struct GNUNET_TIME_Relative *history_expiration, uint32_t *purse_account_limit) { @@ -10661,7 +10597,6 @@ postgres_lookup_global_fee_by_time ( struct GlobalFeeLookupContext wlc = { .fees = fees, .purse_timeout = purse_timeout, - .kyc_timeout = kyc_timeout, .history_expiration = history_expiration, .purse_account_limit = purse_account_limit, .pg = pg diff --git a/src/exchangedb/test_exchangedb.c b/src/exchangedb/test_exchangedb.c index 77f3dab26..eb990412e 100644 --- a/src/exchangedb/test_exchangedb.c +++ b/src/exchangedb/test_exchangedb.c @@ -819,9 +819,6 @@ test_wire_fees (void) GNUNET_assert (GNUNET_OK == TALER_string_to_amount (CURRENCY ":2.424242", &fees.closing)); - GNUNET_assert (GNUNET_OK == - TALER_string_to_amount (CURRENCY ":3.424242", - &fees.wad)); GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, &master_sig, sizeof (master_sig)); -- cgit v1.2.3