Skip to content
This repository was archived by the owner on Jan 24, 2025. It is now read-only.

fix: read token_account from bumps #589

Closed
wants to merge 1 commit into 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
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
no-pr-activity question Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants