From 462fb24d76352388382f1b4acdeae9ab675b60fc Mon Sep 17 00:00:00 2001 From: HaoranYi Date: Tue, 21 Nov 2023 22:33:31 +0000 Subject: [PATCH] fix bank::tests::test_feature_activation_loaded_programs_recompilation_phase --- runtime/src/accounts/mod.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/runtime/src/accounts/mod.rs b/runtime/src/accounts/mod.rs index 820c19c7b3fbb0..2ee3534ed1801c 100644 --- a/runtime/src/accounts/mod.rs +++ b/runtime/src/accounts/mod.rs @@ -25,8 +25,8 @@ use { }, solana_sdk::{ account::{ - is_builtin, is_builtin_or_executable, is_executable, Account, AccountSharedData, - ReadableAccount, WritableAccount, + is_builtin, is_builtin_or_executable, Account, AccountSharedData, ReadableAccount, + WritableAccount, }, account_utils::StateMut, bpf_loader_upgradeable::{self, UpgradeableLoaderState}, @@ -365,6 +365,7 @@ fn load_transaction_accounts( error_counters.account_not_found += 1; return Err(TransactionError::ProgramAccountNotFound); } + if !is_builtin_or_executable(program_account) { error_counters.invalid_program_for_execution += 1; return Err(TransactionError::InvalidProgramForExecution); @@ -386,7 +387,7 @@ fn load_transaction_accounts( if let Some((owner_account, _)) = accounts_db.load_with_fixed_root(ancestors, owner_id) { - if !is_builtin(&owner_account) || !is_executable(&owner_account) { + if !is_builtin(&owner_account) { error_counters.invalid_program_for_execution += 1; return Err(TransactionError::InvalidProgramForExecution); }