|
|
|
@ -128,7 +128,14 @@ export class TxRunnerVM { |
|
|
|
|
transactions: [tx] |
|
|
|
|
}, { common: this.commonContext }) |
|
|
|
|
|
|
|
|
|
if (!this.standaloneTx) { |
|
|
|
|
// standaloneTx represents a gas estimation call
|
|
|
|
|
if (this.standaloneTx || useCall) { |
|
|
|
|
const root = await this.getVMObject().stateManager.getStateRoot() |
|
|
|
|
this.runBlockInVm(tx, block, async (err, result) => { |
|
|
|
|
await this.getVMObject().stateManager.setStateRoot(root) |
|
|
|
|
callback(err, result) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
this.blockParentHash = block.hash() |
|
|
|
|
this.runBlockInVm(tx, block, async (err, result) => { |
|
|
|
|
if (!err) { |
|
|
|
@ -139,12 +146,6 @@ export class TxRunnerVM { |
|
|
|
|
} |
|
|
|
|
callback(err, result) |
|
|
|
|
}) |
|
|
|
|
} else { |
|
|
|
|
const root = await this.getVMObject().stateManager.getStateRoot() |
|
|
|
|
this.runBlockInVm(tx, block, async (err, result) => { |
|
|
|
|
await this.getVMObject().stateManager.setStateRoot(root) |
|
|
|
|
callback(err, result) |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
} catch (e) { |
|
|
|
|
callback(e) |
|
|
|
|