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

[enums] Add partial support for enum types #649

Merged
merged 1 commit into from
Feb 27, 2025

Conversation

GhostWalker562
Copy link
Contributor

@GhostWalker562 GhostWalker562 commented Feb 26, 2025

Description

Add some support for skipping types when parsing structs. This sets up support for enums with the limited information given.

If the struct is unknown and options.allowUnknownStructs is true, we will just let the struct be FixedBytes
If the struct is known through moduleAbi and is fieldless, we will consider it an enum and the struct will be FixedBytes
If the struct is a framework know enum (like DelegationKey or RateLimiter), the struct will be FixedBytes

Test Plan

  • Tested locally to ensure that Enum function arguments were passed and parsed properly.

Related Links

N/A

Checklist

  • Have you ran pnpm fmt?
  • Have you updated the CHANGELOG.md?

@GhostWalker562 GhostWalker562 self-assigned this Feb 26, 2025
@GhostWalker562 GhostWalker562 requested a review from a team as a code owner February 26, 2025 00:46
@GhostWalker562 GhostWalker562 changed the title [enums] Add some support for enum types [enums] Add partial support for enum types Feb 26, 2025
Copy link
Collaborator

@gregnazario gregnazario left a comment

Choose a reason for hiding this comment

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

Seems fine, but keep in mind, you could have structs that are not defined in the current module, since you are using it for any public function.

This will probably need to be reworked to be able to make outbound calls if the struct type doesn't match the module

@GhostWalker562
Copy link
Contributor Author

@gregnazario yeah I ran into that edge case 😞. I think we should find a way to walk through all of the types and structs and make the appropriate calls but definitely for another PR

@GhostWalker562 GhostWalker562 merged commit db88e98 into main Feb 27, 2025
8 checks passed
@GhostWalker562 GhostWalker562 deleted the fix-struct-enum-types branch February 27, 2025 19:09
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 this pull request may close these issues.

2 participants