diff options
author | Christian Grothoff <christian@grothoff.org> | 2020-07-03 20:57:01 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2020-07-05 16:50:16 +0200 |
commit | 49f466df401259248c5d187374655492d4b4eec7 (patch) | |
tree | 71d85be4a5ecabea8dac72670ca6b1d4c7c085aa /src/testing/testing_api_cmd_batch.c | |
parent | 2279c8ab17f641c02fd47a0fb58428ae3b96c920 (diff) | |
download | exchange-49f466df401259248c5d187374655492d4b4eec7.tar.xz |
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.c | 22 |
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 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; +} |