madara icon indicating copy to clipboard operation
madara copied to clipboard

feat(RPC): estimate fee Error returns with transaction context

Open datactor opened this issue 10 months ago • 3 comments

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 that failed and those that were reverted.
  • If an error occurs, the hash of the transaction is now returned in the data field of the ContractError, distinguishing whether it is reverted or rejected.
  • 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

datactor avatar Apr 03 '24 09:04 datactor

Isn't this a duplicate with #1555? @hhamud ?

tdelabro avatar Apr 30 '24 17:04 tdelabro

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 avatar May 01 '24 01:05 hhamud

@hhamud which one should be merged first?

tdelabro avatar May 06 '24 05:05 tdelabro