From a351bfc4b4ca15ce7fd998cf9691e85cf84dc426 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 17 Feb 2022 15:10:14 +0100 Subject: -fix CS nonce reuse check logic --- src/testing/test_exchange_api-cs.conf | 4 ++-- .../testing_api_cmd_auditor_add_denom_sig.c | 5 +---- src/testing/testing_api_cmd_deposit.c | 5 ++--- src/testing/testing_api_cmd_insert_deposit.c | 8 ++++---- src/testing/testing_api_cmd_refresh.c | 4 ++-- src/testing/testing_api_cmd_withdraw.c | 22 +++++++++------------- 6 files changed, 20 insertions(+), 28 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test_exchange_api-cs.conf b/src/testing/test_exchange_api-cs.conf index 79332d64..c50b7e82 100644 --- a/src/testing/test_exchange_api-cs.conf +++ b/src/testing/test_exchange_api-cs.conf @@ -101,7 +101,7 @@ value = EUR:0.10 duration_withdraw = 7 days duration_spend = 2 years duration_legal = 3 years -fee_withdraw = EUR:0.01 +fee_withdraw = EUR:0.00 fee_deposit = EUR:0.01 fee_refresh = EUR:0.03 fee_refund = EUR:0.01 @@ -157,7 +157,7 @@ value = EUR:0.10 duration_withdraw = 7 days duration_spend = 2 years duration_legal = 3 years -fee_withdraw = EUR:0.01 +fee_withdraw = EUR:0.00 fee_deposit = EUR:0.01 fee_refresh = EUR:0.03 fee_refund = EUR:0.01 diff --git a/src/testing/testing_api_cmd_auditor_add_denom_sig.c b/src/testing/testing_api_cmd_auditor_add_denom_sig.c index 33cd9575..b8feb7d3 100644 --- a/src/testing/testing_api_cmd_auditor_add_denom_sig.c +++ b/src/testing/testing_api_cmd_auditor_add_denom_sig.c @@ -152,10 +152,7 @@ auditor_add_run (void *cls, dk->expire_deposit, dk->expire_legal, &dk->value, - &dk->fee_withdraw, - &dk->fee_deposit, - &dk->fee_refresh, - &dk->fee_refund, + &dk->fees, &is->auditor_priv, &auditor_sig); } diff --git a/src/testing/testing_api_cmd_deposit.c b/src/testing/testing_api_cmd_deposit.c index d3fafc63..d3a444ee 100644 --- a/src/testing/testing_api_cmd_deposit.c +++ b/src/testing/testing_api_cmd_deposit.c @@ -409,8 +409,7 @@ deposit_run (void *cls, { TALER_age_commitment_hash (age_commitment, &h_age_commitment); } - - ds->deposit_fee = denom_pub->fee_deposit; + ds->deposit_fee = denom_pub->fees.deposit; GNUNET_CRYPTO_eddsa_key_get_public (&coin_priv->eddsa_priv, &coin_pub.eddsa_pub); @@ -440,7 +439,7 @@ deposit_run (void *cls, TALER_JSON_merchant_wire_signature_hash (ds->wire_details, &h_wire)); TALER_wallet_deposit_sign (&ds->amount, - &denom_pub->fee_deposit, + &denom_pub->fees.deposit, &h_wire, &h_contract_terms, &h_age_commitment, diff --git a/src/testing/testing_api_cmd_insert_deposit.c b/src/testing/testing_api_cmd_insert_deposit.c index dcda7cf3..5247ccd7 100644 --- a/src/testing/testing_api_cmd_insert_deposit.c +++ b/src/testing/testing_api_cmd_insert_deposit.c @@ -103,16 +103,16 @@ fake_issue (struct TALER_EXCHANGEDB_DenominationKeyInformationP *issue) &issue->properties.value)); GNUNET_assert (GNUNET_OK == TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fee_withdraw)); + &issue->properties.fees.withdraw)); GNUNET_assert (GNUNET_OK == TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fee_deposit)); + &issue->properties.fees.deposit)); GNUNET_assert (GNUNET_OK == TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fee_refresh)); + &issue->properties.fees.refresh)); GNUNET_assert (GNUNET_OK == TALER_string_to_amount_nbo ("EUR:0.1", - &issue->properties.fee_refund)); + &issue->properties.fees.refund)); } diff --git a/src/testing/testing_api_cmd_refresh.c b/src/testing/testing_api_cmd_refresh.c index 11c88c19..a2fb4f15 100644 --- a/src/testing/testing_api_cmd_refresh.c +++ b/src/testing/testing_api_cmd_refresh.c @@ -1101,7 +1101,7 @@ melt_run (void *cls, /* Melt amount starts with the melt fee of the old coin; we'll add the values and withdraw fees of the fresh coins next */ - melt_amount = melt_denom_pub->fee_refresh; + melt_amount = melt_denom_pub->fees.refresh; age_restricted = melt_denom_pub->key.age_mask.mask != 0; for (unsigned int i = 0; ifee_withdraw)); + &fresh_pk->fees.withdraw)); rms->fresh_pks[i] = *fresh_pk; /* Make a deep copy of the RSA key */ TALER_denom_pub_deep_copy (&rms->fresh_pks[i].key, diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c index e5e8adfd..14015c49 100644 --- a/src/testing/testing_api_cmd_withdraw.c +++ b/src/testing/testing_api_cmd_withdraw.c @@ -474,19 +474,15 @@ withdraw_run (void *cls, GNUNET_assert (0 <= TALER_amount_add (&ws->reserve_history.amount, &ws->amount, - &ws->pk->fee_withdraw)); - ws->reserve_history.details.withdraw.fee = ws->pk->fee_withdraw; - - { - - ws->wsh = TALER_EXCHANGE_withdraw (is->exchange, - ws->pk, - rp, - &ws->ps, - ws->h_age_commitment, - &reserve_withdraw_cb, - ws); - } + &ws->pk->fees.withdraw)); + ws->reserve_history.details.withdraw.fee = ws->pk->fees.withdraw; + ws->wsh = TALER_EXCHANGE_withdraw (is->exchange, + ws->pk, + rp, + &ws->ps, + ws->h_age_commitment, + &reserve_withdraw_cb, + ws); if (NULL == ws->wsh) { GNUNET_break (0); -- cgit v1.2.3 From 802f4986fea13337ac2a33ac9585b94aebad36da Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 17 Feb 2022 15:29:50 +0100 Subject: -fix Oec FTBFS --- src/testing/test_exchange_api_twisted.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/testing') diff --git a/src/testing/test_exchange_api_twisted.c b/src/testing/test_exchange_api_twisted.c index 33631764..150d3b12 100644 --- a/src/testing/test_exchange_api_twisted.c +++ b/src/testing/test_exchange_api_twisted.c @@ -124,6 +124,7 @@ run (void *cls, TALER_TESTING_cmd_withdraw_amount ("refresh-withdraw-coin", "refresh-create-reserve", "EUR:5", + 0, /* age */ MHD_HTTP_OK), TALER_TESTING_cmd_deposit ("refresh-deposit-partial", "refresh-withdraw-coin", @@ -164,6 +165,7 @@ run (void *cls, TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r1", "create-reserve-r1", "EUR:5", + 0, /* age */ MHD_HTTP_OK), TALER_TESTING_cmd_deposit ("deposit-refund-1", "withdraw-coin-r1", @@ -233,6 +235,7 @@ run (void *cls, TALER_TESTING_cmd_withdraw_amount ("withdraw-coin-r2", "create-reserve-r2", "EUR:5", + 0, /* age */ MHD_HTTP_OK), TALER_TESTING_cmd_end () }; -- cgit v1.2.3 From d380ff1ffec06317ea4f9e6cec2313620148e7d5 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 17 Feb 2022 19:02:55 +0100 Subject: -restore fee structure --- src/testing/test_exchange_api-cs.conf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/testing') diff --git a/src/testing/test_exchange_api-cs.conf b/src/testing/test_exchange_api-cs.conf index c50b7e82..79332d64 100644 --- a/src/testing/test_exchange_api-cs.conf +++ b/src/testing/test_exchange_api-cs.conf @@ -101,7 +101,7 @@ value = EUR:0.10 duration_withdraw = 7 days duration_spend = 2 years duration_legal = 3 years -fee_withdraw = EUR:0.00 +fee_withdraw = EUR:0.01 fee_deposit = EUR:0.01 fee_refresh = EUR:0.03 fee_refund = EUR:0.01 @@ -157,7 +157,7 @@ value = EUR:0.10 duration_withdraw = 7 days duration_spend = 2 years duration_legal = 3 years -fee_withdraw = EUR:0.00 +fee_withdraw = EUR:0.01 fee_deposit = EUR:0.01 fee_refresh = EUR:0.03 fee_refund = EUR:0.01 -- cgit v1.2.3