mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 19:09:54 +00:00
fix(rpc): initialize arena with root node (#2611)
This commit is contained in:
@ -3,7 +3,7 @@ use crate::tracing::types::{CallTrace, CallTraceNode, LogCallOrder};
|
||||
/// An arena of recorded traces.
|
||||
///
|
||||
/// This type will be populated via the [TracingInspector](crate::tracing::TracingInspector).
|
||||
#[derive(Debug, Clone, Default, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
pub struct CallTraceArena {
|
||||
/// The arena of recorded trace nodes
|
||||
pub(crate) arena: Vec<CallTraceNode>,
|
||||
@ -43,3 +43,10 @@ impl CallTraceArena {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl Default for CallTraceArena {
|
||||
fn default() -> Self {
|
||||
// The first node is the root node
|
||||
CallTraceArena { arena: vec![Default::default()] }
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user