diff options
author | cdetrio <cdetrio@gmail.com> | 2018-10-04 16:22:41 +0800 |
---|---|---|
committer | Martin Holst Swende <martin@swende.se> | 2018-10-04 16:22:41 +0800 |
commit | bfa0f96822c310759394640dc2965fceb091a3a4 (patch) | |
tree | f68a9b50e3c04da878269cc059d7af26229ff0eb /cmd/evm | |
parent | 82a1c771ef43c970ca1d77269e871de444c11730 (diff) | |
download | dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar.gz dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar.bz2 dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar.lz dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar.xz dexon-bfa0f96822c310759394640dc2965fceb091a3a4.tar.zst dexon-bfa0f96822c310759394640dc2965fceb091a3a4.zip |
cmd/evm: fix state dump (#17832)
Diffstat (limited to 'cmd/evm')
-rw-r--r-- | cmd/evm/staterunner.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cmd/evm/staterunner.go b/cmd/evm/staterunner.go index 6d5ff069f..06c9be380 100644 --- a/cmd/evm/staterunner.go +++ b/cmd/evm/staterunner.go @@ -97,6 +97,10 @@ func stateTestCmd(ctx *cli.Context) error { // Run the test and aggregate the result result := &StatetestResult{Name: key, Fork: st.Fork, Pass: true} state, err := test.Run(st, cfg) + // print state root for evmlab tracing + if ctx.GlobalBool(MachineFlag.Name) && state != nil { + fmt.Fprintf(os.Stderr, "{\"stateRoot\": \"%x\"}\n", state.IntermediateRoot(false)) + } if err != nil { // Test failed, mark as so and dump any state to aid debugging result.Pass, result.Error = false, err.Error() @@ -105,10 +109,6 @@ func stateTestCmd(ctx *cli.Context) error { 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) |