From f6c5a6addba9c47b8abfa7737ecd7758154d392b Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 3 Apr 2024 08:41:45 +0200 Subject: [PATCH] fix estimateGas --- libs/remix-lib/src/execution/txRunnerVM.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libs/remix-lib/src/execution/txRunnerVM.ts b/libs/remix-lib/src/execution/txRunnerVM.ts index ffdb00e639..da5ad0e7b2 100644 --- a/libs/remix-lib/src/execution/txRunnerVM.ts +++ b/libs/remix-lib/src/execution/txRunnerVM.ts @@ -140,9 +140,9 @@ export class TxRunnerVM { callback(err, result) }) } else { - await this.getVMObject().vm.evm.journal.checkpoint() - this.runTxInVm(tx, block, async (err, result) => { - await this.getVMObject().vm.evm.journal.revert() + const root = await this.getVMObject().stateManager.getStateRoot() + this.runBlockInVm(tx, block, async (err, result) => { + await this.getVMObject().stateManager.setStateRoot(root) callback(err, result) }) }