diff options
Diffstat (limited to 'src/testing/testing_api_cmd_get_reserve.c')
-rw-r--r-- | src/testing/testing_api_cmd_get_reserve.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_get_reserve.c b/src/testing/testing_api_cmd_get_reserve.c index 1cae418e..d617c182 100644 --- a/src/testing/testing_api_cmd_get_reserve.c +++ b/src/testing/testing_api_cmd_get_reserve.c @@ -72,6 +72,11 @@ get_reserve_cb (void *cls, { /* FIXME, deeper checks should be implemented here. */ struct GetReserveState *grs = cls; + const struct TALER_TESTING_Command *reserve_cmd; + + reserve_cmd = TALER_TESTING_interpreter_lookup_command ( + grs->is, + grs->reserve_reference); grs->rgh = NULL; if (grs->http_status != hr->http_status) @@ -89,6 +94,24 @@ get_reserve_cb (void *cls, case MHD_HTTP_OK: // FIXME: use grs->reserve_reference here to // check if the data returned matches that from the POST / PATCH + { + const struct TALER_Amount *initial_amount; + if (GNUNET_OK != + TALER_TESTING_get_trait_amount_obj (reserve_cmd, + 0, + &initial_amount)) + TALER_TESTING_FAIL (grs->is); + if ((GNUNET_OK != TALER_amount_cmp_currency (&rs->merchant_initial_amount, + initial_amount)) || + (0 != TALER_amount_cmp (&rs->merchant_initial_amount, + initial_amount))) + { + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Reserve initial amount does not match\n"); + TALER_TESTING_interpreter_fail (grs->is); + return; + } + } break; default: GNUNET_log (GNUNET_ERROR_TYPE_WARNING, |