The main purpose of this PR is to add a script that sets up a devnet instance with an absorbable trove for the purpose of testing the keeper for purger.absorb.
This led to a series of changes to set up the scripts directory in the best possible way for additional scripts to be added in the future:
Added a simulation package to scripts. This package currently has a single script that opens a trove for 3 devnet accounts, have all three users provide to the Absorber, then crashes the prices to make the troves absorbable.
To facilitate "simulation" scripts on devnet, we need the deployment addresses to be fixed. This is achieved by saving the start state after running the deploy_devnet script into a devnet_dump.json state file, which is then used for replaying the transactions next time. Hence, scarb run devnet in the top level Scarb.toml is now replaced by scarb run load_devnet (which uses the state file) and scarb run restart_devnet (which deletes the state file and starts a new devnet instance that will create a state file on exit).
The scripts directory is also now its own package that contains constants and deployment addresses that are re-used in both deployment and simulation packages.
The main purpose of this PR is to add a script that sets up a devnet instance with an absorbable trove for the purpose of testing the keeper for
purger.absorb
.This led to a series of changes to set up the
scripts
directory in the best possible way for additional scripts to be added in the future:simulation
package toscripts
. This package currently has a single script that opens a trove for 3 devnet accounts, have all three users provide to the Absorber, then crashes the prices to make the troves absorbable.deploy_devnet
script into adevnet_dump.json
state file, which is then used for replaying the transactions next time. Hence,scarb run devnet
in the top levelScarb.toml
is now replaced byscarb run load_devnet
(which uses the state file) andscarb run restart_devnet
(which deletes the state file and starts a new devnet instance that will create a state file on exit).scripts
directory is also now its own package that contains constants and deployment addresses that are re-used in bothdeployment
andsimulation
packages.