-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bolt-cli: Add dry-run flag for developmental/testing #731
base: unstable
Are you sure you want to change the base?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that's correct.
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 |
Improvements:
bolt/bolt-cli/src/commands/validators.rs
Lines 165 to 171 in 6342fb2
Closes #416