diff options
Diffstat (limited to 'src/testing/testing_api_cmd_get_template.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_template.c | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/src/testing/testing_api_cmd_get_template.c b/src/testing/testing_api_cmd_get_template.c index da8b6786..8b32156d 100644 --- a/src/testing/testing_api_cmd_get_template.c +++ b/src/testing/testing_api_cmd_get_template.c @@ -71,33 +71,27 @@ struct GetTemplateState * Callback for a /get/templates/$ID operation. * * @param cls closure for this function - * @param hr HTTP response details - * @param template_description description of the template - * @param pos_key shared key with the POS - * @param template_contract where the contract of the company is + * @param tgr HTTP response details */ static void get_template_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - const char *template_description, - const char *pos_key, - const json_t *template_contract) + const struct TALER_MERCHANT_TemplateGetResponse *tgr) { struct GetTemplateState *gis = cls; const struct TALER_TESTING_Command *template_cmd; gis->igh = NULL; - if (gis->http_status != hr->http_status) + if (gis->http_status != tgr->hr.http_status) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected response code %u (%d) to command %s\n", - hr->http_status, - (int) hr->ec, + tgr->hr.http_status, + (int) tgr->hr.ec, TALER_TESTING_interpreter_get_current_label (gis->is)); TALER_TESTING_interpreter_fail (gis->is); return; } - switch (hr->http_status) + switch (tgr->hr.http_status) { case MHD_HTTP_OK: { @@ -110,7 +104,7 @@ get_template_cb (void *cls, TALER_TESTING_get_trait_template_description (template_cmd, &expected_description)) TALER_TESTING_interpreter_fail (gis->is); - if (0 != strcmp (template_description, + if (0 != strcmp (tgr->details.success.template_description, *expected_description)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, @@ -121,6 +115,7 @@ get_template_cb (void *cls, } { const char **expected_pos_key; + const char *pos_key = tgr->details.success.pos_key; if (GNUNET_OK != TALER_TESTING_get_trait_template_pos_key (template_cmd, @@ -147,7 +142,7 @@ get_template_cb (void *cls, TALER_TESTING_get_trait_template_contract (template_cmd, &expected_template_contract)) TALER_TESTING_interpreter_fail (gis->is); - if (1 != json_equal (template_contract, + if (1 != json_equal (tgr->details.success.template_contract, expected_template_contract)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, |