summaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_purse_create_with_merge.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-04-21 22:44:51 +0200
committerChristian Grothoff <christian@grothoff.org>2022-04-21 22:44:51 +0200
commiteea35ffb01328f4109e4cfaeeff1c3cae586d8e4 (patch)
treec4cb61196675f6799508c97d65371486346574ec /src/lib/exchange_api_purse_create_with_merge.c
parent53cde04c4e62dcf38055502cfc60a691a58a5758 (diff)
downloadexchange-eea35ffb01328f4109e4cfaeeff1c3cae586d8e4.tar.gz
exchange-eea35ffb01328f4109e4cfaeeff1c3cae586d8e4.tar.bz2
exchange-eea35ffb01328f4109e4cfaeeff1c3cae586d8e4.zip
-skeleton logic for deposits into purse
Diffstat (limited to 'src/lib/exchange_api_purse_create_with_merge.c')
-rw-r--r--src/lib/exchange_api_purse_create_with_merge.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/lib/exchange_api_purse_create_with_merge.c b/src/lib/exchange_api_purse_create_with_merge.c
index 03accce10..dac0eaf5d 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));