Merge pull request #4274 from ethereum/yann300-patch-51

First check the revert reason
pull/4277/head
yann300 11 months ago committed by GitHub
commit 18b45da0da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      libs/remix-simulator/src/methods/transactions.ts

@ -158,10 +158,7 @@ export class Transactions {
this.vmContext.web3().flagNextAsDoNotRecordEvmSteps()
processTx(this.txRunnerInstance, payload, true, (error, value: VMexecutionResult) => {
if (error) return cb(error)
const result: any = value.result
if (result.execResult && result.execResult.exceptionError && result.execResult.exceptionError.errorType === 'EvmError') {
return cb(result.execResult.exceptionError.error)
}
const result: any = value.result
if ((result as any).receipt?.status === '0x0' || (result as any).receipt?.status === 0) {
try {
const msg = `0x${result.execResult.returnValue.toString('hex') || '0'}`
@ -172,6 +169,9 @@ export class Transactions {
return cb(e.message)
}
}
if (result.execResult && result.execResult.exceptionError && result.execResult.exceptionError.errorType === 'EvmError') {
return cb(result.execResult.exceptionError.error)
}
let gasUsed = Number(toNumber(result.execResult.executionGasUsed))
if (result.execResult.gasRefund) {
gasUsed += Number(toNumber(result.execResult.gasRefund))

Loading…
Cancel
Save