-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix(script): prevent --verify without --broadcast from causing deployment not found error #11734
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
base: master
Are you sure you want to change the base?
Conversation
crates/script/src/lib.rs
Outdated
if compiled.args.verify && !compiled.args.should_broadcast() { | ||
eyre::bail!( | ||
"The --verify flag requires --broadcast to be specified. Verification without broadcasting is not meaningful." | ||
); | ||
} |
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.
you can do this with requires
on verify
: https://docs.rs/clap/latest/clap/struct.Arg.html#method.requires
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.
Please look into the failing tests:)
Ping @DeVikingMark, some of the tests are failing because the help output of |
Problem
forge script --verify
without--broadcast
fails with "Deployment not found for chain" error because it tries to load non-existent deployment files.Solution
--verify
is used without--broadcast
--broadcast
when using--verify
Changes
crates/script/src/lib.rs
: Fix logic and add validationcrates/forge/tests/cli/script.rs
: Add test caseFixes #11726