nym_cli_commands/validator/block/
current_height.rs

1// Copyright 2022 - Nym Technologies SA <contact@nymtech.net>
2// SPDX-License-Identifier: Apache-2.0
3
4use clap::Parser;
5
6use crate::context::QueryClient;
7use crate::utils::show_error;
8
9#[derive(Debug, Parser)]
10pub struct Args {}
11
12pub async fn query_current_block_height(client: &QueryClient) {
13    match client.get_current_block_height().await {
14        Ok(res) => {
15            println!("Current block height:\n{}", res.value())
16        }
17        Err(e) => show_error(e),
18    }
19}