solana_program/
epoch_stake.rsuse crate::pubkey::Pubkey;
fn get_epoch_stake(var_addr: *const u8) -> u64 {
#[cfg(target_os = "solana")]
let result = unsafe { crate::syscalls::sol_get_epoch_stake(var_addr) };
#[cfg(not(target_os = "solana"))]
let result = crate::program_stubs::sol_get_epoch_stake(var_addr);
result
}
pub fn get_epoch_total_stake() -> u64 {
get_epoch_stake(std::ptr::null::<Pubkey>() as *const u8)
}
pub fn get_epoch_stake_for_vote_account(vote_address: &Pubkey) -> u64 {
get_epoch_stake(vote_address as *const _ as *const u8)
}