trezoa_epoch_stake/
lib.rs1use trezoa_pubkey::Pubkey;
8
9fn get_epoch_stake(var_addr: *const u8) -> u64 {
10 #[cfg(target_os = "trezoa")]
11 {
12 unsafe { trezoa_define_syscall::definitions::trz_get_epoch_stake(var_addr) }
13 }
14
15 #[cfg(not(target_os = "trezoa"))]
16 {
17 core::hint::black_box(var_addr);
18 0
19 }
20}
21
22pub fn get_epoch_total_stake() -> u64 {
24 get_epoch_stake(std::ptr::null::<Pubkey>() as *const u8)
25}
26
27pub fn get_epoch_stake_for_vote_account(vote_address: &Pubkey) -> u64 {
32 get_epoch_stake(vote_address as *const _ as *const u8)
33}