Bolt-cli: Add dry-run flag for developmental/testing#731
Bolt-cli: Add dry-run flag for developmental/testing#7310ex-d wants to merge 3 commits intochainbound:unstablefrom
Conversation
|
N.B: CI would fail, still figuring out somethings out:
Suggestion would be great here guys |
|
This is great, thank you @0ex-d! Ideally dry-run should be available only for commands that send a transaction on-chain (that benefit from simulation). Here are the onchain commands we'd like to simulate:
We can skip "bolt send" for now as it's for a slightly different use case! |
780e2b1 to
24a5a41
Compare
|
No broadcast: |
|
Thank you for this @0ex-d! We'll test it and review soon! |
|
The tests can still be improved IMO, currently running them with |
| /// drop provided `AnvilInstance` to control resource consumption | ||
| pub fn shutdown_anvil(anvil: Option<AnvilInstance>) { | ||
| if let Some(anvil_instance) = anvil { | ||
| info!("[dry-run] Shutting down Anvil instance."); | ||
| drop(anvil_instance); | ||
| } | ||
| } |
There was a problem hiding this comment.
Let me know if I got this right: you need this function (or more generally to manually drop anvil) and call it at the end of a command otherwise the compilers insert the drop too early, right after handle_rpc_dry_run is called because it is no more used.
|
Hey @0ex-d sorry for the delay, we will pick this up shortly! In the meanwhile, could you rebase this? We can't push anything to this branch |
|
Sorry guys, being away, will jump on this now. |
|
Closing in favor of #756 |
Improvements:
bolt/bolt-cli/src/commands/validators.rs
Lines 165 to 171 in 6342fb2
Closes #416