@@ -452,6 +452,8 @@ pub mod sysvar;
452452pub use mollusk_svm_result as result;
453453#[ cfg( any( feature = "fuzz" , feature = "fuzz-fd" ) ) ]
454454use mollusk_svm_result:: Compare ;
455+ #[ cfg( feature = "precompiles" ) ]
456+ use solana_precompile_error:: PrecompileError ;
455457#[ cfg( feature = "invocation-inspect-callback" ) ]
456458use solana_transaction_context:: InstructionAccount ;
457459use {
@@ -466,7 +468,6 @@ use {
466468 solana_compute_budget:: compute_budget:: ComputeBudget ,
467469 solana_hash:: Hash ,
468470 solana_instruction:: { AccountMeta , Instruction } ,
469- solana_precompile_error:: PrecompileError ,
470471 solana_program_runtime:: invoke_context:: { EnvironmentConfig , InvokeContext } ,
471472 solana_pubkey:: Pubkey ,
472473 solana_svm_callback:: InvokeContextCallback ,
@@ -579,6 +580,7 @@ impl CheckContext for Mollusk {
579580}
580581
581582struct MolluskInvokeContextCallback < ' a > {
583+ #[ cfg_attr( not( feature = "precompiles" ) , allow( dead_code) ) ]
582584 feature_set : & ' a FeatureSet ,
583585 epoch_stake : & ' a EpochStake ,
584586}
@@ -592,12 +594,19 @@ impl InvokeContextCallback for MolluskInvokeContextCallback<'_> {
592594 self . epoch_stake . get ( vote_address) . copied ( ) . unwrap_or ( 0 )
593595 }
594596
597+ #[ cfg( feature = "precompiles" ) ]
595598 fn is_precompile ( & self , program_id : & Pubkey ) -> bool {
596599 agave_precompiles:: is_precompile ( program_id, |feature_id| {
597600 self . feature_set . is_active ( feature_id)
598601 } )
599602 }
600603
604+ #[ cfg( not( feature = "precompiles" ) ) ]
605+ fn is_precompile ( & self , _program_id : & Pubkey ) -> bool {
606+ false
607+ }
608+
609+ #[ cfg( feature = "precompiles" ) ]
601610 fn process_precompile (
602611 & self ,
603612 program_id : & Pubkey ,
@@ -612,6 +621,16 @@ impl InvokeContextCallback for MolluskInvokeContextCallback<'_> {
612621 Err ( PrecompileError :: InvalidPublicKey )
613622 }
614623 }
624+
625+ #[ cfg( not( feature = "precompiles" ) ) ]
626+ fn process_precompile (
627+ & self ,
628+ _program_id : & Pubkey ,
629+ _data : & [ u8 ] ,
630+ _instruction_datas : Vec < & [ u8 ] > ,
631+ ) -> Result < ( ) , solana_precompile_error:: PrecompileError > {
632+ panic ! ( "precompiles feature not enabled" ) ;
633+ }
615634}
616635
617636impl Mollusk {
0 commit comments