Skip to content

Commit

Permalink
chore(evm): remove trace printer, trim inspector stack (#7437)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored Mar 19, 2024
1 parent a527c1c commit 03b60c9
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 198 deletions.
12 changes: 8 additions & 4 deletions crates/cast/bin/cmd/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ pub struct RunArgs {
debug: bool,

/// Print out opcode traces.
#[arg(long, short)]
#[deprecated]
#[arg(long, short, hide = true)]
trace_printer: bool,

/// Executes the transaction only with the state from the previous block.
Expand Down Expand Up @@ -82,6 +83,11 @@ impl RunArgs {
///
/// Note: This executes the transaction(s) as is: Cheatcodes are disabled
pub async fn run(self) -> Result<()> {
#[allow(deprecated)]
if self.trace_printer {
eprintln!("WARNING: --trace-printer is deprecated and has no effect\n");
}

let figment =
Config::figment_with_root(find_project_root_path(None).unwrap()).merge(self.rpc);
let evm_opts = figment.extract::<EvmOpts>()?;
Expand Down Expand Up @@ -129,7 +135,7 @@ impl RunArgs {

env.block.number = U256::from(tx_block_number);

if let Some(ref block) = block {
if let Some(block) = &block {
env.block.timestamp = block.header.timestamp;
env.block.coinbase = block.header.miner;
env.block.difficulty = block.header.difficulty;
Expand Down Expand Up @@ -213,8 +219,6 @@ impl RunArgs {

// Execute our transaction
let result = {
executor.set_trace_printer(self.trace_printer);

configure_tx_env(&mut env, &tx);

if let Some(to) = tx.to {
Expand Down
6 changes: 0 additions & 6 deletions crates/evm/evm/src/executors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,12 +171,6 @@ impl Executor {
self
}

#[inline]
pub fn set_trace_printer(&mut self, trace_printer: bool) -> &mut Self {
self.inspector.print(trace_printer);
self
}

#[inline]
pub fn set_gas_limit(&mut self, gas_limit: U256) -> &mut Self {
self.gas_limit = gas_limit;
Expand Down
3 changes: 0 additions & 3 deletions crates/evm/evm/src/inspectors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,5 @@ pub use debugger::Debugger;
mod logs;
pub use logs::LogCollector;

mod printer;
pub use printer::TracePrinter;

mod stack;
pub use stack::{InspectorData, InspectorStack, InspectorStackBuilder};
66 changes: 0 additions & 66 deletions crates/evm/evm/src/inspectors/printer.rs

This file was deleted.

Loading

0 comments on commit 03b60c9

Please sign in to comment.