Skip to content

Commit a6acfb9

Browse files
authored
first check the revert reason
1 parent 1315a91 commit a6acfb9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

libs/remix-simulator/src/methods/transactions.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,7 @@ export class Transactions {
158158
this.vmContext.web3().flagNextAsDoNotRecordEvmSteps()
159159
processTx(this.txRunnerInstance, payload, true, (error, value: VMexecutionResult) => {
160160
if (error) return cb(error)
161-
const result: any = value.result
162-
if (result.execResult && result.execResult.exceptionError && result.execResult.exceptionError.errorType === 'EvmError') {
163-
return cb(result.execResult.exceptionError.error)
164-
}
161+
const result: any = value.result
165162
if ((result as any).receipt?.status === '0x0' || (result as any).receipt?.status === 0) {
166163
try {
167164
const msg = `0x${result.execResult.returnValue.toString('hex') || '0'}`
@@ -172,6 +169,9 @@ export class Transactions {
172169
return cb(e.message)
173170
}
174171
}
172+
if (result.execResult && result.execResult.exceptionError && result.execResult.exceptionError.errorType === 'EvmError') {
173+
return cb(result.execResult.exceptionError.error)
174+
}
175175
let gasUsed = Number(toNumber(result.execResult.executionGasUsed))
176176
if (result.execResult.gasRefund) {
177177
gasUsed += Number(toNumber(result.execResult.gasRefund))

0 commit comments

Comments
 (0)