pub fn verify_if_precompile(
    program_id: &Pubkey,
    precompile_instruction: &CompiledInstruction,
    all_instructions: &[CompiledInstruction],
    feature_set: &Arc<FeatureSet>,
) -> Result<(), PrecompileError> {
    for precompile in PRECOMPILES.iter() {
        if precompile.check_id(program_id, |feature_id| feature_set.is_active(feature_id)) {
            let instruction_datas: Vec<_> = all_instructions
                .iter()
                .map(|instruction| instruction.data.as_ref())
                .collect();
            return precompile.verify(
                &precompile_instruction.data,
                &instruction_datas,
                feature_set,
            );
        }
    }
    Ok(())
}
/// Check that a program is precompiled and if so verify it
Check that a program is precompiled and if so verify it
Check that a program is precompiled and if so verify it
pub fn verify_if_precompile(
    program_id: &Pubkey,
    precompile_instruction: &CompiledInstruction,
    all_instructions: &[CompiledInstruction],
    feature_set: &Arc<FeatureSet>,
) -> Result<(), PrecompileError> {
    for precompile in PRECOMPILES.iter() {
        if precompile.check_id(program_id, |feature_id| feature_set.is_active(feature_id)) {
            let instruction_datas: Vec<_> = all_instructions
                .iter()
                .map(|instruction| instruction.data.as_ref())
                .collect();
            return precompile.verify(
                &precompile_instruction.data,
                &instruction_datas,
                feature_set,
            );
        }
    }
    Ok(())
}
pub fn verify_if_precompile ( program_id : & Pubkey , precompile_instruction : & CompiledInstruction , all_instructions : & [ CompiledInstruction ] , feature_set : & Arc < FeatureSet > , ) -> Result < ( ) , PrecompileError > { for precompile in PRECOMPILES . iter ( ) { if precompile . check_id ( program_id , | feature_id | feature_set . is_active ( feature_id ) ) { let instruction_datas : Vec < _ > = all_instructions . iter ( ) . map ( | instruction | instruction . data . as_ref ( ) ) . collect ( ) ; return precompile . verify ( & precompile_instruction . data , & instruction_datas , feature_set , ) ; } } Ok ( ( ) ) }
Check that a program is precompiled and if so verify it
Check that a program is precompiled and if so verify it
program_id
&Pubkey
precompile_instruction
&CompiledInstruction
all_instructions
&[CompiledInstruction]
feature_set
&Arc<FeatureSet>