fix: tvx: fvm vm.Flush

This commit is contained in:
Steven Allen 2023-04-20 13:50:16 -07:00
parent 7b6f6843a7
commit 54d8ddf3c1

View File

@ -297,12 +297,12 @@ func (d *Driver) ExecuteMessage(bs blockstore.Blockstore, params ExecuteMessageP
} }
var root cid.Cid var root cid.Cid
if d.vmFlush { if lvm, ok := vmi.(*vm.LegacyVM); ok && !d.vmFlush {
root, err = lvm.StateTree().(*state.StateTree).Flush(d.ctx)
} else {
// flush the VM, committing the state tree changes and forcing a // flush the VM, committing the state tree changes and forcing a
// recursive copy from the temporary blockstore to the real blockstore. // recursive copy from the temporary blockstore to the real blockstore.
root, err = vmi.Flush(d.ctx) root, err = vmi.Flush(d.ctx)
} else {
root, err = vmi.(*vm.LegacyVM).StateTree().(*state.StateTree).Flush(d.ctx)
} }
return ret, root, err return ret, root, err