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