arbiter icon indicating copy to clipboard operation
arbiter copied to clipboard

feat: Add Cheatcodes::AddAccount

Open jbargu opened this issue 1 year ago • 4 comments

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

jbargu avatar May 31 '24 10:05 jbargu

Reviewing next week

Alexangelj avatar May 31 '24 23:05 Alexangelj

Overall like the changes - just need to make sure everything merges in clean

Alexangelj avatar May 31 '24 23:05 Alexangelj

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.

jbargu avatar Jun 03 '24 06:06 jbargu

Actually - maybe we can just keep the existing apply_cheatcode and expose a new method apply_instruction(Instruction), @kinrezC wdyt?

Alexangelj avatar Jun 05 '24 14:06 Alexangelj