solana_epoch_stake/
lib.rs1#![cfg_attr(docsrs, feature(doc_cfg))]
7#![no_std]
8
9use solana_pubkey::Pubkey;
10
11fn get_epoch_stake(var_addr: *const u8) -> u64 {
12 #[cfg(target_os = "solana")]
13 {
14 unsafe { solana_define_syscall::definitions::sol_get_epoch_stake(var_addr) }
15 }
16
17 #[cfg(not(target_os = "solana"))]
18 {
19 core::hint::black_box(var_addr);
20 0
21 }
22}
23
24pub fn get_epoch_total_stake() -> u64 {
26 get_epoch_stake(core::ptr::null::<Pubkey>() as *const u8)
27}
28
29pub fn get_epoch_stake_for_vote_account(vote_address: &Pubkey) -> u64 {
34 get_epoch_stake(vote_address as *const _ as *const u8)
35}