Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
move PROGRAM_OWNERS to sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Nov 21, 2023
1 parent 7010ebf commit ab49dc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 1 addition & 7 deletions runtime/src/bank.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ use {
account::{
create_account_shared_data_with_fields as create_account, from_account, Account,
AccountSharedData, InheritableAccountFields, ReadableAccount, WritableAccount,
PROGRAM_OWNERS,
},
account_utils::StateMut,
bpf_loader, bpf_loader_deprecated,
bpf_loader_upgradeable::{self, UpgradeableLoaderState},
clock::{
BankId, Epoch, Slot, SlotCount, SlotIndex, UnixTimestamp, DEFAULT_HASHES_PER_TICK,
Expand Down Expand Up @@ -5229,12 +5229,6 @@ impl Bank {
);
check_time.stop();

const PROGRAM_OWNERS: &[Pubkey] = &[
bpf_loader_upgradeable::id(),
bpf_loader::id(),
bpf_loader_deprecated::id(),
loader_v4::id(),
];
let mut program_accounts_map = self.filter_executable_program_accounts(
&self.ancestors,
sanitized_txs,
Expand Down
9 changes: 9 additions & 0 deletions sdk/src/account.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
use qualifier_attr::qualifiers;
use {
crate::{
bpf_loader, bpf_loader_deprecated, bpf_loader_upgradeable,
clock::{Epoch, INITIAL_RENT_EPOCH},
lamports::LamportsError,
loader_v4,
pubkey::Pubkey,
},
serde::{
Expand Down Expand Up @@ -754,6 +756,13 @@ pub fn create_is_signer_account_infos<'a>(
.collect()
}

pub const PROGRAM_OWNERS: &[Pubkey] = &[
bpf_loader_upgradeable::id(),
bpf_loader::id(),
bpf_loader_deprecated::id(),
loader_v4::id(),
];

#[cfg(test)]
pub mod tests {
use super::*;
Expand Down

0 comments on commit ab49dc7

Please sign in to comment.