Skip to content

Commit

Permalink
cmd/evm: allow state dump regardless if test passes in statetest (#28484
Browse files Browse the repository at this point in the history
)

This change makes it so that when executing state tess, state is always dumped out if the corresponding flag is set.
  • Loading branch information
sorpaas authored Nov 10, 2023
1 parent 326fa00 commit 2f4833b
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions cmd/evm/staterunner.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ func runStateTest(fname string, cfg vm.Config, jsonOut, dump bool) error {
fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%#x\"}\n", root)
}
}
// Dump any state to aid debugging
if dump {
dump := state.RawDump(nil)
result.State = &dump
}
if err != nil {
// Test failed, mark as so and dump any state to aid debugging
// Test failed, mark as so
result.Pass, result.Error = false, err.Error()
if dump {
dump := state.RawDump(nil)
result.State = &dump
}
}
})
results = append(results, *result)
Expand Down

0 comments on commit 2f4833b

Please sign in to comment.