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

find_program_address() #9

Merged
merged 1 commit into from
Sep 13, 2024
Merged

find_program_address() #9

merged 1 commit into from
Sep 13, 2024

Conversation

billythedummy
Copy link
Contributor

No description provided.

};
match result {
crate::entrypoint::SUCCESS => (bytes, bump_seed),
_ => panic!("PDA cannot be found"),
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we use the same message from solana_program, e.g., "Unable to find a viable program address bump seed"?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should keep error logs consistent

Copy link
Collaborator

@febo febo left a comment

Choose a reason for hiding this comment

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

Looks great, thanks! I have one minor nit.

Also, I was wondering whether it is worth adding a try_find_program_address or not, which returns a Result instead of panic. We could either do it in this PR or in a separate one.

@Ozodimgba
Copy link
Contributor

I think we should add it in this PR and think we should try and keep things as they are and only reinvent the wheel where absolutely necessary, so we don't inadvertently steepen the learning curve for devs. Docs are also necessary as we build

Copy link
Collaborator

@febo febo left a comment

Choose a reason for hiding this comment

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

Approved - the little nits will be done on a separate PR.

@febo febo merged commit 5a32edb into anza-xyz:main Sep 13, 2024
3 checks passed
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.

3 participants