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

fix: read token_account from bumps #589

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yanCode
Copy link
Contributor

@yanCode yanCode commented Oct 28, 2024

Problem

in this page: https://solana.com/developers/courses/program-security/owner-checks
current rust code in the tutorial, using syntax *ctx.bumps.get("token_account").unwrap() to read token_account from bumps, that now no longer works on anchor-lang = "0.30.1". In fact, this has already been updated in the sample code repository, https://github.com/yanCode/owner-checks/blob/7bda9fb5051976b37ec7cd68aa9cf9595ad087b8/programs/owner-check/src/lib.rs#L49

I personally think while the code repository got updated, the doc has'nt been update accordingly.

Summary of Changes

Update the code as:

 let seeds = &[b"token".as_ref(), &[ctx.bumps.token_account]];

@yanCode yanCode requested a review from mikemaccana as a code owner October 28, 2024 05:08
Copy link

This pull request has been automatically marked as stale because it has not had recent activity. Remove stale label or comment or this will be closed in 7 days.

@nickfrosty nickfrosty added question Further information is requested and removed no-pr-activity labels Nov 26, 2024
@nickfrosty nickfrosty requested review from ZYJLiu and removed request for mikemaccana November 26, 2024 22:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants