use crate::re_throw::OrSyscallThrow;
use crate::sys::{self, SyscallNo};
use thruput_xdr::types::{BlockHeight, NetworkHash, SHA256Hash, TimePoint};
pub fn get_block_height() -> BlockHeight {
let mut block: BlockHeight = 0i64.into();
sys::raw_GetBlockHeight(&mut block)
.or_syscall_throw(SyscallNo::kGetBlockHeight);
block
}
pub fn get_network_hash() -> NetworkHash {
let mut network_hash: NetworkHash = SHA256Hash::default().into();
sys::raw_GetNetworkHash(&mut network_hash)
.or_syscall_throw(SyscallNo::kGetNetworkHash);
network_hash
}
pub fn get_block_timepoint() -> TimePoint {
let mut timepoint: TimePoint = 0u64.into();
sys::raw_GetBlockTimepoint(&mut timepoint)
.or_syscall_throw(SyscallNo::kGetBlockTimepoint);
timepoint
}