From 4da8f3a27faac4326168880dec2fe2f83960298f Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Thu, 2 Oct 2025 14:53:07 +0700 Subject: [PATCH 1/2] fix(script): show console logs with --verify flag --- crates/script/src/lib.rs | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/crates/script/src/lib.rs b/crates/script/src/lib.rs index 6a90aef307c19..dd34d92033cd6 100644 --- a/crates/script/src/lib.rs +++ b/crates/script/src/lib.rs @@ -250,9 +250,30 @@ impl ScriptArgs { // Move from `CompiledState` to `BundledState` either by resuming or executing and // simulating script. - let bundled = if compiled.args.resume || (compiled.args.verify && !compiled.args.broadcast) + let bundled = if compiled.args.resume { compiled.resume().await? + } else if compiled.args.verify && !compiled.args.broadcast { + // If we're verifying without broadcasting, we need to show console logs + // by executing the script first to capture them + let pre_simulation = compiled + .link() + .await? + .prepare_execution() + .await? + .execute() + .await? + .prepare_simulation() + .await?; + + if shell::is_json() { + pre_simulation.show_json().await?; + } else { + pre_simulation.show_traces().await?; + } + + // Now bundle to get the bundled state for verification + pre_simulation.bundle().await? } else { // Drive state machine to point at which we have everything needed for simulation. let pre_simulation = compiled From 2f4ca656489490b97cbb941c712cd56dddb8c433 Mon Sep 17 00:00:00 2001 From: Khanh Hoa Date: Thu, 2 Oct 2025 15:35:02 +0700 Subject: [PATCH 2/2] fix lint --- crates/script/src/lib.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/crates/script/src/lib.rs b/crates/script/src/lib.rs index dd34d92033cd6..d06f13e106b38 100644 --- a/crates/script/src/lib.rs +++ b/crates/script/src/lib.rs @@ -250,8 +250,7 @@ impl ScriptArgs { // Move from `CompiledState` to `BundledState` either by resuming or executing and // simulating script. - let bundled = if compiled.args.resume - { + let bundled = if compiled.args.resume { compiled.resume().await? } else if compiled.args.verify && !compiled.args.broadcast { // If we're verifying without broadcasting, we need to show console logs @@ -271,7 +270,7 @@ impl ScriptArgs { } else { pre_simulation.show_traces().await?; } - + // Now bundle to get the bundled state for verification pre_simulation.bundle().await? } else {