diff options
author | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-16 21:44:18 -0400 |
---|---|---|
committer | Jonathan Buchanan <jonathan.russ.buchanan@gmail.com> | 2020-06-16 21:44:18 -0400 |
commit | 06010ba8681aa588c977410e0ae6f32879435432 (patch) | |
tree | 819200d410273f103d3a8f5764ce681b3f0a7f06 /src/testing/testing_api_cmd_get_reserve.c | |
parent | 63c035bfffaec9b245da58828f7d6504278fc46e (diff) | |
download | merchant-06010ba8681aa588c977410e0ae6f32879435432.tar.gz merchant-06010ba8681aa588c977410e0ae6f32879435432.tar.bz2 merchant-06010ba8681aa588c977410e0ae6f32879435432.zip |
fix/test for POST tips//pickup
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, |