aboutsummaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_batch.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-07-03 20:57:01 +0200
committerChristian Grothoff <christian@grothoff.org>2020-07-03 20:57:01 +0200
commit025c2f566709abb1f8971b7458f68223492c81e3 (patch)
tree41f7df5c55edf5f2b11cbacb72df5325f480631a /src/testing/testing_api_cmd_batch.c
parentbf50cb2352978c74f11d8f0b4ae9de4af955ab3f (diff)
move rewind command to exchange, add proper support for rewinding in batches, modify API to rewind to label
Diffstat (limited to 'src/testing/testing_api_cmd_batch.c')
-rw-r--r--src/testing/testing_api_cmd_batch.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/testing/testing_api_cmd_batch.c b/src/testing/testing_api_cmd_batch.c
index 48ccf55f..d81a5c38 100644
--- a/src/testing/testing_api_cmd_batch.c
+++ b/src/testing/testing_api_cmd_batch.c
@@ -228,5 +228,27 @@ TALER_TESTING_cmd_batch_get_current (const struct TALER_TESTING_Command *cmd)
{
struct BatchState *bs = cmd->cls;
+ GNUNET_assert (cmd->run == &batch_run);
return &bs->batch[bs->batch_ip];
}
+
+
+/**
+ * Set what command the batch should be at.
+ *
+ * @param cmd current batch command
+ * @param new_ip where to move the IP
+ */
+void
+TALER_TESTING_cmd_batch_set_current (const struct TALER_TESTING_Command *cmd,
+ unsigned int new_ip)
+{
+ struct BatchState *bs = cmd->cls;
+
+ /* sanity checks */
+ GNUNET_assert (cmd->run == &batch_run);
+ for (unsigned int i = 0; i < new_ip; i++)
+ GNUNET_assert (NULL != bs->batch[i].label);
+ /* actual logic */
+ bs->batch_ip = new_ip;
+}