aboutsummaryrefslogtreecommitdiff
path: root/src/exchange-lib/exchange_api_refresh.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2016-05-21 18:36:12 +0200
committerChristian Grothoff <christian@grothoff.org>2016-05-21 18:36:12 +0200
commit9160245167ded9b2b7c11716dfa1a1e8887187f4 (patch)
tree64720ebc3b69f84055f25d8a7f309b19b0ebd52a /src/exchange-lib/exchange_api_refresh.c
parent922175d3082b138f4973fe11d81327806e68021d (diff)
make use of GNUNET_JSON_from_data_auto where possible
Diffstat (limited to 'src/exchange-lib/exchange_api_refresh.c')
-rw-r--r--src/exchange-lib/exchange_api_refresh.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/exchange-lib/exchange_api_refresh.c b/src/exchange-lib/exchange_api_refresh.c
index ad2195689..e98b3c782 100644
--- a/src/exchange-lib/exchange_api_refresh.c
+++ b/src/exchange-lib/exchange_api_refresh.c
@@ -1310,15 +1310,13 @@ melted_coin_to_json (const struct GNUNET_HashCode *melt_session_hash,
&confirm_sig.eddsa_signature);
return json_pack ("{s:o, s:o, s:o, s:o, s:o}",
"coin_pub",
- GNUNET_JSON_from_data (&melt.coin_pub,
- sizeof (melt.coin_pub)),
+ GNUNET_JSON_from_data_auto (&melt.coin_pub),
"denom_pub",
GNUNET_JSON_from_rsa_public_key (mc->pub_key.rsa_public_key),
"denom_sig",
GNUNET_JSON_from_rsa_signature (mc->sig.rsa_signature),
"confirm_sig",
- GNUNET_JSON_from_data (&confirm_sig,
- sizeof (confirm_sig)),
+ GNUNET_JSON_from_data_auto (&confirm_sig),
"value_with_fee",
TALER_JSON_from_amount (&mc->melt_amount_with_fee));
}
@@ -1398,8 +1396,7 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_CRYPTO_ecdhe_key_get_public (&mc->transfer_priv[j].ecdhe_priv,
&transfer_pub.ecdhe_pub);
json_array_append (transfer_pubs,
- GNUNET_JSON_from_data (&transfer_pub,
- sizeof (transfer_pub)));
+ GNUNET_JSON_from_data_auto (&transfer_pub));
}
/* now secret_encs */
@@ -1417,8 +1414,7 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
&trans_sec,
&els));
json_array_append (secret_encs,
- GNUNET_JSON_from_data (&els,
- sizeof (els)));
+ GNUNET_JSON_from_data_auto (&els));
}
/* now new_denoms */
@@ -1451,7 +1447,7 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
GNUNET_assert (NULL != buf);
json_array_append (tmp,
GNUNET_JSON_from_data (buf,
- buf_len));
+ buf_len));
GNUNET_free (buf);
GNUNET_free (rle);
}
@@ -1482,7 +1478,7 @@ TALER_EXCHANGE_refresh_melt (struct TALER_EXCHANGE_Handle *exchange,
&coin_ev);
json_array_append (tmp,
GNUNET_JSON_from_data (coin_ev,
- coin_ev_size));
+ coin_ev_size));
GNUNET_free (coin_ev);
}
json_array_append (coin_evs,
@@ -1869,15 +1865,13 @@ TALER_EXCHANGE_refresh_reveal (struct TALER_EXCHANGE_Handle *exchange,
continue;
}
json_array_append (transfer_privs,
- GNUNET_JSON_from_data (&md->melted_coin.transfer_priv[j],
- sizeof (struct TALER_TransferPrivateKeyP)));
+ GNUNET_JSON_from_data_auto (&md->melted_coin.transfer_priv[j]));
}
/* build main JSON request */
reveal_obj = json_pack ("{s:o, s:o}",
"session_hash",
- GNUNET_JSON_from_data (&md->melt_session_hash,
- sizeof (struct GNUNET_HashCode)),
+ GNUNET_JSON_from_data_auto (&md->melt_session_hash),
"transfer_privs",
transfer_privs);