Skip to content

Parse correctly enumerated types#1055

Open
gustavo-grieco wants to merge 1 commit intomainfrom
fix-enumerated-types
Open

Parse correctly enumerated types#1055
gustavo-grieco wants to merge 1 commit intomainfrom
fix-enumerated-types

Conversation

@gustavo-grieco
Copy link
Copy Markdown
Collaborator

Description

Fix for #980

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

@msooseth
Copy link
Copy Markdown
Collaborator

msooseth commented Apr 2, 2026

This is nice actually! Can you maybe add some test cases? I think they'd be good as examples, too! Perhaps an LLM can dream up some nice use-cases :)

@gustavo-grieco
Copy link
Copy Markdown
Collaborator Author

You mean more test cases, using complete solidity contracts?

@msooseth
Copy link
Copy Markdown
Collaborator

msooseth commented Apr 2, 2026

Yes, perhaps we could add them to test.hs or if that doesn't work, then clitest.hs ? I prefer test.hs because it's faster, but either works :)

Copy link
Copy Markdown
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

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

Looks good to me!

case readP_to_S (parseAbiValue (AbiBytesType 4)) threeBytes of
[] -> pure () -- Expected: parsing should fail
_ -> internalError "Should reject 3-byte value for bytes4"
, test "ABI-user-defined-enum-type" $ do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe we should rename this to ABI-parsing-types? And add tests for all the standard types?

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.

3 participants