Add static vector to get all static ids in runtime (#25909)

* Add function to get all static ids in runtime

* static_ids.rs: use a lazy_static ref instead of a function
This commit is contained in:
apfitzge 2022-06-13 13:21:16 -05:00 committed by GitHub
parent 825b95154f
commit d56a706b20
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 0 deletions

View File

@ -65,6 +65,7 @@ mod stake_account;
pub mod stake_history;
pub mod stake_weighted_timestamp;
pub mod stakes;
pub mod static_ids;
pub mod status_cache;
mod storable_accounts;
mod system_instruction_processor;

15
runtime/src/static_ids.rs Normal file
View File

@ -0,0 +1,15 @@
use {
crate::{inline_spl_associated_token_account, inline_spl_token, inline_spl_token_2022},
solana_sdk::pubkey::Pubkey,
};
lazy_static! {
/// Vector of static token & mint IDs
pub static ref STATIC_IDS: Vec<Pubkey> = vec![
inline_spl_associated_token_account::id(),
inline_spl_associated_token_account::program_v1_1_0::id(),
inline_spl_token::id(),
inline_spl_token::native_mint::id(),
inline_spl_token_2022::id(),
];
}