cmd/evm: allow state dump regardless if test passes

This commit is contained in:
Wei Tang 2023-11-08 05:12:30 +01:00 committed by GitHub
parent 4d9f3cd5d7
commit 8ff557a68b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -108,13 +108,15 @@ 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)