From cbb905a9aae891c6c3af5ead5709951c4f038a2a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 30 Jul 2021 17:24:16 +0200 Subject: -eliminate more json_pack format strings --- src/exchange/taler-exchange-httpd_deposits_get.c | 38 +++++++++++------------- 1 file changed, 18 insertions(+), 20 deletions(-) (limited to 'src/exchange/taler-exchange-httpd_deposits_get.c') diff --git a/src/exchange/taler-exchange-httpd_deposits_get.c b/src/exchange/taler-exchange-httpd_deposits_get.c index 90f28b4e3..c51e0f426 100644 --- a/src/exchange/taler-exchange-httpd_deposits_get.c +++ b/src/exchange/taler-exchange-httpd_deposits_get.c @@ -78,20 +78,19 @@ reply_deposit_details (struct MHD_Connection *connection, ec, NULL); } - return TALER_MHD_reply_json_pack (connection, - MHD_HTTP_OK, - "{s:o, s:o, s:o, s:o, s:o}", - "wtid", GNUNET_JSON_from_data_auto ( - wtid), - "execution_time", - GNUNET_JSON_from_time_abs (exec_time), - "coin_contribution", - TALER_JSON_from_amount ( - coin_contribution), - "exchange_sig", - GNUNET_JSON_from_data_auto (&sig), - "exchange_pub", - GNUNET_JSON_from_data_auto (&pub)); + return TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_OK, + GNUNET_JSON_pack_data_auto ("wtid", + wtid), + GNUNET_JSON_pack_time_abs ("execution_time", + exec_time), + TALER_JSON_pack_amount ("coin_contribution", + coin_contribution), + GNUNET_JSON_pack_data_auto ("exchange_sig", + &sig), + GNUNET_JSON_pack_data_auto ("exchange_pub", + &pub)); } @@ -279,12 +278,11 @@ handle_track_transaction_request ( &ctx)) return mhd_ret; if (GNUNET_YES == ctx.pending) - return TALER_MHD_reply_json_pack (connection, - MHD_HTTP_ACCEPTED, - "{s:o}", - "execution_time", - GNUNET_JSON_from_time_abs ( - ctx.execution_time)); + return TALER_MHD_REPLY_JSON_PACK ( + connection, + MHD_HTTP_ACCEPTED, + GNUNET_JSON_pack_time_abs ("execution_time", + ctx.execution_time)); if (GNUNET_SYSERR == ctx.pending) return TALER_MHD_reply_with_error (connection, MHD_HTTP_INTERNAL_SERVER_ERROR, -- cgit v1.2.3