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