File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 1
1
use crate :: tx:: CastTxBuilder ;
2
2
use alloy_primitives:: { TxKind , U256 } ;
3
- use alloy_rpc_types:: BlockId ;
3
+ use alloy_rpc_types:: { BlockId , BlockNumberOrTag } ;
4
4
use cast:: Cast ;
5
5
use clap:: Parser ;
6
6
use eyre:: Result ;
@@ -114,7 +114,7 @@ impl CallArgs {
114
114
sig = Some ( data) ;
115
115
}
116
116
117
- let config = Config :: from ( & eth) ;
117
+ let mut config = Config :: from ( & eth) ;
118
118
let provider = utils:: get_provider ( & config) ?;
119
119
let sender = eth. wallet . sender ( ) . await ;
120
120
@@ -153,6 +153,11 @@ impl CallArgs {
153
153
let figment =
154
154
Config :: figment_with_root ( find_project_root_path ( None ) . unwrap ( ) ) . merge ( eth. rpc ) ;
155
155
let evm_opts = figment. extract :: < EvmOpts > ( ) ?;
156
+ if let Some ( BlockId :: Number ( BlockNumberOrTag :: Number ( block_number) ) ) = self . block {
157
+ // Override Config `fork_block_number` (if set) with CLI value.
158
+ config. fork_block_number = Some ( block_number) ;
159
+ }
160
+
156
161
let ( env, fork, chain) = TracingExecutor :: get_fork_material ( & config, evm_opts) . await ?;
157
162
let mut executor = TracingExecutor :: new ( env, fork, evm_version, debug) ;
158
163
You can’t perform that action at this time.
0 commit comments