exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit b9e4431ae6d6075bc0af8ab3bad7b976d831c8f0
parent 6516f1899f4202d802901d08ce26d02db63af83f
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Wed, 28 Jul 2021 09:45:33 +0200

-fix amount packer

Diffstat:
Msrc/json/json_pack.c | 20++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/json/json_pack.c b/src/json/json_pack.c @@ -88,12 +88,12 @@ struct GNUNET_JSON_PackSpec TALER_JSON_pack_amount (const char *name, const struct TALER_Amount *amount) { - json_t *json; + struct GNUNET_JSON_PackSpec ps = { + .field_name = name, + .object = TALER_JSON_from_amount (amount) + }; - json = TALER_JSON_from_amount (amount); - GNUNET_assert (NULL != json); - return GNUNET_JSON_pack_object_steal (name, - json); + return ps; } @@ -101,12 +101,12 @@ struct GNUNET_JSON_PackSpec TALER_JSON_pack_amount_nbo (const char *name, const struct TALER_AmountNBO *amount) { - json_t *json; + struct GNUNET_JSON_PackSpec ps = { + .field_name = name, + .object = TALER_JSON_from_amount_nbo (amount) + }; - json = TALER_JSON_from_amount_nbo (amount); - GNUNET_assert (NULL != json); - return GNUNET_JSON_pack_object_steal (name, - json); + return ps; }