do not send eror if receipt is available.

pull/3654/head^2
yann300 1 year ago committed by Aniket
parent 0634dde893
commit d294e8d2d7
  1. 10
      libs/remix-lib/src/execution/txRunnerWeb3.ts

@ -69,7 +69,10 @@ export class TxRunnerWeb3 {
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
cb(e, null)
// in case the receipt is available, we consider that only the execution failed but the transaction went through.
// So we don't consider this to be an error.
if (e.receipt) cb(null, e.receipt.transactionHash)
else cb(e, null)
}
},
() => {
@ -82,7 +85,10 @@ export class TxRunnerWeb3 {
cb(null, res.transactionHash)
} catch (e) {
console.log(`Send transaction failed: ${e.message} . if you use an injected provider, please check it is properly unlocked. `)
cb(e, null)
// in case the receipt is available, we consider that only the execution failed but the transaction went through.
// So we don't consider this to be an error.
if (e.receipt) cb(null, e.receipt.transactionHash)
else cb(e, null)
}
}
}

Loading…
Cancel
Save