madara
madara copied to clipboard
feat(RPC): estimate fee Error returns with transaction context
Pull Request type
Please add the labels corresponding to the type of changes your PR introduces:
- Feature: Enhanced error handling for
estimate_fee
calls, including specific transaction hash in error data for failed and reverted transactions
What is the current behavior?
When requesting a fee estimate, the call expects a list of transactions. However, if the call fails, it returns an error without context, making it difficult to identify which specific transaction caused the failure.
What is the new behavior?
-
Error
enum has been updated to distinguish between transactions thatfailed
and those that werereverted
. - If an error occurs, the hash of the transaction is now returned in the data field of the
ContractError
, distinguishing whether it isreverted
orrejected
. - This change makes it clear which transaction caused the error, allowing you to preview executable transactions by simulating the transaction list.
Does this introduce a breaking change?
No
Other information
Isn't this a duplicate with #1555? @hhamud ?
Isn't this a duplicate with #1555? @hhamud ?
its more specific to their case of just piping back a list of reverted and failed transactions when calling a specific function. My PR is more general change of piping whatever error back to the user.
@hhamud which one should be merged first?