From 165c5337b1fc1df42521ab1cba520b7ddede6fdd Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 21 Feb 2023 17:43:11 +0100 Subject: add algorithm identifier to client API --- src/backend/taler-merchant-httpd_private-post-templates.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'src/backend/taler-merchant-httpd_private-post-templates.c') diff --git a/src/backend/taler-merchant-httpd_private-post-templates.c b/src/backend/taler-merchant-httpd_private-post-templates.c index ac2a9206..2ed76940 100644 --- a/src/backend/taler-merchant-httpd_private-post-templates.c +++ b/src/backend/taler-merchant-httpd_private-post-templates.c @@ -67,13 +67,16 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, struct TALER_MERCHANTDB_TemplateDetails tp = { 0 }; const char *template_id; enum GNUNET_DB_QueryStatus qs; + uint32_t pos_algorithm; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("template_id", &template_id), GNUNET_JSON_spec_string ("template_description", (const char **) &tp.template_description), - GNUNET_JSON_spec_mark_optional( - GNUNET_JSON_spec_string ("image", + GNUNET_JSON_spec_uint32 ("pos_algorithm", + &pos_algorithm), + GNUNET_JSON_spec_mark_optional ( + GNUNET_JSON_spec_string ("pos_key", (const char **) &tp.pos_key), NULL), GNUNET_JSON_spec_json ("template_contract", @@ -96,6 +99,7 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, : MHD_NO; } } + tp.pos_algorithm = (enum TALER_MerchantConfirmationAlgorithm) pos_algorithm; if (! TMH_template_contract_valid (tp.template_contract)) { GNUNET_break_op (0); @@ -185,8 +189,8 @@ TMH_private_post_templates (const struct TMH_RequestHandler *rh, if (GNUNET_DB_STATUS_SOFT_ERROR != qs) break; } -retry: - GNUNET_assert (GNUNET_DB_STATUS_SOFT_ERROR == qs); +retry: + GNUNET_assert (GNUNET_DB_STATUS_SOFT_ERROR == qs); TMH_db->rollback (TMH_db->cls); } /* for RETRIES loop */ GNUNET_JSON_parse_free (spec); -- cgit v1.2.3