aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_wire.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_wire.c
parent015b08b0489d72f3fda587eec900bc4193a6a57e (diff)
downloadexchange-a2dde02b64a8ee75c9243632eb45a6ceb9b62dd5.tar.xz
major libtalertesting API refactoring, including no longer having taler-specific logic in the test engine core
Diffstat (limited to 'src/testing/testing_api_cmd_wire.c')
-rw-r--r--src/testing/testing_api_cmd_wire.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/testing/testing_api_cmd_wire.c b/src/testing/testing_api_cmd_wire.c
index 5fbd41b1e..a13242315 100644
--- a/src/testing/testing_api_cmd_wire.c
+++ b/src/testing/testing_api_cmd_wire.c
@@ -39,6 +39,11 @@ struct WireState
struct TALER_EXCHANGE_WireHandle *wh;
/**
+ * Our command.
+ */
+ const struct TALER_TESTING_Command *cmd;
+
+ /**
* Which wire-method we expect is offered by the exchange.
*/
const char *expected_method;
@@ -80,7 +85,6 @@ wire_cb (void *cls,
{
struct WireState *ws = cls;
const struct TALER_EXCHANGE_HttpResponse *hr = &wr->hr;
- struct TALER_TESTING_Command *cmd = &ws->is->commands[ws->is->ip];
struct TALER_Amount expected_fee;
TALER_LOG_DEBUG ("Checking parsed /wire response\n");
@@ -145,7 +149,7 @@ wire_cb (void *cls,
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Wire fee mismatch to command %s\n",
- cmd->label);
+ ws->cmd->label);
TALER_TESTING_interpreter_fail (ws->is);
return;
}
@@ -187,10 +191,14 @@ wire_run (void *cls,
struct TALER_TESTING_Interpreter *is)
{
struct WireState *ws = cls;
+ struct TALER_EXCHANGE_Handle *exchange
+ = TALER_TESTING_get_exchange (is);
- (void) cmd;
+ ws->cmd = cmd;
+ if (NULL == exchange)
+ return;
ws->is = is;
- ws->wh = TALER_EXCHANGE_wire (is->exchange,
+ ws->wh = TALER_EXCHANGE_wire (exchange,
&wire_cb,
ws);
}
@@ -211,10 +219,8 @@ wire_cleanup (void *cls,
if (NULL != ws->wh)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
- "Command %u (%s) did not complete\n",
- ws->is->ip,
- cmd->label);
+ TALER_TESTING_command_incomplete (ws->is,
+ cmd->label);
TALER_EXCHANGE_wire_cancel (ws->wh);
ws->wh = NULL;
}