Skip to content
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
7 changes: 7 additions & 0 deletions src/tracing/arena.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use super::types::{CallTrace, CallTraceNode, TraceMemberOrder};
use alloc::{vec, vec::Vec};
use alloy_primitives::Address;

/// An arena of recorded traces.
///
Expand Down Expand Up @@ -43,6 +44,12 @@ impl CallTraceArena {
self.arena.push(Default::default());
}

/// Returns __all__ addresses in the recorded traces, that is addresses of the trace and the
/// caller address.
pub fn trace_addresses(&self) -> impl Iterator<Item = Address> + '_ {
self.nodes().iter().flat_map(|node| [node.trace.address, node.trace.caller].into_iter())
}

/// Pushes a new trace into the arena, returning the trace ID
///
/// This appends a new trace to the arena, and also inserts a new entry in the node's parent
Expand Down
Loading