diff options
Diffstat (limited to 'src/testing/testing_api_cmd_get_tips.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_tips.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/testing/testing_api_cmd_get_tips.c b/src/testing/testing_api_cmd_get_tips.c index 89a82202..8ae2fa9e 100644 --- a/src/testing/testing_api_cmd_get_tips.c +++ b/src/testing/testing_api_cmd_get_tips.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020 Taler Systems SA + Copyright (C) 2020-2023 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -80,41 +80,39 @@ struct GetTipsState * Callback for a GET /private/tips operation. * * @param cls closure for this function - * @param hr HTTP response details - * @param tips_length length of the @a tips array - * @param tips array of tips + * @param tgr response details */ static void get_tips_cb (void *cls, - const struct TALER_MERCHANT_HttpResponse *hr, - unsigned int tips_length, - const struct TALER_MERCHANT_TipEntry tips[]) + const struct TALER_MERCHANT_TipsGetResponse *tgr) { struct GetTipsState *gts = cls; gts->tgh = NULL; - if (gts->http_status != hr->http_status) + if (gts->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 (gts->is)); TALER_TESTING_interpreter_fail (gts->is); return; } - switch (hr->http_status) + switch (tgr->hr.http_status) { case MHD_HTTP_OK: - if (tips_length != gts->tips_length) + if (tgr->details.ok.tips_length != gts->tips_length) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tips length does not match\n"); TALER_TESTING_interpreter_fail (gts->is); return; } - for (unsigned int i = 0; i < tips_length; ++i) + for (unsigned int i = 0; i < tgr->details.ok.tips_length; ++i) { + const struct TALER_MERCHANT_TipEntry *tip + = &tgr->details.ok.tips[i]; const struct TALER_TESTING_Command *tip_cmd; tip_cmd = TALER_TESTING_interpreter_lookup_command ( @@ -133,7 +131,7 @@ get_tips_cb (void *cls, return; } if (0 != GNUNET_memcmp (tip_id, - &tips[i].tip_id)) + &tip->tip_id)) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tip id does not match\n"); @@ -153,10 +151,12 @@ get_tips_cb (void *cls, TALER_TESTING_interpreter_fail (gts->is); return; } - if ((GNUNET_OK != TALER_amount_cmp_currency (tip_amount, - &tips[i].tip_amount)) || - (0 != TALER_amount_cmp (tip_amount, - &tips[i].tip_amount))) + if ( (GNUNET_OK != + TALER_amount_cmp_currency (tip_amount, + &tip->tip_amount)) || + (0 != + TALER_amount_cmp (tip_amount, + &tip->tip_amount)) ) { GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Tip amount does not match\n"); |