#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[deprecated]
#[prost(message, repeated, tag = "1")]
pub send_enabled: ::prost::alloc::vec::Vec<SendEnabled>,
#[prost(bool, tag = "2")]
pub default_send_enabled: bool,
}
impl ::prost::Name for Params {
const NAME: &'static str = "Params";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SendEnabled {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
#[prost(bool, tag = "2")]
pub enabled: bool,
}
impl ::prost::Name for SendEnabled {
const NAME: &'static str = "SendEnabled";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Input {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub coins: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for Input {
const NAME: &'static str = "Input";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Output {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub coins: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for Output {
const NAME: &'static str = "Output";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Supply {
#[prost(message, repeated, tag = "1")]
pub total: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for Supply {
const NAME: &'static str = "Supply";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DenomUnit {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
#[prost(uint32, tag = "2")]
pub exponent: u32,
#[prost(string, repeated, tag = "3")]
pub aliases: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
}
impl ::prost::Name for DenomUnit {
const NAME: &'static str = "DenomUnit";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Metadata {
#[prost(string, tag = "1")]
pub description: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub denom_units: ::prost::alloc::vec::Vec<DenomUnit>,
#[prost(string, tag = "3")]
pub base: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub display: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub name: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub symbol: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub uri: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub uri_hash: ::prost::alloc::string::String,
}
impl ::prost::Name for Metadata {
const NAME: &'static str = "Metadata";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBalanceRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub denom: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryBalanceRequest {
const NAME: &'static str = "QueryBalanceRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryBalanceResponse {
#[prost(message, optional, tag = "1")]
pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for QueryBalanceResponse {
const NAME: &'static str = "QueryBalanceResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAllBalancesRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
#[prost(bool, tag = "3")]
pub resolve_denom: bool,
}
impl ::prost::Name for QueryAllBalancesRequest {
const NAME: &'static str = "QueryAllBalancesRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryAllBalancesResponse {
#[prost(message, repeated, tag = "1")]
pub balances: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryAllBalancesResponse {
const NAME: &'static str = "QueryAllBalancesResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySpendableBalancesRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QuerySpendableBalancesRequest {
const NAME: &'static str = "QuerySpendableBalancesRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySpendableBalancesResponse {
#[prost(message, repeated, tag = "1")]
pub balances: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QuerySpendableBalancesResponse {
const NAME: &'static str = "QuerySpendableBalancesResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySpendableBalanceByDenomRequest {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub denom: ::prost::alloc::string::String,
}
impl ::prost::Name for QuerySpendableBalanceByDenomRequest {
const NAME: &'static str = "QuerySpendableBalanceByDenomRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySpendableBalanceByDenomResponse {
#[prost(message, optional, tag = "1")]
pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for QuerySpendableBalanceByDenomResponse {
const NAME: &'static str = "QuerySpendableBalanceByDenomResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryTotalSupplyRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryTotalSupplyRequest {
const NAME: &'static str = "QueryTotalSupplyRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryTotalSupplyResponse {
#[prost(message, repeated, tag = "1")]
pub supply: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryTotalSupplyResponse {
const NAME: &'static str = "QueryTotalSupplyResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySupplyOfRequest {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
}
impl ::prost::Name for QuerySupplyOfRequest {
const NAME: &'static str = "QuerySupplyOfRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySupplyOfResponse {
#[prost(message, optional, tag = "1")]
pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for QuerySupplyOfResponse {
const NAME: &'static str = "QuerySupplyOfResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
impl ::prost::Name for QueryParamsRequest {
const NAME: &'static str = "QueryParamsRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomsMetadataRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryDenomsMetadataRequest {
const NAME: &'static str = "QueryDenomsMetadataRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomsMetadataResponse {
#[prost(message, repeated, tag = "1")]
pub metadatas: ::prost::alloc::vec::Vec<Metadata>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryDenomsMetadataResponse {
const NAME: &'static str = "QueryDenomsMetadataResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomMetadataRequest {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryDenomMetadataRequest {
const NAME: &'static str = "QueryDenomMetadataRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomMetadataResponse {
#[prost(message, optional, tag = "1")]
pub metadata: ::core::option::Option<Metadata>,
}
impl ::prost::Name for QueryDenomMetadataResponse {
const NAME: &'static str = "QueryDenomMetadataResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomOwnersRequest {
#[prost(string, tag = "1")]
pub denom: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryDenomOwnersRequest {
const NAME: &'static str = "QueryDenomOwnersRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DenomOwner {
#[prost(string, tag = "1")]
pub address: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
}
impl ::prost::Name for DenomOwner {
const NAME: &'static str = "DenomOwner";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryDenomOwnersResponse {
#[prost(message, repeated, tag = "1")]
pub denom_owners: ::prost::alloc::vec::Vec<DenomOwner>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryDenomOwnersResponse {
const NAME: &'static str = "QueryDenomOwnersResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySendEnabledRequest {
#[prost(string, repeated, tag = "1")]
pub denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "99")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QuerySendEnabledRequest {
const NAME: &'static str = "QuerySendEnabledRequest";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QuerySendEnabledResponse {
#[prost(message, repeated, tag = "1")]
pub send_enabled: ::prost::alloc::vec::Vec<SendEnabled>,
#[prost(message, optional, tag = "99")]
pub pagination: ::core::option::Option<
super::super::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QuerySendEnabledResponse {
const NAME: &'static str = "QuerySendEnabledResponse";
const PACKAGE: &'static str = "cosmos.bank.v1beta1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME)
}
}
#[cfg(feature = "rpc")]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
impl QueryClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> QueryClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
QueryClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn balance(
&mut self,
request: impl tonic::IntoRequest<super::QueryBalanceRequest>,
) -> std::result::Result<
tonic::Response<super::QueryBalanceResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/Balance",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Balance"));
self.inner.unary(req, path, codec).await
}
pub async fn all_balances(
&mut self,
request: impl tonic::IntoRequest<super::QueryAllBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAllBalancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/AllBalances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "AllBalances"));
self.inner.unary(req, path, codec).await
}
pub async fn spendable_balances(
&mut self,
request: impl tonic::IntoRequest<super::QuerySpendableBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySpendableBalancesResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/SpendableBalances",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("cosmos.bank.v1beta1.Query", "SpendableBalances"),
);
self.inner.unary(req, path, codec).await
}
pub async fn spendable_balance_by_denom(
&mut self,
request: impl tonic::IntoRequest<super::QuerySpendableBalanceByDenomRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySpendableBalanceByDenomResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"cosmos.bank.v1beta1.Query",
"SpendableBalanceByDenom",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn total_supply(
&mut self,
request: impl tonic::IntoRequest<super::QueryTotalSupplyRequest>,
) -> std::result::Result<
tonic::Response<super::QueryTotalSupplyResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/TotalSupply",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "TotalSupply"));
self.inner.unary(req, path, codec).await
}
pub async fn supply_of(
&mut self,
request: impl tonic::IntoRequest<super::QuerySupplyOfRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySupplyOfResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/SupplyOf",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "SupplyOf"));
self.inner.unary(req, path, codec).await
}
pub async fn params(
&mut self,
request: impl tonic::IntoRequest<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/Params",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Params"));
self.inner.unary(req, path, codec).await
}
pub async fn denom_metadata(
&mut self,
request: impl tonic::IntoRequest<super::QueryDenomMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomMetadataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/DenomMetadata",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomMetadata"));
self.inner.unary(req, path, codec).await
}
pub async fn denoms_metadata(
&mut self,
request: impl tonic::IntoRequest<super::QueryDenomsMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomsMetadataResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/DenomsMetadata",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomsMetadata"));
self.inner.unary(req, path, codec).await
}
pub async fn denom_owners(
&mut self,
request: impl tonic::IntoRequest<super::QueryDenomOwnersRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomOwnersResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/DenomOwners",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwners"));
self.inner.unary(req, path, codec).await
}
pub async fn send_enabled(
&mut self,
request: impl tonic::IntoRequest<super::QuerySendEnabledRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySendEnabledResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/cosmos.bank.v1beta1.Query/SendEnabled",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "SendEnabled"));
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "rpc")]
pub mod query_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Query: Send + Sync + 'static {
async fn balance(
&self,
request: tonic::Request<super::QueryBalanceRequest>,
) -> std::result::Result<
tonic::Response<super::QueryBalanceResponse>,
tonic::Status,
>;
async fn all_balances(
&self,
request: tonic::Request<super::QueryAllBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::QueryAllBalancesResponse>,
tonic::Status,
>;
async fn spendable_balances(
&self,
request: tonic::Request<super::QuerySpendableBalancesRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySpendableBalancesResponse>,
tonic::Status,
>;
async fn spendable_balance_by_denom(
&self,
request: tonic::Request<super::QuerySpendableBalanceByDenomRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySpendableBalanceByDenomResponse>,
tonic::Status,
>;
async fn total_supply(
&self,
request: tonic::Request<super::QueryTotalSupplyRequest>,
) -> std::result::Result<
tonic::Response<super::QueryTotalSupplyResponse>,
tonic::Status,
>;
async fn supply_of(
&self,
request: tonic::Request<super::QuerySupplyOfRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySupplyOfResponse>,
tonic::Status,
>;
async fn params(
&self,
request: tonic::Request<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
>;
async fn denom_metadata(
&self,
request: tonic::Request<super::QueryDenomMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomMetadataResponse>,
tonic::Status,
>;
async fn denoms_metadata(
&self,
request: tonic::Request<super::QueryDenomsMetadataRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomsMetadataResponse>,
tonic::Status,
>;
async fn denom_owners(
&self,
request: tonic::Request<super::QueryDenomOwnersRequest>,
) -> std::result::Result<
tonic::Response<super::QueryDenomOwnersResponse>,
tonic::Status,
>;
async fn send_enabled(
&self,
request: tonic::Request<super::QuerySendEnabledRequest>,
) -> std::result::Result<
tonic::Response<super::QuerySendEnabledResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Query> QueryServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
where
T: Query,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.bank.v1beta1.Query/Balance" => {
#[allow(non_camel_case_types)]
struct BalanceSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryBalanceRequest>
for BalanceSvc<T> {
type Response = super::QueryBalanceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryBalanceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::balance(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = BalanceSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/AllBalances" => {
#[allow(non_camel_case_types)]
struct AllBalancesSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryAllBalancesRequest>
for AllBalancesSvc<T> {
type Response = super::QueryAllBalancesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryAllBalancesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::all_balances(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = AllBalancesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/SpendableBalances" => {
#[allow(non_camel_case_types)]
struct SpendableBalancesSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QuerySpendableBalancesRequest>
for SpendableBalancesSvc<T> {
type Response = super::QuerySpendableBalancesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QuerySpendableBalancesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::spendable_balances(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SpendableBalancesSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/SpendableBalanceByDenom" => {
#[allow(non_camel_case_types)]
struct SpendableBalanceByDenomSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QuerySpendableBalanceByDenomRequest,
> for SpendableBalanceByDenomSvc<T> {
type Response = super::QuerySpendableBalanceByDenomResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QuerySpendableBalanceByDenomRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::spendable_balance_by_denom(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SpendableBalanceByDenomSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/TotalSupply" => {
#[allow(non_camel_case_types)]
struct TotalSupplySvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryTotalSupplyRequest>
for TotalSupplySvc<T> {
type Response = super::QueryTotalSupplyResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryTotalSupplyRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::total_supply(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = TotalSupplySvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/SupplyOf" => {
#[allow(non_camel_case_types)]
struct SupplyOfSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QuerySupplyOfRequest>
for SupplyOfSvc<T> {
type Response = super::QuerySupplyOfResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QuerySupplyOfRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::supply_of(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SupplyOfSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/Params" => {
#[allow(non_camel_case_types)]
struct ParamsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
for ParamsSvc<T> {
type Response = super::QueryParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ParamsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/DenomMetadata" => {
#[allow(non_camel_case_types)]
struct DenomMetadataSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDenomMetadataRequest>
for DenomMetadataSvc<T> {
type Response = super::QueryDenomMetadataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryDenomMetadataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::denom_metadata(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DenomMetadataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/DenomsMetadata" => {
#[allow(non_camel_case_types)]
struct DenomsMetadataSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDenomsMetadataRequest>
for DenomsMetadataSvc<T> {
type Response = super::QueryDenomsMetadataResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryDenomsMetadataRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::denoms_metadata(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DenomsMetadataSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/DenomOwners" => {
#[allow(non_camel_case_types)]
struct DenomOwnersSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryDenomOwnersRequest>
for DenomOwnersSvc<T> {
type Response = super::QueryDenomOwnersResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryDenomOwnersRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::denom_owners(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = DenomOwnersSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.bank.v1beta1.Query/SendEnabled" => {
#[allow(non_camel_case_types)]
struct SendEnabledSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QuerySendEnabledRequest>
for SendEnabledSvc<T> {
type Response = super::QuerySendEnabledResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QuerySendEnabledRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::send_enabled(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = SendEnabledSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Query> Clone for QueryServer<T> {
fn clone(&self) -> Self {
let inner = self.inner.clone();
Self {
inner,
accept_compression_encodings: self.accept_compression_encodings,
send_compression_encodings: self.send_compression_encodings,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
impl<T: Query> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Query> tonic::server::NamedService for QueryServer<T> {
const NAME: &'static str = "cosmos.bank.v1beta1.Query";
}
}