From ae10f30d2377278cf122bfc7c59bb25ca82cfb37 Mon Sep 17 00:00:00 2001 From: devopsbo3 <69951731+devopsbo3@users.noreply.github.com> Date: Fri, 10 Nov 2023 12:27:53 -0600 Subject: [PATCH] Revert "cmd/evm: add back stateroot to jsonl-output (#27968)" This reverts commit f28ec27bcd86f4ff3f10dc6fc33282a3e85a8614. --- cmd/evm/staterunner.go | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index 85931f0406..a29c4b18f6 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -107,13 +107,6 @@ func runStateTest(fname string, cfg vm.Config, jsonOut, dump bool) error { // Run the test and aggregate the result result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true} test.Run(st, cfg, false, rawdb.HashScheme, func(err error, snaps *snapshot.Tree, state *state.StateDB) { - if state != nil { - root := state.IntermediateRoot(false) - result.Root = &root - if jsonOut { - fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%#x\"}\n", root) - } - } if err != nil { // Test failed, mark as so and dump any state to aid debugging result.Pass, result.Error = false, err.Error() @@ -121,6 +114,12 @@ func runStateTest(fname string, cfg vm.Config, jsonOut, dump bool) error { dump := state.RawDump(nil) result.State = &dump } + } else { + root := state.IntermediateRoot(false) + result.Root = &root + if jsonOut { + fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%#x\"}\n", root) + } } }) results = append(results, *result)