summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-08-21 23:58:37 +0200
committerChristian Grothoff <christian@grothoff.org>2023-08-21 23:58:37 +0200
commit373d9df0d6c3448ae8d72071ba96f7e3f45b4272 (patch)
treed2bf5cb887422e75e1f8140d892d687dd33226ad
parent250e1997d86c160e1a6603c72b23bf1ec8eafb5d (diff)
downloadexchange-373d9df0d6c3448ae8d72071ba96f7e3f45b4272.tar.gz
exchange-373d9df0d6c3448ae8d72071ba96f7e3f45b4272.tar.bz2
exchange-373d9df0d6c3448ae8d72071ba96f7e3f45b4272.zip
improve logging, fix client-side serialization of new /keys options
-rw-r--r--src/exchange/taler-exchange-httpd_keys.c6
-rw-r--r--src/lib/exchange_api_handle.c26
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",