From 373d9df0d6c3448ae8d72071ba96f7e3f45b4272 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 21 Aug 2023 23:58:37 +0200 Subject: improve logging, fix client-side serialization of new /keys options --- src/exchange/taler-exchange-httpd_keys.c | 6 ++---- src/lib/exchange_api_handle.c | 26 ++++++++++++++++++++++---- 2 files changed, 24 insertions(+), 8 deletions(-) diff --git a/src/exchange/taler-exchange-httpd_keys.c b/src/exchange/taler-exchange-httpd_keys.c index 0bb5c8138..ef12609a8 100644 --- a/src/exchange/taler-exchange-httpd_keys.c +++ b/src/exchange/taler-exchange-httpd_keys.c @@ -2535,11 +2535,9 @@ create_krd (struct TEH_KeyStateHandle *ksh, &TEH_stefan_lin), GNUNET_JSON_pack_string ("asset_type", asset_type), - // FIXME: legacy, remove soon! - GNUNET_JSON_pack_bool ("tipping_allowed", - GNUNET_YES == TEH_enable_rewards), GNUNET_JSON_pack_bool ("rewards_allowed", - GNUNET_YES == TEH_enable_rewards), + GNUNET_YES == + TEH_enable_rewards), GNUNET_JSON_pack_data_auto ("master_public_key", &TEH_master_public_key), GNUNET_JSON_pack_time_rel ("reserve_closing_delay", diff --git a/src/lib/exchange_api_handle.c b/src/lib/exchange_api_handle.c index 9c5e12785..3fe45ede8 100644 --- a/src/lib/exchange_api_handle.c +++ b/src/lib/exchange_api_handle.c @@ -789,11 +789,21 @@ decode_keys_json (const json_t *resp_obj, NULL), GNUNET_JSON_spec_end () }; + const char *emsg; + unsigned int eline; - EXITIF (GNUNET_OK != - GNUNET_JSON_parse (resp_obj, - (check_sig) ? mspec : &mspec[2], - NULL, NULL)); + if (GNUNET_OK != + GNUNET_JSON_parse (resp_obj, + (check_sig) ? mspec : &mspec[2], + &emsg, + &eline)) + { + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Parsing /keys failed for `%s' (%u)\n", + emsg, + eline); + EXITIF (1); + } { struct GNUNET_JSON_Specification sspec[] = { TALER_JSON_spec_amount ( @@ -2240,6 +2250,14 @@ TALER_EXCHANGE_keys_to_json (const struct TALER_EXCHANGE_Keys *kd) kd->version), GNUNET_JSON_pack_string ("currency", kd->currency), + GNUNET_JSON_pack_uint64 ("currency_fraction_digits", + kd->currency_fraction_digits), + TALER_JSON_pack_amount ("stefan_abs", + &kd->stefan_abs), + TALER_JSON_pack_amount ("stefan_log", + &kd->stefan_log), + TALER_JSON_pack_amount ("stefan_lin", + &kd->stefan_lin), GNUNET_JSON_pack_string ("asset_type", kd->asset_type), GNUNET_JSON_pack_data_auto ("master_public_key", -- cgit v1.2.3