Skip to main content

layer_climb_core/
network.rs

1pub mod rpc;
2
3use crate::prelude::*;
4
5cfg_if::cfg_if! {
6    if #[cfg(all(target_arch = "wasm32", target_os = "unknown"))] {
7        pub mod grpc_web;
8    } else if #[cfg(target_arch = "wasm32")] {
9        pub mod grpc_wasi;
10    } else {
11        pub mod grpc_native;
12    }
13}
14
15pub fn apply_grpc_height<T>(req: &mut tonic::Request<T>, height: Option<u64>) -> Result<()> {
16    if let Some(height) = height {
17        req.metadata_mut()
18            .insert("x-cosmos-block-height", height.to_string().try_into()?);
19    }
20
21    Ok(())
22}