opengov-cli icon indicating copy to clipboard operation
opengov-cli copied to clipboard

Automatically boot a chopsticks instance on the given network after creating a referendum

Open seadanda opened this issue 7 months ago • 1 comments

Essentially generalise and codify the following flow: https://hackmd.io/@seadanda/BksjUxC91e

I would expect to be able to write:

opengov-cli submit-referendum \
                --proposal "./upgrade-kusama-1.4.1/kusama-1.4.1.call" \
                --network "kusama" --track "whitelistedcaller" \
                --test testfile.{js,ts}

Where the testfile includes:

  • pre-run setup (including the chopsticks config)
  • post-run assertions

This would take the output calls from submit-referendum, fork the network, upload the preimages and then inject the output calls in the way specified in the above hackmd to simulate a referendum executing from the specified origin.

There should also be a way to generate some scaffolding for the chopsticks test from the tool, e.g.

opengov-cli scaffold-tests --network polkadot

which would output a testfile.ts configured to fork a network including all system chains, fund an account and inject a fellow who could submit the whitelist calls.

A good MVP or example could be limiting ourselves to an upgrade with some hardcoded assertions, attempting to upload the code after it has been authorised etc

seadanda avatar May 21 '25 16:05 seadanda