Skip to content

Conversation

@blishko
Copy link
Collaborator

@blishko blishko commented Aug 11, 2025

Description

We refactor the method readStdJSON so that it can better propagate errors, similar to other JSON reading functions.

To enable that we introduce a datatype to represent the contract data in the JSON representation. This simplifies JSON parsing significantly, because we can rely on Aeson to do the heavy lifting, for the most part.

Additionally, we change the return type to only Contracts, since this is the only part that callers were interested in. We do not try to construct Asts and Sources anymore.

We should probably not export the function at all and keep it internal.

Checklist

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

@blishko blishko force-pushed the standard-json-reading-cleanup branch from 6ababb4 to eb77571 Compare August 11, 2025 08:29
@blishko blishko requested a review from msooseth August 11, 2025 08:30
Copy link
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

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

Nice! So this should improve our error handling :)

We refactor the method readStdJSON so that it can better propagate
errors, similar to other JSON reading functions.

To enable that we introduce a datatype to represent the contract data in
the JSON representation. This simplifies JSON parsing significantly,
because we can rely on Aeson to do the heavy lifting, for the most part.

Additionally, we change the return type to only `Contracts`, since this
is the only part that callers were interested in. We do not try to
construct Asts and Sources anymore.

We should probably not export the function at all and keep it internal.
@blishko blishko force-pushed the standard-json-reading-cleanup branch from eb77571 to 3ce69f6 Compare August 11, 2025 10:20
@blishko blishko merged commit 874d8b4 into main Aug 11, 2025
9 checks passed
@blishko blishko deleted the standard-json-reading-cleanup branch August 11, 2025 13:55
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