layer_climb_core/signing/ibc/
health.rs

1use crate::{prelude::*, querier::abci::AbciProofKind};
2
3impl SigningClient {
4    // sanity check that the node has everything we need to do stuff
5    // returns the tendermint version info
6    pub async fn ibc_check_compat(&self) -> Result<layer_climb_proto::tendermint::VersionInfo> {
7        let _ = self
8            .querier
9            .rpc_client()?
10            .health()
11            .await
12            .context("couldn't get health over rpc")?;
13
14        let node_info_resp = self.querier.node_info().await?;
15
16        let version = node_info_resp
17            .application_version
18            .context("missing application version")?;
19
20        self.querier
21            .abci_proof(AbciProofKind::StakingParams, None)
22            .await
23            .context("couldn't get staking params proof")?;
24
25        // let _ = self.http_client().rpc.tx_search(
26        //     tendermint_rpc::query::Query::from(tendermint_rpc::query::EventType::NewBlock),
27        //     false, 1, 1,
28        //     tendermint_rpc::Order::Ascending
29        // ).await.context("couldn't get tx search")?;
30
31        Ok(version)
32    }
33}