Skip to main content

check_version

Function check_version 

Source
pub fn check_version(data: &[u8], min_version: u8) -> ProgramResult
Expand description

Verify the header version byte (data[1]) meets a minimum version.

Standalone version of the check inside check_header. Use this when you’ve already validated the discriminator separately and just need the version gate.

let data = account.try_borrow()?;
check_version(&data, 2)?; // requires version >= 2