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

1/// Minter represents the minting state.
2#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Minter {
5    /// current annual inflation rate
6    #[prost(string, tag = "1")]
7    pub inflation: ::prost::alloc::string::String,
8    /// current annual expected provisions
9    #[prost(string, tag = "2")]
10    pub annual_provisions: ::prost::alloc::string::String,
11}
12/// Params holds parameters for the mint module.
13#[allow(clippy::derive_partial_eq_without_eq)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct Params {
16    /// type of coin to mint
17    #[prost(string, tag = "1")]
18    pub mint_denom: ::prost::alloc::string::String,
19    /// maximum annual change in inflation rate
20    #[prost(string, tag = "2")]
21    pub inflation_rate_change: ::prost::alloc::string::String,
22    /// maximum inflation rate
23    #[prost(string, tag = "3")]
24    pub inflation_max: ::prost::alloc::string::String,
25    /// minimum inflation rate
26    #[prost(string, tag = "4")]
27    pub inflation_min: ::prost::alloc::string::String,
28    /// goal of percent bonded atoms
29    #[prost(string, tag = "5")]
30    pub goal_bonded: ::prost::alloc::string::String,
31    /// expected blocks per year
32    #[prost(uint64, tag = "6")]
33    pub blocks_per_year: u64,
34}
35/// QueryParamsRequest is the request type for the Query/Params RPC method.
36#[allow(clippy::derive_partial_eq_without_eq)]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct QueryParamsRequest {}
39/// QueryParamsResponse is the response type for the Query/Params RPC method.
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct QueryParamsResponse {
43    /// params defines the parameters of the module.
44    #[prost(message, optional, tag = "1")]
45    pub params: ::core::option::Option<Params>,
46}
47/// QueryInflationRequest is the request type for the Query/Inflation RPC method.
48#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct QueryInflationRequest {}
51/// QueryInflationResponse is the response type for the Query/Inflation RPC
52/// method.
53#[allow(clippy::derive_partial_eq_without_eq)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct QueryInflationResponse {
56    /// inflation is the current minting inflation value.
57    #[prost(bytes = "vec", tag = "1")]
58    pub inflation: ::prost::alloc::vec::Vec<u8>,
59}
60/// QueryAnnualProvisionsRequest is the request type for the
61/// Query/AnnualProvisions RPC method.
62#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct QueryAnnualProvisionsRequest {}
65/// QueryAnnualProvisionsResponse is the response type for the
66/// Query/AnnualProvisions RPC method.
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct QueryAnnualProvisionsResponse {
70    /// annual_provisions is the current minting annual provisions value.
71    #[prost(bytes = "vec", tag = "1")]
72    pub annual_provisions: ::prost::alloc::vec::Vec<u8>,
73}
74/// Generated client implementations.
75#[cfg(feature = "grpc")]
76#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
77pub mod query_client {
78    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
79    use tonic::codegen::http::Uri;
80    use tonic::codegen::*;
81    /// Query provides defines the gRPC querier service.
82    #[derive(Debug, Clone)]
83    pub struct QueryClient<T> {
84        inner: tonic::client::Grpc<T>,
85    }
86    #[cfg(feature = "grpc-transport")]
87    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
88    impl QueryClient<tonic::transport::Channel> {
89        /// Attempt to create a new client by connecting to a given endpoint.
90        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
91        where
92            D: std::convert::TryInto<tonic::transport::Endpoint>,
93            D::Error: Into<StdError>,
94        {
95            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
96            Ok(Self::new(conn))
97        }
98    }
99    impl<T> QueryClient<T>
100    where
101        T: tonic::client::GrpcService<tonic::body::BoxBody>,
102        T::Error: Into<StdError>,
103        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
104        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
105    {
106        pub fn new(inner: T) -> Self {
107            let inner = tonic::client::Grpc::new(inner);
108            Self { inner }
109        }
110        pub fn with_origin(inner: T, origin: Uri) -> Self {
111            let inner = tonic::client::Grpc::with_origin(inner, origin);
112            Self { inner }
113        }
114        pub fn with_interceptor<F>(
115            inner: T,
116            interceptor: F,
117        ) -> QueryClient<InterceptedService<T, F>>
118        where
119            F: tonic::service::Interceptor,
120            T::ResponseBody: Default,
121            T: tonic::codegen::Service<
122                http::Request<tonic::body::BoxBody>,
123                Response = http::Response<
124                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
125                >,
126            >,
127            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
128                Into<StdError> + Send + Sync,
129        {
130            QueryClient::new(InterceptedService::new(inner, interceptor))
131        }
132        /// Compress requests with the given encoding.
133        ///
134        /// This requires the server to support it otherwise it might respond with an
135        /// error.
136        #[must_use]
137        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
138            self.inner = self.inner.send_compressed(encoding);
139            self
140        }
141        /// Enable decompressing responses.
142        #[must_use]
143        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
144            self.inner = self.inner.accept_compressed(encoding);
145            self
146        }
147        /// Params returns the total set of minting parameters.
148        pub async fn params(
149            &mut self,
150            request: impl tonic::IntoRequest<super::QueryParamsRequest>,
151        ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
152            self.inner.ready().await.map_err(|e| {
153                tonic::Status::new(
154                    tonic::Code::Unknown,
155                    format!("Service was not ready: {}", e.into()),
156                )
157            })?;
158            let codec = tonic::codec::ProstCodec::default();
159            let path = http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Query/Params");
160            self.inner.unary(request.into_request(), path, codec).await
161        }
162        /// Inflation returns the current minting inflation value.
163        pub async fn inflation(
164            &mut self,
165            request: impl tonic::IntoRequest<super::QueryInflationRequest>,
166        ) -> Result<tonic::Response<super::QueryInflationResponse>, tonic::Status> {
167            self.inner.ready().await.map_err(|e| {
168                tonic::Status::new(
169                    tonic::Code::Unknown,
170                    format!("Service was not ready: {}", e.into()),
171                )
172            })?;
173            let codec = tonic::codec::ProstCodec::default();
174            let path = http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Query/Inflation");
175            self.inner.unary(request.into_request(), path, codec).await
176        }
177        /// AnnualProvisions current minting annual provisions value.
178        pub async fn annual_provisions(
179            &mut self,
180            request: impl tonic::IntoRequest<super::QueryAnnualProvisionsRequest>,
181        ) -> Result<tonic::Response<super::QueryAnnualProvisionsResponse>, tonic::Status> {
182            self.inner.ready().await.map_err(|e| {
183                tonic::Status::new(
184                    tonic::Code::Unknown,
185                    format!("Service was not ready: {}", e.into()),
186                )
187            })?;
188            let codec = tonic::codec::ProstCodec::default();
189            let path =
190                http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Query/AnnualProvisions");
191            self.inner.unary(request.into_request(), path, codec).await
192        }
193    }
194}
195/// Generated server implementations.
196#[cfg(feature = "grpc")]
197#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
198pub mod query_server {
199    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
200    use tonic::codegen::*;
201    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
202    #[async_trait]
203    pub trait Query: Send + Sync + 'static {
204        /// Params returns the total set of minting parameters.
205        async fn params(
206            &self,
207            request: tonic::Request<super::QueryParamsRequest>,
208        ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
209        /// Inflation returns the current minting inflation value.
210        async fn inflation(
211            &self,
212            request: tonic::Request<super::QueryInflationRequest>,
213        ) -> Result<tonic::Response<super::QueryInflationResponse>, tonic::Status>;
214        /// AnnualProvisions current minting annual provisions value.
215        async fn annual_provisions(
216            &self,
217            request: tonic::Request<super::QueryAnnualProvisionsRequest>,
218        ) -> Result<tonic::Response<super::QueryAnnualProvisionsResponse>, tonic::Status>;
219    }
220    /// Query provides defines the gRPC querier service.
221    #[derive(Debug)]
222    pub struct QueryServer<T: Query> {
223        inner: _Inner<T>,
224        accept_compression_encodings: EnabledCompressionEncodings,
225        send_compression_encodings: EnabledCompressionEncodings,
226    }
227    struct _Inner<T>(Arc<T>);
228    impl<T: Query> QueryServer<T> {
229        pub fn new(inner: T) -> Self {
230            Self::from_arc(Arc::new(inner))
231        }
232        pub fn from_arc(inner: Arc<T>) -> Self {
233            let inner = _Inner(inner);
234            Self {
235                inner,
236                accept_compression_encodings: Default::default(),
237                send_compression_encodings: Default::default(),
238            }
239        }
240        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
241        where
242            F: tonic::service::Interceptor,
243        {
244            InterceptedService::new(Self::new(inner), interceptor)
245        }
246        /// Enable decompressing requests with the given encoding.
247        #[must_use]
248        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
249            self.accept_compression_encodings.enable(encoding);
250            self
251        }
252        /// Compress responses with the given encoding, if the client supports it.
253        #[must_use]
254        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
255            self.send_compression_encodings.enable(encoding);
256            self
257        }
258    }
259    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
260    where
261        T: Query,
262        B: Body + Send + 'static,
263        B::Error: Into<StdError> + Send + 'static,
264    {
265        type Response = http::Response<tonic::body::BoxBody>;
266        type Error = std::convert::Infallible;
267        type Future = BoxFuture<Self::Response, Self::Error>;
268        fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
269            Poll::Ready(Ok(()))
270        }
271        fn call(&mut self, req: http::Request<B>) -> Self::Future {
272            let inner = self.inner.clone();
273            match req.uri().path() {
274                "/cosmos.mint.v1beta1.Query/Params" => {
275                    #[allow(non_camel_case_types)]
276                    struct ParamsSvc<T: Query>(pub Arc<T>);
277                    impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest> for ParamsSvc<T> {
278                        type Response = super::QueryParamsResponse;
279                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
280                        fn call(
281                            &mut self,
282                            request: tonic::Request<super::QueryParamsRequest>,
283                        ) -> Self::Future {
284                            let inner = self.0.clone();
285                            let fut = async move { (*inner).params(request).await };
286                            Box::pin(fut)
287                        }
288                    }
289                    let accept_compression_encodings = self.accept_compression_encodings;
290                    let send_compression_encodings = self.send_compression_encodings;
291                    let inner = self.inner.clone();
292                    let fut = async move {
293                        let inner = inner.0;
294                        let method = ParamsSvc(inner);
295                        let codec = tonic::codec::ProstCodec::default();
296                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
297                            accept_compression_encodings,
298                            send_compression_encodings,
299                        );
300                        let res = grpc.unary(method, req).await;
301                        Ok(res)
302                    };
303                    Box::pin(fut)
304                }
305                "/cosmos.mint.v1beta1.Query/Inflation" => {
306                    #[allow(non_camel_case_types)]
307                    struct InflationSvc<T: Query>(pub Arc<T>);
308                    impl<T: Query> tonic::server::UnaryService<super::QueryInflationRequest> for InflationSvc<T> {
309                        type Response = super::QueryInflationResponse;
310                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
311                        fn call(
312                            &mut self,
313                            request: tonic::Request<super::QueryInflationRequest>,
314                        ) -> Self::Future {
315                            let inner = self.0.clone();
316                            let fut = async move { (*inner).inflation(request).await };
317                            Box::pin(fut)
318                        }
319                    }
320                    let accept_compression_encodings = self.accept_compression_encodings;
321                    let send_compression_encodings = self.send_compression_encodings;
322                    let inner = self.inner.clone();
323                    let fut = async move {
324                        let inner = inner.0;
325                        let method = InflationSvc(inner);
326                        let codec = tonic::codec::ProstCodec::default();
327                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
328                            accept_compression_encodings,
329                            send_compression_encodings,
330                        );
331                        let res = grpc.unary(method, req).await;
332                        Ok(res)
333                    };
334                    Box::pin(fut)
335                }
336                "/cosmos.mint.v1beta1.Query/AnnualProvisions" => {
337                    #[allow(non_camel_case_types)]
338                    struct AnnualProvisionsSvc<T: Query>(pub Arc<T>);
339                    impl<T: Query> tonic::server::UnaryService<super::QueryAnnualProvisionsRequest>
340                        for AnnualProvisionsSvc<T>
341                    {
342                        type Response = super::QueryAnnualProvisionsResponse;
343                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
344                        fn call(
345                            &mut self,
346                            request: tonic::Request<super::QueryAnnualProvisionsRequest>,
347                        ) -> Self::Future {
348                            let inner = self.0.clone();
349                            let fut = async move { (*inner).annual_provisions(request).await };
350                            Box::pin(fut)
351                        }
352                    }
353                    let accept_compression_encodings = self.accept_compression_encodings;
354                    let send_compression_encodings = self.send_compression_encodings;
355                    let inner = self.inner.clone();
356                    let fut = async move {
357                        let inner = inner.0;
358                        let method = AnnualProvisionsSvc(inner);
359                        let codec = tonic::codec::ProstCodec::default();
360                        let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
361                            accept_compression_encodings,
362                            send_compression_encodings,
363                        );
364                        let res = grpc.unary(method, req).await;
365                        Ok(res)
366                    };
367                    Box::pin(fut)
368                }
369                _ => Box::pin(async move {
370                    Ok(http::Response::builder()
371                        .status(200)
372                        .header("grpc-status", "12")
373                        .header("content-type", "application/grpc")
374                        .body(empty_body())
375                        .unwrap())
376                }),
377            }
378        }
379    }
380    impl<T: Query> Clone for QueryServer<T> {
381        fn clone(&self) -> Self {
382            let inner = self.inner.clone();
383            Self {
384                inner,
385                accept_compression_encodings: self.accept_compression_encodings,
386                send_compression_encodings: self.send_compression_encodings,
387            }
388        }
389    }
390    impl<T: Query> Clone for _Inner<T> {
391        fn clone(&self) -> Self {
392            Self(self.0.clone())
393        }
394    }
395    impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
396        fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
397            write!(f, "{:?}", self.0)
398        }
399    }
400    impl<T: Query> tonic::server::NamedService for QueryServer<T> {
401        const NAME: &'static str = "cosmos.mint.v1beta1.Query";
402    }
403}
404/// GenesisState defines the mint module's genesis state.
405#[allow(clippy::derive_partial_eq_without_eq)]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct GenesisState {
408    /// minter is a space for holding current inflation information.
409    #[prost(message, optional, tag = "1")]
410    pub minter: ::core::option::Option<Minter>,
411    /// params defines all the paramaters of the module.
412    #[prost(message, optional, tag = "2")]
413    pub params: ::core::option::Option<Params>,
414}