Skip to content

Commit

Permalink
Merge pull request #4274 from ethereum/yann300-patch-51
Browse files Browse the repository at this point in the history
First check the revert reason
  • Loading branch information
yann300 authored Nov 28, 2023
2 parents 1315a91 + a6acfb9 commit 18b45da
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libs/remix-simulator/src/methods/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'}`
Expand All @@ -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))
Expand Down

0 comments on commit 18b45da

Please sign in to comment.