Skip to content
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

style: smol refactor #9224

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 11 additions & 12 deletions crates/forge/bin/cmd/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,19 @@ impl CreateArgs {
};

// Add arguments to constructor
let provider = utils::get_provider(&config)?;
let params = match abi.constructor {
Some(ref v) => {
let constructor_args =
if let Some(ref constructor_args_path) = self.constructor_args_path {
read_constructor_args_file(constructor_args_path.to_path_buf())?
} else {
self.constructor_args.clone()
};
self.parse_constructor_args(v, &constructor_args)?
}
None => vec![],
let params = if let Some(constructor) = &abi.constructor {
let constructor_args =
self.constructor_args_path.clone().map(read_constructor_args_file).transpose()?;
self.parse_constructor_args(
constructor,
constructor_args.as_deref().unwrap_or(&self.constructor_args),
)?
} else {
vec![]
};

let provider = utils::get_provider(&config)?;

// respect chain, if set explicitly via cmd args
let chain_id = if let Some(chain_id) = self.chain_id() {
chain_id
Expand Down
Loading