summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_deposits_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_deposits_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_deposits_get.c')
-rw-r--r--src/testing/testing_api_cmd_deposits_get.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/src/testing/testing_api_cmd_deposits_get.c b/src/testing/testing_api_cmd_deposits_get.c
index c39d7f6c1..972a85b7c 100644
--- a/src/testing/testing_api_cmd_deposits_get.c
+++ b/src/testing/testing_api_cmd_deposits_get.c
@@ -40,6 +40,11 @@ struct TrackTransactionState
const char *bank_transfer_reference;
/**
+ * Our command.
+ */
+ const struct TALER_TESTING_Command *cmd;
+
+ /**
* The WTID associated by the transaction being tracked.
*/
struct TALER_WireTransferIdentifierRawP wtid;
@@ -107,22 +112,12 @@ deposit_wtid_cb (void *cls,
{
struct TrackTransactionState *tts = cls;
struct TALER_TESTING_Interpreter *is = tts->is;
- struct TALER_TESTING_Command *cmd = &is->commands[is->ip];
tts->tth = NULL;
if (tts->expected_response_code != dr->hr.http_status)
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Unexpected response code %u/%d to command %s in %s:%u\n",
- dr->hr.http_status,
- (int) dr->hr.ec,
- cmd->label,
- __FILE__,
- __LINE__);
- json_dumpf (dr->hr.reply,
- stderr,
- 0);
- TALER_TESTING_interpreter_fail (is);
+ TALER_TESTING_unexpected_status (is,
+ dr->hr.http_status);
return;
}
switch (dr->hr.http_status)
@@ -203,8 +198,12 @@ track_transaction_run (void *cls,
struct TALER_MerchantWireHashP h_wire_details;
struct TALER_PrivateContractHashP h_contract_terms;
const struct TALER_MerchantPrivateKeyP *merchant_priv;
+ struct TALER_EXCHANGE_Handle *exchange
+ = TALER_TESTING_get_exchange (is);
- (void) cmd;
+ tts->cmd = cmd;
+ if (NULL == exchange)
+ return;
tts->is = is;
transaction_cmd
= TALER_TESTING_interpreter_lookup_command (tts->is,
@@ -276,7 +275,7 @@ track_transaction_run (void *cls,
return;
}
- tts->tth = TALER_EXCHANGE_deposits_get (is->exchange,
+ tts->tth = TALER_EXCHANGE_deposits_get (exchange,
merchant_priv,
&h_wire_details,
&h_contract_terms,
@@ -303,10 +302,8 @@ track_transaction_cleanup (void *cls,
if (NULL != tts->tth)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command %u (%s) did not complete\n",
- tts->is->ip,
- cmd->label);
+ TALER_TESTING_command_incomplete (tts->is,
+ cmd->label);
TALER_EXCHANGE_deposits_get_cancel (tts->tth);
tts->tth = NULL;
}
@@ -335,10 +332,8 @@ track_transaction_traits (void *cls,
TALER_TESTING_make_trait_wtid (&tts->wtid),
TALER_TESTING_make_trait_legi_requirement_row (
&tts->requirement_row),
- TALER_TESTING_make_trait_h_payto (
- &tts->h_payto),
- TALER_TESTING_make_trait_payto_uri (
- (const char **) &tts->merchant_payto_uri),
+ TALER_TESTING_make_trait_h_payto (&tts->h_payto),
+ TALER_TESTING_make_trait_payto_uri (tts->merchant_payto_uri),
TALER_TESTING_trait_end ()
};