Skip to content
Closed
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
24 changes: 22 additions & 2 deletions crates/script/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,29 @@ 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
Expand Down