cardano-node-tests
cardano-node-tests copied to clipboard
Add cleanup code to the end of Plutus spending tests
Scope We have several plutus spending tests that leave funds in the script address when the test is finished (partial spending tests etc.). Some of these funds are lost (namely when locked using the "always fails" plutus script), some can be retrieved. When we run tests on testnet, we run a code that retrieves as many funds as possible at the end of each testrun. We retrieve change from all addresses that we created, withdraw rewards, deregister pools and stake addresses to get deposits back, etc. But we cannot retrieve funds locked by Plutus scripts, because we don't know all the details at the time we run the cleanup code.
We need to add cleanup code to all such Plutus spending tests so that the locked funds are retrieved back to payment address when the test is finished.
Note We use something similar in test_pools.py for deregistering pools, search for request.addfinalizer