diff options
Diffstat (limited to 'src/testing/testing_api_cmd_check_aml_decision.c')
-rw-r--r-- | src/testing/testing_api_cmd_check_aml_decision.c | 43 |
1 files changed, 25 insertions, 18 deletions
diff --git a/src/testing/testing_api_cmd_check_aml_decision.c b/src/testing/testing_api_cmd_check_aml_decision.c index dd317142b..1f0ada7b6 100644 --- a/src/testing/testing_api_cmd_check_aml_decision.c +++ b/src/testing/testing_api_cmd_check_aml_decision.c @@ -79,22 +79,14 @@ 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); 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; @@ -138,7 +130,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 +157,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 +200,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 +231,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; } |