#[macro_export]
macro_rules! cosmos_query {
($self:ident, $module:ident, $func_name:ident, $request_type:ident { $($field:ident : $value:expr),* $(,)? }) => {
{
use $crate::cosmos_modules::$module::{
query_client::QueryClient, $request_type,
};
let mut client = QueryClient::new($self.channel.clone());
#[allow(clippy::redundant_field_names)]
let request = $request_type { $($field : $value),* };
let response = client.$func_name(request.clone()).await?.into_inner();
::log::trace!(
"cosmos_query: {:?} resulted in: {:?}",
request,
response
);
response
}
};
}
mod bank;
mod cosmwasm;
mod feegrant;
mod gov;
mod ibc;
mod node;
mod staking;
pub use bank::Bank;
pub use cosmwasm::CosmWasm;
pub use feegrant::Feegrant;
pub use ibc::Ibc;
pub use node::Node;
pub use gov::*;
pub use staking::*;
use tonic::transport::Channel;
pub trait DaemonQuerier {
fn new(channel: Channel) -> Self;
}