cmd/evm: reopen the statedb for dumping (#29437)

pull/29469/head
rjl493456442 7 months ago committed by GitHub
parent 0bd03dbc55
commit fe0bf325a6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 13
      cmd/evm/runner.go

@ -272,8 +272,17 @@ func runCmd(ctx *cli.Context) error {
output, leftOverGas, stats, err := timedExec(bench, execFunc) output, leftOverGas, stats, err := timedExec(bench, execFunc)
if ctx.Bool(DumpFlag.Name) { if ctx.Bool(DumpFlag.Name) {
statedb.Commit(genesisConfig.Number, true) root, err := statedb.Commit(genesisConfig.Number, true)
fmt.Println(string(statedb.Dump(nil))) if err != nil {
fmt.Printf("Failed to commit changes %v\n", err)
return err
}
dumpdb, err := state.New(root, sdb, nil)
if err != nil {
fmt.Printf("Failed to open statedb %v\n", err)
return err
}
fmt.Println(string(dumpdb.Dump(nil)))
} }
if ctx.Bool(DebugFlag.Name) { if ctx.Bool(DebugFlag.Name) {

Loading…
Cancel
Save