From eea35ffb01328f4109e4cfaeeff1c3cae586d8e4 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 21 Apr 2022 22:44:51 +0200 Subject: -skeleton logic for deposits into purse --- src/lib/exchange_api_purse_create_with_merge.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'src/lib/exchange_api_purse_create_with_merge.c') diff --git a/src/lib/exchange_api_purse_create_with_merge.c b/src/lib/exchange_api_purse_create_with_merge.c index 03accce1..dac0eaf5 100644 --- a/src/lib/exchange_api_purse_create_with_merge.c +++ b/src/lib/exchange_api_purse_create_with_merge.c @@ -297,6 +297,31 @@ TALER_EXCHANGE_purse_create_with_merge ( &contract_pub.ecdhe_pub); // FIXME: extract min_age from contract_terms! + { + // FIXME: extract amount from contract + // or pass explicitly? what about other + // args, like the purse expiration time? + struct GNUNET_JSON_Specification spec[] = { + TALER_JSON_spec_amount_any ("amount", + &pcm->purse_value_after_fees), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_uint32 ("minimum_age", + &min_age), + NULL), + GNUNET_JSON_spec_end () + }; + + if (GNUNET_OK != + GNUNET_JSON_parse (contract_terms, + spec, + NULL, NULL)) + { + GNUNET_break (0); + GNUNET_free (pcm); + return NULL; + } + } + GNUNET_assert (GNUNET_YES == TEAH_handle_is_ready (exchange)); -- cgit v1.2.3