return error from gasEstimate if EvmError

pull/4201/head
yann300 1 year ago committed by Aniket
parent 1e9049d42f
commit 49ec740771
  1. 2
      apps/remix-ide/src/app/tabs/web3-provider.js
  2. 3
      libs/remix-simulator/src/methods/transactions.ts

@ -64,7 +64,7 @@ export class Web3ProviderModule extends Plugin {
try {
resultFn(null, await provider.sendAsync(payload))
} catch (e) {
resultFn(e.message)
resultFn(e.error ? new Error(e.error) : new Error(e))
}
} else {
reject(new Error('User denied permission'))

@ -159,6 +159,9 @@ export class Transactions {
processTx(this.txRunnerInstance, payload, true, (error, value: VMexecutionResult) => {
if (error) return cb(error)
const result: RunTxResult = value.result
if (result.execResult && result.execResult.exceptionError && result.execResult.exceptionError.errorType === 'EvmError') {
return cb(result.execResult.exceptionError.error)
}
if ((result as any).receipt?.status === '0x0' || (result as any).receipt?.status === 0) {
try {
const msg = `0x${result.execResult.returnValue.toString('hex') || '0'}`

Loading…
Cancel
Save