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

Improve store_program validation #114

Merged
merged 1 commit into from
Jan 19, 2022
Merged

Improve store_program validation #114

merged 1 commit into from
Jan 19, 2022

Conversation

archseer
Copy link
Collaborator

The Program account type provided by Anchor will check that the provided address is executable (and that the id matches the expected program_id). This can help catch issues where a regular account is provided accidentally.

The Program<T> account type will check that the provided address
is executable.
Comment on lines -82 to -83
#[account(address = store::ID)]
pub store_program: AccountInfo<'info>,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This is the bulk of the change. The rest just adds the Store type and renames the old Store type to State.

@aalu1418 aalu1418 merged commit c788470 into develop Jan 19, 2022
@aalu1418 aalu1418 deleted the improve-validation branch January 19, 2022 13:50
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.

2 participants