/// EventGrant is emitted on Msg/Grant #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { /// Msg type URL for which an autorization is granted #[prost(string, tag = "2")] pub msg_type_url: ::prost::alloc::string::String, /// Granter account address #[prost(string, tag = "3")] pub granter: ::prost::alloc::string::String, /// Grantee account address #[prost(string, tag = "4")] pub grantee: ::prost::alloc::string::String, } /// EventRevoke is emitted on Msg/Revoke #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventRevoke { /// Msg type URL for which an autorization is revoked #[prost(string, tag = "2")] pub msg_type_url: ::prost::alloc::string::String, /// Granter account address #[prost(string, tag = "3")] pub granter: ::prost::alloc::string::String, /// Grantee account address #[prost(string, tag = "4")] pub grantee: ::prost::alloc::string::String, } /// GenericAuthorization gives the grantee unrestricted permissions to execute /// the provided method on behalf of the granter's account. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenericAuthorization { /// Msg, identified by it's type URL, to grant unrestricted permissions to execute #[prost(string, tag = "1")] pub msg: ::prost::alloc::string::String, } /// Grant gives permissions to execute /// the provide method with expiration time. #[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>, /// time when the grant will expire and will be pruned. If null, then the grant /// doesn't have a time expiration (other conditions in `authorization` /// may apply to invalidate the grant) #[prost(message, optional, tag = "2")] pub expiration: ::core::option::Option<::prost_types::Timestamp>, } /// GrantAuthorization extends a grant with both the addresses of the grantee and granter. /// It is used in genesis.proto and query.proto #[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>, } /// GrantQueueItem contains the list of TypeURL of a sdk.Msg. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantQueueItem { /// msg_type_urls contains the list of TypeURL of a sdk.Msg. #[prost(string, repeated, tag = "1")] pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// GenesisState defines the authz module's genesis state. #[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, } /// QueryGrantsRequest is the request type for the Query/Grants RPC method. #[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, /// Optional, msg_type_url, when set, will query only grants matching given msg type. #[prost(string, tag = "3")] pub msg_type_url: ::prost::alloc::string::String, /// pagination defines an pagination for the request. #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option, } /// QueryGrantsResponse is the response type for the Query/Authorizations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGrantsResponse { /// authorizations is a list of grants granted for grantee by granter. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryGranterGrantsRequest is the request type for the Query/GranterGrants RPC method. #[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, /// pagination defines an pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryGranterGrantsResponse is the response type for the Query/GranterGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranterGrantsResponse { /// grants is a list of grants granted by the granter. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. #[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, /// pagination defines an pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// QueryGranteeGrantsResponse is the response type for the Query/GranteeGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsResponse { /// grants is a list of grants granted to the grantee. #[prost(message, repeated, tag = "1")] pub grants: ::prost::alloc::vec::Vec, /// pagination defines an pagination for the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// Generated client implementations. #[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::*; /// Query defines the gRPC querier service. #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + 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( inner: T, interceptor: F, ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Returns list of `Authorization`, granted to the grantee by the granter. pub async fn grants( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } /// GranterGrants returns list of `GrantAuthorization`, granted by granter. /// /// Since: cosmos-sdk 0.46 pub async fn granter_grants( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } /// GranteeGrants returns a list of `GrantAuthorization` by grantee. /// /// Since: cosmos-sdk 0.46 pub async fn grantee_grants( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } } } /// Generated server implementations. #[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::*; /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { /// Returns list of `Authorization`, granted to the grantee by the granter. async fn grants( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GranterGrants returns list of `GrantAuthorization`, granted by granter. /// /// Since: cosmos-sdk 0.46 async fn granter_grants( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GranteeGrants returns a list of `GrantAuthorization` by grantee. /// /// Since: cosmos-sdk 0.46 async fn grantee_grants( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query defines the gRPC querier service. #[derive(Debug)] pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for QueryServer where T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.authz.v1beta1.Query/Grants" => { #[allow(non_camel_case_types)] struct GrantsSvc(pub Arc); impl tonic::server::UnaryService for GrantsSvc { type Response = super::QueryGrantsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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(pub Arc); impl tonic::server::UnaryService for GranterGrantsSvc { type Response = super::QueryGranterGrantsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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(pub Arc); impl tonic::server::UnaryService for GranteeGrantsSvc { type Response = super::QueryGranteeGrantsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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 Clone for QueryServer { 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 Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "cosmos.authz.v1beta1.Query"; } } /// MsgGrant is a request type for Grant method. It declares authorization to the grantee /// on behalf of the granter with the provided expiration time. #[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, } /// MsgExecResponse defines the Msg/MsgExecResponse response type. #[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>, } /// MsgExec attempts to execute the provided messages using /// authorizations granted to the grantee. Each message should have only /// one signer corresponding to the granter of the authorization. #[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, /// Execute Msg. /// The x/authz will try to find a grant matching (msg.signers\[0\], grantee, MsgTypeURL(msg)) /// triple and validate it. #[prost(message, repeated, tag = "2")] pub msgs: ::prost::alloc::vec::Vec<::prost_types::Any>, } /// MsgGrantResponse defines the Msg/MsgGrant response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgGrantResponse {} /// MsgRevoke revokes any authorization with the provided sdk.Msg type on the /// granter's account with that has been granted to the grantee. #[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, } /// MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRevokeResponse {} /// Generated client implementations. #[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::*; /// Msg defines the authz Msg service. #[derive(Debug, Clone)] pub struct MsgClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + 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(inner: T, interceptor: F) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Grant grants the provided authorization to the grantee on the granter's /// account with the provided expiration time. If there is already a grant /// for the given (granter, grantee, Authorization) triple, then the grant /// will be overwritten. pub async fn grant( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } /// Exec attempts to execute the provided messages using /// authorizations granted to the grantee. Each message should have only /// one signer corresponding to the granter of the authorization. pub async fn exec( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } /// Revoke revokes any authorization corresponding to the provided method name on the /// granter's account that has been granted to the grantee. pub async fn revoke( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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 } } } /// Generated server implementations. #[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::*; /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] pub trait Msg: Send + Sync + 'static { /// Grant grants the provided authorization to the grantee on the granter's /// account with the provided expiration time. If there is already a grant /// for the given (granter, grantee, Authorization) triple, then the grant /// will be overwritten. async fn grant( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Exec attempts to execute the provided messages using /// authorizations granted to the grantee. Each message should have only /// one signer corresponding to the granter of the authorization. async fn exec( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Revoke revokes any authorization corresponding to the provided method name on the /// granter's account that has been granted to the grantee. async fn revoke( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the authz Msg service. #[derive(Debug)] pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for MsgServer where T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.authz.v1beta1.Msg/Grant" => { #[allow(non_camel_case_types)] struct GrantSvc(pub Arc); impl tonic::server::UnaryService for GrantSvc { type Response = super::MsgGrantResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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(pub Arc); impl tonic::server::UnaryService for ExecSvc { type Response = super::MsgExecResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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(pub Arc); impl tonic::server::UnaryService for RevokeSvc { type Response = super::MsgRevokeResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> 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 Clone for MsgServer { 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 Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "cosmos.authz.v1beta1.Msg"; } }