Skip to content

Commit

Permalink
chore: bump revm-inspectors (#717)
Browse files Browse the repository at this point in the history
  • Loading branch information
agostbiro authored Oct 28, 2024
1 parent 56b795a commit dd33f1d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ foundry-fork-db = "=0.1.0"
# no default features to avoid c-kzg
revm = { version = "10.0.0", default-features = false }
revm-primitives = { version = "5.0.0", default-features = false }
revm-inspectors = { version = "0.1", features = ["serde"] }
revm-inspectors = { version = "=0.3.0", features = ["serde"] }

## ethers
ethers-contract-abigen = { version = "2.0.14", default-features = false }
Expand Down
4 changes: 3 additions & 1 deletion crates/foundry/evm/evm/src/inspectors/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@ impl InspectorStack {
record_memory_snapshots: false,
record_stack_snapshots: StackSnapshotType::None,
record_state_diff: false,
record_returndata_snapshots: false,
record_opcodes_filter: None,
exclude_precompile_calls: false,
record_logs: true,
})
Expand All @@ -397,7 +399,7 @@ impl InspectorStack {
.collect()
})
.unwrap_or_default(),
traces: self.tracer.map(|tracer| tracer.get_traces().clone()),
traces: self.tracer.map(TracingInspector::into_traces),
coverage: self.coverage.map(|coverage| coverage.maps),
cheatcodes: self.cheatcodes,
chisel_state: self.chisel_state.and_then(|state| state.state),
Expand Down
6 changes: 5 additions & 1 deletion crates/foundry/evm/traces/src/decoder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,11 @@ impl CallTraceDecoder {

let events_it = nodes
.iter()
.flat_map(|node| node.logs.iter().filter_map(|log| log.topics().first()))
.flat_map(|node| {
node.logs
.iter()
.filter_map(|log| log.raw_log.topics().first())
})
.unique();
identifier.write().await.identify_events(events_it).await;

Expand Down
9 changes: 5 additions & 4 deletions crates/foundry/evm/traces/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub mod abi;
mod decoder;
pub use decoder::{CallTraceDecoder, CallTraceDecoderBuilder};
use foundry_evm_core::contracts::{ContractsByAddress, ContractsByArtifact};
use revm_inspectors::tracing::types::LogCallOrder;
use revm_inspectors::tracing::types::TraceMemberOrder;
pub use revm_inspectors::tracing::{
types::{CallKind, CallTrace, CallTraceNode},
CallTraceArena, GethTraceBuilder, ParityTraceBuilder, StackSnapshotType, TracingInspector,
Expand Down Expand Up @@ -93,8 +93,8 @@ pub async fn render_trace_arena(
let right_prefix = format!("{child}{PIPE}");
for child in &node.ordering {
match child {
LogCallOrder::Log(index) => {
let log = render_trace_log(&node.logs[*index], decoder).await?;
TraceMemberOrder::Log(index) => {
let log = render_trace_log(&node.logs[*index].raw_log, decoder).await?;

// Prepend our tree structure symbols to each line of the displayed log
log.lines().enumerate().try_for_each(|(i, line)| {
Expand All @@ -106,7 +106,7 @@ pub async fn render_trace_arena(
)
})?;
}
LogCallOrder::Call(index) => {
TraceMemberOrder::Call(index) => {
inner(
arena,
decoder,
Expand All @@ -117,6 +117,7 @@ pub async fn render_trace_arena(
)
.await?;
}
TraceMemberOrder::Step(_) => {}
}
}

Expand Down

0 comments on commit dd33f1d

Please sign in to comment.