forked from cerc-io/plugeth
cmd/evm: print stateroot in evm utility (#15341)
This commit is contained in:
parent
eea996e4e1
commit
0900aae412
@ -94,7 +94,8 @@ func stateTestCmd(ctx *cli.Context) error {
|
|||||||
for _, st := range test.Subtests() {
|
for _, st := range test.Subtests() {
|
||||||
// Run the test and aggregate the result
|
// Run the test and aggregate the result
|
||||||
result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true}
|
result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true}
|
||||||
if state, err := test.Run(st, cfg); err != nil {
|
state, err := test.Run(st, cfg)
|
||||||
|
if err != nil {
|
||||||
// Test failed, mark as so and dump any state to aid debugging
|
// Test failed, mark as so and dump any state to aid debugging
|
||||||
result.Pass, result.Error = false, err.Error()
|
result.Pass, result.Error = false, err.Error()
|
||||||
if ctx.GlobalBool(DumpFlag.Name) && state != nil {
|
if ctx.GlobalBool(DumpFlag.Name) && state != nil {
|
||||||
@ -102,6 +103,11 @@ func stateTestCmd(ctx *cli.Context) error {
|
|||||||
result.State = &dump
|
result.State = &dump
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// print state root for evmlab tracing (already committed above, so no need to delete objects again
|
||||||
|
if ctx.GlobalBool(MachineFlag.Name) && state != nil {
|
||||||
|
fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", state.IntermediateRoot(false))
|
||||||
|
}
|
||||||
|
|
||||||
results = append(results, *result)
|
results = append(results, *result)
|
||||||
|
|
||||||
// Print any structured logs collected
|
// Print any structured logs collected
|
||||||
|
Loading…
Reference in New Issue
Block a user