diff options
Diffstat (limited to 'src/testing/testing_api_cmd_kyc_wallet_get.c')
-rw-r--r-- | src/testing/testing_api_cmd_kyc_wallet_get.c | 50 |
1 files changed, 27 insertions, 23 deletions
diff --git a/src/testing/testing_api_cmd_kyc_wallet_get.c b/src/testing/testing_api_cmd_kyc_wallet_get.c index 23df3b9df..ffb143ffb 100644 --- a/src/testing/testing_api_cmd_kyc_wallet_get.c +++ b/src/testing/testing_api_cmd_kyc_wallet_get.c @@ -49,6 +49,11 @@ struct KycWalletGetState char *reserve_payto_uri; /** + * Our command. + */ + const struct TALER_TESTING_Command *cmd; + + /** * Command to get a reserve private key from. */ const char *reserve_reference; @@ -99,20 +104,13 @@ wallet_kyc_cb (void *cls, { struct KycWalletGetState *kwg = cls; struct TALER_TESTING_Interpreter *is = kwg->is; - struct TALER_TESTING_Command *cmd = &is->commands[is->ip]; kwg->kwh = NULL; if (kwg->expected_response_code != wkr->http_status) { - GNUNET_log (GNUNET_ERROR_TYPE_ERROR, - "Unexpected response code %u/%d (wanted %u) to command %s in %s:%u\n", - wkr->http_status, - (int) wkr->ec, - kwg->expected_response_code, - cmd->label, - __FILE__, - __LINE__); - TALER_TESTING_interpreter_fail (is); + TALER_TESTING_unexpected_status (is, + wkr->http_status, + kwg->expected_response_code); return; } switch (wkr->http_status) @@ -150,9 +148,16 @@ wallet_kyc_run (void *cls, struct TALER_TESTING_Interpreter *is) { struct KycWalletGetState *kwg = cls; + const char *exchange_url; - (void) cmd; + kwg->cmd = cmd; kwg->is = is; + exchange_url = TALER_TESTING_get_exchange_url (is); + if (NULL == exchange_url) + { + GNUNET_break (0); + return; + } if (NULL != kwg->reserve_reference) { const struct TALER_TESTING_Command *res_cmd; @@ -184,13 +189,15 @@ wallet_kyc_run (void *cls, GNUNET_CRYPTO_eddsa_key_get_public (&kwg->reserve_priv.eddsa_priv, &kwg->reserve_pub.eddsa_pub); kwg->reserve_payto_uri - = TALER_reserve_make_payto (TALER_EXCHANGE_get_base_url (is->exchange), + = TALER_reserve_make_payto (exchange_url, &kwg->reserve_pub); - kwg->kwh = TALER_EXCHANGE_kyc_wallet (is->exchange, - &kwg->reserve_priv, - &kwg->balance, - &wallet_kyc_cb, - kwg); + kwg->kwh = TALER_EXCHANGE_kyc_wallet ( + TALER_TESTING_interpreter_get_context (is), + exchange_url, + &kwg->reserve_priv, + &kwg->balance, + &wallet_kyc_cb, + kwg); GNUNET_assert (NULL != kwg->kwh); } @@ -210,10 +217,8 @@ wallet_kyc_cleanup (void *cls, if (NULL != kwg->kwh) { - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, - "Command %u (%s) did not complete\n", - kwg->is->ip, - cmd->label); + TALER_TESTING_command_incomplete (kwg->is, + cmd->label); TALER_EXCHANGE_kyc_wallet_cancel (kwg->kwh); kwg->kwh = NULL; } @@ -243,8 +248,7 @@ wallet_kyc_traits (void *cls, TALER_TESTING_make_trait_reserve_pub (&kwg->reserve_pub), TALER_TESTING_make_trait_legi_requirement_row (&kwg->requirement_row), TALER_TESTING_make_trait_h_payto (&kwg->h_payto), - TALER_TESTING_make_trait_payto_uri ( - (const char **) &kwg->reserve_payto_uri), + TALER_TESTING_make_trait_payto_uri (kwg->reserve_payto_uri), TALER_TESTING_trait_end () }; |