Skip to content

Commit

Permalink
do not send eror if receipt is available.
Browse files Browse the repository at this point in the history
  • Loading branch information
yann300 authored and Aniket-Engg committed Oct 31, 2023
1 parent 0634dde commit d294e8d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions libs/remix-lib/src/execution/txRunnerWeb3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
},
() => {
Expand All @@ -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)
}
}
}
Expand Down

0 comments on commit d294e8d

Please sign in to comment.