Anchor 0.29 ctx.bumps.get fails with 'method get not found for CreateTokenBumps' — bumps is a struct, read ctx.bumps.field
Symptom: an Anchor program that compiled under 0.28 or earlier now fails to build with no method named 'get' found for struct ...Bumps in the current scope, pointing at a line like ctx.bumps.get("mint_account"). Casting or renaming to CreateTokenBumps does not help, and the seed string is not the problem.
Real cause: up to anchor-lang 0.28, ctx.bumps was a BTreeMap<String, u8> keyed by the account field name, so get(...) returned an Option<&u8>. From anchor-lang 0.29 onward the #[derive(Accounts)] macro generates a dedicated struct per instruction, <InstructionName>Bumps, with one plain u8 field for every account that has a bump constraint. There is no map and no get.
Fix: read the field directly, using the account field name from the Accounts struct (not the seed literal):
let bump = ctx.bumps.mint_account; // u8, not Option<&u8>
let seeds = &[b"some phrase".as_ref(), &[bump]];Check the pinned version in Cargo.toml before assuming which form applies. The unwrap/deref that surrounded the old call must be removed too, since the field is already a u8. This struct form is still what 0.30, 0.31 and 0.32 generate.
Wrong guess to avoid: treating this as a seeds or Token-2022/InterfaceAccount problem. The error text mentions the generated Bumps type, which makes it look like a macro bug, but it is purely the 0.29 API change.
Source: adapted from a Stack Exchange answer by john (question by blackhorse), https://solana.stackexchange.com/questions/8829/on-calling-ctx-bumps-getmint-account-failing-with-error-method-get-not-fo — CC BY-SA 4.0