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

declare_program!() macro not supported for previous version IDLs #2972

Closed
VY5FR2NWJ9 opened this issue May 17, 2024 · 2 comments · Fixed by #2997
Closed

declare_program!() macro not supported for previous version IDLs #2972

VY5FR2NWJ9 opened this issue May 17, 2024 · 2 comments · Fixed by #2997
Assignees
Labels

Comments

@VY5FR2NWJ9
Copy link

The macro attempts to parse the Idl type using serde_json, but complains about mandatory discriminator field for IDLs generated before anchor 0.30

Example IDL that does not work with this macro: https://github.com/drift-labs/protocol-v2/blob/master/sdk/src/idl/drift.json

I wonder if it would be sensible to have the option to make backwards incompatible fields such as discriminator Option<>, or if there is a way of migrating old IDL JSON files to the new format (as a client, who does not have access to the project)

@acheroncrypto
Copy link
Collaborator

I wonder if it would be sensible to have the option to make backwards incompatible fields such as discriminator Option<>, or if there is a way of migrating old IDL JSON files to the new format (as a client, who does not have access to the project)

Yes, I'll add a utility to convert an old IDL to a new one, and this will be supported by default with declare_program!.

@acheroncrypto acheroncrypto self-assigned this May 18, 2024
@VY5FR2NWJ9
Copy link
Author

awesome, that sounds great

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants