xmtpd
xmtpd copied to clipboard
Improve upgrade tests by managing contracts state
Problem statement
Currently the upgrade test don't deploy or upgrade contracts, instead they rely on the blockchain status blindly. If an upgrade requires new contracts to be deployed, or an old ABI has changed, the upgrade test fails.
Expected behavior
Upgrade test is able to deploy, upgrade or re-deploy the needed contracts introduced on each version. A naive flow would be:
old version test start
- deploy needed contracts.
- load envVars.
- test
new version test start
- deploy new contracts if any.
- upgrade existing contracts if there's an upgrade script available.
- load envVars again, as an old envVar could be overridden by a new contract address.
- test