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

CIP-0057: Extend the Blueprint test case with the AsData example. #5837

Merged
merged 4 commits into from Apr 2, 2024

Conversation

Unisay
Copy link
Contributor

@Unisay Unisay commented Mar 14, 2024

AsData types like this example one

$( PlutusTx.asData
    [d|
      data Datum2 = MkDatum2
        { datum2integer :: Integer
        , datum2bool :: Bool
        }
        deriving stock (Generic)
        deriving newtype (AsDefinitionId)
      |]
 )

can't have their HasSchema Datum2 instance derived using TH:

$(makeIsDataSchemaIndexed ''Datum2 [('MkDatum2 0)])
-- Error: No index given for constructorBlueprint.Tests.Lib.Datum2_6989586621683919396typec

I have extended the test for Blueprint generation with the AsData type and showed how a manual HasSchema instance could be provided in such case.

@Unisay Unisay added the No Changelog Required Add this to skip the Changelog Check label Mar 14, 2024
@Unisay Unisay requested a review from zliu41 March 14, 2024 12:24
@Unisay Unisay self-assigned this Mar 14, 2024
@Unisay
Copy link
Contributor Author

Unisay commented Mar 14, 2024

I have an idea to try extending the asData TH macros to also generate an HasSchema instance (analogous to how makeIsDataSchemaIndexed adds a HasSchema instance on top of what makeIsDataIndexed does)
but I am not sure how important is it at this time to implement, @zliu41 wdyt?

@Unisay Unisay requested a review from michaelpj March 14, 2024 12:39
@Unisay Unisay force-pushed the yura/PLT-9659/cip57-asData branch 2 times, most recently from 067e961 to 2509c9c Compare March 14, 2024 14:41
@Unisay Unisay force-pushed the yura/PLT-9660/derive-validator-params-args branch from 396d119 to 6c2bab8 Compare March 18, 2024 13:39
Base automatically changed from yura/PLT-9660/derive-validator-params-args to yura/PLT-9657/derive-schema-types March 18, 2024 13:42
@Unisay Unisay force-pushed the yura/PLT-9657/derive-schema-types branch 2 times, most recently from 210aa9e to 7755732 Compare March 18, 2024 13:47
Base automatically changed from yura/PLT-9657/derive-schema-types to master March 18, 2024 15:02
@Unisay Unisay force-pushed the yura/PLT-9659/cip57-asData branch 2 times, most recently from 31262d3 to f3b2a3c Compare March 18, 2024 16:43
@Unisay Unisay force-pushed the yura/PLT-9659/cip57-asData branch from f3b2a3c to a9ef445 Compare March 19, 2024 08:51
@Unisay Unisay force-pushed the yura/PLT-9659/cip57-asData branch from 4d0b029 to e13a4cf Compare March 25, 2024 17:38
@Unisay Unisay force-pushed the yura/PLT-9659/cip57-asData branch from e13a4cf to ac79a71 Compare March 26, 2024 09:02
@Unisay Unisay requested a review from michaelpj March 26, 2024 12:31
@Unisay Unisay merged commit b22f5ad into master Apr 2, 2024
5 checks passed
@Unisay Unisay deleted the yura/PLT-9659/cip57-asData branch April 2, 2024 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
No Changelog Required Add this to skip the Changelog Check
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants