summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_check_aml_decision.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/testing/testing_api_cmd_check_aml_decision.c')
-rw-r--r--src/testing/testing_api_cmd_check_aml_decision.c48
1 files changed, 28 insertions, 20 deletions
diff --git a/src/testing/testing_api_cmd_check_aml_decision.c b/src/testing/testing_api_cmd_check_aml_decision.c
index d77e9b6b9..fa0981e0d 100644
--- a/src/testing/testing_api_cmd_check_aml_decision.c
+++ b/src/testing/testing_api_cmd_check_aml_decision.c
@@ -79,22 +79,15 @@ check_aml_decision_cb (void *cls,
ds->dh = NULL;
if (ds->expected_http_status != adr->hr.http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Unexpected response code %u to command %s in %s:%u\n",
- adr->hr.http_status,
- ds->is->commands[ds->is->ip].label,
- __FILE__,
- __LINE__);
- json_dumpf (adr->hr.reply,
- stderr,
- 0);
- TALER_TESTING_interpreter_fail (ds->is);
+ TALER_TESTING_unexpected_status (ds->is,
+ adr->hr.http_status,
+ ds->expected_http_status);
return;
}
if (MHD_HTTP_OK == adr->hr.http_status)
{
const struct TALER_TESTING_Command *ref;
- const char **justification;
+ const char *justification;
enum TALER_AmlDecisionState *new_state;
const struct TALER_Amount *amount;
const struct TALER_EXCHANGE_AmlDecisionDetail *oldest = NULL;
@@ -116,10 +109,10 @@ check_aml_decision_cb (void *cls,
GNUNET_assert (GNUNET_OK ==
TALER_TESTING_get_trait_amount (ref,
&amount));
- for (unsigned int i = 0; i<adr->details.success.aml_history_length; i++)
+ for (unsigned int i = 0; i<adr->details.ok.aml_history_length; i++)
{
const struct TALER_EXCHANGE_AmlDecisionDetail *aml_history
- = &adr->details.success.aml_history[i];
+ = &adr->details.ok.aml_history[i];
if ( (NULL == oldest) ||
(0 !=
@@ -138,7 +131,7 @@ check_aml_decision_cb (void *cls,
}
if ( (oldest->new_state != *new_state) ||
(0 != strcmp (oldest->justification,
- *justification) ) )
+ justification) ) )
{
GNUNET_break (0);
TALER_TESTING_interpreter_fail (ds->is);
@@ -165,9 +158,26 @@ check_aml_decision_run (void *cls,
const struct TALER_PaytoHashP *h_payto;
const struct TALER_AmlOfficerPrivateKeyP *officer_priv;
const struct TALER_TESTING_Command *ref;
+ const char *exchange_url;
(void) cmd;
ds->is = is;
+ {
+ const struct TALER_TESTING_Command *exchange_cmd;
+
+ exchange_cmd = TALER_TESTING_interpreter_get_command (is,
+ "exchange");
+ if (NULL == exchange_cmd)
+ {
+ GNUNET_break (0);
+ TALER_TESTING_interpreter_fail (is);
+ return;
+ }
+ GNUNET_assert (GNUNET_OK ==
+ TALER_TESTING_get_trait_exchange_url (exchange_cmd,
+ &exchange_url));
+ }
+
ref = TALER_TESTING_interpreter_lookup_command (is,
ds->ref_operation);
if (NULL == ref)
@@ -191,8 +201,8 @@ check_aml_decision_run (void *cls,
TALER_TESTING_get_trait_officer_priv (ref,
&officer_priv));
ds->dh = TALER_EXCHANGE_lookup_aml_decision (
- is->ctx,
- is->exchange_url,
+ TALER_TESTING_interpreter_get_context (is),
+ exchange_url,
h_payto,
officer_priv,
true, /* history */
@@ -222,10 +232,8 @@ check_aml_decision_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_lookup_aml_decision_cancel (ds->dh);
ds->dh = NULL;
}