Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parse revert error codes to determine more specific reasons for revert #829

Closed
camsjams opened this issue Mar 14, 2023 · 0 comments · Fixed by #833
Closed

Parse revert error codes to determine more specific reasons for revert #829

camsjams opened this issue Mar 14, 2023 · 0 comments · Fixed by #833
Assignees

Comments

@camsjams
Copy link
Contributor

camsjams commented Mar 14, 2023

Motivation

Every Revert has a specific code that enables it to treat the log in different ways
https://github.com/FuelLabs/fuel-abi-types/blob/a340a110ded4268ca834269cb5916b9ac9b90943/src/error_codes.rs#L3-L16

In the case of a revert of a type required "0xffff_ffff_ffff_0000", we can safely get the previous log data from the log stack.

Usage example

No response

Possible implementations

  1. improve our parsing of the revert to better utilize the different types of revert codes
  2. This would allow us to have five types of revert cases now to better help DX, they'd have a better understanding of why something failed:
FAILED_REQUIRE_SIGNAL
FAILED_ASSERT_EQ_SIGNAL
FAILED_ASSERT_SIGNAL
FAILED_SEND_MESSAGE_SIGNAL
FAILED_TRANSFER_TO_ADDRESS_SIGNAL

Three part update to improve DX for #634:

  1. This one
  2. Update enum support
  3. Use better enums in errors
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant