aeternity / aeproject

Testing framework for Sophia Smart Contract development.
https://docs.aeternity.com/aeproject
ISC License
28 stars 18 forks source link

extend utils for rollback to explicit height #476

Closed marc0olo closed 1 year ago

marc0olo commented 1 year ago

currently the rollback can be performed for a specific "snapshot-height" only using the tools.

in my project I have the test-scenario where I want to claim a set of names in before and after each test a rollback to the snapshot after those names have been claimed is performed.

I need to perform an additional rollback after all tests have been executed to the height before those names have been claimed.

otherwise my test scenario isn't working anymore because the names have actually been claimed already.

of course I can now call the rollback endpoint of the devmode without using the devmode. and maybe it even makes sense to keep the names claimed and just do a short initial check before claiming the names, but in general it might be helpful to have the utils extended to allow an explicit rollback to a specific height even before the "snapshot" has been taken.

while writing this it makes more sense for me to keep the names and do simple check 😅

thepiwo commented 1 year ago

I think this issue has to be raised with the dev-mode plugin first, as it only exposes 2 functions for snapshots. 1. create snapshot at current height, 2. rollback to last created snapshot

marc0olo commented 1 year ago

I don't think this is correct. when looking at the functionality I don't see any real "snapshot" usage. what aeproject utils do now is remembering the block height to perform a rollback to.

the devmode plugin of the node allows to perform a rollback to a specific height OR a specific keyblock/microblock by providing its hash, see https://github.com/aeternity/aeplugin_dev_mode/blob/master/doc/json_api.md#rollback-the-chain

thepiwo commented 1 year ago

you are right, forgot about this as initially it was specified differently I think. Added a PR here: https://github.com/aeternity/aeproject/pull/477