solana_program/
epoch_stake.rs1use crate::pubkey::Pubkey;
8
9fn get_epoch_stake(var_addr: *const u8) -> u64 {
10 #[cfg(target_os = "solana")]
11 let result = unsafe { crate::syscalls::sol_get_epoch_stake(var_addr) };
12
13 #[cfg(not(target_os = "solana"))]
14 let result = crate::program_stubs::sol_get_epoch_stake(var_addr);
15
16 result
17}
18
19pub fn get_epoch_total_stake() -> u64 {
21 get_epoch_stake(std::ptr::null::<Pubkey>() as *const u8)
22}
23
24pub fn get_epoch_stake_for_vote_account(vote_address: &Pubkey) -> u64 {
29 get_epoch_stake(vote_address as *const _ as *const u8)
30}