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

package-metadata: Add macro to define program id from Cargo.toml #1806

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

joncinque
Copy link

Problem

This is a remake of #1483 but using a new crate instead of adding to solana_program.

We've added in the preliminary scaffolding in #1464 and #1465, but we still don't have the last bit to declare the program id in Cargo.toml.

Summary of Changes

Add the macro. As part of this, we have a few additions:

  • Move the documentation for the macro and re-export in solana-program. This seems to be how we do all the other macros
  • Add Pubkey::from_str_const
  • Add a little extra helper macro to combine everything
  • Changed one of the test programs to show the new way to declare the program id.

As noted in Pubkey::from_str_const, it's currently impossible to do a length check, which isn't great. We'll see if the upstream PR get accepted. I can keep this in draft until that goes through. I can also move that to a separate PR.

cc @lorisleiva

@joncinque joncinque changed the title package-metadata: Add macro to define program id from Cargo.toml #1483 package-metadata: Add macro to define program id from Cargo.toml Jun 20, 2024
Copy link

@buffalojoec buffalojoec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm again, just need the upstream PR to get reviewed.

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.

None yet

2 participants