summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_contract_get.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_contract_get.c')
-rw-r--r--src/testing/testing_api_cmd_contract_get.c29
1 files changed, 14 insertions, 15 deletions
diff --git a/src/testing/testing_api_cmd_contract_get.c b/src/testing/testing_api_cmd_contract_get.c
index d599cb595..fa83d83f7 100644
--- a/src/testing/testing_api_cmd_contract_get.c
+++ b/src/testing/testing_api_cmd_contract_get.c
@@ -101,16 +101,9 @@ get_cb (void *cls,
ds->dh = NULL;
if (ds->expected_response_code != dr->hr.http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u to command %s in %s:%u\n",
- dr->hr.http_status,
- ds->is->commands[ds->is->ip].label,
- __FILE__,
- __LINE__);
- json_dumpf (dr->hr.reply,
- stderr,
- 0);
- TALER_TESTING_interpreter_fail (ds->is);
+ TALER_TESTING_unexpected_status (ds->is,
+ dr->hr.http_status,
+ ds->expected_response_code);
return;
}
ref = TALER_TESTING_interpreter_lookup_command (ds->is,
@@ -198,9 +191,16 @@ get_run (void *cls,
struct ContractGetState *ds = cls;
const struct TALER_ContractDiffiePrivateP *contract_priv;
const struct TALER_TESTING_Command *ref;
+ const char *exchange_url;
(void) cmd;
ds->is = is;
+ exchange_url = TALER_TESTING_get_exchange_url (is);
+ if (NULL == exchange_url)
+ {
+ GNUNET_break (0);
+ return;
+ }
ref = TALER_TESTING_interpreter_lookup_command (ds->is,
ds->contract_ref);
GNUNET_assert (NULL != ref);
@@ -214,7 +214,8 @@ get_run (void *cls,
}
ds->contract_priv = *contract_priv;
ds->dh = TALER_EXCHANGE_contract_get (
- is->exchange,
+ TALER_TESTING_interpreter_get_context (is),
+ exchange_url,
contract_priv,
&get_cb,
ds);
@@ -244,10 +245,8 @@ get_cleanup (void *cls,
if (NULL != ds->dh)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command %u (%s) did not complete\n",
- ds->is->ip,
- cmd->label);
+ TALER_TESTING_command_incomplete (ds->is,
+ cmd->label);
TALER_EXCHANGE_contract_get_cancel (ds->dh);
ds->dh = NULL;
}