gemachain_program/sysvar/
slot_history.rs1pub use crate::{
7 account_info::AccountInfo, program_error::ProgramError, slot_history::SlotHistory,
8};
9
10use crate::sysvar::Sysvar;
11
12crate::declare_sysvar_id!("SysvarS1otHistory11111111111111111111111111", SlotHistory);
13
14impl Sysvar for SlotHistory {
15 fn size_of() -> usize {
17 131_097 }
20 fn from_account_info(_account_info: &AccountInfo) -> Result<Self, ProgramError> {
21 Err(ProgramError::UnsupportedSysvar)
23 }
24}
25
26#[cfg(test)]
27mod tests {
28 use super::*;
29 #[test]
30 fn test_size_of() {
31 assert_eq!(
32 SlotHistory::size_of(),
33 bincode::serialized_size(&SlotHistory::default()).unwrap() as usize
34 );
35 }
36}