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

Derive IsPlutusData #56

Open
wants to merge 12 commits into
base: szg251/improvements
Choose a base branch
from

Conversation

chfanghr
Copy link
Member

@chfanghr chfanghr commented Oct 8, 2024

  • implement derive macro forIsPlutusData.
  • Move PlutusData and IsPlutusData to a crate plutus-data. The reason was that there's not a unified way to reference types and functions in the macro otherwise.
  • Fixed a few bugs in error messages of instances for "primitive" types; improved parsing logic.
  • Replace as many manually written IsPlutusData instances in plutus-ledger-api with derivation as possible.
  • All tests passed, including golden tests, to verify the correctness of the generated instances.

TODOs:

  • Test the derive macro itself, mainly edge cases

@chfanghr chfanghr changed the base branch from main to szg251/improvements October 8, 2024 13:13
@chfanghr chfanghr force-pushed the connor/is_plutus_data_derive branch 3 times, most recently from bf66073 to dddfbb6 Compare October 14, 2024 12:02
@chfanghr chfanghr marked this pull request as ready for review October 14, 2024 12:02
@szg251
Copy link
Collaborator

szg251 commented Oct 21, 2024

Move PlutusData and IsPlutusData to a crate plutus-data. The reason was that there's not a unified way to reference types and functions in the macro otherwise.

Personally, I'd prefer to have a use crate as plutus_ledger_api; in every module in plutus-ledger-api where we're using the macro, instead of having a separate package.

@chfanghr
Copy link
Member Author

@szg251 Done. I don't know how to implement the derive feature flag tho.

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