summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_purse_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_purse_get.c')
-rw-r--r--src/testing/testing_api_cmd_purse_get.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/src/testing/testing_api_cmd_purse_get.c b/src/testing/testing_api_cmd_purse_get.c
index 61873721b..d5246660b 100644
--- a/src/testing/testing_api_cmd_purse_get.c
+++ b/src/testing/testing_api_cmd_purse_get.c
@@ -147,11 +147,11 @@ purse_status_cb (void *cls,
TALER_string_to_amount (ss->expected_balance,
&eb));
if (0 != TALER_amount_cmp (&eb,
- &rs->details.success.balance))
+ &rs->details.ok.balance))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Unexpected amount in purse: %s\n",
- TALER_amount_to_string (&rs->details.success.balance));
+ TALER_amount_to_string (&rs->details.ok.balance));
TALER_TESTING_interpreter_fail (ss->is);
return;
}
@@ -188,13 +188,7 @@ status_run (void *cls,
create_purse
= TALER_TESTING_interpreter_lookup_command (is,
ss->purse_reference);
-
- if (NULL == create_purse)
- {
- GNUNET_break (0);
- TALER_TESTING_interpreter_fail (is);
- return;
- }
+ GNUNET_assert (NULL != create_purse);
if (GNUNET_OK !=
TALER_TESTING_get_trait_purse_pub (create_purse,
&ss->purse_pub))
@@ -204,12 +198,15 @@ status_run (void *cls,
TALER_TESTING_interpreter_fail (is);
return;
}
- ss->pgh = TALER_EXCHANGE_purse_get (is->exchange,
- ss->purse_pub,
- ss->timeout,
- ss->wait_for_merge,
- &purse_status_cb,
- ss);
+ ss->pgh = TALER_EXCHANGE_purse_get (
+ TALER_TESTING_interpreter_get_context (is),
+ TALER_TESTING_get_exchange_url (is),
+ TALER_TESTING_get_keys (is),
+ ss->purse_pub,
+ ss->timeout,
+ ss->wait_for_merge,
+ &purse_status_cb,
+ ss);
if (! GNUNET_TIME_relative_is_zero (ss->timeout))
{
TALER_TESTING_interpreter_next (is);
@@ -233,10 +230,8 @@ status_cleanup (void *cls,
if (NULL != ss->pgh)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command %u (%s) did not complete\n",
- ss->is->ip,
- cmd->label);
+ TALER_TESTING_command_incomplete (ss->is,
+ cmd->label);
TALER_EXCHANGE_purse_get_cancel (ss->pgh);
ss->pgh = NULL;
}
@@ -311,6 +306,7 @@ finish_run (void *cls,
poll_purse
= TALER_TESTING_interpreter_lookup_command (is,
ps->poll_reference);
+ GNUNET_assert (NULL != poll_purse);
GNUNET_assert (poll_purse->run == &status_run);
ss = poll_purse->cls;
if (NULL == ss->pgh)