diff options
Diffstat (limited to 'src/testing/testing_api_cmd_get_webhooks.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_webhooks.c | 37 |
1 files changed, 17 insertions, 20 deletions
diff --git a/src/testing/testing_api_cmd_get_webhooks.c b/src/testing/testing_api_cmd_get_webhooks.c index 536512aa..56bf43e8 100644 --- a/src/testing/testing_api_cmd_get_webhooks.c +++ b/src/testing/testing_api_cmd_get_webhooks.c @@ -71,33 +71,29 @@ struct GetWebhooksState * Callback for a GET /webhooks operation. * * @param cls closure for this function - * @param hr HTTP response details - * @param webhooks_length length of the @a webhooks array - * @param webhooks array of webhooks the requested instance offers + * @param wgr response details */ static void get_webhooks_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - unsigned int webhooks_length, - const struct TALER_MERCHANT_WebhookEntry webhooks[]) + const struct TALER_MERCHANT_WebhooksGetResponse *wgr) { struct GetWebhooksState *gis = cls; gis->igh = NULL; - if (gis->http_status != hr->http_status) + if (gis->http_status != wgr->hr.http_status) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Unexpected response code %u (%d) to command %s\n", - hr->http_status, - (int) hr->ec, + wgr->hr.http_status, + (int) wgr->hr.ec, TALER_TESTING_interpreter_get_current_label (gis->is)); TALER_TESTING_interpreter_fail (gis->is); return; } - switch (hr->http_status) + switch (wgr->hr.http_status) { case MHD_HTTP_OK: - if (webhooks_length != gis->webhooks_length) + if (wgr->details.ok.webhooks_length != gis->webhooks_length) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Length of webhooks found does not match\n"); @@ -113,7 +109,7 @@ get_webhooks_cb (void *cls, gis->webhooks[i]); { - const char **webhook_id; + const char *webhook_id; if (GNUNET_OK != TALER_TESTING_get_trait_webhook_id (webhook_cmd, @@ -124,8 +120,8 @@ get_webhooks_cb (void *cls, TALER_TESTING_interpreter_fail (gis->is); return; } - if (0 != strcmp (webhooks[i].webhook_id, - *webhook_id)) + if (0 != strcmp (wgr->details.ok.webhooks[i].webhook_id, + webhook_id)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Webhook id does not match\n"); @@ -143,8 +139,8 @@ get_webhooks_cb (void *cls, default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Unhandled HTTP status %u (%d).\n", - hr->http_status, - hr->ec); + wgr->hr.http_status, + wgr->hr.ec); } TALER_TESTING_interpreter_next (gis->is); } @@ -166,10 +162,11 @@ get_webhooks_run (void *cls, struct GetWebhooksState *gis = cls; gis->is = is; - gis->igh = TALER_MERCHANT_webhooks_get (is->ctx, - gis->merchant_url, - &get_webhooks_cb, - gis); + gis->igh = TALER_MERCHANT_webhooks_get ( + TALER_TESTING_interpreter_get_context (is), + gis->merchant_url, + &get_webhooks_cb, + gis); GNUNET_assert (NULL != gis->igh); } |