From 49f466df401259248c5d187374655492d4b4eec7 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 3 Jul 2020 20:57:01 +0200 Subject: move rewind command to exchange, add proper support for rewinding in batches, modify API to rewind to label --- src/testing/testing_api_cmd_batch.c | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/testing/testing_api_cmd_batch.c') diff --git a/src/testing/testing_api_cmd_batch.c b/src/testing/testing_api_cmd_batch.c index 48ccf55f1..d81a5c38d 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; +} -- cgit v1.2.3