diff options
author | Christian Grothoff <christian@grothoff.org> | 2016-03-19 19:16:35 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2016-03-19 19:16:35 +0100 |
commit | 737e3f4bf67a2048381785328206c595bffe632a (patch) | |
tree | b9c0a93fc43d1e6cd5c0dbd14ff53d0ee2d29fee /src/exchange/taler-exchange-httpd_tracking.c | |
parent | 3d5e096fa24a2d11873d7e09a0b994a00882325d (diff) |
refactor to eliminate duplicated JSON parsing logic (#4150)
Diffstat (limited to 'src/exchange/taler-exchange-httpd_tracking.c')
-rw-r--r-- | src/exchange/taler-exchange-httpd_tracking.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/exchange/taler-exchange-httpd_tracking.c b/src/exchange/taler-exchange-httpd_tracking.c index afb821cb..36782332 100644 --- a/src/exchange/taler-exchange-httpd_tracking.c +++ b/src/exchange/taler-exchange-httpd_tracking.c @@ -121,14 +121,14 @@ TMH_TRACKING_handler_deposit_wtid (struct TMH_RequestHandler *rh, struct TALER_DepositTrackPS tps; uint64_t transaction_id; struct TALER_MerchantSignatureP merchant_sig; - struct TMH_PARSE_FieldSpecification spec[] = { - TMH_PARSE_member_fixed ("H_wire", &tps.h_wire), - TMH_PARSE_member_fixed ("H_contract", &tps.h_contract), - TMH_PARSE_member_fixed ("coin_pub", &tps.coin_pub), - TMH_PARSE_member_uint64 ("transaction_id", &transaction_id), - TMH_PARSE_member_fixed ("merchant_pub", &tps.merchant), - TMH_PARSE_member_fixed ("merchant_sig", &merchant_sig), - TMH_PARSE_MEMBER_END + struct GNUNET_JSON_Specification spec[] = { + GNUNET_JSON_spec_fixed_auto ("H_wire", &tps.h_wire), + GNUNET_JSON_spec_fixed_auto ("H_contract", &tps.h_contract), + GNUNET_JSON_spec_fixed_auto ("coin_pub", &tps.coin_pub), + GNUNET_JSON_spec_uint64 ("transaction_id", &transaction_id), + GNUNET_JSON_spec_fixed_auto ("merchant_pub", &tps.merchant), + GNUNET_JSON_spec_fixed_auto ("merchant_sig", &merchant_sig), + GNUNET_JSON_spec_end () }; res = TMH_PARSE_post_json (connection, @@ -156,7 +156,7 @@ TMH_TRACKING_handler_deposit_wtid (struct TMH_RequestHandler *rh, &tps.merchant, &merchant_sig, transaction_id); - TMH_PARSE_release_data (spec); + GNUNET_JSON_parse_free (spec); json_decref (json); return res; } |