Replies: 1 comment 1 reply
-
Making bread types of changes in v5 could break backwards compatibility. But have you tried v6 yet? In v6, they both throw a CALL_EXCEPTION, but the action property indicated |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In the abstract class Signer, the function
populateTransaction
callsestimateGas
if no gasLimit has been passed along the transaction.Two scenarios with the same expected result could then be used :
estimateGas
and pass the result topopulateTransaction
(that's what @wagmi/core prepareWriteContrat does for instance)populateTransaction
directly and let it make the estimateIn case of a revert in the contract method while eventually making the same low-level
eth_estimateGas
operation, these two scenarios throw different errors.estimateGas
directly lets the error to bubbles uppopulateTransaction
without gasLimit catches it and rethrows it asUNPREDICTABLE_GAS_LIMIT
errorethers.js/packages/abstract-signer/src.ts/index.ts
Lines 295 to 306 in 01aea70
Imho, the custom
UNPREDICTABLE_GAS_LIMIT
error should be thrown from insideestimateGas
making it the same and then catchable for the both scenarios.I'm also wondering about other providers and/or signers : is this behavior commonly enforced ? Do the thrown errors follow a common pattern and structure ?
Beta Was this translation helpful? Give feedback.
All reactions