#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventGrant {
#[prost(string, tag = "2")]
pub msg_type_url: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub grantee: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventRevoke {
#[prost(string, tag = "2")]
pub msg_type_url: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub grantee: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenericAuthorization {
#[prost(string, tag = "1")]
pub msg: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Grant {
#[prost(message, optional, tag = "1")]
pub authorization: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "2")]
pub expiration: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GrantAuthorization {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub authorization: ::core::option::Option<::prost_types::Any>,
#[prost(message, optional, tag = "4")]
pub expiration: ::core::option::Option<::prost_types::Timestamp>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgGrant {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "3")]
pub grant: ::core::option::Option<Grant>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgExecResponse {
#[prost(bytes = "vec", repeated, tag = "1")]
pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgExec {
#[prost(string, tag = "1")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub msgs: ::prost::alloc::vec::Vec<::prost_types::Any>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgGrantResponse {}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRevoke {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub msg_type_url: ::prost::alloc::string::String,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRevokeResponse {}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
pub mod msg_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
#[cfg(feature = "grpc-transport")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
impl MsgClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MsgClient<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) -> MsgClient<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,
{
MsgClient::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
}
pub async fn grant(
&mut self,
request: impl tonic::IntoRequest<super::MsgGrant>,
) -> Result<tonic::Response<super::MsgGrantResponse>, 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.authz.v1beta1.Msg/Grant");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn exec(
&mut self,
request: impl tonic::IntoRequest<super::MsgExec>,
) -> Result<tonic::Response<super::MsgExecResponse>, 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.authz.v1beta1.Msg/Exec");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn revoke(
&mut self,
request: impl tonic::IntoRequest<super::MsgRevoke>,
) -> Result<tonic::Response<super::MsgRevokeResponse>, 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.authz.v1beta1.Msg/Revoke");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
pub mod msg_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Msg: Send + Sync + 'static {
async fn grant(
&self,
request: tonic::Request<super::MsgGrant>,
) -> Result<tonic::Response<super::MsgGrantResponse>, tonic::Status>;
async fn exec(
&self,
request: tonic::Request<super::MsgExec>,
) -> Result<tonic::Response<super::MsgExecResponse>, tonic::Status>;
async fn revoke(
&self,
request: tonic::Request<super::MsgRevoke>,
) -> Result<tonic::Response<super::MsgRevokeResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct MsgServer<T: Msg> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Msg> MsgServer<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(),
}
}
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
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
where
T: Msg,
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<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.authz.v1beta1.Msg/Grant" => {
#[allow(non_camel_case_types)]
struct GrantSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgGrant> for GrantSvc<T> {
type Response = super::MsgGrantResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::MsgGrant>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).grant(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GrantSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.authz.v1beta1.Msg/Exec" => {
#[allow(non_camel_case_types)]
struct ExecSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgExec> for ExecSvc<T> {
type Response = super::MsgExecResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::MsgExec>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).exec(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = ExecSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.authz.v1beta1.Msg/Revoke" => {
#[allow(non_camel_case_types)]
struct RevokeSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgRevoke> for RevokeSvc<T> {
type Response = super::MsgRevokeResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::MsgRevoke>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).revoke(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = RevokeSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
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: Msg> Clone for MsgServer<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,
}
}
}
impl<T: Msg> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
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: Msg> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = "cosmos.authz.v1beta1.Msg";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGrantsRequest {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub grantee: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub msg_type_url: ::prost::alloc::string::String,
#[prost(message, optional, tag = "4")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGrantsResponse {
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<Grant>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGranterGrantsRequest {
#[prost(string, tag = "1")]
pub granter: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGranterGrantsResponse {
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<GrantAuthorization>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGranteeGrantsRequest {
#[prost(string, tag = "1")]
pub grantee: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryGranteeGrantsResponse {
#[prost(message, repeated, tag = "1")]
pub grants: ::prost::alloc::vec::Vec<GrantAuthorization>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
pub mod query_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::http::Uri;
use tonic::codegen::*;
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
#[cfg(feature = "grpc-transport")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
impl QueryClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::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
}
pub async fn grants(
&mut self,
request: impl tonic::IntoRequest<super::QueryGrantsRequest>,
) -> Result<tonic::Response<super::QueryGrantsResponse>, 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.authz.v1beta1.Query/Grants");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn granter_grants(
&mut self,
request: impl tonic::IntoRequest<super::QueryGranterGrantsRequest>,
) -> Result<tonic::Response<super::QueryGranterGrantsResponse>, 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.authz.v1beta1.Query/GranterGrants");
self.inner.unary(request.into_request(), path, codec).await
}
pub async fn grantee_grants(
&mut self,
request: impl tonic::IntoRequest<super::QueryGranteeGrantsRequest>,
) -> Result<tonic::Response<super::QueryGranteeGrantsResponse>, 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.authz.v1beta1.Query/GranteeGrants");
self.inner.unary(request.into_request(), path, codec).await
}
}
}
#[cfg(feature = "grpc")]
#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
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 grants(
&self,
request: tonic::Request<super::QueryGrantsRequest>,
) -> Result<tonic::Response<super::QueryGrantsResponse>, tonic::Status>;
async fn granter_grants(
&self,
request: tonic::Request<super::QueryGranterGrantsRequest>,
) -> Result<tonic::Response<super::QueryGranterGrantsResponse>, tonic::Status>;
async fn grantee_grants(
&self,
request: tonic::Request<super::QueryGranteeGrantsRequest>,
) -> Result<tonic::Response<super::QueryGranteeGrantsResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
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(),
}
}
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
}
}
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<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.authz.v1beta1.Query/Grants" => {
#[allow(non_camel_case_types)]
struct GrantsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryGrantsRequest> for GrantsSvc<T> {
type Response = super::QueryGrantsResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::QueryGrantsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).grants(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GrantsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.authz.v1beta1.Query/GranterGrants" => {
#[allow(non_camel_case_types)]
struct GranterGrantsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryGranterGrantsRequest>
for GranterGrantsSvc<T>
{
type Response = super::QueryGranterGrantsResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::QueryGranterGrantsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).granter_grants(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GranterGrantsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/cosmos.authz.v1beta1.Query/GranteeGrants" => {
#[allow(non_camel_case_types)]
struct GranteeGrantsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryGranteeGrantsRequest>
for GranteeGrantsSvc<T>
{
type Response = super::QueryGranteeGrantsResponse;
type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
fn call(
&mut self,
request: tonic::Request<super::QueryGranteeGrantsRequest>,
) -> Self::Future {
let inner = self.0.clone();
let fut = async move { (*inner).grantee_grants(request).await };
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let inner = self.inner.clone();
let fut = async move {
let inner = inner.0;
let method = GranteeGrantsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
);
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,
}
}
}
impl<T: Query> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
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.authz.v1beta1.Query";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, repeated, tag = "1")]
pub authorization: ::prost::alloc::vec::Vec<GrantAuthorization>,
}