check_pda_accounts

Function check_pda_accounts 

Source
pub fn check_pda_accounts(
    program_id: Pubkey,
    accounts: &[AccountInfo<'static>],
    expected_accounts: u32,
) -> Result<(), ProgramError>
Expand description

Verify that each entry in accounts matches the PDA derived on-the-fly for its index. Returns Ok(()) on success or a ProgramError::Custom with [ErrorCode::InvalidPda] (value 1) on the first mismatch.