From 20aad54c3e010020185c76d9e0727f3f497c2f73 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 8 May 2017 13:18:36 +0200 Subject: remove dead transfer details field from reserves_in (API, exchangedb, etc.) --- src/exchange/taler-exchange-httpd_db.c | 15 ++++++++++++--- src/exchange/taler-exchange-httpd_responses.c | 3 ++- src/exchange/taler-exchange-wirewatch.c | 4 +--- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'src/exchange') diff --git a/src/exchange/taler-exchange-httpd_db.c b/src/exchange/taler-exchange-httpd_db.c index 085438d60..0634e34f6 100644 --- a/src/exchange/taler-exchange-httpd_db.c +++ b/src/exchange/taler-exchange-httpd_db.c @@ -1867,6 +1867,7 @@ TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection, { struct TALER_EXCHANGEDB_Session *session; int ret; + void *json_str; if (NULL == (session = TEH_plugin->get_session (TEH_plugin->cls))) { @@ -1874,15 +1875,23 @@ TEH_DB_execute_admin_add_incoming (struct MHD_Connection *connection, return TEH_RESPONSE_reply_internal_db_error (connection, TALER_EC_DB_SETUP_FAILED); } + json_str = json_dumps (transfer_details, + JSON_INDENT(2)); + if (NULL == json_str) + { + GNUNET_break (0); + return TEH_RESPONSE_reply_internal_db_error (connection, + TALER_EC_PARSER_OUT_OF_MEMORY); + } ret = TEH_plugin->reserves_in_insert (TEH_plugin->cls, session, reserve_pub, amount, execution_time, sender_account_details, - "FIXME", - 5, - transfer_details); + json_str, + strlen (json_str)); + free (json_str); if (GNUNET_SYSERR == ret) { GNUNET_break (0); diff --git a/src/exchange/taler-exchange-httpd_responses.c b/src/exchange/taler-exchange-httpd_responses.c index a839413b7..f9051f0b4 100644 --- a/src/exchange/taler-exchange-httpd_responses.c +++ b/src/exchange/taler-exchange-httpd_responses.c @@ -772,7 +772,8 @@ compile_reserve_history (const struct TALER_EXCHANGEDB_ReserveHistory *rh, json_pack ("{s:s, s:O, s:O, s:o}", "type", "DEPOSIT", "sender_account_details", pos->details.bank->sender_account_details, - "transfer_details", pos->details.bank->transfer_details, + "wire_reference", GNUNET_JSON_from_data (pos->details.bank->wire_reference, + pos->details.bank->wire_reference_size), "amount", TALER_JSON_from_amount (&pos->details.bank->amount)))); break; case TALER_EXCHANGEDB_RO_WITHDRAW_COIN: diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index 918eb597a..6daf5caca 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -238,7 +238,6 @@ history_cb (void *cls, NULL); return GNUNET_OK; /* will be ignored anyway */ } - // FIXME: create json! ret = db_plugin->reserves_in_insert (db_plugin->cls, session, &details->reserve_pub, @@ -246,8 +245,7 @@ history_cb (void *cls, details->execution_date, details->account_details, row_off, - row_off_size, - NULL /* FIXME */); + row_off_size); if (GNUNET_OK != ret) { GNUNET_break (0); -- cgit v1.2.3