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

feat!: improve error on malformed abi #1347

Merged
merged 14 commits into from May 4, 2024
Merged

feat!: improve error on malformed abi #1347

merged 14 commits into from May 4, 2024

Conversation

hal3e
Copy link
Contributor

@hal3e hal3e commented Apr 25, 2024

closes: #1343

BREAKING CHANGE:

  • AbigenTarget now holds the parsed FullProgramAbi and the path.
  • fields of AbigenTarget and Abi are pub(crate)
  • Source is removed in favor of Abi

Checklist

  • I have linked to any relevant issues.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary labels.
  • I have done my best to ensure that my PR adheres to the Fuel Labs Code Review Standards.
  • I have requested a review from the relevant team or maintainers.

Copy link
Contributor

@segfault-magnet segfault-magnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice if we could catch this before Abigen. Sometime while we still have the Span so that we may underline the ABI part of the macro.

We can change the AbigenTarget to contain the FullAbiProgram instead of the source.

But maybe for another time. Maybe an issue if you agree? Or a point in the neverending wish list @digorithm ?

@hal3e
Copy link
Contributor Author

hal3e commented Apr 25, 2024

I will give it a try int this PR

@hal3e hal3e changed the title feat: improve error on malformed abi feat!: improve error on malformed abi Apr 26, 2024
@hal3e hal3e requested a review from segfault-magnet May 2, 2024 09:08
segfault-magnet
segfault-magnet previously approved these changes May 2, 2024
Copy link
Contributor

@segfault-magnet segfault-magnet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ty for the effort 🥇

MujkicA
MujkicA previously approved these changes May 3, 2024
Copy link
Contributor

@MujkicA MujkicA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 🚀

packages/fuels-code-gen/src/program_bindings/abigen.rs Outdated Show resolved Hide resolved
Copy link
Member

@digorithm digorithm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@hal3e hal3e merged commit a0cf378 into master May 4, 2024
41 checks passed
@hal3e hal3e deleted the hal3e/improve-abi-error branch May 4, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Malformed abi json will result in a lower level err message to the user
5 participants