juno_rust_proto/prost/cosmos-sdk/
cosmos.feegrant.v1beta1.rs

1/// MsgGrantAllowance adds permission for Grantee to spend up to Allowance
2/// of fees from the account of Granter.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct MsgGrantAllowance {
6    /// granter is the address of the user granting an allowance of their funds.
7    #[prost(string, tag = "1")]
8    pub granter: ::prost::alloc::string::String,
9    /// grantee is the address of the user being granted an allowance of another user's funds.
10    #[prost(string, tag = "2")]
11    pub grantee: ::prost::alloc::string::String,
12    /// allowance can be any of basic and filtered fee allowance.
13    #[prost(message, optional, tag = "3")]
14    pub allowance: ::core::option::Option<::prost_types::Any>,
15}
16/// MsgGrantAllowanceResponse defines the Msg/GrantAllowanceResponse response type.
17#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct MsgGrantAllowanceResponse {}
20/// MsgRevokeAllowance removes any existing Allowance from Granter to Grantee.
21#[allow(clippy::derive_partial_eq_without_eq)]
22#[derive(Clone, PartialEq, ::prost::Message)]
23pub struct MsgRevokeAllowance {
24    /// granter is the address of the user granting an allowance of their funds.
25    #[prost(string, tag = "1")]
26    pub granter: ::prost::alloc::string::String,
27    /// grantee is the address of the user being granted an allowance of another user's funds.
28    #[prost(string, tag = "2")]
29    pub grantee: ::prost::alloc::string::String,
30}
31/// MsgRevokeAllowanceResponse defines the Msg/RevokeAllowanceResponse response type.
32#[allow(clippy::derive_partial_eq_without_eq)]
33#[derive(Clone, PartialEq, ::prost::Message)]
34pub struct MsgRevokeAllowanceResponse {}
35/// Generated client implementations.
36#[cfg(feature = "grpc")]
37#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
38pub mod msg_client {
39    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
40    use tonic::codegen::http::Uri;
41    use tonic::codegen::*;
42    /// Msg defines the feegrant msg service.
43    #[derive(Debug, Clone)]
44    pub struct MsgClient<T> {
45        inner: tonic::client::Grpc<T>,
46    }
47    #[cfg(feature = "grpc-transport")]
48    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
49    impl MsgClient<tonic::transport::Channel> {
50        /// Attempt to create a new client by connecting to a given endpoint.
51        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
52        where
53            D: std::convert::TryInto<tonic::transport::Endpoint>,
54            D::Error: Into<StdError>,
55        {
56            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
57            Ok(Self::new(conn))
58        }
59    }
60    impl<T> MsgClient<T>
61    where
62        T: tonic::client::GrpcService<tonic::body::BoxBody>,
63        T::Error: Into<StdError>,
64        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
65        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
66    {
67        pub fn new(inner: T) -> Self {
68            let inner = tonic::client::Grpc::new(inner);
69            Self { inner }
70        }
71        pub fn with_origin(inner: T, origin: Uri) -> Self {
72            let inner = tonic::client::Grpc::with_origin(inner, origin);
73            Self { inner }
74        }
75        pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
76        where
77            F: tonic::service::Interceptor,
78            T::ResponseBody: Default,
79            T: tonic::codegen::Service<
80                http::Request<tonic::body::BoxBody>,
81                Response = http::Response<
82                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
83                >,
84            >,
85            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
86                Into<StdError> + Send + Sync,
87        {
88            MsgClient::new(InterceptedService::new(inner, interceptor))
89        }
90        /// Compress requests with the given encoding.
91        ///
92        /// This requires the server to support it otherwise it might respond with an
93        /// error.
94        #[must_use]
95        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
96            self.inner = self.inner.send_compressed(encoding);
97            self
98        }
99        /// Enable decompressing responses.
100        #[must_use]
101        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
102            self.inner = self.inner.accept_compressed(encoding);
103            self
104        }
105        /// GrantAllowance grants fee allowance to the grantee on the granter's
106        /// account with the provided expiration time.
107        pub async fn grant_allowance(
108            &mut self,
109            request: impl tonic::IntoRequest<super::MsgGrantAllowance>,
110        ) -> Result<tonic::Response<super::MsgGrantAllowanceResponse>, tonic::Status> {
111            self.inner.ready().await.map_err(|e| {
112                tonic::Status::new(
113                    tonic::Code::Unknown,
114                    format!("Service was not ready: {}", e.into()),
115                )
116            })?;
117            let codec = tonic::codec::ProstCodec::default();
118            let path =
119                http::uri::PathAndQuery::from_static("/cosmos.feegrant.v1beta1.Msg/GrantAllowance");
120            self.inner.unary(request.into_request(), path, codec).await
121        }
122        /// RevokeAllowance revokes any fee allowance of granter's account that
123        /// has been granted to the grantee.
124        pub async fn revoke_allowance(
125            &mut self,
126            request: impl tonic::IntoRequest<super::MsgRevokeAllowance>,
127        ) -> Result<tonic::Response<super::MsgRevokeAllowanceResponse>, tonic::Status> {
128            self.inner.ready().await.map_err(|e| {
129                tonic::Status::new(
130                    tonic::Code::Unknown,
131                    format!("Service was not ready: {}", e.into()),
132                )
133            })?;
134            let codec = tonic::codec::ProstCodec::default();
135            let path = http::uri::PathAndQuery::from_static(
136                "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance",
137            );
138            self.inner.unary(request.into_request(), path, codec).await
139        }
140    }
141}
142/// Generated server implementations.
143#[cfg(feature = "grpc")]
144#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
145pub mod msg_server {
146    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
147    use tonic::codegen::*;
148    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
149    #[async_trait]
150    pub trait Msg: Send + Sync + 'static {
151        /// GrantAllowance grants fee allowance to the grantee on the granter's
152        /// account with the provided expiration time.
153        async fn grant_allowance(
154            &self,
155            request: tonic::Request<super::MsgGrantAllowance>,
156        ) -> Result<tonic::Response<super::MsgGrantAllowanceResponse>, tonic::Status>;
157        /// RevokeAllowance revokes any fee allowance of granter's account that
158        /// has been granted to the grantee.
159        async fn revoke_allowance(
160            &self,
161            request: tonic::Request<super::MsgRevokeAllowance>,
162        ) -> Result<tonic::Response<super::MsgRevokeAllowanceResponse>, tonic::Status>;
163    }
164    /// Msg defines the feegrant msg service.
165    #[derive(Debug)]
166    pub struct MsgServer<T: Msg> {
167        inner: _Inner<T>,
168        accept_compression_encodings: EnabledCompressionEncodings,
169        send_compression_encodings: EnabledCompressionEncodings,
170    }
171    struct _Inner<T>(Arc<T>);
172    impl<T: Msg> MsgServer<T> {
173        pub fn new(inner: T) -> Self {
174            Self::from_arc(Arc::new(inner))
175        }
176        pub fn from_arc(inner: Arc<T>) -> Self {
177            let inner = _Inner(inner);
178            Self {
179                inner,
180                accept_compression_encodings: Default::default(),
181                send_compression_encodings: Default::default(),
182            }
183        }
184        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
185        where
186            F: tonic::service::Interceptor,
187        {
188            InterceptedService::new(Self::new(inner), interceptor)
189        }
190        /// Enable decompressing requests with the given encoding.
191        #[must_use]
192        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
193            self.accept_compression_encodings.enable(encoding);
194            self
195        }
196        /// Compress responses with the given encoding, if the client supports it.
197        #[must_use]
198        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
199            self.send_compression_encodings.enable(encoding);
200            self
201        }
202    }
203    impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
204    where
205        T: Msg,
206        B: Body + Send + 'static,
207        B::Error: Into<StdError> + Send + 'static,
208    {
209        type Response = http::Response<tonic::body::BoxBody>;
210        type Error = std::convert::Infallible;
211        type Future = BoxFuture<Self::Response, Self::Error>;
212        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
213            Poll::Ready(Ok(()))
214        }
215        fn call(&mut self, req: http::Request<B>) -> Self::Future {
216            let inner = self.inner.clone();
217            match req.uri().path() {
218                "/cosmos.feegrant.v1beta1.Msg/GrantAllowance" => {
219                    #[allow(non_camel_case_types)]
220                    struct GrantAllowanceSvc<T: Msg>(pub Arc<T>);
221                    impl<T: Msg> tonic::server::UnaryService<super::MsgGrantAllowance> for GrantAllowanceSvc<T> {
222                        type Response = super::MsgGrantAllowanceResponse;
223                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
224                        fn call(
225                            &mut self,
226                            request: tonic::Request<super::MsgGrantAllowance>,
227                        ) -> Self::Future {
228                            let inner = self.0.clone();
229                            let fut = async move { (*inner).grant_allowance(request).await };
230                            Box::pin(fut)
231                        }
232                    }
233                    let accept_compression_encodings = self.accept_compression_encodings;
234                    let send_compression_encodings = self.send_compression_encodings;
235                    let inner = self.inner.clone();
236                    let fut = async move {
237                        let inner = inner.0;
238                        let method = GrantAllowanceSvc(inner);
239                        let codec = tonic::codec::ProstCodec::default();
240                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
241                            accept_compression_encodings,
242                            send_compression_encodings,
243                        );
244                        let res = grpc.unary(method, req).await;
245                        Ok(res)
246                    };
247                    Box::pin(fut)
248                }
249                "/cosmos.feegrant.v1beta1.Msg/RevokeAllowance" => {
250                    #[allow(non_camel_case_types)]
251                    struct RevokeAllowanceSvc<T: Msg>(pub Arc<T>);
252                    impl<T: Msg> tonic::server::UnaryService<super::MsgRevokeAllowance> for RevokeAllowanceSvc<T> {
253                        type Response = super::MsgRevokeAllowanceResponse;
254                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
255                        fn call(
256                            &mut self,
257                            request: tonic::Request<super::MsgRevokeAllowance>,
258                        ) -> Self::Future {
259                            let inner = self.0.clone();
260                            let fut = async move { (*inner).revoke_allowance(request).await };
261                            Box::pin(fut)
262                        }
263                    }
264                    let accept_compression_encodings = self.accept_compression_encodings;
265                    let send_compression_encodings = self.send_compression_encodings;
266                    let inner = self.inner.clone();
267                    let fut = async move {
268                        let inner = inner.0;
269                        let method = RevokeAllowanceSvc(inner);
270                        let codec = tonic::codec::ProstCodec::default();
271                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
272                            accept_compression_encodings,
273                            send_compression_encodings,
274                        );
275                        let res = grpc.unary(method, req).await;
276                        Ok(res)
277                    };
278                    Box::pin(fut)
279                }
280                _ => Box::pin(async move {
281                    Ok(http::Response::builder()
282                        .status(200)
283                        .header("grpc-status", "12")
284                        .header("content-type", "application/grpc")
285                        .body(empty_body())
286                        .unwrap())
287                }),
288            }
289        }
290    }
291    impl<T: Msg> Clone for MsgServer<T> {
292        fn clone(&self) -> Self {
293            let inner = self.inner.clone();
294            Self {
295                inner,
296                accept_compression_encodings: self.accept_compression_encodings,
297                send_compression_encodings: self.send_compression_encodings,
298            }
299        }
300    }
301    impl<T: Msg> Clone for _Inner<T> {
302        fn clone(&self) -> Self {
303            Self(self.0.clone())
304        }
305    }
306    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
307        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
308            write!(f, "{:?}", self.0)
309        }
310    }
311    impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
312        const NAME: &'static str = "cosmos.feegrant.v1beta1.Msg";
313    }
314}
315/// BasicAllowance implements Allowance with a one-time grant of tokens
316/// that optionally expires. The grantee can use up to SpendLimit to cover fees.
317#[allow(clippy::derive_partial_eq_without_eq)]
318#[derive(Clone, PartialEq, ::prost::Message)]
319pub struct BasicAllowance {
320    /// spend_limit specifies the maximum amount of tokens that can be spent
321    /// by this allowance and will be updated as tokens are spent. If it is
322    /// empty, there is no spend limit and any amount of coins can be spent.
323    #[prost(message, repeated, tag = "1")]
324    pub spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
325    /// expiration specifies an optional time when this allowance expires
326    #[prost(message, optional, tag = "2")]
327    pub expiration: ::core::option::Option<::prost_types::Timestamp>,
328}
329/// PeriodicAllowance extends Allowance to allow for both a maximum cap,
330/// as well as a limit per time period.
331#[allow(clippy::derive_partial_eq_without_eq)]
332#[derive(Clone, PartialEq, ::prost::Message)]
333pub struct PeriodicAllowance {
334    /// basic specifies a struct of `BasicAllowance`
335    #[prost(message, optional, tag = "1")]
336    pub basic: ::core::option::Option<BasicAllowance>,
337    /// period specifies the time duration in which period_spend_limit coins can
338    /// be spent before that allowance is reset
339    #[prost(message, optional, tag = "2")]
340    pub period: ::core::option::Option<::prost_types::Duration>,
341    /// period_spend_limit specifies the maximum number of coins that can be spent
342    /// in the period
343    #[prost(message, repeated, tag = "3")]
344    pub period_spend_limit: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
345    /// period_can_spend is the number of coins left to be spent before the period_reset time
346    #[prost(message, repeated, tag = "4")]
347    pub period_can_spend: ::prost::alloc::vec::Vec<super::super::base::v1beta1::Coin>,
348    /// period_reset is the time at which this period resets and a new one begins,
349    /// it is calculated from the start time of the first transaction after the
350    /// last period ended
351    #[prost(message, optional, tag = "5")]
352    pub period_reset: ::core::option::Option<::prost_types::Timestamp>,
353}
354/// AllowedMsgAllowance creates allowance only for specified message types.
355#[allow(clippy::derive_partial_eq_without_eq)]
356#[derive(Clone, PartialEq, ::prost::Message)]
357pub struct AllowedMsgAllowance {
358    /// allowance can be any of basic and filtered fee allowance.
359    #[prost(message, optional, tag = "1")]
360    pub allowance: ::core::option::Option<::prost_types::Any>,
361    /// allowed_messages are the messages for which the grantee has the access.
362    #[prost(string, repeated, tag = "2")]
363    pub allowed_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
364}
365/// Grant is stored in the KVStore to record a grant with full context
366#[allow(clippy::derive_partial_eq_without_eq)]
367#[derive(Clone, PartialEq, ::prost::Message)]
368pub struct Grant {
369    /// granter is the address of the user granting an allowance of their funds.
370    #[prost(string, tag = "1")]
371    pub granter: ::prost::alloc::string::String,
372    /// grantee is the address of the user being granted an allowance of another user's funds.
373    #[prost(string, tag = "2")]
374    pub grantee: ::prost::alloc::string::String,
375    /// allowance can be any of basic and filtered fee allowance.
376    #[prost(message, optional, tag = "3")]
377    pub allowance: ::core::option::Option<::prost_types::Any>,
378}
379/// QueryAllowanceRequest is the request type for the Query/Allowance RPC method.
380#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct QueryAllowanceRequest {
383    /// granter is the address of the user granting an allowance of their funds.
384    #[prost(string, tag = "1")]
385    pub granter: ::prost::alloc::string::String,
386    /// grantee is the address of the user being granted an allowance of another user's funds.
387    #[prost(string, tag = "2")]
388    pub grantee: ::prost::alloc::string::String,
389}
390/// QueryAllowanceResponse is the response type for the Query/Allowance RPC method.
391#[allow(clippy::derive_partial_eq_without_eq)]
392#[derive(Clone, PartialEq, ::prost::Message)]
393pub struct QueryAllowanceResponse {
394    /// allowance is a allowance granted for grantee by granter.
395    #[prost(message, optional, tag = "1")]
396    pub allowance: ::core::option::Option<Grant>,
397}
398/// QueryAllowancesRequest is the request type for the Query/Allowances RPC method.
399#[allow(clippy::derive_partial_eq_without_eq)]
400#[derive(Clone, PartialEq, ::prost::Message)]
401pub struct QueryAllowancesRequest {
402    #[prost(string, tag = "1")]
403    pub grantee: ::prost::alloc::string::String,
404    /// pagination defines an pagination for the request.
405    #[prost(message, optional, tag = "2")]
406    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
407}
408/// QueryAllowancesResponse is the response type for the Query/Allowances RPC method.
409#[allow(clippy::derive_partial_eq_without_eq)]
410#[derive(Clone, PartialEq, ::prost::Message)]
411pub struct QueryAllowancesResponse {
412    /// allowances are allowance's granted for grantee by granter.
413    #[prost(message, repeated, tag = "1")]
414    pub allowances: ::prost::alloc::vec::Vec<Grant>,
415    /// pagination defines an pagination for the response.
416    #[prost(message, optional, tag = "2")]
417    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
418}
419/// Generated client implementations.
420#[cfg(feature = "grpc")]
421#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
422pub mod query_client {
423    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
424    use tonic::codegen::http::Uri;
425    use tonic::codegen::*;
426    /// Query defines the gRPC querier service.
427    #[derive(Debug, Clone)]
428    pub struct QueryClient<T> {
429        inner: tonic::client::Grpc<T>,
430    }
431    #[cfg(feature = "grpc-transport")]
432    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
433    impl QueryClient<tonic::transport::Channel> {
434        /// Attempt to create a new client by connecting to a given endpoint.
435        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
436        where
437            D: std::convert::TryInto<tonic::transport::Endpoint>,
438            D::Error: Into<StdError>,
439        {
440            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
441            Ok(Self::new(conn))
442        }
443    }
444    impl<T> QueryClient<T>
445    where
446        T: tonic::client::GrpcService<tonic::body::BoxBody>,
447        T::Error: Into<StdError>,
448        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
449        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
450    {
451        pub fn new(inner: T) -> Self {
452            let inner = tonic::client::Grpc::new(inner);
453            Self { inner }
454        }
455        pub fn with_origin(inner: T, origin: Uri) -> Self {
456            let inner = tonic::client::Grpc::with_origin(inner, origin);
457            Self { inner }
458        }
459        pub fn with_interceptor<F>(
460            inner: T,
461            interceptor: F,
462        ) -> QueryClient<InterceptedService<T, F>>
463        where
464            F: tonic::service::Interceptor,
465            T::ResponseBody: Default,
466            T: tonic::codegen::Service<
467                http::Request<tonic::body::BoxBody>,
468                Response = http::Response<
469                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
470                >,
471            >,
472            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
473                Into<StdError> + Send + Sync,
474        {
475            QueryClient::new(InterceptedService::new(inner, interceptor))
476        }
477        /// Compress requests with the given encoding.
478        ///
479        /// This requires the server to support it otherwise it might respond with an
480        /// error.
481        #[must_use]
482        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
483            self.inner = self.inner.send_compressed(encoding);
484            self
485        }
486        /// Enable decompressing responses.
487        #[must_use]
488        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
489            self.inner = self.inner.accept_compressed(encoding);
490            self
491        }
492        /// Allowance returns fee granted to the grantee by the granter.
493        pub async fn allowance(
494            &mut self,
495            request: impl tonic::IntoRequest<super::QueryAllowanceRequest>,
496        ) -> Result<tonic::Response<super::QueryAllowanceResponse>, tonic::Status> {
497            self.inner.ready().await.map_err(|e| {
498                tonic::Status::new(
499                    tonic::Code::Unknown,
500                    format!("Service was not ready: {}", e.into()),
501                )
502            })?;
503            let codec = tonic::codec::ProstCodec::default();
504            let path =
505                http::uri::PathAndQuery::from_static("/cosmos.feegrant.v1beta1.Query/Allowance");
506            self.inner.unary(request.into_request(), path, codec).await
507        }
508        /// Allowances returns all the grants for address.
509        pub async fn allowances(
510            &mut self,
511            request: impl tonic::IntoRequest<super::QueryAllowancesRequest>,
512        ) -> Result<tonic::Response<super::QueryAllowancesResponse>, tonic::Status> {
513            self.inner.ready().await.map_err(|e| {
514                tonic::Status::new(
515                    tonic::Code::Unknown,
516                    format!("Service was not ready: {}", e.into()),
517                )
518            })?;
519            let codec = tonic::codec::ProstCodec::default();
520            let path =
521                http::uri::PathAndQuery::from_static("/cosmos.feegrant.v1beta1.Query/Allowances");
522            self.inner.unary(request.into_request(), path, codec).await
523        }
524    }
525}
526/// Generated server implementations.
527#[cfg(feature = "grpc")]
528#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
529pub mod query_server {
530    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
531    use tonic::codegen::*;
532    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
533    #[async_trait]
534    pub trait Query: Send + Sync + 'static {
535        /// Allowance returns fee granted to the grantee by the granter.
536        async fn allowance(
537            &self,
538            request: tonic::Request<super::QueryAllowanceRequest>,
539        ) -> Result<tonic::Response<super::QueryAllowanceResponse>, tonic::Status>;
540        /// Allowances returns all the grants for address.
541        async fn allowances(
542            &self,
543            request: tonic::Request<super::QueryAllowancesRequest>,
544        ) -> Result<tonic::Response<super::QueryAllowancesResponse>, tonic::Status>;
545    }
546    /// Query defines the gRPC querier service.
547    #[derive(Debug)]
548    pub struct QueryServer<T: Query> {
549        inner: _Inner<T>,
550        accept_compression_encodings: EnabledCompressionEncodings,
551        send_compression_encodings: EnabledCompressionEncodings,
552    }
553    struct _Inner<T>(Arc<T>);
554    impl<T: Query> QueryServer<T> {
555        pub fn new(inner: T) -> Self {
556            Self::from_arc(Arc::new(inner))
557        }
558        pub fn from_arc(inner: Arc<T>) -> Self {
559            let inner = _Inner(inner);
560            Self {
561                inner,
562                accept_compression_encodings: Default::default(),
563                send_compression_encodings: Default::default(),
564            }
565        }
566        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
567        where
568            F: tonic::service::Interceptor,
569        {
570            InterceptedService::new(Self::new(inner), interceptor)
571        }
572        /// Enable decompressing requests with the given encoding.
573        #[must_use]
574        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
575            self.accept_compression_encodings.enable(encoding);
576            self
577        }
578        /// Compress responses with the given encoding, if the client supports it.
579        #[must_use]
580        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
581            self.send_compression_encodings.enable(encoding);
582            self
583        }
584    }
585    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
586    where
587        T: Query,
588        B: Body + Send + 'static,
589        B::Error: Into<StdError> + Send + 'static,
590    {
591        type Response = http::Response<tonic::body::BoxBody>;
592        type Error = std::convert::Infallible;
593        type Future = BoxFuture<Self::Response, Self::Error>;
594        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
595            Poll::Ready(Ok(()))
596        }
597        fn call(&mut self, req: http::Request<B>) -> Self::Future {
598            let inner = self.inner.clone();
599            match req.uri().path() {
600                "/cosmos.feegrant.v1beta1.Query/Allowance" => {
601                    #[allow(non_camel_case_types)]
602                    struct AllowanceSvc<T: Query>(pub Arc<T>);
603                    impl<T: Query> tonic::server::UnaryService<super::QueryAllowanceRequest> for AllowanceSvc<T> {
604                        type Response = super::QueryAllowanceResponse;
605                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
606                        fn call(
607                            &mut self,
608                            request: tonic::Request<super::QueryAllowanceRequest>,
609                        ) -> Self::Future {
610                            let inner = self.0.clone();
611                            let fut = async move { (*inner).allowance(request).await };
612                            Box::pin(fut)
613                        }
614                    }
615                    let accept_compression_encodings = self.accept_compression_encodings;
616                    let send_compression_encodings = self.send_compression_encodings;
617                    let inner = self.inner.clone();
618                    let fut = async move {
619                        let inner = inner.0;
620                        let method = AllowanceSvc(inner);
621                        let codec = tonic::codec::ProstCodec::default();
622                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
623                            accept_compression_encodings,
624                            send_compression_encodings,
625                        );
626                        let res = grpc.unary(method, req).await;
627                        Ok(res)
628                    };
629                    Box::pin(fut)
630                }
631                "/cosmos.feegrant.v1beta1.Query/Allowances" => {
632                    #[allow(non_camel_case_types)]
633                    struct AllowancesSvc<T: Query>(pub Arc<T>);
634                    impl<T: Query> tonic::server::UnaryService<super::QueryAllowancesRequest> for AllowancesSvc<T> {
635                        type Response = super::QueryAllowancesResponse;
636                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
637                        fn call(
638                            &mut self,
639                            request: tonic::Request<super::QueryAllowancesRequest>,
640                        ) -> Self::Future {
641                            let inner = self.0.clone();
642                            let fut = async move { (*inner).allowances(request).await };
643                            Box::pin(fut)
644                        }
645                    }
646                    let accept_compression_encodings = self.accept_compression_encodings;
647                    let send_compression_encodings = self.send_compression_encodings;
648                    let inner = self.inner.clone();
649                    let fut = async move {
650                        let inner = inner.0;
651                        let method = AllowancesSvc(inner);
652                        let codec = tonic::codec::ProstCodec::default();
653                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
654                            accept_compression_encodings,
655                            send_compression_encodings,
656                        );
657                        let res = grpc.unary(method, req).await;
658                        Ok(res)
659                    };
660                    Box::pin(fut)
661                }
662                _ => Box::pin(async move {
663                    Ok(http::Response::builder()
664                        .status(200)
665                        .header("grpc-status", "12")
666                        .header("content-type", "application/grpc")
667                        .body(empty_body())
668                        .unwrap())
669                }),
670            }
671        }
672    }
673    impl<T: Query> Clone for QueryServer<T> {
674        fn clone(&self) -> Self {
675            let inner = self.inner.clone();
676            Self {
677                inner,
678                accept_compression_encodings: self.accept_compression_encodings,
679                send_compression_encodings: self.send_compression_encodings,
680            }
681        }
682    }
683    impl<T: Query> Clone for _Inner<T> {
684        fn clone(&self) -> Self {
685            Self(self.0.clone())
686        }
687    }
688    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
689        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
690            write!(f, "{:?}", self.0)
691        }
692    }
693    impl<T: Query> tonic::server::NamedService for QueryServer<T> {
694        const NAME: &'static str = "cosmos.feegrant.v1beta1.Query";
695    }
696}
697/// GenesisState contains a set of fee allowances, persisted from the store
698#[allow(clippy::derive_partial_eq_without_eq)]
699#[derive(Clone, PartialEq, ::prost::Message)]
700pub struct GenesisState {
701    #[prost(message, repeated, tag = "1")]
702    pub allowances: ::prost::alloc::vec::Vec<Grant>,
703}