aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcdetrio <cdetrio@gmail.com>2018-10-04 16:22:41 +0800
committerMartin Holst Swende <martin@swende.se>2018-10-04 16:22:41 +0800
commitbfa0f96822c310759394640dc2965fceb091a3a4 (patch)
treef68a9b50e3c04da878269cc059d7af26229ff0eb
parent82a1c771ef43c970ca1d77269e871de444c11730 (diff)
downloadgo-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar.gz
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar.bz2
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar.lz
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar.xz
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.tar.zst
go-tangerine-bfa0f96822c310759394640dc2965fceb091a3a4.zip
cmd/evm: fix state dump (#17832)
-rw-r--r--cmd/evm/staterunner.go8
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)