1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
use crate::{models::Height, *}; /// Get the current height of the blockchain pub async fn height(client: &Client) -> Result<u64> { let height: Height = client.fetch("/blocks/height", NO_QUERY).await?; Ok(height.height) } #[cfg(test)] mod test { use super::*; use tokio::test; #[test] async fn heigh() { let client = Client::default(); let height = blocks::height(&client).await.expect("height"); assert!(height > 0); } }