Skip to content

Commit 20905ef

Browse files
authored
chore: rename the arg name of EvmOpts from evm_opts to evm_args (#9424)
* script: evm_opts -> evm_args Signed-off-by: jsvisa <[email protected]> * forge: evm_opts -> evm_args Signed-off-by: jsvisa <[email protected]> * chisel: evm_opts -> evm_args Signed-off-by: jsvisa <[email protected]> * forge: evm_opts -> evm_args Signed-off-by: jsvisa <[email protected]> --------- Signed-off-by: jsvisa <[email protected]>
1 parent 56d0dd8 commit 20905ef

File tree

7 files changed

+17
-17
lines changed

7 files changed

+17
-17
lines changed

crates/chisel/bin/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ extern crate foundry_common;
3535
static ALLOC: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc;
3636

3737
// Loads project's figment and merges the build cli arguments into it
38-
foundry_config::merge_impl_figment_convert!(Chisel, opts, evm_opts);
38+
foundry_config::merge_impl_figment_convert!(Chisel, opts, evm_args);
3939

4040
const VERSION_MESSAGE: &str = concat!(
4141
env!("CARGO_PKG_VERSION"),
@@ -76,7 +76,7 @@ pub struct Chisel {
7676
pub opts: CoreBuildArgs,
7777

7878
#[command(flatten)]
79-
pub evm_opts: EvmArgs,
79+
pub evm_args: EvmArgs,
8080
}
8181

8282
/// Chisel binary subcommands

crates/forge/bin/cmd/config.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use foundry_cli::utils::LoadConfig;
55
use foundry_common::{evm::EvmArgs, shell};
66
use foundry_config::fix::fix_tomls;
77

8-
foundry_config::impl_figment_convert!(ConfigArgs, opts, evm_opts);
8+
foundry_config::impl_figment_convert!(ConfigArgs, opts, evm_args);
99

1010
/// CLI arguments for `forge config`.
1111
#[derive(Clone, Debug, Parser)]
@@ -23,7 +23,7 @@ pub struct ConfigArgs {
2323
opts: BuildArgs,
2424

2525
#[command(flatten)]
26-
evm_opts: EvmArgs,
26+
evm_args: EvmArgs,
2727
}
2828

2929
impl ConfigArgs {

crates/forge/bin/cmd/debug.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use foundry_common::evm::EvmArgs;
66
use std::path::PathBuf;
77

88
// Loads project's figment and merges the build cli arguments into it
9-
foundry_config::impl_figment_convert!(DebugArgs, opts, evm_opts);
9+
foundry_config::impl_figment_convert!(DebugArgs, opts, evm_args);
1010

1111
/// CLI arguments for `forge debug`.
1212
#[derive(Clone, Debug, Parser)]
@@ -46,7 +46,7 @@ pub struct DebugArgs {
4646
pub opts: CoreBuildArgs,
4747

4848
#[command(flatten)]
49-
pub evm_opts: EvmArgs,
49+
pub evm_args: EvmArgs,
5050
}
5151

5252
impl DebugArgs {
@@ -58,7 +58,7 @@ impl DebugArgs {
5858
sig: self.sig,
5959
gas_estimate_multiplier: 130,
6060
opts: self.opts,
61-
evm_opts: self.evm_opts,
61+
evm_args: self.evm_args,
6262
debug: true,
6363
dump: self.dump,
6464
retry: RETRY_VERIFY_ON_CREATE,

crates/forge/bin/cmd/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
//! #[derive(Clone, Debug, Parser)]
2525
//! pub struct MyArgs {
2626
//! #[command(flatten)]
27-
//! evm_opts: EvmArgs,
27+
//! evm_args: EvmArgs,
2828
//! #[command(flatten)]
2929
//! opts: BuildArgs,
3030
//! }

crates/forge/bin/cmd/test/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub use filter::FilterArgs;
5959
use forge::{result::TestKind, traces::render_trace_arena_inner};
6060

6161
// Loads project's figment and merges the build cli arguments into it
62-
foundry_config::merge_impl_figment_convert!(TestArgs, opts, evm_opts);
62+
foundry_config::merge_impl_figment_convert!(TestArgs, opts, evm_args);
6363

6464
/// CLI arguments for `forge test`.
6565
#[derive(Clone, Debug, Parser)]
@@ -162,7 +162,7 @@ pub struct TestArgs {
162162
pub rerun: bool,
163163

164164
#[command(flatten)]
165-
evm_opts: EvmArgs,
165+
evm_args: EvmArgs,
166166

167167
#[command(flatten)]
168168
opts: CoreBuildArgs,
@@ -1001,7 +1001,7 @@ mod tests {
10011001
fn extract_chain() {
10021002
let test = |arg: &str, expected: Chain| {
10031003
let args = TestArgs::parse_from(["foundry-cli", arg]);
1004-
assert_eq!(args.evm_opts.env.chain, Some(expected));
1004+
assert_eq!(args.evm_args.env.chain, Some(expected));
10051005
let (config, evm_opts) = args.load_config_and_evm_opts().unwrap();
10061006
assert_eq!(config.chain, Some(expected));
10071007
assert_eq!(evm_opts.env.chain_id, Some(expected.id()));

crates/script/src/execute.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ impl PreExecutionState {
189189
if let Some(txs) = transactions {
190190
// If the user passed a `--sender` don't check anything.
191191
if self.build_data.predeploy_libraries.libraries_count() > 0 &&
192-
self.args.evm_opts.sender.is_none()
192+
self.args.evm_args.sender.is_none()
193193
{
194194
for tx in txs.iter() {
195195
if tx.transaction.to().is_none() {

crates/script/src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ mod transaction;
7373
mod verify;
7474

7575
// Loads project's figment and merges the build cli arguments into it
76-
foundry_config::merge_impl_figment_convert!(ScriptArgs, opts, evm_opts);
76+
foundry_config::merge_impl_figment_convert!(ScriptArgs, opts, evm_args);
7777

7878
/// CLI arguments for `forge script`.
7979
#[derive(Clone, Debug, Default, Parser)]
@@ -210,7 +210,7 @@ pub struct ScriptArgs {
210210
pub wallets: MultiWalletOpts,
211211

212212
#[command(flatten)]
213-
pub evm_opts: EvmArgs,
213+
pub evm_args: EvmArgs,
214214

215215
#[command(flatten)]
216216
pub verifier: forge_verify::VerifierArgs,
@@ -222,7 +222,7 @@ pub struct ScriptArgs {
222222
impl ScriptArgs {
223223
pub async fn preprocess(self) -> Result<PreprocessedState> {
224224
let script_wallets =
225-
Wallets::new(self.wallets.get_multi_wallet().await?, self.evm_opts.sender);
225+
Wallets::new(self.wallets.get_multi_wallet().await?, self.evm_args.sender);
226226

227227
let (config, mut evm_opts) = self.load_config_and_evm_opts_emit_warnings()?;
228228

@@ -411,7 +411,7 @@ impl ScriptArgs {
411411
}
412412

413413
let mut prompt_user = false;
414-
let max_size = match self.evm_opts.env.code_size_limit {
414+
let max_size = match self.evm_args.env.code_size_limit {
415415
Some(size) => size,
416416
None => CONTRACT_MAX_SIZE,
417417
};
@@ -723,7 +723,7 @@ mod tests {
723723
"--code-size-limit",
724724
"50000",
725725
]);
726-
assert_eq!(args.evm_opts.env.code_size_limit, Some(50000));
726+
assert_eq!(args.evm_args.env.code_size_limit, Some(50000));
727727
}
728728

729729
#[test]

0 commit comments

Comments
 (0)