idl: Add ability to convert legacy IDLs #2986
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
There are a lot of projects that haven't yet upgraded to use the new IDL spec, which also means they can't be used in the new
declare_program!
macro.Summary of changes
Add ability to convert legacy IDLs to the new IDLs.
The conversion is not perfect, as the new IDL stores much more information than the legacy ones. Thus, projects should preferably aim to generate new IDLs by upgrading their Anchor version rather than this method to get the full benefits of the new IDL spec.
Related: #2972