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

cli: Add version name from programs Cargo.toml to IDL #1061

Merged

Conversation

tomlinton
Copy link
Contributor

This required some changes to the manifest discovery code because anchor idl parse doesn't necessarily execute from within the program directory like the anchor build does.

It might be cleaner to do this all in lang/syn/src/idl/file.rs but it probably requires duplicating that manifest discovery code rather than just passing the version as an arg.

Closes #349

Example:

anchor idl parse --file programs/basic-0/src/lib.rs
{
  "version": "0.1.0",
  "name": "basic_0",
  "instructions": [
    {
      "name": "initialize",
      "accounts": [],
      "args": []
    }
  ]
}

@armaniferrante armaniferrante merged commit 1c5f503 into coral-xyz:master Nov 27, 2021
@fanatid
Copy link
Contributor

fanatid commented Nov 27, 2021

Any chance to add a test for this feature? Or we do not need it?

@tomlinton
Copy link
Contributor Author

Sure, happy to add a test!

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.

cli: Generating idl should use the program's current version
3 participants