-cleanups

This commit is contained in:
Christian Grothoff 2022-02-07 23:38:30 +01:00
parent e27ff05e63
commit 17a30cbd70
No known key found for this signature in database
GPG Key ID: 939E6BE1E29FC3CC
5 changed files with 14 additions and 9 deletions

View File

@ -1,6 +1,6 @@
/* /*
This file is part of TALER This file is part of TALER
Copyright (C) 2014-2021 Taler Systems SA Copyright (C) 2014-2022 Taler Systems SA
TALER is free software; you can redistribute it and/or modify it under the TALER is free software; you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free Software terms of the GNU Affero General Public License as published by the Free Software
@ -183,6 +183,7 @@ melt_transaction (void *cls,
} }
if (! balance_ok) if (! balance_ok)
{ {
GNUNET_break_op (0);
TEH_plugin->rollback (TEH_plugin->cls); TEH_plugin->rollback (TEH_plugin->cls);
*mhd_ret *mhd_ret
= TEH_RESPONSE_reply_coin_insufficient_funds ( = TEH_RESPONSE_reply_coin_insufficient_funds (
@ -299,6 +300,9 @@ check_melt_valid (struct MHD_Connection *connection,
rmc->coin_refresh_fee = dk->meta.fee_refresh; rmc->coin_refresh_fee = dk->meta.fee_refresh;
rmc->coin_value = dk->meta.value; rmc->coin_value = dk->meta.value;
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
"Melted coin's denomination is worth %s\n",
TALER_amount2s (&dk->meta.value));
/* sanity-check that "total melt amount > melt fee" */ /* sanity-check that "total melt amount > melt fee" */
if (0 < if (0 <
TALER_amount_cmp (&rmc->coin_refresh_fee, TALER_amount_cmp (&rmc->coin_refresh_fee,

View File

@ -479,7 +479,6 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
struct TALER_CoinSpendSignatureP confirm_sig; struct TALER_CoinSpendSignatureP confirm_sig;
char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32]; char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32];
struct TALER_DenominationHash h_denom_pub; struct TALER_DenominationHash h_denom_pub;
struct TALER_CoinSpendPublicKeyP coin_pub;
if (GNUNET_OK != if (GNUNET_OK !=
TALER_EXCHANGE_get_melt_data_ (mh->ps, TALER_EXCHANGE_get_melt_data_ (mh->ps,
@ -499,7 +498,7 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
&mh->md.melted_coin.coin_priv, &mh->md.melted_coin.coin_priv,
&confirm_sig); &confirm_sig);
GNUNET_CRYPTO_eddsa_key_get_public (&mh->md.melted_coin.coin_priv.eddsa_priv, GNUNET_CRYPTO_eddsa_key_get_public (&mh->md.melted_coin.coin_priv.eddsa_priv,
&coin_pub.eddsa_pub); &mh->coin_pub.eddsa_pub);
melt_obj = GNUNET_JSON_PACK ( melt_obj = GNUNET_JSON_PACK (
GNUNET_JSON_pack_data_auto ("denom_pub_hash", GNUNET_JSON_pack_data_auto ("denom_pub_hash",
&h_denom_pub), &h_denom_pub),
@ -516,7 +515,7 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
char *end; char *end;
end = GNUNET_STRINGS_data_to_string ( end = GNUNET_STRINGS_data_to_string (
&coin_pub, &mh->coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP), sizeof (struct TALER_CoinSpendPublicKeyP),
pub_str, pub_str,
sizeof (pub_str)); sizeof (pub_str));

View File

@ -184,7 +184,7 @@ run (void *cls,
/** /**
* Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x * Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x
* EUR:0.13) * EUR:0.13)
*/ */
TALER_TESTING_cmd_melt_double ("refresh-melt-1", TALER_TESTING_cmd_melt_double ("refresh-melt-1",
"refresh-withdraw-coin-1", "refresh-withdraw-coin-1",
MHD_HTTP_OK, MHD_HTTP_OK,

View File

@ -765,6 +765,7 @@ TALER_TESTING_setup_with_exchange_cfg (
#endif #endif
"taler-exchange-httpd", "taler-exchange-httpd",
"taler-exchange-httpd", "taler-exchange-httpd",
"-L", "INFO",
"-a", /* some tests may need timetravel */ "-a", /* some tests may need timetravel */
"-c", setup_ctx->config_filename, "-c", setup_ctx->config_filename,
#if GNU_PARALLEL #if GNU_PARALLEL

View File

@ -691,7 +691,7 @@ main_wrapper_exchange_connect (void *cls)
* *
* @param[in,out] is state to initialize * @param[in,out] is state to initialize
*/ */
static int static enum GNUNET_GenericReturnValue
load_keys (struct TALER_TESTING_Interpreter *is) load_keys (struct TALER_TESTING_Interpreter *is)
{ {
char *fn; char *fn;
@ -774,7 +774,7 @@ load_keys (struct TALER_TESTING_Interpreter *is)
* *
* @param[in,out] is state to initialize * @param[in,out] is state to initialize
*/ */
static int static enum GNUNET_GenericReturnValue
load_urls (struct TALER_TESTING_Interpreter *is) load_urls (struct TALER_TESTING_Interpreter *is)
{ {
if (GNUNET_OK != if (GNUNET_OK !=
@ -804,7 +804,7 @@ load_urls (struct TALER_TESTING_Interpreter *is)
} }
int enum GNUNET_GenericReturnValue
TALER_TESTING_setup (TALER_TESTING_Main main_cb, TALER_TESTING_setup (TALER_TESTING_Main main_cb,
void *main_cb_cls, void *main_cb_cls,
const struct GNUNET_CONFIGURATION_Handle *cfg, const struct GNUNET_CONFIGURATION_Handle *cfg,
@ -839,7 +839,8 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
is.ctx = GNUNET_CURL_init is.ctx = GNUNET_CURL_init
(&GNUNET_CURL_gnunet_scheduler_reschedule, (&GNUNET_CURL_gnunet_scheduler_reschedule,
&is.rc); &is.rc);
GNUNET_CURL_enable_async_scope_header (is.ctx, "Taler-Correlation-Id"); GNUNET_CURL_enable_async_scope_header (is.ctx,
"Taler-Correlation-Id");
GNUNET_assert (NULL != is.ctx); GNUNET_assert (NULL != is.ctx);
is.rc = GNUNET_CURL_gnunet_rc_create (is.ctx); is.rc = GNUNET_CURL_gnunet_rc_create (is.ctx);