summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_kyc_wallet_get.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:05 +0200
committerChristian Grothoff <christian@grothoff.org>2023-06-07 23:11:05 +0200
commita2dde02b64a8ee75c9243632eb45a6ceb9b62dd5 (patch)
tree378cb6aefaf7f00894a7c8916fad9c3de84e31b4 /src/testing/testing_api_cmd_kyc_wallet_get.c
parent015b08b0489d72f3fda587eec900bc4193a6a57e (diff)
downloadexchange-a2dde02b64a8ee75c9243632eb45a6ceb9b62dd5.tar.gz
exchange-a2dde02b64a8ee75c9243632eb45a6ceb9b62dd5.tar.bz2
exchange-a2dde02b64a8ee75c9243632eb45a6ceb9b62dd5.zip
major libtalertesting API refactoring, including no longer having taler-specific logic in the test engine core
Diffstat (limited to 'src/testing/testing_api_cmd_kyc_wallet_get.c')
-rw-r--r--src/testing/testing_api_cmd_kyc_wallet_get.c36
1 files changed, 17 insertions, 19 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..5f6eaeb4c 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,12 @@ 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);
return;
}
switch (wkr->http_status)
@@ -150,8 +147,12 @@ wallet_kyc_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct KycWalletGetState *kwg = cls;
+ struct TALER_EXCHANGE_Handle *exchange
+ = TALER_TESTING_get_exchange (is);
- (void) cmd;
+ kwg->cmd = cmd;
+ if (NULL == exchange)
+ return;
kwg->is = is;
if (NULL != kwg->reserve_reference)
{
@@ -184,9 +185,9 @@ 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 (TALER_EXCHANGE_get_base_url (exchange),
&kwg->reserve_pub);
- kwg->kwh = TALER_EXCHANGE_kyc_wallet (is->exchange,
+ kwg->kwh = TALER_EXCHANGE_kyc_wallet (exchange,
&kwg->reserve_priv,
&kwg->balance,
&wallet_kyc_cb,
@@ -210,10 +211,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 +242,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 ()
};