Skip to main content

assert_pda_with_bump

Function assert_pda_with_bump 

Source
pub fn assert_pda_with_bump(
    account: &AccountView,
    seeds: &[&[u8]],
    bump: u8,
    program_id: &Address,
) -> ProgramResult
Expand description

Verify a PDA matches when the bump is already known. Way cheaper than assert_pda because it only does one derivation instead of searching all 256 bumps.

Use this when the bump is stored in account data or passed as instruction data.

assert_pda_with_bump(vault, &[b"vault", authority.as_ref()], bump, program_id)?;