aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-07 23:38:30 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-07 23:38:30 +0100
commit17a30cbd708cb2427fd3a7533fc9945898e2c34c (patch)
treec6886d8feff8697265a850ec15efe98134b6b66a /src
parente27ff05e63cae9075b8b9a88cbd7dd10d8c39adc (diff)
-cleanups
Diffstat (limited to 'src')
-rw-r--r--src/exchange/taler-exchange-httpd_melt.c6
-rw-r--r--src/lib/exchange_api_melt.c5
-rw-r--r--src/testing/test_auditor_api.c2
-rw-r--r--src/testing/testing_api_helpers_exchange.c1
-rw-r--r--src/testing/testing_api_loop.c9
5 files changed, 14 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_melt.c b/src/exchange/taler-exchange-httpd_melt.c
index 54f1385d7..021b629b3 100644
--- a/src/exchange/taler-exchange-httpd_melt.c
+++ b/src/exchange/taler-exchange-httpd_melt.c
@@ -1,6 +1,6 @@
/*
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
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)
{
+ GNUNET_break_op (0);
TEH_plugin->rollback (TEH_plugin->cls);
*mhd_ret
= 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_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" */
if (0 <
TALER_amount_cmp (&rmc->coin_refresh_fee,
diff --git a/src/lib/exchange_api_melt.c b/src/lib/exchange_api_melt.c
index 10086ed5c..3308ffda6 100644
--- a/src/lib/exchange_api_melt.c
+++ b/src/lib/exchange_api_melt.c
@@ -479,7 +479,6 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
struct TALER_CoinSpendSignatureP confirm_sig;
char arg_str[sizeof (struct TALER_CoinSpendPublicKeyP) * 2 + 32];
struct TALER_DenominationHash h_denom_pub;
- struct TALER_CoinSpendPublicKeyP coin_pub;
if (GNUNET_OK !=
TALER_EXCHANGE_get_melt_data_ (mh->ps,
@@ -499,7 +498,7 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
&mh->md.melted_coin.coin_priv,
&confirm_sig);
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 (
GNUNET_JSON_pack_data_auto ("denom_pub_hash",
&h_denom_pub),
@@ -516,7 +515,7 @@ start_melt (struct TALER_EXCHANGE_MeltHandle *mh)
char *end;
end = GNUNET_STRINGS_data_to_string (
- &coin_pub,
+ &mh->coin_pub,
sizeof (struct TALER_CoinSpendPublicKeyP),
pub_str,
sizeof (pub_str));
diff --git a/src/testing/test_auditor_api.c b/src/testing/test_auditor_api.c
index d1616c915..cf2354bd8 100644
--- a/src/testing/test_auditor_api.c
+++ b/src/testing/test_auditor_api.c
@@ -184,7 +184,7 @@ run (void *cls,
/**
* Melt the rest of the coin's value (EUR:4.00 = 3x EUR:1.03 + 7x
* EUR:0.13)
-*/
+ */
TALER_TESTING_cmd_melt_double ("refresh-melt-1",
"refresh-withdraw-coin-1",
MHD_HTTP_OK,
diff --git a/src/testing/testing_api_helpers_exchange.c b/src/testing/testing_api_helpers_exchange.c
index 9414af662..ba0e5a0fb 100644
--- a/src/testing/testing_api_helpers_exchange.c
+++ b/src/testing/testing_api_helpers_exchange.c
@@ -765,6 +765,7 @@ TALER_TESTING_setup_with_exchange_cfg (
#endif
"taler-exchange-httpd",
"taler-exchange-httpd",
+ "-L", "INFO",
"-a", /* some tests may need timetravel */
"-c", setup_ctx->config_filename,
#if GNU_PARALLEL
diff --git a/src/testing/testing_api_loop.c b/src/testing/testing_api_loop.c
index 7a25bed64..9ce201120 100644
--- a/src/testing/testing_api_loop.c
+++ b/src/testing/testing_api_loop.c
@@ -691,7 +691,7 @@ main_wrapper_exchange_connect (void *cls)
*
* @param[in,out] is state to initialize
*/
-static int
+static enum GNUNET_GenericReturnValue
load_keys (struct TALER_TESTING_Interpreter *is)
{
char *fn;
@@ -774,7 +774,7 @@ load_keys (struct TALER_TESTING_Interpreter *is)
*
* @param[in,out] is state to initialize
*/
-static int
+static enum GNUNET_GenericReturnValue
load_urls (struct TALER_TESTING_Interpreter *is)
{
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,
void *main_cb_cls,
const struct GNUNET_CONFIGURATION_Handle *cfg,
@@ -839,7 +839,8 @@ TALER_TESTING_setup (TALER_TESTING_Main main_cb,
is.ctx = GNUNET_CURL_init
(&GNUNET_CURL_gnunet_scheduler_reschedule,
&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);
is.rc = GNUNET_CURL_gnunet_rc_create (is.ctx);