2019-07-12 16:38:15 -07:00
|
|
|
//! named accounts for synthesized data accounts for bank state, etc.
|
|
|
|
//!
|
|
|
|
use crate::pubkey::Pubkey;
|
|
|
|
|
|
|
|
pub mod clock;
|
2019-10-08 22:34:26 -07:00
|
|
|
pub mod epoch_schedule;
|
2019-07-12 16:38:15 -07:00
|
|
|
pub mod fees;
|
2019-09-17 17:12:55 +05:30
|
|
|
pub mod rent;
|
2019-07-12 16:38:15 -07:00
|
|
|
pub mod rewards;
|
|
|
|
pub mod slot_hashes;
|
2019-08-09 12:31:56 -07:00
|
|
|
pub mod stake_history;
|
2019-07-12 16:38:15 -07:00
|
|
|
|
|
|
|
pub fn is_sysvar_id(id: &Pubkey) -> bool {
|
2019-10-09 23:22:33 -07:00
|
|
|
clock::check_id(id)
|
|
|
|
|| epoch_schedule::check_id(id)
|
|
|
|
|| fees::check_id(id)
|
|
|
|
|| rent::check_id(id)
|
|
|
|
|| rewards::check_id(id)
|
|
|
|
|| slot_hashes::check_id(id)
|
|
|
|
|| stake_history::check_id(id)
|
2019-07-12 16:38:15 -07:00
|
|
|
}
|
|
|
|
|
2019-10-09 23:22:33 -07:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! solana_sysvar_id(
|
|
|
|
($id:ident, $name:expr) => (
|
|
|
|
$crate::solana_name_id!($id, $name);
|
|
|
|
|
|
|
|
#[cfg(test)]
|
|
|
|
#[test]
|
|
|
|
fn test_sysvar_id() {
|
|
|
|
if !$crate::sysvar::is_sysvar_id(&id()) {
|
|
|
|
panic!("sysvar::is_sysvar_id() doesn't know about {}", $name);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2019-07-12 16:38:15 -07:00
|
|
|
/// "Sysvar1111111111111111111111111111111111111"
|
|
|
|
/// owner pubkey for sysvar accounts
|
|
|
|
const ID: [u8; 32] = [
|
|
|
|
6, 167, 213, 23, 24, 117, 247, 41, 199, 61, 147, 64, 143, 33, 97, 32, 6, 126, 216, 140, 118,
|
|
|
|
224, 140, 40, 127, 193, 148, 96, 0, 0, 0, 0,
|
|
|
|
];
|
|
|
|
|
|
|
|
crate::solana_name_id!(ID, "Sysvar1111111111111111111111111111111111111");
|