feat: Add Cheatcodes::AddAccount
Give an overview of the tasks completed
Arbiter currently assumes all accounts are initialized before the execution. However sometimes the user cannot anticipate all the involved accounts. With the Cheatcodes::AddAccount cheat code, the user can inject a new account mid execution and then update the balance with Cheatcodes::Deal cheat code.
The PR is based on top of #977.
REMINDER! Please check that you have done the following prior to submitting this PR:
- [x] Checked that the relevant version(s) have been incremented if necessary.
- [x] Ran both and made any changes necessary for:
-
cargo +nightly fmt --all -
cargo clippy --all
-
Reviewing next week
Overall like the changes - just need to make sure everything merges in clean
At first I wanted to expose the whole Instruction struct and add Cheatcodes(Instruction) but then the struct is cyclic.
Maybe a more sound way would be to have an apply_instruction(Instruction) function or modify apply_cheatcode(Cheatcodes) to apply_cheatcode(Instruction) however this would be a breaking change.
Actually - maybe we can just keep the existing apply_cheatcode and expose a new method apply_instruction(Instruction), @kinrezC wdyt?