1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use solana_sdk::{account::AccountSharedData, pubkey::Pubkey, sysvar};
#[derive(Default)]
pub struct AccountOverrides {
pub slot_history: Option<AccountSharedData>,
}
impl AccountOverrides {
pub fn set_slot_history(&mut self, slot_history: Option<AccountSharedData>) {
self.slot_history = slot_history;
}
pub fn get(&self, pubkey: &Pubkey) -> Option<&AccountSharedData> {
if pubkey == &sysvar::slot_history::id() {
self.slot_history.as_ref()
} else {
None
}
}
}