bitway_proto/prost/bitway/
bitway.farming.tonic.rs

1// @generated
2/// Generated client implementations.
3#[cfg(feature = "grpc")]
4pub mod query_client {
5    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
6    use tonic::codegen::http::Uri;
7    use tonic::codegen::*;
8    #[derive(Debug, Clone)]
9    pub struct QueryClient<T> {
10        inner: tonic::client::Grpc<T>,
11    }
12    #[cfg(feature = "grpc-transport")]
13    impl QueryClient<tonic::transport::Channel> {
14        /// Attempt to create a new client by connecting to a given endpoint.
15        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
16        where
17            D: TryInto<tonic::transport::Endpoint>,
18            D::Error: Into<StdError>,
19        {
20            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
21            Ok(Self::new(conn))
22        }
23    }
24    impl<T> QueryClient<T>
25    where
26        T: tonic::client::GrpcService<tonic::body::BoxBody>,
27        T::Error: Into<StdError>,
28        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
29        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
30    {
31        pub fn new(inner: T) -> Self {
32            let inner = tonic::client::Grpc::new(inner);
33            Self { inner }
34        }
35        pub fn with_origin(inner: T, origin: Uri) -> Self {
36            let inner = tonic::client::Grpc::with_origin(inner, origin);
37            Self { inner }
38        }
39        pub fn with_interceptor<F>(
40            inner: T,
41            interceptor: F,
42        ) -> QueryClient<InterceptedService<T, F>>
43        where
44            F: tonic::service::Interceptor,
45            T::ResponseBody: Default,
46            T: tonic::codegen::Service<
47                http::Request<tonic::body::BoxBody>,
48                Response = http::Response<
49                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
50                >,
51            >,
52            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
53                Into<StdError> + Send + Sync,
54        {
55            QueryClient::new(InterceptedService::new(inner, interceptor))
56        }
57        /// Compress requests with the given encoding.
58        ///
59        /// This requires the server to support it otherwise it might respond with an
60        /// error.
61        #[must_use]
62        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
63            self.inner = self.inner.send_compressed(encoding);
64            self
65        }
66        /// Enable decompressing responses.
67        #[must_use]
68        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
69            self.inner = self.inner.accept_compressed(encoding);
70            self
71        }
72        /// Limits the maximum size of a decoded message.
73        ///
74        /// Default: `4MB`
75        #[must_use]
76        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
77            self.inner = self.inner.max_decoding_message_size(limit);
78            self
79        }
80        /// Limits the maximum size of an encoded message.
81        ///
82        /// Default: `usize::MAX`
83        #[must_use]
84        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
85            self.inner = self.inner.max_encoding_message_size(limit);
86            self
87        }
88        pub async fn params(
89            &mut self,
90            request: impl tonic::IntoRequest<super::QueryParamsRequest>,
91        ) -> core::result::Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>
92        {
93            self.inner.ready().await.map_err(|e| {
94                tonic::Status::new(
95                    tonic::Code::Unknown,
96                    alloc::format!("Service was not ready: {}", e.into()),
97                )
98            })?;
99            let codec = tonic::codec::ProstCodec::default();
100            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/Params");
101            let mut req = request.into_request();
102            req.extensions_mut()
103                .insert(GrpcMethod::new("bitway.farming.Query", "Params"));
104            self.inner.unary(req, path, codec).await
105        }
106        pub async fn staking(
107            &mut self,
108            request: impl tonic::IntoRequest<super::QueryStakingRequest>,
109        ) -> core::result::Result<tonic::Response<super::QueryStakingResponse>, tonic::Status>
110        {
111            self.inner.ready().await.map_err(|e| {
112                tonic::Status::new(
113                    tonic::Code::Unknown,
114                    alloc::format!("Service was not ready: {}", e.into()),
115                )
116            })?;
117            let codec = tonic::codec::ProstCodec::default();
118            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/Staking");
119            let mut req = request.into_request();
120            req.extensions_mut()
121                .insert(GrpcMethod::new("bitway.farming.Query", "Staking"));
122            self.inner.unary(req, path, codec).await
123        }
124        pub async fn stakings(
125            &mut self,
126            request: impl tonic::IntoRequest<super::QueryStakingsRequest>,
127        ) -> core::result::Result<tonic::Response<super::QueryStakingsResponse>, tonic::Status>
128        {
129            self.inner.ready().await.map_err(|e| {
130                tonic::Status::new(
131                    tonic::Code::Unknown,
132                    alloc::format!("Service was not ready: {}", e.into()),
133                )
134            })?;
135            let codec = tonic::codec::ProstCodec::default();
136            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/Stakings");
137            let mut req = request.into_request();
138            req.extensions_mut()
139                .insert(GrpcMethod::new("bitway.farming.Query", "Stakings"));
140            self.inner.unary(req, path, codec).await
141        }
142        pub async fn stakings_by_address(
143            &mut self,
144            request: impl tonic::IntoRequest<super::QueryStakingsByAddressRequest>,
145        ) -> core::result::Result<
146            tonic::Response<super::QueryStakingsByAddressResponse>,
147            tonic::Status,
148        > {
149            self.inner.ready().await.map_err(|e| {
150                tonic::Status::new(
151                    tonic::Code::Unknown,
152                    alloc::format!("Service was not ready: {}", e.into()),
153                )
154            })?;
155            let codec = tonic::codec::ProstCodec::default();
156            let path =
157                http::uri::PathAndQuery::from_static("/bitway.farming.Query/StakingsByAddress");
158            let mut req = request.into_request();
159            req.extensions_mut()
160                .insert(GrpcMethod::new("bitway.farming.Query", "StakingsByAddress"));
161            self.inner.unary(req, path, codec).await
162        }
163        pub async fn total_staking(
164            &mut self,
165            request: impl tonic::IntoRequest<super::QueryTotalStakingRequest>,
166        ) -> core::result::Result<tonic::Response<super::QueryTotalStakingResponse>, tonic::Status>
167        {
168            self.inner.ready().await.map_err(|e| {
169                tonic::Status::new(
170                    tonic::Code::Unknown,
171                    alloc::format!("Service was not ready: {}", e.into()),
172                )
173            })?;
174            let codec = tonic::codec::ProstCodec::default();
175            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/TotalStaking");
176            let mut req = request.into_request();
177            req.extensions_mut()
178                .insert(GrpcMethod::new("bitway.farming.Query", "TotalStaking"));
179            self.inner.unary(req, path, codec).await
180        }
181        pub async fn current_epoch(
182            &mut self,
183            request: impl tonic::IntoRequest<super::QueryCurrentEpochRequest>,
184        ) -> core::result::Result<tonic::Response<super::QueryCurrentEpochResponse>, tonic::Status>
185        {
186            self.inner.ready().await.map_err(|e| {
187                tonic::Status::new(
188                    tonic::Code::Unknown,
189                    alloc::format!("Service was not ready: {}", e.into()),
190                )
191            })?;
192            let codec = tonic::codec::ProstCodec::default();
193            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/CurrentEpoch");
194            let mut req = request.into_request();
195            req.extensions_mut()
196                .insert(GrpcMethod::new("bitway.farming.Query", "CurrentEpoch"));
197            self.inner.unary(req, path, codec).await
198        }
199        pub async fn rewards(
200            &mut self,
201            request: impl tonic::IntoRequest<super::QueryRewardsRequest>,
202        ) -> core::result::Result<tonic::Response<super::QueryRewardsResponse>, tonic::Status>
203        {
204            self.inner.ready().await.map_err(|e| {
205                tonic::Status::new(
206                    tonic::Code::Unknown,
207                    alloc::format!("Service was not ready: {}", e.into()),
208                )
209            })?;
210            let codec = tonic::codec::ProstCodec::default();
211            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/Rewards");
212            let mut req = request.into_request();
213            req.extensions_mut()
214                .insert(GrpcMethod::new("bitway.farming.Query", "Rewards"));
215            self.inner.unary(req, path, codec).await
216        }
217        pub async fn pending_reward(
218            &mut self,
219            request: impl tonic::IntoRequest<super::QueryPendingRewardRequest>,
220        ) -> core::result::Result<tonic::Response<super::QueryPendingRewardResponse>, tonic::Status>
221        {
222            self.inner.ready().await.map_err(|e| {
223                tonic::Status::new(
224                    tonic::Code::Unknown,
225                    alloc::format!("Service was not ready: {}", e.into()),
226                )
227            })?;
228            let codec = tonic::codec::ProstCodec::default();
229            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Query/PendingReward");
230            let mut req = request.into_request();
231            req.extensions_mut()
232                .insert(GrpcMethod::new("bitway.farming.Query", "PendingReward"));
233            self.inner.unary(req, path, codec).await
234        }
235        pub async fn pending_reward_by_address(
236            &mut self,
237            request: impl tonic::IntoRequest<super::QueryPendingRewardByAddressRequest>,
238        ) -> core::result::Result<
239            tonic::Response<super::QueryPendingRewardByAddressResponse>,
240            tonic::Status,
241        > {
242            self.inner.ready().await.map_err(|e| {
243                tonic::Status::new(
244                    tonic::Code::Unknown,
245                    alloc::format!("Service was not ready: {}", e.into()),
246                )
247            })?;
248            let codec = tonic::codec::ProstCodec::default();
249            let path = http::uri::PathAndQuery::from_static(
250                "/bitway.farming.Query/PendingRewardByAddress",
251            );
252            let mut req = request.into_request();
253            req.extensions_mut().insert(GrpcMethod::new(
254                "bitway.farming.Query",
255                "PendingRewardByAddress",
256            ));
257            self.inner.unary(req, path, codec).await
258        }
259        pub async fn estimated_reward(
260            &mut self,
261            request: impl tonic::IntoRequest<super::QueryEstimatedRewardRequest>,
262        ) -> core::result::Result<tonic::Response<super::QueryEstimatedRewardResponse>, tonic::Status>
263        {
264            self.inner.ready().await.map_err(|e| {
265                tonic::Status::new(
266                    tonic::Code::Unknown,
267                    alloc::format!("Service was not ready: {}", e.into()),
268                )
269            })?;
270            let codec = tonic::codec::ProstCodec::default();
271            let path =
272                http::uri::PathAndQuery::from_static("/bitway.farming.Query/EstimatedReward");
273            let mut req = request.into_request();
274            req.extensions_mut()
275                .insert(GrpcMethod::new("bitway.farming.Query", "EstimatedReward"));
276            self.inner.unary(req, path, codec).await
277        }
278    }
279}
280/// Generated server implementations.
281#[cfg(feature = "grpc")]
282pub mod query_server {
283    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
284    use tonic::codegen::*;
285    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
286    #[async_trait]
287    pub trait Query: Send + Sync + 'static {
288        async fn params(
289            &self,
290            request: tonic::Request<super::QueryParamsRequest>,
291        ) -> core::result::Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
292        async fn staking(
293            &self,
294            request: tonic::Request<super::QueryStakingRequest>,
295        ) -> core::result::Result<tonic::Response<super::QueryStakingResponse>, tonic::Status>;
296        async fn stakings(
297            &self,
298            request: tonic::Request<super::QueryStakingsRequest>,
299        ) -> core::result::Result<tonic::Response<super::QueryStakingsResponse>, tonic::Status>;
300        async fn stakings_by_address(
301            &self,
302            request: tonic::Request<super::QueryStakingsByAddressRequest>,
303        ) -> core::result::Result<
304            tonic::Response<super::QueryStakingsByAddressResponse>,
305            tonic::Status,
306        >;
307        async fn total_staking(
308            &self,
309            request: tonic::Request<super::QueryTotalStakingRequest>,
310        ) -> core::result::Result<tonic::Response<super::QueryTotalStakingResponse>, tonic::Status>;
311        async fn current_epoch(
312            &self,
313            request: tonic::Request<super::QueryCurrentEpochRequest>,
314        ) -> core::result::Result<tonic::Response<super::QueryCurrentEpochResponse>, tonic::Status>;
315        async fn rewards(
316            &self,
317            request: tonic::Request<super::QueryRewardsRequest>,
318        ) -> core::result::Result<tonic::Response<super::QueryRewardsResponse>, tonic::Status>;
319        async fn pending_reward(
320            &self,
321            request: tonic::Request<super::QueryPendingRewardRequest>,
322        ) -> core::result::Result<tonic::Response<super::QueryPendingRewardResponse>, tonic::Status>;
323        async fn pending_reward_by_address(
324            &self,
325            request: tonic::Request<super::QueryPendingRewardByAddressRequest>,
326        ) -> core::result::Result<
327            tonic::Response<super::QueryPendingRewardByAddressResponse>,
328            tonic::Status,
329        >;
330        async fn estimated_reward(
331            &self,
332            request: tonic::Request<super::QueryEstimatedRewardRequest>,
333        ) -> core::result::Result<tonic::Response<super::QueryEstimatedRewardResponse>, tonic::Status>;
334    }
335    #[derive(Debug)]
336    pub struct QueryServer<T: Query> {
337        inner: _Inner<T>,
338        accept_compression_encodings: EnabledCompressionEncodings,
339        send_compression_encodings: EnabledCompressionEncodings,
340        max_decoding_message_size: Option<usize>,
341        max_encoding_message_size: Option<usize>,
342    }
343    struct _Inner<T>(Arc<T>);
344    impl<T: Query> QueryServer<T> {
345        pub fn new(inner: T) -> Self {
346            Self::from_arc(Arc::new(inner))
347        }
348        pub fn from_arc(inner: Arc<T>) -> Self {
349            let inner = _Inner(inner);
350            Self {
351                inner,
352                accept_compression_encodings: Default::default(),
353                send_compression_encodings: Default::default(),
354                max_decoding_message_size: None,
355                max_encoding_message_size: None,
356            }
357        }
358        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
359        where
360            F: tonic::service::Interceptor,
361        {
362            InterceptedService::new(Self::new(inner), interceptor)
363        }
364        /// Enable decompressing requests with the given encoding.
365        #[must_use]
366        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
367            self.accept_compression_encodings.enable(encoding);
368            self
369        }
370        /// Compress responses with the given encoding, if the client supports it.
371        #[must_use]
372        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
373            self.send_compression_encodings.enable(encoding);
374            self
375        }
376        /// Limits the maximum size of a decoded message.
377        ///
378        /// Default: `4MB`
379        #[must_use]
380        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
381            self.max_decoding_message_size = Some(limit);
382            self
383        }
384        /// Limits the maximum size of an encoded message.
385        ///
386        /// Default: `usize::MAX`
387        #[must_use]
388        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
389            self.max_encoding_message_size = Some(limit);
390            self
391        }
392    }
393    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
394    where
395        T: Query,
396        B: Body + Send + 'static,
397        B::Error: Into<StdError> + Send + 'static,
398    {
399        type Response = http::Response<tonic::body::BoxBody>;
400        type Error = std::convert::Infallible;
401        type Future = BoxFuture<Self::Response, Self::Error>;
402        fn poll_ready(
403            &mut self,
404            _cx: &mut Context<'_>,
405        ) -> Poll<core::result::Result<(), Self::Error>> {
406            Poll::Ready(Ok(()))
407        }
408        fn call(&mut self, req: http::Request<B>) -> Self::Future {
409            let inner = self.inner.clone();
410            match req.uri().path() {
411                "/bitway.farming.Query/Params" => {
412                    #[allow(non_camel_case_types)]
413                    struct ParamsSvc<T: Query>(pub Arc<T>);
414                    impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest> for ParamsSvc<T> {
415                        type Response = super::QueryParamsResponse;
416                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
417                        fn call(
418                            &mut self,
419                            request: tonic::Request<super::QueryParamsRequest>,
420                        ) -> Self::Future {
421                            let inner = Arc::clone(&self.0);
422                            let fut = async move { (*inner).params(request).await };
423                            Box::pin(fut)
424                        }
425                    }
426                    let accept_compression_encodings = self.accept_compression_encodings;
427                    let send_compression_encodings = self.send_compression_encodings;
428                    let max_decoding_message_size = self.max_decoding_message_size;
429                    let max_encoding_message_size = self.max_encoding_message_size;
430                    let inner = self.inner.clone();
431                    let fut = async move {
432                        let inner = inner.0;
433                        let method = ParamsSvc(inner);
434                        let codec = tonic::codec::ProstCodec::default();
435                        let mut grpc = tonic::server::Grpc::new(codec)
436                            .apply_compression_config(
437                                accept_compression_encodings,
438                                send_compression_encodings,
439                            )
440                            .apply_max_message_size_config(
441                                max_decoding_message_size,
442                                max_encoding_message_size,
443                            );
444                        let res = grpc.unary(method, req).await;
445                        Ok(res)
446                    };
447                    Box::pin(fut)
448                }
449                "/bitway.farming.Query/Staking" => {
450                    #[allow(non_camel_case_types)]
451                    struct StakingSvc<T: Query>(pub Arc<T>);
452                    impl<T: Query> tonic::server::UnaryService<super::QueryStakingRequest> for StakingSvc<T> {
453                        type Response = super::QueryStakingResponse;
454                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
455                        fn call(
456                            &mut self,
457                            request: tonic::Request<super::QueryStakingRequest>,
458                        ) -> Self::Future {
459                            let inner = Arc::clone(&self.0);
460                            let fut = async move { (*inner).staking(request).await };
461                            Box::pin(fut)
462                        }
463                    }
464                    let accept_compression_encodings = self.accept_compression_encodings;
465                    let send_compression_encodings = self.send_compression_encodings;
466                    let max_decoding_message_size = self.max_decoding_message_size;
467                    let max_encoding_message_size = self.max_encoding_message_size;
468                    let inner = self.inner.clone();
469                    let fut = async move {
470                        let inner = inner.0;
471                        let method = StakingSvc(inner);
472                        let codec = tonic::codec::ProstCodec::default();
473                        let mut grpc = tonic::server::Grpc::new(codec)
474                            .apply_compression_config(
475                                accept_compression_encodings,
476                                send_compression_encodings,
477                            )
478                            .apply_max_message_size_config(
479                                max_decoding_message_size,
480                                max_encoding_message_size,
481                            );
482                        let res = grpc.unary(method, req).await;
483                        Ok(res)
484                    };
485                    Box::pin(fut)
486                }
487                "/bitway.farming.Query/Stakings" => {
488                    #[allow(non_camel_case_types)]
489                    struct StakingsSvc<T: Query>(pub Arc<T>);
490                    impl<T: Query> tonic::server::UnaryService<super::QueryStakingsRequest> for StakingsSvc<T> {
491                        type Response = super::QueryStakingsResponse;
492                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
493                        fn call(
494                            &mut self,
495                            request: tonic::Request<super::QueryStakingsRequest>,
496                        ) -> Self::Future {
497                            let inner = Arc::clone(&self.0);
498                            let fut = async move { (*inner).stakings(request).await };
499                            Box::pin(fut)
500                        }
501                    }
502                    let accept_compression_encodings = self.accept_compression_encodings;
503                    let send_compression_encodings = self.send_compression_encodings;
504                    let max_decoding_message_size = self.max_decoding_message_size;
505                    let max_encoding_message_size = self.max_encoding_message_size;
506                    let inner = self.inner.clone();
507                    let fut = async move {
508                        let inner = inner.0;
509                        let method = StakingsSvc(inner);
510                        let codec = tonic::codec::ProstCodec::default();
511                        let mut grpc = tonic::server::Grpc::new(codec)
512                            .apply_compression_config(
513                                accept_compression_encodings,
514                                send_compression_encodings,
515                            )
516                            .apply_max_message_size_config(
517                                max_decoding_message_size,
518                                max_encoding_message_size,
519                            );
520                        let res = grpc.unary(method, req).await;
521                        Ok(res)
522                    };
523                    Box::pin(fut)
524                }
525                "/bitway.farming.Query/StakingsByAddress" => {
526                    #[allow(non_camel_case_types)]
527                    struct StakingsByAddressSvc<T: Query>(pub Arc<T>);
528                    impl<T: Query> tonic::server::UnaryService<super::QueryStakingsByAddressRequest>
529                        for StakingsByAddressSvc<T>
530                    {
531                        type Response = super::QueryStakingsByAddressResponse;
532                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
533                        fn call(
534                            &mut self,
535                            request: tonic::Request<super::QueryStakingsByAddressRequest>,
536                        ) -> Self::Future {
537                            let inner = Arc::clone(&self.0);
538                            let fut = async move { (*inner).stakings_by_address(request).await };
539                            Box::pin(fut)
540                        }
541                    }
542                    let accept_compression_encodings = self.accept_compression_encodings;
543                    let send_compression_encodings = self.send_compression_encodings;
544                    let max_decoding_message_size = self.max_decoding_message_size;
545                    let max_encoding_message_size = self.max_encoding_message_size;
546                    let inner = self.inner.clone();
547                    let fut = async move {
548                        let inner = inner.0;
549                        let method = StakingsByAddressSvc(inner);
550                        let codec = tonic::codec::ProstCodec::default();
551                        let mut grpc = tonic::server::Grpc::new(codec)
552                            .apply_compression_config(
553                                accept_compression_encodings,
554                                send_compression_encodings,
555                            )
556                            .apply_max_message_size_config(
557                                max_decoding_message_size,
558                                max_encoding_message_size,
559                            );
560                        let res = grpc.unary(method, req).await;
561                        Ok(res)
562                    };
563                    Box::pin(fut)
564                }
565                "/bitway.farming.Query/TotalStaking" => {
566                    #[allow(non_camel_case_types)]
567                    struct TotalStakingSvc<T: Query>(pub Arc<T>);
568                    impl<T: Query> tonic::server::UnaryService<super::QueryTotalStakingRequest> for TotalStakingSvc<T> {
569                        type Response = super::QueryTotalStakingResponse;
570                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
571                        fn call(
572                            &mut self,
573                            request: tonic::Request<super::QueryTotalStakingRequest>,
574                        ) -> Self::Future {
575                            let inner = Arc::clone(&self.0);
576                            let fut = async move { (*inner).total_staking(request).await };
577                            Box::pin(fut)
578                        }
579                    }
580                    let accept_compression_encodings = self.accept_compression_encodings;
581                    let send_compression_encodings = self.send_compression_encodings;
582                    let max_decoding_message_size = self.max_decoding_message_size;
583                    let max_encoding_message_size = self.max_encoding_message_size;
584                    let inner = self.inner.clone();
585                    let fut = async move {
586                        let inner = inner.0;
587                        let method = TotalStakingSvc(inner);
588                        let codec = tonic::codec::ProstCodec::default();
589                        let mut grpc = tonic::server::Grpc::new(codec)
590                            .apply_compression_config(
591                                accept_compression_encodings,
592                                send_compression_encodings,
593                            )
594                            .apply_max_message_size_config(
595                                max_decoding_message_size,
596                                max_encoding_message_size,
597                            );
598                        let res = grpc.unary(method, req).await;
599                        Ok(res)
600                    };
601                    Box::pin(fut)
602                }
603                "/bitway.farming.Query/CurrentEpoch" => {
604                    #[allow(non_camel_case_types)]
605                    struct CurrentEpochSvc<T: Query>(pub Arc<T>);
606                    impl<T: Query> tonic::server::UnaryService<super::QueryCurrentEpochRequest> for CurrentEpochSvc<T> {
607                        type Response = super::QueryCurrentEpochResponse;
608                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
609                        fn call(
610                            &mut self,
611                            request: tonic::Request<super::QueryCurrentEpochRequest>,
612                        ) -> Self::Future {
613                            let inner = Arc::clone(&self.0);
614                            let fut = async move { (*inner).current_epoch(request).await };
615                            Box::pin(fut)
616                        }
617                    }
618                    let accept_compression_encodings = self.accept_compression_encodings;
619                    let send_compression_encodings = self.send_compression_encodings;
620                    let max_decoding_message_size = self.max_decoding_message_size;
621                    let max_encoding_message_size = self.max_encoding_message_size;
622                    let inner = self.inner.clone();
623                    let fut = async move {
624                        let inner = inner.0;
625                        let method = CurrentEpochSvc(inner);
626                        let codec = tonic::codec::ProstCodec::default();
627                        let mut grpc = tonic::server::Grpc::new(codec)
628                            .apply_compression_config(
629                                accept_compression_encodings,
630                                send_compression_encodings,
631                            )
632                            .apply_max_message_size_config(
633                                max_decoding_message_size,
634                                max_encoding_message_size,
635                            );
636                        let res = grpc.unary(method, req).await;
637                        Ok(res)
638                    };
639                    Box::pin(fut)
640                }
641                "/bitway.farming.Query/Rewards" => {
642                    #[allow(non_camel_case_types)]
643                    struct RewardsSvc<T: Query>(pub Arc<T>);
644                    impl<T: Query> tonic::server::UnaryService<super::QueryRewardsRequest> for RewardsSvc<T> {
645                        type Response = super::QueryRewardsResponse;
646                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
647                        fn call(
648                            &mut self,
649                            request: tonic::Request<super::QueryRewardsRequest>,
650                        ) -> Self::Future {
651                            let inner = Arc::clone(&self.0);
652                            let fut = async move { (*inner).rewards(request).await };
653                            Box::pin(fut)
654                        }
655                    }
656                    let accept_compression_encodings = self.accept_compression_encodings;
657                    let send_compression_encodings = self.send_compression_encodings;
658                    let max_decoding_message_size = self.max_decoding_message_size;
659                    let max_encoding_message_size = self.max_encoding_message_size;
660                    let inner = self.inner.clone();
661                    let fut = async move {
662                        let inner = inner.0;
663                        let method = RewardsSvc(inner);
664                        let codec = tonic::codec::ProstCodec::default();
665                        let mut grpc = tonic::server::Grpc::new(codec)
666                            .apply_compression_config(
667                                accept_compression_encodings,
668                                send_compression_encodings,
669                            )
670                            .apply_max_message_size_config(
671                                max_decoding_message_size,
672                                max_encoding_message_size,
673                            );
674                        let res = grpc.unary(method, req).await;
675                        Ok(res)
676                    };
677                    Box::pin(fut)
678                }
679                "/bitway.farming.Query/PendingReward" => {
680                    #[allow(non_camel_case_types)]
681                    struct PendingRewardSvc<T: Query>(pub Arc<T>);
682                    impl<T: Query> tonic::server::UnaryService<super::QueryPendingRewardRequest>
683                        for PendingRewardSvc<T>
684                    {
685                        type Response = super::QueryPendingRewardResponse;
686                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
687                        fn call(
688                            &mut self,
689                            request: tonic::Request<super::QueryPendingRewardRequest>,
690                        ) -> Self::Future {
691                            let inner = Arc::clone(&self.0);
692                            let fut = async move { (*inner).pending_reward(request).await };
693                            Box::pin(fut)
694                        }
695                    }
696                    let accept_compression_encodings = self.accept_compression_encodings;
697                    let send_compression_encodings = self.send_compression_encodings;
698                    let max_decoding_message_size = self.max_decoding_message_size;
699                    let max_encoding_message_size = self.max_encoding_message_size;
700                    let inner = self.inner.clone();
701                    let fut = async move {
702                        let inner = inner.0;
703                        let method = PendingRewardSvc(inner);
704                        let codec = tonic::codec::ProstCodec::default();
705                        let mut grpc = tonic::server::Grpc::new(codec)
706                            .apply_compression_config(
707                                accept_compression_encodings,
708                                send_compression_encodings,
709                            )
710                            .apply_max_message_size_config(
711                                max_decoding_message_size,
712                                max_encoding_message_size,
713                            );
714                        let res = grpc.unary(method, req).await;
715                        Ok(res)
716                    };
717                    Box::pin(fut)
718                }
719                "/bitway.farming.Query/PendingRewardByAddress" => {
720                    #[allow(non_camel_case_types)]
721                    struct PendingRewardByAddressSvc<T: Query>(pub Arc<T>);
722                    impl<T: Query>
723                        tonic::server::UnaryService<super::QueryPendingRewardByAddressRequest>
724                        for PendingRewardByAddressSvc<T>
725                    {
726                        type Response = super::QueryPendingRewardByAddressResponse;
727                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
728                        fn call(
729                            &mut self,
730                            request: tonic::Request<super::QueryPendingRewardByAddressRequest>,
731                        ) -> Self::Future {
732                            let inner = Arc::clone(&self.0);
733                            let fut =
734                                async move { (*inner).pending_reward_by_address(request).await };
735                            Box::pin(fut)
736                        }
737                    }
738                    let accept_compression_encodings = self.accept_compression_encodings;
739                    let send_compression_encodings = self.send_compression_encodings;
740                    let max_decoding_message_size = self.max_decoding_message_size;
741                    let max_encoding_message_size = self.max_encoding_message_size;
742                    let inner = self.inner.clone();
743                    let fut = async move {
744                        let inner = inner.0;
745                        let method = PendingRewardByAddressSvc(inner);
746                        let codec = tonic::codec::ProstCodec::default();
747                        let mut grpc = tonic::server::Grpc::new(codec)
748                            .apply_compression_config(
749                                accept_compression_encodings,
750                                send_compression_encodings,
751                            )
752                            .apply_max_message_size_config(
753                                max_decoding_message_size,
754                                max_encoding_message_size,
755                            );
756                        let res = grpc.unary(method, req).await;
757                        Ok(res)
758                    };
759                    Box::pin(fut)
760                }
761                "/bitway.farming.Query/EstimatedReward" => {
762                    #[allow(non_camel_case_types)]
763                    struct EstimatedRewardSvc<T: Query>(pub Arc<T>);
764                    impl<T: Query> tonic::server::UnaryService<super::QueryEstimatedRewardRequest>
765                        for EstimatedRewardSvc<T>
766                    {
767                        type Response = super::QueryEstimatedRewardResponse;
768                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
769                        fn call(
770                            &mut self,
771                            request: tonic::Request<super::QueryEstimatedRewardRequest>,
772                        ) -> Self::Future {
773                            let inner = Arc::clone(&self.0);
774                            let fut = async move { (*inner).estimated_reward(request).await };
775                            Box::pin(fut)
776                        }
777                    }
778                    let accept_compression_encodings = self.accept_compression_encodings;
779                    let send_compression_encodings = self.send_compression_encodings;
780                    let max_decoding_message_size = self.max_decoding_message_size;
781                    let max_encoding_message_size = self.max_encoding_message_size;
782                    let inner = self.inner.clone();
783                    let fut = async move {
784                        let inner = inner.0;
785                        let method = EstimatedRewardSvc(inner);
786                        let codec = tonic::codec::ProstCodec::default();
787                        let mut grpc = tonic::server::Grpc::new(codec)
788                            .apply_compression_config(
789                                accept_compression_encodings,
790                                send_compression_encodings,
791                            )
792                            .apply_max_message_size_config(
793                                max_decoding_message_size,
794                                max_encoding_message_size,
795                            );
796                        let res = grpc.unary(method, req).await;
797                        Ok(res)
798                    };
799                    Box::pin(fut)
800                }
801                _ => Box::pin(async move {
802                    Ok(http::Response::builder()
803                        .status(200)
804                        .header("grpc-status", "12")
805                        .header("content-type", "application/grpc")
806                        .body(empty_body())
807                        .unwrap())
808                }),
809            }
810        }
811    }
812    impl<T: Query> Clone for QueryServer<T> {
813        fn clone(&self) -> Self {
814            let inner = self.inner.clone();
815            Self {
816                inner,
817                accept_compression_encodings: self.accept_compression_encodings,
818                send_compression_encodings: self.send_compression_encodings,
819                max_decoding_message_size: self.max_decoding_message_size,
820                max_encoding_message_size: self.max_encoding_message_size,
821            }
822        }
823    }
824    impl<T: Query> Clone for _Inner<T> {
825        fn clone(&self) -> Self {
826            Self(Arc::clone(&self.0))
827        }
828    }
829    impl<T: core::fmt::Debug> core::fmt::Debug for _Inner<T> {
830        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
831            write!(f, "{:?}", self.0)
832        }
833    }
834    impl<T: Query> tonic::server::NamedService for QueryServer<T> {
835        const NAME: &'static str = "bitway.farming.Query";
836    }
837}
838/// Generated client implementations.
839#[cfg(feature = "grpc")]
840pub mod msg_client {
841    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
842    use tonic::codegen::http::Uri;
843    use tonic::codegen::*;
844    #[derive(Debug, Clone)]
845    pub struct MsgClient<T> {
846        inner: tonic::client::Grpc<T>,
847    }
848    #[cfg(feature = "grpc-transport")]
849    impl MsgClient<tonic::transport::Channel> {
850        /// Attempt to create a new client by connecting to a given endpoint.
851        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
852        where
853            D: TryInto<tonic::transport::Endpoint>,
854            D::Error: Into<StdError>,
855        {
856            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
857            Ok(Self::new(conn))
858        }
859    }
860    impl<T> MsgClient<T>
861    where
862        T: tonic::client::GrpcService<tonic::body::BoxBody>,
863        T::Error: Into<StdError>,
864        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
865        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
866    {
867        pub fn new(inner: T) -> Self {
868            let inner = tonic::client::Grpc::new(inner);
869            Self { inner }
870        }
871        pub fn with_origin(inner: T, origin: Uri) -> Self {
872            let inner = tonic::client::Grpc::with_origin(inner, origin);
873            Self { inner }
874        }
875        pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
876        where
877            F: tonic::service::Interceptor,
878            T::ResponseBody: Default,
879            T: tonic::codegen::Service<
880                http::Request<tonic::body::BoxBody>,
881                Response = http::Response<
882                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
883                >,
884            >,
885            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
886                Into<StdError> + Send + Sync,
887        {
888            MsgClient::new(InterceptedService::new(inner, interceptor))
889        }
890        /// Compress requests with the given encoding.
891        ///
892        /// This requires the server to support it otherwise it might respond with an
893        /// error.
894        #[must_use]
895        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
896            self.inner = self.inner.send_compressed(encoding);
897            self
898        }
899        /// Enable decompressing responses.
900        #[must_use]
901        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
902            self.inner = self.inner.accept_compressed(encoding);
903            self
904        }
905        /// Limits the maximum size of a decoded message.
906        ///
907        /// Default: `4MB`
908        #[must_use]
909        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
910            self.inner = self.inner.max_decoding_message_size(limit);
911            self
912        }
913        /// Limits the maximum size of an encoded message.
914        ///
915        /// Default: `usize::MAX`
916        #[must_use]
917        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
918            self.inner = self.inner.max_encoding_message_size(limit);
919            self
920        }
921        pub async fn stake(
922            &mut self,
923            request: impl tonic::IntoRequest<super::MsgStake>,
924        ) -> core::result::Result<tonic::Response<super::MsgStakeResponse>, tonic::Status> {
925            self.inner.ready().await.map_err(|e| {
926                tonic::Status::new(
927                    tonic::Code::Unknown,
928                    alloc::format!("Service was not ready: {}", e.into()),
929                )
930            })?;
931            let codec = tonic::codec::ProstCodec::default();
932            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Msg/Stake");
933            let mut req = request.into_request();
934            req.extensions_mut()
935                .insert(GrpcMethod::new("bitway.farming.Msg", "Stake"));
936            self.inner.unary(req, path, codec).await
937        }
938        pub async fn unstake(
939            &mut self,
940            request: impl tonic::IntoRequest<super::MsgUnstake>,
941        ) -> core::result::Result<tonic::Response<super::MsgUnstakeResponse>, tonic::Status>
942        {
943            self.inner.ready().await.map_err(|e| {
944                tonic::Status::new(
945                    tonic::Code::Unknown,
946                    alloc::format!("Service was not ready: {}", e.into()),
947                )
948            })?;
949            let codec = tonic::codec::ProstCodec::default();
950            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Msg/Unstake");
951            let mut req = request.into_request();
952            req.extensions_mut()
953                .insert(GrpcMethod::new("bitway.farming.Msg", "Unstake"));
954            self.inner.unary(req, path, codec).await
955        }
956        pub async fn claim(
957            &mut self,
958            request: impl tonic::IntoRequest<super::MsgClaim>,
959        ) -> core::result::Result<tonic::Response<super::MsgClaimResponse>, tonic::Status> {
960            self.inner.ready().await.map_err(|e| {
961                tonic::Status::new(
962                    tonic::Code::Unknown,
963                    alloc::format!("Service was not ready: {}", e.into()),
964                )
965            })?;
966            let codec = tonic::codec::ProstCodec::default();
967            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Msg/Claim");
968            let mut req = request.into_request();
969            req.extensions_mut()
970                .insert(GrpcMethod::new("bitway.farming.Msg", "Claim"));
971            self.inner.unary(req, path, codec).await
972        }
973        pub async fn claim_all(
974            &mut self,
975            request: impl tonic::IntoRequest<super::MsgClaimAll>,
976        ) -> core::result::Result<tonic::Response<super::MsgClaimAllResponse>, tonic::Status>
977        {
978            self.inner.ready().await.map_err(|e| {
979                tonic::Status::new(
980                    tonic::Code::Unknown,
981                    alloc::format!("Service was not ready: {}", e.into()),
982                )
983            })?;
984            let codec = tonic::codec::ProstCodec::default();
985            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Msg/ClaimAll");
986            let mut req = request.into_request();
987            req.extensions_mut()
988                .insert(GrpcMethod::new("bitway.farming.Msg", "ClaimAll"));
989            self.inner.unary(req, path, codec).await
990        }
991        pub async fn update_params(
992            &mut self,
993            request: impl tonic::IntoRequest<super::MsgUpdateParams>,
994        ) -> core::result::Result<tonic::Response<super::MsgUpdateParamsResponse>, tonic::Status>
995        {
996            self.inner.ready().await.map_err(|e| {
997                tonic::Status::new(
998                    tonic::Code::Unknown,
999                    alloc::format!("Service was not ready: {}", e.into()),
1000                )
1001            })?;
1002            let codec = tonic::codec::ProstCodec::default();
1003            let path = http::uri::PathAndQuery::from_static("/bitway.farming.Msg/UpdateParams");
1004            let mut req = request.into_request();
1005            req.extensions_mut()
1006                .insert(GrpcMethod::new("bitway.farming.Msg", "UpdateParams"));
1007            self.inner.unary(req, path, codec).await
1008        }
1009    }
1010}
1011/// Generated server implementations.
1012#[cfg(feature = "grpc")]
1013pub mod msg_server {
1014    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1015    use tonic::codegen::*;
1016    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
1017    #[async_trait]
1018    pub trait Msg: Send + Sync + 'static {
1019        async fn stake(
1020            &self,
1021            request: tonic::Request<super::MsgStake>,
1022        ) -> core::result::Result<tonic::Response<super::MsgStakeResponse>, tonic::Status>;
1023        async fn unstake(
1024            &self,
1025            request: tonic::Request<super::MsgUnstake>,
1026        ) -> core::result::Result<tonic::Response<super::MsgUnstakeResponse>, tonic::Status>;
1027        async fn claim(
1028            &self,
1029            request: tonic::Request<super::MsgClaim>,
1030        ) -> core::result::Result<tonic::Response<super::MsgClaimResponse>, tonic::Status>;
1031        async fn claim_all(
1032            &self,
1033            request: tonic::Request<super::MsgClaimAll>,
1034        ) -> core::result::Result<tonic::Response<super::MsgClaimAllResponse>, tonic::Status>;
1035        async fn update_params(
1036            &self,
1037            request: tonic::Request<super::MsgUpdateParams>,
1038        ) -> core::result::Result<tonic::Response<super::MsgUpdateParamsResponse>, tonic::Status>;
1039    }
1040    #[derive(Debug)]
1041    pub struct MsgServer<T: Msg> {
1042        inner: _Inner<T>,
1043        accept_compression_encodings: EnabledCompressionEncodings,
1044        send_compression_encodings: EnabledCompressionEncodings,
1045        max_decoding_message_size: Option<usize>,
1046        max_encoding_message_size: Option<usize>,
1047    }
1048    struct _Inner<T>(Arc<T>);
1049    impl<T: Msg> MsgServer<T> {
1050        pub fn new(inner: T) -> Self {
1051            Self::from_arc(Arc::new(inner))
1052        }
1053        pub fn from_arc(inner: Arc<T>) -> Self {
1054            let inner = _Inner(inner);
1055            Self {
1056                inner,
1057                accept_compression_encodings: Default::default(),
1058                send_compression_encodings: Default::default(),
1059                max_decoding_message_size: None,
1060                max_encoding_message_size: None,
1061            }
1062        }
1063        pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
1064        where
1065            F: tonic::service::Interceptor,
1066        {
1067            InterceptedService::new(Self::new(inner), interceptor)
1068        }
1069        /// Enable decompressing requests with the given encoding.
1070        #[must_use]
1071        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1072            self.accept_compression_encodings.enable(encoding);
1073            self
1074        }
1075        /// Compress responses with the given encoding, if the client supports it.
1076        #[must_use]
1077        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1078            self.send_compression_encodings.enable(encoding);
1079            self
1080        }
1081        /// Limits the maximum size of a decoded message.
1082        ///
1083        /// Default: `4MB`
1084        #[must_use]
1085        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1086            self.max_decoding_message_size = Some(limit);
1087            self
1088        }
1089        /// Limits the maximum size of an encoded message.
1090        ///
1091        /// Default: `usize::MAX`
1092        #[must_use]
1093        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1094            self.max_encoding_message_size = Some(limit);
1095            self
1096        }
1097    }
1098    impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
1099    where
1100        T: Msg,
1101        B: Body + Send + 'static,
1102        B::Error: Into<StdError> + Send + 'static,
1103    {
1104        type Response = http::Response<tonic::body::BoxBody>;
1105        type Error = std::convert::Infallible;
1106        type Future = BoxFuture<Self::Response, Self::Error>;
1107        fn poll_ready(
1108            &mut self,
1109            _cx: &mut Context<'_>,
1110        ) -> Poll<core::result::Result<(), Self::Error>> {
1111            Poll::Ready(Ok(()))
1112        }
1113        fn call(&mut self, req: http::Request<B>) -> Self::Future {
1114            let inner = self.inner.clone();
1115            match req.uri().path() {
1116                "/bitway.farming.Msg/Stake" => {
1117                    #[allow(non_camel_case_types)]
1118                    struct StakeSvc<T: Msg>(pub Arc<T>);
1119                    impl<T: Msg> tonic::server::UnaryService<super::MsgStake> for StakeSvc<T> {
1120                        type Response = super::MsgStakeResponse;
1121                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1122                        fn call(
1123                            &mut self,
1124                            request: tonic::Request<super::MsgStake>,
1125                        ) -> Self::Future {
1126                            let inner = Arc::clone(&self.0);
1127                            let fut = async move { (*inner).stake(request).await };
1128                            Box::pin(fut)
1129                        }
1130                    }
1131                    let accept_compression_encodings = self.accept_compression_encodings;
1132                    let send_compression_encodings = self.send_compression_encodings;
1133                    let max_decoding_message_size = self.max_decoding_message_size;
1134                    let max_encoding_message_size = self.max_encoding_message_size;
1135                    let inner = self.inner.clone();
1136                    let fut = async move {
1137                        let inner = inner.0;
1138                        let method = StakeSvc(inner);
1139                        let codec = tonic::codec::ProstCodec::default();
1140                        let mut grpc = tonic::server::Grpc::new(codec)
1141                            .apply_compression_config(
1142                                accept_compression_encodings,
1143                                send_compression_encodings,
1144                            )
1145                            .apply_max_message_size_config(
1146                                max_decoding_message_size,
1147                                max_encoding_message_size,
1148                            );
1149                        let res = grpc.unary(method, req).await;
1150                        Ok(res)
1151                    };
1152                    Box::pin(fut)
1153                }
1154                "/bitway.farming.Msg/Unstake" => {
1155                    #[allow(non_camel_case_types)]
1156                    struct UnstakeSvc<T: Msg>(pub Arc<T>);
1157                    impl<T: Msg> tonic::server::UnaryService<super::MsgUnstake> for UnstakeSvc<T> {
1158                        type Response = super::MsgUnstakeResponse;
1159                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1160                        fn call(
1161                            &mut self,
1162                            request: tonic::Request<super::MsgUnstake>,
1163                        ) -> Self::Future {
1164                            let inner = Arc::clone(&self.0);
1165                            let fut = async move { (*inner).unstake(request).await };
1166                            Box::pin(fut)
1167                        }
1168                    }
1169                    let accept_compression_encodings = self.accept_compression_encodings;
1170                    let send_compression_encodings = self.send_compression_encodings;
1171                    let max_decoding_message_size = self.max_decoding_message_size;
1172                    let max_encoding_message_size = self.max_encoding_message_size;
1173                    let inner = self.inner.clone();
1174                    let fut = async move {
1175                        let inner = inner.0;
1176                        let method = UnstakeSvc(inner);
1177                        let codec = tonic::codec::ProstCodec::default();
1178                        let mut grpc = tonic::server::Grpc::new(codec)
1179                            .apply_compression_config(
1180                                accept_compression_encodings,
1181                                send_compression_encodings,
1182                            )
1183                            .apply_max_message_size_config(
1184                                max_decoding_message_size,
1185                                max_encoding_message_size,
1186                            );
1187                        let res = grpc.unary(method, req).await;
1188                        Ok(res)
1189                    };
1190                    Box::pin(fut)
1191                }
1192                "/bitway.farming.Msg/Claim" => {
1193                    #[allow(non_camel_case_types)]
1194                    struct ClaimSvc<T: Msg>(pub Arc<T>);
1195                    impl<T: Msg> tonic::server::UnaryService<super::MsgClaim> for ClaimSvc<T> {
1196                        type Response = super::MsgClaimResponse;
1197                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1198                        fn call(
1199                            &mut self,
1200                            request: tonic::Request<super::MsgClaim>,
1201                        ) -> Self::Future {
1202                            let inner = Arc::clone(&self.0);
1203                            let fut = async move { (*inner).claim(request).await };
1204                            Box::pin(fut)
1205                        }
1206                    }
1207                    let accept_compression_encodings = self.accept_compression_encodings;
1208                    let send_compression_encodings = self.send_compression_encodings;
1209                    let max_decoding_message_size = self.max_decoding_message_size;
1210                    let max_encoding_message_size = self.max_encoding_message_size;
1211                    let inner = self.inner.clone();
1212                    let fut = async move {
1213                        let inner = inner.0;
1214                        let method = ClaimSvc(inner);
1215                        let codec = tonic::codec::ProstCodec::default();
1216                        let mut grpc = tonic::server::Grpc::new(codec)
1217                            .apply_compression_config(
1218                                accept_compression_encodings,
1219                                send_compression_encodings,
1220                            )
1221                            .apply_max_message_size_config(
1222                                max_decoding_message_size,
1223                                max_encoding_message_size,
1224                            );
1225                        let res = grpc.unary(method, req).await;
1226                        Ok(res)
1227                    };
1228                    Box::pin(fut)
1229                }
1230                "/bitway.farming.Msg/ClaimAll" => {
1231                    #[allow(non_camel_case_types)]
1232                    struct ClaimAllSvc<T: Msg>(pub Arc<T>);
1233                    impl<T: Msg> tonic::server::UnaryService<super::MsgClaimAll> for ClaimAllSvc<T> {
1234                        type Response = super::MsgClaimAllResponse;
1235                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1236                        fn call(
1237                            &mut self,
1238                            request: tonic::Request<super::MsgClaimAll>,
1239                        ) -> Self::Future {
1240                            let inner = Arc::clone(&self.0);
1241                            let fut = async move { (*inner).claim_all(request).await };
1242                            Box::pin(fut)
1243                        }
1244                    }
1245                    let accept_compression_encodings = self.accept_compression_encodings;
1246                    let send_compression_encodings = self.send_compression_encodings;
1247                    let max_decoding_message_size = self.max_decoding_message_size;
1248                    let max_encoding_message_size = self.max_encoding_message_size;
1249                    let inner = self.inner.clone();
1250                    let fut = async move {
1251                        let inner = inner.0;
1252                        let method = ClaimAllSvc(inner);
1253                        let codec = tonic::codec::ProstCodec::default();
1254                        let mut grpc = tonic::server::Grpc::new(codec)
1255                            .apply_compression_config(
1256                                accept_compression_encodings,
1257                                send_compression_encodings,
1258                            )
1259                            .apply_max_message_size_config(
1260                                max_decoding_message_size,
1261                                max_encoding_message_size,
1262                            );
1263                        let res = grpc.unary(method, req).await;
1264                        Ok(res)
1265                    };
1266                    Box::pin(fut)
1267                }
1268                "/bitway.farming.Msg/UpdateParams" => {
1269                    #[allow(non_camel_case_types)]
1270                    struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
1271                    impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams> for UpdateParamsSvc<T> {
1272                        type Response = super::MsgUpdateParamsResponse;
1273                        type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1274                        fn call(
1275                            &mut self,
1276                            request: tonic::Request<super::MsgUpdateParams>,
1277                        ) -> Self::Future {
1278                            let inner = Arc::clone(&self.0);
1279                            let fut = async move { (*inner).update_params(request).await };
1280                            Box::pin(fut)
1281                        }
1282                    }
1283                    let accept_compression_encodings = self.accept_compression_encodings;
1284                    let send_compression_encodings = self.send_compression_encodings;
1285                    let max_decoding_message_size = self.max_decoding_message_size;
1286                    let max_encoding_message_size = self.max_encoding_message_size;
1287                    let inner = self.inner.clone();
1288                    let fut = async move {
1289                        let inner = inner.0;
1290                        let method = UpdateParamsSvc(inner);
1291                        let codec = tonic::codec::ProstCodec::default();
1292                        let mut grpc = tonic::server::Grpc::new(codec)
1293                            .apply_compression_config(
1294                                accept_compression_encodings,
1295                                send_compression_encodings,
1296                            )
1297                            .apply_max_message_size_config(
1298                                max_decoding_message_size,
1299                                max_encoding_message_size,
1300                            );
1301                        let res = grpc.unary(method, req).await;
1302                        Ok(res)
1303                    };
1304                    Box::pin(fut)
1305                }
1306                _ => Box::pin(async move {
1307                    Ok(http::Response::builder()
1308                        .status(200)
1309                        .header("grpc-status", "12")
1310                        .header("content-type", "application/grpc")
1311                        .body(empty_body())
1312                        .unwrap())
1313                }),
1314            }
1315        }
1316    }
1317    impl<T: Msg> Clone for MsgServer<T> {
1318        fn clone(&self) -> Self {
1319            let inner = self.inner.clone();
1320            Self {
1321                inner,
1322                accept_compression_encodings: self.accept_compression_encodings,
1323                send_compression_encodings: self.send_compression_encodings,
1324                max_decoding_message_size: self.max_decoding_message_size,
1325                max_encoding_message_size: self.max_encoding_message_size,
1326            }
1327        }
1328    }
1329    impl<T: Msg> Clone for _Inner<T> {
1330        fn clone(&self) -> Self {
1331            Self(Arc::clone(&self.0))
1332        }
1333    }
1334    impl<T: core::fmt::Debug> core::fmt::Debug for _Inner<T> {
1335        fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
1336            write!(f, "{:?}", self.0)
1337        }
1338    }
1339    impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
1340        const NAME: &'static str = "bitway.farming.Msg";
1341    }
1342}