Open yanCode opened 1 month ago
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
*ctx.bumps.get("token_account").unwrap()
token_account
bumps
anchor-lang = "0.30.1"
I personally think while the code repository got updated, the doc has'nt been update accordingly.
Update the code as:
let seeds = &[b"token".as_ref(), &[ctx.bumps.token_account]];
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.
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 readtoken_account
frombumps
, that now no longer works onanchor-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#L49I personally think while the code repository got updated, the doc has'nt been update accordingly.
Summary of Changes
Update the code as: