diff --git a/loader-v3-interface/src/instruction.rs b/loader-v3-interface/src/instruction.rs index 87ee10809..d0de845f9 100644 --- a/loader-v3-interface/src/instruction.rs +++ b/loader-v3-interface/src/instruction.rs @@ -330,6 +330,10 @@ pub fn is_migrate_instruction(instruction_data: &[u8]) -> bool { !instruction_data.is_empty() && 8 == instruction_data[0] } +pub fn is_extend_program_checked_instruction(instruction_data: &[u8]) -> bool { + !instruction_data.is_empty() && 9 == instruction_data[0] +} + #[cfg(feature = "bincode")] /// Returns the instructions required to set a buffers's authority. pub fn set_buffer_authority( @@ -619,4 +623,15 @@ mod tests { UpgradeableLoaderInstruction::Migrate {}, ); } + + #[test] + fn test_is_extend_program_checked_instruction() { + assert!(!is_extend_program_checked_instruction(&[])); + assert_is_instruction( + is_extend_program_checked_instruction, + UpgradeableLoaderInstruction::ExtendProgramChecked { + additional_bytes: 0, + }, + ); + } }