1#[allow(clippy::derive_partial_eq_without_eq)]
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct Minter {
5 #[prost(string, tag = "1")]
7 pub inflation: ::prost::alloc::string::String,
8 #[prost(string, tag = "2")]
10 pub annual_provisions: ::prost::alloc::string::String,
11}
12#[allow(clippy::derive_partial_eq_without_eq)]
14#[derive(Clone, PartialEq, ::prost::Message)]
15pub struct Params {
16 #[prost(string, tag = "1")]
18 pub mint_denom: ::prost::alloc::string::String,
19 #[prost(string, tag = "2")]
21 pub inflation_rate_change: ::prost::alloc::string::String,
22 #[prost(string, tag = "3")]
24 pub inflation_max: ::prost::alloc::string::String,
25 #[prost(string, tag = "4")]
27 pub inflation_min: ::prost::alloc::string::String,
28 #[prost(string, tag = "5")]
30 pub goal_bonded: ::prost::alloc::string::String,
31 #[prost(uint64, tag = "6")]
33 pub blocks_per_year: u64,
34}
35#[allow(clippy::derive_partial_eq_without_eq)]
37#[derive(Clone, PartialEq, ::prost::Message)]
38pub struct QueryParamsRequest {}
39#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct QueryParamsResponse {
43 #[prost(message, optional, tag = "1")]
45 pub params: ::core::option::Option<Params>,
46}
47#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, PartialEq, ::prost::Message)]
50pub struct QueryInflationRequest {}
51#[allow(clippy::derive_partial_eq_without_eq)]
54#[derive(Clone, PartialEq, ::prost::Message)]
55pub struct QueryInflationResponse {
56 #[prost(bytes = "vec", tag = "1")]
58 pub inflation: ::prost::alloc::vec::Vec<u8>,
59}
60#[allow(clippy::derive_partial_eq_without_eq)]
63#[derive(Clone, PartialEq, ::prost::Message)]
64pub struct QueryAnnualProvisionsRequest {}
65#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct QueryAnnualProvisionsResponse {
70 #[prost(bytes = "vec", tag = "1")]
72 pub annual_provisions: ::prost::alloc::vec::Vec<u8>,
73}
74#[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 #[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 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 #[must_use]
137 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
138 self.inner = self.inner.send_compressed(encoding);
139 self
140 }
141 #[must_use]
143 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
144 self.inner = self.inner.accept_compressed(encoding);
145 self
146 }
147 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 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 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#[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 #[async_trait]
203 pub trait Query: Send + Sync + 'static {
204 async fn params(
206 &self,
207 request: tonic::Request<super::QueryParamsRequest>,
208 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
209 async fn inflation(
211 &self,
212 request: tonic::Request<super::QueryInflationRequest>,
213 ) -> Result<tonic::Response<super::QueryInflationResponse>, tonic::Status>;
214 async fn annual_provisions(
216 &self,
217 request: tonic::Request<super::QueryAnnualProvisionsRequest>,
218 ) -> Result<tonic::Response<super::QueryAnnualProvisionsResponse>, tonic::Status>;
219 }
220 #[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 #[must_use]
248 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
249 self.accept_compression_encodings.enable(encoding);
250 self
251 }
252 #[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#[allow(clippy::derive_partial_eq_without_eq)]
406#[derive(Clone, PartialEq, ::prost::Message)]
407pub struct GenesisState {
408 #[prost(message, optional, tag = "1")]
410 pub minter: ::core::option::Option<Minter>,
411 #[prost(message, optional, tag = "2")]
413 pub params: ::core::option::Option<Params>,
414}