Skip to content

Commit

Permalink
fix: Make the depth optional in printMessageTrace
Browse files Browse the repository at this point in the history
  • Loading branch information
Xanewok committed Aug 16, 2024
1 parent 6e3aad9 commit 5a7cd18
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion crates/edr_napi/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ export interface SourceMap {
location: SourceMapLocation
jumpType: JumpType
}
export function printMessageTrace(trace: PrecompileMessageTrace | CallMessageTrace | CreateMessageTrace, depth: number): void
export function printMessageTrace(trace: PrecompileMessageTrace | CallMessageTrace | CreateMessageTrace, depth?: number | undefined | null): void
export function printStackTrace(trace: SolidityStackTrace): void
export interface SubmessageData {
messageTrace: PrecompileMessageTrace | CallMessageTrace | CreateMessageTrace
Expand Down
4 changes: 3 additions & 1 deletion crates/edr_napi/src/trace/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const MARGIN_SPACE: usize = 6;
#[napi]
fn print_message_trace(
trace: Either3<PrecompileMessageTrace, CallMessageTrace, CreateMessageTrace>,
depth: u32,
depth: Option<u32>,
env: Env,
) -> napi::Result<()> {
let trace = match &trace {
Expand All @@ -29,6 +29,8 @@ fn print_message_trace(
Either3::C(create) => Either3::C(create),
};

let depth = depth.unwrap_or(0);

print_message_trace_inner(trace, depth, env)
}

Expand Down

0 comments on commit 5a7cd18

Please sign in to comment.