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 eugypalu opened this issue 4 months ago • 0 comments

Closes #38

This PR implements the chopsticks testing integration requested in issue #38, enabling automated testing of OpenGov referenda through network forking and simulation.

Enhanced submit-referendum command: opengov-cli submit-referendum \ --proposal "./upgrade-kusama-1.4.1/kusama-1.4.1.call" \ --network "kusama" --track "whitelistedcaller" \ --test testfile.js

  • Added --test flag to accept .js or .ts test files
  • Automatically boots chopsticks instance and executes tests when test file is provided
  • Maintains backward compatibility - existing functionality unchanged when --test is not used

New scaffold-tests command opengov-cli scaffold-tests --network polkadot

  • Generates test scaffolding for chopsticks testing: opengov-cli scaffold-tests --network polkadot
  • Creates self-contained test files with no external dependencies (uses only Node.js built-ins)
  • Includes pre-configured network setup, account funding utilities, and test examples

eugypalu avatar Aug 20 '25 20:08 eugypalu