1#[allow(clippy::derive_partial_eq_without_eq)]
6#[derive(Clone, PartialEq, ::prost::Message)]
7pub struct HistoricalInfo {
8 #[prost(message, optional, tag = "1")]
9 pub header: ::core::option::Option<::tendermint_proto::types::Header>,
10 #[prost(message, repeated, tag = "2")]
11 pub valset: ::prost::alloc::vec::Vec<Validator>,
12}
13#[allow(clippy::derive_partial_eq_without_eq)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct CommissionRates {
18 #[prost(string, tag = "1")]
20 pub rate: ::prost::alloc::string::String,
21 #[prost(string, tag = "2")]
23 pub max_rate: ::prost::alloc::string::String,
24 #[prost(string, tag = "3")]
26 pub max_change_rate: ::prost::alloc::string::String,
27}
28#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct Commission {
32 #[prost(message, optional, tag = "1")]
34 pub commission_rates: ::core::option::Option<CommissionRates>,
35 #[prost(message, optional, tag = "2")]
37 pub update_time: ::core::option::Option<::prost_types::Timestamp>,
38}
39#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct Description {
43 #[prost(string, tag = "1")]
45 pub moniker: ::prost::alloc::string::String,
46 #[prost(string, tag = "2")]
48 pub identity: ::prost::alloc::string::String,
49 #[prost(string, tag = "3")]
51 pub website: ::prost::alloc::string::String,
52 #[prost(string, tag = "4")]
54 pub security_contact: ::prost::alloc::string::String,
55 #[prost(string, tag = "5")]
57 pub details: ::prost::alloc::string::String,
58}
59#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct Validator {
70 #[prost(string, tag = "1")]
72 pub operator_address: ::prost::alloc::string::String,
73 #[prost(message, optional, tag = "2")]
75 pub consensus_pubkey: ::core::option::Option<::prost_types::Any>,
76 #[prost(bool, tag = "3")]
78 pub jailed: bool,
79 #[prost(enumeration = "BondStatus", tag = "4")]
81 pub status: i32,
82 #[prost(string, tag = "5")]
84 pub tokens: ::prost::alloc::string::String,
85 #[prost(string, tag = "6")]
87 pub delegator_shares: ::prost::alloc::string::String,
88 #[prost(message, optional, tag = "7")]
90 pub description: ::core::option::Option<Description>,
91 #[prost(int64, tag = "8")]
93 pub unbonding_height: i64,
94 #[prost(message, optional, tag = "9")]
96 pub unbonding_time: ::core::option::Option<::prost_types::Timestamp>,
97 #[prost(message, optional, tag = "10")]
99 pub commission: ::core::option::Option<Commission>,
100 #[prost(string, tag = "11")]
102 pub min_self_delegation: ::prost::alloc::string::String,
103}
104#[allow(clippy::derive_partial_eq_without_eq)]
106#[derive(Clone, PartialEq, ::prost::Message)]
107pub struct ValAddresses {
108 #[prost(string, repeated, tag = "1")]
109 pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
110}
111#[allow(clippy::derive_partial_eq_without_eq)]
115#[derive(Clone, PartialEq, ::prost::Message)]
116pub struct DvPair {
117 #[prost(string, tag = "1")]
118 pub delegator_address: ::prost::alloc::string::String,
119 #[prost(string, tag = "2")]
120 pub validator_address: ::prost::alloc::string::String,
121}
122#[allow(clippy::derive_partial_eq_without_eq)]
124#[derive(Clone, PartialEq, ::prost::Message)]
125pub struct DvPairs {
126 #[prost(message, repeated, tag = "1")]
127 pub pairs: ::prost::alloc::vec::Vec<DvPair>,
128}
129#[allow(clippy::derive_partial_eq_without_eq)]
134#[derive(Clone, PartialEq, ::prost::Message)]
135pub struct DvvTriplet {
136 #[prost(string, tag = "1")]
137 pub delegator_address: ::prost::alloc::string::String,
138 #[prost(string, tag = "2")]
139 pub validator_src_address: ::prost::alloc::string::String,
140 #[prost(string, tag = "3")]
141 pub validator_dst_address: ::prost::alloc::string::String,
142}
143#[allow(clippy::derive_partial_eq_without_eq)]
145#[derive(Clone, PartialEq, ::prost::Message)]
146pub struct DvvTriplets {
147 #[prost(message, repeated, tag = "1")]
148 pub triplets: ::prost::alloc::vec::Vec<DvvTriplet>,
149}
150#[allow(clippy::derive_partial_eq_without_eq)]
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct Delegation {
156 #[prost(string, tag = "1")]
158 pub delegator_address: ::prost::alloc::string::String,
159 #[prost(string, tag = "2")]
161 pub validator_address: ::prost::alloc::string::String,
162 #[prost(string, tag = "3")]
164 pub shares: ::prost::alloc::string::String,
165}
166#[allow(clippy::derive_partial_eq_without_eq)]
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct UnbondingDelegation {
171 #[prost(string, tag = "1")]
173 pub delegator_address: ::prost::alloc::string::String,
174 #[prost(string, tag = "2")]
176 pub validator_address: ::prost::alloc::string::String,
177 #[prost(message, repeated, tag = "3")]
181 pub entries: ::prost::alloc::vec::Vec<UnbondingDelegationEntry>,
182}
183#[allow(clippy::derive_partial_eq_without_eq)]
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct UnbondingDelegationEntry {
187 #[prost(int64, tag = "1")]
189 pub creation_height: i64,
190 #[prost(message, optional, tag = "2")]
192 pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
193 #[prost(string, tag = "3")]
195 pub initial_balance: ::prost::alloc::string::String,
196 #[prost(string, tag = "4")]
198 pub balance: ::prost::alloc::string::String,
199}
200#[allow(clippy::derive_partial_eq_without_eq)]
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct RedelegationEntry {
204 #[prost(int64, tag = "1")]
206 pub creation_height: i64,
207 #[prost(message, optional, tag = "2")]
209 pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
210 #[prost(string, tag = "3")]
212 pub initial_balance: ::prost::alloc::string::String,
213 #[prost(string, tag = "4")]
215 pub shares_dst: ::prost::alloc::string::String,
216}
217#[allow(clippy::derive_partial_eq_without_eq)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct Redelegation {
222 #[prost(string, tag = "1")]
224 pub delegator_address: ::prost::alloc::string::String,
225 #[prost(string, tag = "2")]
227 pub validator_src_address: ::prost::alloc::string::String,
228 #[prost(string, tag = "3")]
230 pub validator_dst_address: ::prost::alloc::string::String,
231 #[prost(message, repeated, tag = "4")]
235 pub entries: ::prost::alloc::vec::Vec<RedelegationEntry>,
236}
237#[allow(clippy::derive_partial_eq_without_eq)]
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct Params {
241 #[prost(message, optional, tag = "1")]
243 pub unbonding_time: ::core::option::Option<::prost_types::Duration>,
244 #[prost(uint32, tag = "2")]
246 pub max_validators: u32,
247 #[prost(uint32, tag = "3")]
249 pub max_entries: u32,
250 #[prost(uint32, tag = "4")]
252 pub historical_entries: u32,
253 #[prost(string, tag = "5")]
255 pub bond_denom: ::prost::alloc::string::String,
256}
257#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct DelegationResponse {
262 #[prost(message, optional, tag = "1")]
263 pub delegation: ::core::option::Option<Delegation>,
264 #[prost(message, optional, tag = "2")]
265 pub balance: ::core::option::Option<super::super::base::v1beta1::Coin>,
266}
267#[allow(clippy::derive_partial_eq_without_eq)]
271#[derive(Clone, PartialEq, ::prost::Message)]
272pub struct RedelegationEntryResponse {
273 #[prost(message, optional, tag = "1")]
274 pub redelegation_entry: ::core::option::Option<RedelegationEntry>,
275 #[prost(string, tag = "4")]
276 pub balance: ::prost::alloc::string::String,
277}
278#[allow(clippy::derive_partial_eq_without_eq)]
282#[derive(Clone, PartialEq, ::prost::Message)]
283pub struct RedelegationResponse {
284 #[prost(message, optional, tag = "1")]
285 pub redelegation: ::core::option::Option<Redelegation>,
286 #[prost(message, repeated, tag = "2")]
287 pub entries: ::prost::alloc::vec::Vec<RedelegationEntryResponse>,
288}
289#[allow(clippy::derive_partial_eq_without_eq)]
292#[derive(Clone, PartialEq, ::prost::Message)]
293pub struct Pool {
294 #[prost(string, tag = "1")]
295 pub not_bonded_tokens: ::prost::alloc::string::String,
296 #[prost(string, tag = "2")]
297 pub bonded_tokens: ::prost::alloc::string::String,
298}
299#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
301#[repr(i32)]
302pub enum BondStatus {
303 Unspecified = 0,
305 Unbonded = 1,
307 Unbonding = 2,
309 Bonded = 3,
311}
312impl BondStatus {
313 pub fn as_str_name(&self) -> &'static str {
318 match self {
319 BondStatus::Unspecified => "BOND_STATUS_UNSPECIFIED",
320 BondStatus::Unbonded => "BOND_STATUS_UNBONDED",
321 BondStatus::Unbonding => "BOND_STATUS_UNBONDING",
322 BondStatus::Bonded => "BOND_STATUS_BONDED",
323 }
324 }
325 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
327 match value {
328 "BOND_STATUS_UNSPECIFIED" => Some(Self::Unspecified),
329 "BOND_STATUS_UNBONDED" => Some(Self::Unbonded),
330 "BOND_STATUS_UNBONDING" => Some(Self::Unbonding),
331 "BOND_STATUS_BONDED" => Some(Self::Bonded),
332 _ => None,
333 }
334 }
335}
336#[allow(clippy::derive_partial_eq_without_eq)]
338#[derive(Clone, PartialEq, ::prost::Message)]
339pub struct MsgCreateValidator {
340 #[prost(message, optional, tag = "1")]
341 pub description: ::core::option::Option<Description>,
342 #[prost(message, optional, tag = "2")]
343 pub commission: ::core::option::Option<CommissionRates>,
344 #[prost(string, tag = "3")]
345 pub min_self_delegation: ::prost::alloc::string::String,
346 #[prost(string, tag = "4")]
347 pub delegator_address: ::prost::alloc::string::String,
348 #[prost(string, tag = "5")]
349 pub validator_address: ::prost::alloc::string::String,
350 #[prost(message, optional, tag = "6")]
351 pub pubkey: ::core::option::Option<::prost_types::Any>,
352 #[prost(message, optional, tag = "7")]
353 pub value: ::core::option::Option<super::super::base::v1beta1::Coin>,
354}
355#[allow(clippy::derive_partial_eq_without_eq)]
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct MsgCreateValidatorResponse {}
359#[allow(clippy::derive_partial_eq_without_eq)]
361#[derive(Clone, PartialEq, ::prost::Message)]
362pub struct MsgEditValidator {
363 #[prost(message, optional, tag = "1")]
364 pub description: ::core::option::Option<Description>,
365 #[prost(string, tag = "2")]
366 pub validator_address: ::prost::alloc::string::String,
367 #[prost(string, tag = "3")]
372 pub commission_rate: ::prost::alloc::string::String,
373 #[prost(string, tag = "4")]
374 pub min_self_delegation: ::prost::alloc::string::String,
375}
376#[allow(clippy::derive_partial_eq_without_eq)]
378#[derive(Clone, PartialEq, ::prost::Message)]
379pub struct MsgEditValidatorResponse {}
380#[allow(clippy::derive_partial_eq_without_eq)]
383#[derive(Clone, PartialEq, ::prost::Message)]
384pub struct MsgDelegate {
385 #[prost(string, tag = "1")]
386 pub delegator_address: ::prost::alloc::string::String,
387 #[prost(string, tag = "2")]
388 pub validator_address: ::prost::alloc::string::String,
389 #[prost(message, optional, tag = "3")]
390 pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
391}
392#[allow(clippy::derive_partial_eq_without_eq)]
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct MsgDelegateResponse {}
396#[allow(clippy::derive_partial_eq_without_eq)]
399#[derive(Clone, PartialEq, ::prost::Message)]
400pub struct MsgBeginRedelegate {
401 #[prost(string, tag = "1")]
402 pub delegator_address: ::prost::alloc::string::String,
403 #[prost(string, tag = "2")]
404 pub validator_src_address: ::prost::alloc::string::String,
405 #[prost(string, tag = "3")]
406 pub validator_dst_address: ::prost::alloc::string::String,
407 #[prost(message, optional, tag = "4")]
408 pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
409}
410#[allow(clippy::derive_partial_eq_without_eq)]
412#[derive(Clone, PartialEq, ::prost::Message)]
413pub struct MsgBeginRedelegateResponse {
414 #[prost(message, optional, tag = "1")]
415 pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
416}
417#[allow(clippy::derive_partial_eq_without_eq)]
420#[derive(Clone, PartialEq, ::prost::Message)]
421pub struct MsgUndelegate {
422 #[prost(string, tag = "1")]
423 pub delegator_address: ::prost::alloc::string::String,
424 #[prost(string, tag = "2")]
425 pub validator_address: ::prost::alloc::string::String,
426 #[prost(message, optional, tag = "3")]
427 pub amount: ::core::option::Option<super::super::base::v1beta1::Coin>,
428}
429#[allow(clippy::derive_partial_eq_without_eq)]
431#[derive(Clone, PartialEq, ::prost::Message)]
432pub struct MsgUndelegateResponse {
433 #[prost(message, optional, tag = "1")]
434 pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
435}
436#[cfg(feature = "grpc")]
438#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
439pub mod msg_client {
440 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
441 use tonic::codegen::http::Uri;
442 use tonic::codegen::*;
443 #[derive(Debug, Clone)]
445 pub struct MsgClient<T> {
446 inner: tonic::client::Grpc<T>,
447 }
448 #[cfg(feature = "grpc-transport")]
449 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
450 impl MsgClient<tonic::transport::Channel> {
451 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
453 where
454 D: std::convert::TryInto<tonic::transport::Endpoint>,
455 D::Error: Into<StdError>,
456 {
457 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
458 Ok(Self::new(conn))
459 }
460 }
461 impl<T> MsgClient<T>
462 where
463 T: tonic::client::GrpcService<tonic::body::BoxBody>,
464 T::Error: Into<StdError>,
465 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
466 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
467 {
468 pub fn new(inner: T) -> Self {
469 let inner = tonic::client::Grpc::new(inner);
470 Self { inner }
471 }
472 pub fn with_origin(inner: T, origin: Uri) -> Self {
473 let inner = tonic::client::Grpc::with_origin(inner, origin);
474 Self { inner }
475 }
476 pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
477 where
478 F: tonic::service::Interceptor,
479 T::ResponseBody: Default,
480 T: tonic::codegen::Service<
481 http::Request<tonic::body::BoxBody>,
482 Response = http::Response<
483 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
484 >,
485 >,
486 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
487 Into<StdError> + Send + Sync,
488 {
489 MsgClient::new(InterceptedService::new(inner, interceptor))
490 }
491 #[must_use]
496 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
497 self.inner = self.inner.send_compressed(encoding);
498 self
499 }
500 #[must_use]
502 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
503 self.inner = self.inner.accept_compressed(encoding);
504 self
505 }
506 pub async fn create_validator(
508 &mut self,
509 request: impl tonic::IntoRequest<super::MsgCreateValidator>,
510 ) -> Result<tonic::Response<super::MsgCreateValidatorResponse>, tonic::Status> {
511 self.inner.ready().await.map_err(|e| {
512 tonic::Status::new(
513 tonic::Code::Unknown,
514 format!("Service was not ready: {}", e.into()),
515 )
516 })?;
517 let codec = tonic::codec::ProstCodec::default();
518 let path =
519 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/CreateValidator");
520 self.inner.unary(request.into_request(), path, codec).await
521 }
522 pub async fn edit_validator(
524 &mut self,
525 request: impl tonic::IntoRequest<super::MsgEditValidator>,
526 ) -> Result<tonic::Response<super::MsgEditValidatorResponse>, tonic::Status> {
527 self.inner.ready().await.map_err(|e| {
528 tonic::Status::new(
529 tonic::Code::Unknown,
530 format!("Service was not ready: {}", e.into()),
531 )
532 })?;
533 let codec = tonic::codec::ProstCodec::default();
534 let path =
535 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/EditValidator");
536 self.inner.unary(request.into_request(), path, codec).await
537 }
538 pub async fn delegate(
541 &mut self,
542 request: impl tonic::IntoRequest<super::MsgDelegate>,
543 ) -> Result<tonic::Response<super::MsgDelegateResponse>, tonic::Status> {
544 self.inner.ready().await.map_err(|e| {
545 tonic::Status::new(
546 tonic::Code::Unknown,
547 format!("Service was not ready: {}", e.into()),
548 )
549 })?;
550 let codec = tonic::codec::ProstCodec::default();
551 let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Delegate");
552 self.inner.unary(request.into_request(), path, codec).await
553 }
554 pub async fn begin_redelegate(
557 &mut self,
558 request: impl tonic::IntoRequest<super::MsgBeginRedelegate>,
559 ) -> Result<tonic::Response<super::MsgBeginRedelegateResponse>, tonic::Status> {
560 self.inner.ready().await.map_err(|e| {
561 tonic::Status::new(
562 tonic::Code::Unknown,
563 format!("Service was not ready: {}", e.into()),
564 )
565 })?;
566 let codec = tonic::codec::ProstCodec::default();
567 let path =
568 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/BeginRedelegate");
569 self.inner.unary(request.into_request(), path, codec).await
570 }
571 pub async fn undelegate(
574 &mut self,
575 request: impl tonic::IntoRequest<super::MsgUndelegate>,
576 ) -> Result<tonic::Response<super::MsgUndelegateResponse>, tonic::Status> {
577 self.inner.ready().await.map_err(|e| {
578 tonic::Status::new(
579 tonic::Code::Unknown,
580 format!("Service was not ready: {}", e.into()),
581 )
582 })?;
583 let codec = tonic::codec::ProstCodec::default();
584 let path =
585 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Undelegate");
586 self.inner.unary(request.into_request(), path, codec).await
587 }
588 }
589}
590#[cfg(feature = "grpc")]
592#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
593pub mod msg_server {
594 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
595 use tonic::codegen::*;
596 #[async_trait]
598 pub trait Msg: Send + Sync + 'static {
599 async fn create_validator(
601 &self,
602 request: tonic::Request<super::MsgCreateValidator>,
603 ) -> Result<tonic::Response<super::MsgCreateValidatorResponse>, tonic::Status>;
604 async fn edit_validator(
606 &self,
607 request: tonic::Request<super::MsgEditValidator>,
608 ) -> Result<tonic::Response<super::MsgEditValidatorResponse>, tonic::Status>;
609 async fn delegate(
612 &self,
613 request: tonic::Request<super::MsgDelegate>,
614 ) -> Result<tonic::Response<super::MsgDelegateResponse>, tonic::Status>;
615 async fn begin_redelegate(
618 &self,
619 request: tonic::Request<super::MsgBeginRedelegate>,
620 ) -> Result<tonic::Response<super::MsgBeginRedelegateResponse>, tonic::Status>;
621 async fn undelegate(
624 &self,
625 request: tonic::Request<super::MsgUndelegate>,
626 ) -> Result<tonic::Response<super::MsgUndelegateResponse>, tonic::Status>;
627 }
628 #[derive(Debug)]
630 pub struct MsgServer<T: Msg> {
631 inner: _Inner<T>,
632 accept_compression_encodings: EnabledCompressionEncodings,
633 send_compression_encodings: EnabledCompressionEncodings,
634 }
635 struct _Inner<T>(Arc<T>);
636 impl<T: Msg> MsgServer<T> {
637 pub fn new(inner: T) -> Self {
638 Self::from_arc(Arc::new(inner))
639 }
640 pub fn from_arc(inner: Arc<T>) -> Self {
641 let inner = _Inner(inner);
642 Self {
643 inner,
644 accept_compression_encodings: Default::default(),
645 send_compression_encodings: Default::default(),
646 }
647 }
648 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
649 where
650 F: tonic::service::Interceptor,
651 {
652 InterceptedService::new(Self::new(inner), interceptor)
653 }
654 #[must_use]
656 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
657 self.accept_compression_encodings.enable(encoding);
658 self
659 }
660 #[must_use]
662 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
663 self.send_compression_encodings.enable(encoding);
664 self
665 }
666 }
667 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
668 where
669 T: Msg,
670 B: Body + Send + 'static,
671 B::Error: Into<StdError> + Send + 'static,
672 {
673 type Response = http::Response<tonic::body::BoxBody>;
674 type Error = std::convert::Infallible;
675 type Future = BoxFuture<Self::Response, Self::Error>;
676 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
677 Poll::Ready(Ok(()))
678 }
679 fn call(&mut self, req: http::Request<B>) -> Self::Future {
680 let inner = self.inner.clone();
681 match req.uri().path() {
682 "/cosmos.staking.v1beta1.Msg/CreateValidator" => {
683 #[allow(non_camel_case_types)]
684 struct CreateValidatorSvc<T: Msg>(pub Arc<T>);
685 impl<T: Msg> tonic::server::UnaryService<super::MsgCreateValidator> for CreateValidatorSvc<T> {
686 type Response = super::MsgCreateValidatorResponse;
687 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
688 fn call(
689 &mut self,
690 request: tonic::Request<super::MsgCreateValidator>,
691 ) -> Self::Future {
692 let inner = self.0.clone();
693 let fut = async move { (*inner).create_validator(request).await };
694 Box::pin(fut)
695 }
696 }
697 let accept_compression_encodings = self.accept_compression_encodings;
698 let send_compression_encodings = self.send_compression_encodings;
699 let inner = self.inner.clone();
700 let fut = async move {
701 let inner = inner.0;
702 let method = CreateValidatorSvc(inner);
703 let codec = tonic::codec::ProstCodec::default();
704 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
705 accept_compression_encodings,
706 send_compression_encodings,
707 );
708 let res = grpc.unary(method, req).await;
709 Ok(res)
710 };
711 Box::pin(fut)
712 }
713 "/cosmos.staking.v1beta1.Msg/EditValidator" => {
714 #[allow(non_camel_case_types)]
715 struct EditValidatorSvc<T: Msg>(pub Arc<T>);
716 impl<T: Msg> tonic::server::UnaryService<super::MsgEditValidator> for EditValidatorSvc<T> {
717 type Response = super::MsgEditValidatorResponse;
718 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
719 fn call(
720 &mut self,
721 request: tonic::Request<super::MsgEditValidator>,
722 ) -> Self::Future {
723 let inner = self.0.clone();
724 let fut = async move { (*inner).edit_validator(request).await };
725 Box::pin(fut)
726 }
727 }
728 let accept_compression_encodings = self.accept_compression_encodings;
729 let send_compression_encodings = self.send_compression_encodings;
730 let inner = self.inner.clone();
731 let fut = async move {
732 let inner = inner.0;
733 let method = EditValidatorSvc(inner);
734 let codec = tonic::codec::ProstCodec::default();
735 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
736 accept_compression_encodings,
737 send_compression_encodings,
738 );
739 let res = grpc.unary(method, req).await;
740 Ok(res)
741 };
742 Box::pin(fut)
743 }
744 "/cosmos.staking.v1beta1.Msg/Delegate" => {
745 #[allow(non_camel_case_types)]
746 struct DelegateSvc<T: Msg>(pub Arc<T>);
747 impl<T: Msg> tonic::server::UnaryService<super::MsgDelegate> for DelegateSvc<T> {
748 type Response = super::MsgDelegateResponse;
749 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
750 fn call(
751 &mut self,
752 request: tonic::Request<super::MsgDelegate>,
753 ) -> Self::Future {
754 let inner = self.0.clone();
755 let fut = async move { (*inner).delegate(request).await };
756 Box::pin(fut)
757 }
758 }
759 let accept_compression_encodings = self.accept_compression_encodings;
760 let send_compression_encodings = self.send_compression_encodings;
761 let inner = self.inner.clone();
762 let fut = async move {
763 let inner = inner.0;
764 let method = DelegateSvc(inner);
765 let codec = tonic::codec::ProstCodec::default();
766 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
767 accept_compression_encodings,
768 send_compression_encodings,
769 );
770 let res = grpc.unary(method, req).await;
771 Ok(res)
772 };
773 Box::pin(fut)
774 }
775 "/cosmos.staking.v1beta1.Msg/BeginRedelegate" => {
776 #[allow(non_camel_case_types)]
777 struct BeginRedelegateSvc<T: Msg>(pub Arc<T>);
778 impl<T: Msg> tonic::server::UnaryService<super::MsgBeginRedelegate> for BeginRedelegateSvc<T> {
779 type Response = super::MsgBeginRedelegateResponse;
780 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
781 fn call(
782 &mut self,
783 request: tonic::Request<super::MsgBeginRedelegate>,
784 ) -> Self::Future {
785 let inner = self.0.clone();
786 let fut = async move { (*inner).begin_redelegate(request).await };
787 Box::pin(fut)
788 }
789 }
790 let accept_compression_encodings = self.accept_compression_encodings;
791 let send_compression_encodings = self.send_compression_encodings;
792 let inner = self.inner.clone();
793 let fut = async move {
794 let inner = inner.0;
795 let method = BeginRedelegateSvc(inner);
796 let codec = tonic::codec::ProstCodec::default();
797 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
798 accept_compression_encodings,
799 send_compression_encodings,
800 );
801 let res = grpc.unary(method, req).await;
802 Ok(res)
803 };
804 Box::pin(fut)
805 }
806 "/cosmos.staking.v1beta1.Msg/Undelegate" => {
807 #[allow(non_camel_case_types)]
808 struct UndelegateSvc<T: Msg>(pub Arc<T>);
809 impl<T: Msg> tonic::server::UnaryService<super::MsgUndelegate> for UndelegateSvc<T> {
810 type Response = super::MsgUndelegateResponse;
811 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
812 fn call(
813 &mut self,
814 request: tonic::Request<super::MsgUndelegate>,
815 ) -> Self::Future {
816 let inner = self.0.clone();
817 let fut = async move { (*inner).undelegate(request).await };
818 Box::pin(fut)
819 }
820 }
821 let accept_compression_encodings = self.accept_compression_encodings;
822 let send_compression_encodings = self.send_compression_encodings;
823 let inner = self.inner.clone();
824 let fut = async move {
825 let inner = inner.0;
826 let method = UndelegateSvc(inner);
827 let codec = tonic::codec::ProstCodec::default();
828 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
829 accept_compression_encodings,
830 send_compression_encodings,
831 );
832 let res = grpc.unary(method, req).await;
833 Ok(res)
834 };
835 Box::pin(fut)
836 }
837 _ => Box::pin(async move {
838 Ok(http::Response::builder()
839 .status(200)
840 .header("grpc-status", "12")
841 .header("content-type", "application/grpc")
842 .body(empty_body())
843 .unwrap())
844 }),
845 }
846 }
847 }
848 impl<T: Msg> Clone for MsgServer<T> {
849 fn clone(&self) -> Self {
850 let inner = self.inner.clone();
851 Self {
852 inner,
853 accept_compression_encodings: self.accept_compression_encodings,
854 send_compression_encodings: self.send_compression_encodings,
855 }
856 }
857 }
858 impl<T: Msg> Clone for _Inner<T> {
859 fn clone(&self) -> Self {
860 Self(self.0.clone())
861 }
862 }
863 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
864 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
865 write!(f, "{:?}", self.0)
866 }
867 }
868 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
869 const NAME: &'static str = "cosmos.staking.v1beta1.Msg";
870 }
871}
872#[allow(clippy::derive_partial_eq_without_eq)]
874#[derive(Clone, PartialEq, ::prost::Message)]
875pub struct QueryValidatorsRequest {
876 #[prost(string, tag = "1")]
878 pub status: ::prost::alloc::string::String,
879 #[prost(message, optional, tag = "2")]
881 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
882}
883#[allow(clippy::derive_partial_eq_without_eq)]
885#[derive(Clone, PartialEq, ::prost::Message)]
886pub struct QueryValidatorsResponse {
887 #[prost(message, repeated, tag = "1")]
889 pub validators: ::prost::alloc::vec::Vec<Validator>,
890 #[prost(message, optional, tag = "2")]
892 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
893}
894#[allow(clippy::derive_partial_eq_without_eq)]
896#[derive(Clone, PartialEq, ::prost::Message)]
897pub struct QueryValidatorRequest {
898 #[prost(string, tag = "1")]
900 pub validator_addr: ::prost::alloc::string::String,
901}
902#[allow(clippy::derive_partial_eq_without_eq)]
904#[derive(Clone, PartialEq, ::prost::Message)]
905pub struct QueryValidatorResponse {
906 #[prost(message, optional, tag = "1")]
908 pub validator: ::core::option::Option<Validator>,
909}
910#[allow(clippy::derive_partial_eq_without_eq)]
913#[derive(Clone, PartialEq, ::prost::Message)]
914pub struct QueryValidatorDelegationsRequest {
915 #[prost(string, tag = "1")]
917 pub validator_addr: ::prost::alloc::string::String,
918 #[prost(message, optional, tag = "2")]
920 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
921}
922#[allow(clippy::derive_partial_eq_without_eq)]
925#[derive(Clone, PartialEq, ::prost::Message)]
926pub struct QueryValidatorDelegationsResponse {
927 #[prost(message, repeated, tag = "1")]
928 pub delegation_responses: ::prost::alloc::vec::Vec<DelegationResponse>,
929 #[prost(message, optional, tag = "2")]
931 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
932}
933#[allow(clippy::derive_partial_eq_without_eq)]
936#[derive(Clone, PartialEq, ::prost::Message)]
937pub struct QueryValidatorUnbondingDelegationsRequest {
938 #[prost(string, tag = "1")]
940 pub validator_addr: ::prost::alloc::string::String,
941 #[prost(message, optional, tag = "2")]
943 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
944}
945#[allow(clippy::derive_partial_eq_without_eq)]
948#[derive(Clone, PartialEq, ::prost::Message)]
949pub struct QueryValidatorUnbondingDelegationsResponse {
950 #[prost(message, repeated, tag = "1")]
951 pub unbonding_responses: ::prost::alloc::vec::Vec<UnbondingDelegation>,
952 #[prost(message, optional, tag = "2")]
954 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
955}
956#[allow(clippy::derive_partial_eq_without_eq)]
958#[derive(Clone, PartialEq, ::prost::Message)]
959pub struct QueryDelegationRequest {
960 #[prost(string, tag = "1")]
962 pub delegator_addr: ::prost::alloc::string::String,
963 #[prost(string, tag = "2")]
965 pub validator_addr: ::prost::alloc::string::String,
966}
967#[allow(clippy::derive_partial_eq_without_eq)]
969#[derive(Clone, PartialEq, ::prost::Message)]
970pub struct QueryDelegationResponse {
971 #[prost(message, optional, tag = "1")]
973 pub delegation_response: ::core::option::Option<DelegationResponse>,
974}
975#[allow(clippy::derive_partial_eq_without_eq)]
978#[derive(Clone, PartialEq, ::prost::Message)]
979pub struct QueryUnbondingDelegationRequest {
980 #[prost(string, tag = "1")]
982 pub delegator_addr: ::prost::alloc::string::String,
983 #[prost(string, tag = "2")]
985 pub validator_addr: ::prost::alloc::string::String,
986}
987#[allow(clippy::derive_partial_eq_without_eq)]
990#[derive(Clone, PartialEq, ::prost::Message)]
991pub struct QueryUnbondingDelegationResponse {
992 #[prost(message, optional, tag = "1")]
994 pub unbond: ::core::option::Option<UnbondingDelegation>,
995}
996#[allow(clippy::derive_partial_eq_without_eq)]
999#[derive(Clone, PartialEq, ::prost::Message)]
1000pub struct QueryDelegatorDelegationsRequest {
1001 #[prost(string, tag = "1")]
1003 pub delegator_addr: ::prost::alloc::string::String,
1004 #[prost(message, optional, tag = "2")]
1006 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1007}
1008#[allow(clippy::derive_partial_eq_without_eq)]
1011#[derive(Clone, PartialEq, ::prost::Message)]
1012pub struct QueryDelegatorDelegationsResponse {
1013 #[prost(message, repeated, tag = "1")]
1015 pub delegation_responses: ::prost::alloc::vec::Vec<DelegationResponse>,
1016 #[prost(message, optional, tag = "2")]
1018 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1019}
1020#[allow(clippy::derive_partial_eq_without_eq)]
1023#[derive(Clone, PartialEq, ::prost::Message)]
1024pub struct QueryDelegatorUnbondingDelegationsRequest {
1025 #[prost(string, tag = "1")]
1027 pub delegator_addr: ::prost::alloc::string::String,
1028 #[prost(message, optional, tag = "2")]
1030 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1031}
1032#[allow(clippy::derive_partial_eq_without_eq)]
1035#[derive(Clone, PartialEq, ::prost::Message)]
1036pub struct QueryDelegatorUnbondingDelegationsResponse {
1037 #[prost(message, repeated, tag = "1")]
1038 pub unbonding_responses: ::prost::alloc::vec::Vec<UnbondingDelegation>,
1039 #[prost(message, optional, tag = "2")]
1041 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1042}
1043#[allow(clippy::derive_partial_eq_without_eq)]
1046#[derive(Clone, PartialEq, ::prost::Message)]
1047pub struct QueryRedelegationsRequest {
1048 #[prost(string, tag = "1")]
1050 pub delegator_addr: ::prost::alloc::string::String,
1051 #[prost(string, tag = "2")]
1053 pub src_validator_addr: ::prost::alloc::string::String,
1054 #[prost(string, tag = "3")]
1056 pub dst_validator_addr: ::prost::alloc::string::String,
1057 #[prost(message, optional, tag = "4")]
1059 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1060}
1061#[allow(clippy::derive_partial_eq_without_eq)]
1064#[derive(Clone, PartialEq, ::prost::Message)]
1065pub struct QueryRedelegationsResponse {
1066 #[prost(message, repeated, tag = "1")]
1067 pub redelegation_responses: ::prost::alloc::vec::Vec<RedelegationResponse>,
1068 #[prost(message, optional, tag = "2")]
1070 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1071}
1072#[allow(clippy::derive_partial_eq_without_eq)]
1075#[derive(Clone, PartialEq, ::prost::Message)]
1076pub struct QueryDelegatorValidatorsRequest {
1077 #[prost(string, tag = "1")]
1079 pub delegator_addr: ::prost::alloc::string::String,
1080 #[prost(message, optional, tag = "2")]
1082 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1083}
1084#[allow(clippy::derive_partial_eq_without_eq)]
1087#[derive(Clone, PartialEq, ::prost::Message)]
1088pub struct QueryDelegatorValidatorsResponse {
1089 #[prost(message, repeated, tag = "1")]
1091 pub validators: ::prost::alloc::vec::Vec<Validator>,
1092 #[prost(message, optional, tag = "2")]
1094 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1095}
1096#[allow(clippy::derive_partial_eq_without_eq)]
1099#[derive(Clone, PartialEq, ::prost::Message)]
1100pub struct QueryDelegatorValidatorRequest {
1101 #[prost(string, tag = "1")]
1103 pub delegator_addr: ::prost::alloc::string::String,
1104 #[prost(string, tag = "2")]
1106 pub validator_addr: ::prost::alloc::string::String,
1107}
1108#[allow(clippy::derive_partial_eq_without_eq)]
1111#[derive(Clone, PartialEq, ::prost::Message)]
1112pub struct QueryDelegatorValidatorResponse {
1113 #[prost(message, optional, tag = "1")]
1115 pub validator: ::core::option::Option<Validator>,
1116}
1117#[allow(clippy::derive_partial_eq_without_eq)]
1120#[derive(Clone, PartialEq, ::prost::Message)]
1121pub struct QueryHistoricalInfoRequest {
1122 #[prost(int64, tag = "1")]
1124 pub height: i64,
1125}
1126#[allow(clippy::derive_partial_eq_without_eq)]
1129#[derive(Clone, PartialEq, ::prost::Message)]
1130pub struct QueryHistoricalInfoResponse {
1131 #[prost(message, optional, tag = "1")]
1133 pub hist: ::core::option::Option<HistoricalInfo>,
1134}
1135#[allow(clippy::derive_partial_eq_without_eq)]
1137#[derive(Clone, PartialEq, ::prost::Message)]
1138pub struct QueryPoolRequest {}
1139#[allow(clippy::derive_partial_eq_without_eq)]
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct QueryPoolResponse {
1143 #[prost(message, optional, tag = "1")]
1145 pub pool: ::core::option::Option<Pool>,
1146}
1147#[allow(clippy::derive_partial_eq_without_eq)]
1149#[derive(Clone, PartialEq, ::prost::Message)]
1150pub struct QueryParamsRequest {}
1151#[allow(clippy::derive_partial_eq_without_eq)]
1153#[derive(Clone, PartialEq, ::prost::Message)]
1154pub struct QueryParamsResponse {
1155 #[prost(message, optional, tag = "1")]
1157 pub params: ::core::option::Option<Params>,
1158}
1159#[cfg(feature = "grpc")]
1161#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
1162pub mod query_client {
1163 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1164 use tonic::codegen::http::Uri;
1165 use tonic::codegen::*;
1166 #[derive(Debug, Clone)]
1168 pub struct QueryClient<T> {
1169 inner: tonic::client::Grpc<T>,
1170 }
1171 #[cfg(feature = "grpc-transport")]
1172 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
1173 impl QueryClient<tonic::transport::Channel> {
1174 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1176 where
1177 D: std::convert::TryInto<tonic::transport::Endpoint>,
1178 D::Error: Into<StdError>,
1179 {
1180 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1181 Ok(Self::new(conn))
1182 }
1183 }
1184 impl<T> QueryClient<T>
1185 where
1186 T: tonic::client::GrpcService<tonic::body::BoxBody>,
1187 T::Error: Into<StdError>,
1188 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
1189 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
1190 {
1191 pub fn new(inner: T) -> Self {
1192 let inner = tonic::client::Grpc::new(inner);
1193 Self { inner }
1194 }
1195 pub fn with_origin(inner: T, origin: Uri) -> Self {
1196 let inner = tonic::client::Grpc::with_origin(inner, origin);
1197 Self { inner }
1198 }
1199 pub fn with_interceptor<F>(
1200 inner: T,
1201 interceptor: F,
1202 ) -> QueryClient<InterceptedService<T, F>>
1203 where
1204 F: tonic::service::Interceptor,
1205 T::ResponseBody: Default,
1206 T: tonic::codegen::Service<
1207 http::Request<tonic::body::BoxBody>,
1208 Response = http::Response<
1209 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
1210 >,
1211 >,
1212 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
1213 Into<StdError> + Send + Sync,
1214 {
1215 QueryClient::new(InterceptedService::new(inner, interceptor))
1216 }
1217 #[must_use]
1222 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1223 self.inner = self.inner.send_compressed(encoding);
1224 self
1225 }
1226 #[must_use]
1228 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1229 self.inner = self.inner.accept_compressed(encoding);
1230 self
1231 }
1232 pub async fn validators(
1234 &mut self,
1235 request: impl tonic::IntoRequest<super::QueryValidatorsRequest>,
1236 ) -> Result<tonic::Response<super::QueryValidatorsResponse>, tonic::Status> {
1237 self.inner.ready().await.map_err(|e| {
1238 tonic::Status::new(
1239 tonic::Code::Unknown,
1240 format!("Service was not ready: {}", e.into()),
1241 )
1242 })?;
1243 let codec = tonic::codec::ProstCodec::default();
1244 let path =
1245 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Validators");
1246 self.inner.unary(request.into_request(), path, codec).await
1247 }
1248 pub async fn validator(
1250 &mut self,
1251 request: impl tonic::IntoRequest<super::QueryValidatorRequest>,
1252 ) -> Result<tonic::Response<super::QueryValidatorResponse>, tonic::Status> {
1253 self.inner.ready().await.map_err(|e| {
1254 tonic::Status::new(
1255 tonic::Code::Unknown,
1256 format!("Service was not ready: {}", e.into()),
1257 )
1258 })?;
1259 let codec = tonic::codec::ProstCodec::default();
1260 let path =
1261 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Validator");
1262 self.inner.unary(request.into_request(), path, codec).await
1263 }
1264 pub async fn validator_delegations(
1266 &mut self,
1267 request: impl tonic::IntoRequest<super::QueryValidatorDelegationsRequest>,
1268 ) -> Result<tonic::Response<super::QueryValidatorDelegationsResponse>, tonic::Status>
1269 {
1270 self.inner.ready().await.map_err(|e| {
1271 tonic::Status::new(
1272 tonic::Code::Unknown,
1273 format!("Service was not ready: {}", e.into()),
1274 )
1275 })?;
1276 let codec = tonic::codec::ProstCodec::default();
1277 let path = http::uri::PathAndQuery::from_static(
1278 "/cosmos.staking.v1beta1.Query/ValidatorDelegations",
1279 );
1280 self.inner.unary(request.into_request(), path, codec).await
1281 }
1282 pub async fn validator_unbonding_delegations(
1284 &mut self,
1285 request: impl tonic::IntoRequest<super::QueryValidatorUnbondingDelegationsRequest>,
1286 ) -> Result<tonic::Response<super::QueryValidatorUnbondingDelegationsResponse>, tonic::Status>
1287 {
1288 self.inner.ready().await.map_err(|e| {
1289 tonic::Status::new(
1290 tonic::Code::Unknown,
1291 format!("Service was not ready: {}", e.into()),
1292 )
1293 })?;
1294 let codec = tonic::codec::ProstCodec::default();
1295 let path = http::uri::PathAndQuery::from_static(
1296 "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations",
1297 );
1298 self.inner.unary(request.into_request(), path, codec).await
1299 }
1300 pub async fn delegation(
1302 &mut self,
1303 request: impl tonic::IntoRequest<super::QueryDelegationRequest>,
1304 ) -> Result<tonic::Response<super::QueryDelegationResponse>, tonic::Status> {
1305 self.inner.ready().await.map_err(|e| {
1306 tonic::Status::new(
1307 tonic::Code::Unknown,
1308 format!("Service was not ready: {}", e.into()),
1309 )
1310 })?;
1311 let codec = tonic::codec::ProstCodec::default();
1312 let path =
1313 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Delegation");
1314 self.inner.unary(request.into_request(), path, codec).await
1315 }
1316 pub async fn unbonding_delegation(
1319 &mut self,
1320 request: impl tonic::IntoRequest<super::QueryUnbondingDelegationRequest>,
1321 ) -> Result<tonic::Response<super::QueryUnbondingDelegationResponse>, tonic::Status>
1322 {
1323 self.inner.ready().await.map_err(|e| {
1324 tonic::Status::new(
1325 tonic::Code::Unknown,
1326 format!("Service was not ready: {}", e.into()),
1327 )
1328 })?;
1329 let codec = tonic::codec::ProstCodec::default();
1330 let path = http::uri::PathAndQuery::from_static(
1331 "/cosmos.staking.v1beta1.Query/UnbondingDelegation",
1332 );
1333 self.inner.unary(request.into_request(), path, codec).await
1334 }
1335 pub async fn delegator_delegations(
1337 &mut self,
1338 request: impl tonic::IntoRequest<super::QueryDelegatorDelegationsRequest>,
1339 ) -> Result<tonic::Response<super::QueryDelegatorDelegationsResponse>, tonic::Status>
1340 {
1341 self.inner.ready().await.map_err(|e| {
1342 tonic::Status::new(
1343 tonic::Code::Unknown,
1344 format!("Service was not ready: {}", e.into()),
1345 )
1346 })?;
1347 let codec = tonic::codec::ProstCodec::default();
1348 let path = http::uri::PathAndQuery::from_static(
1349 "/cosmos.staking.v1beta1.Query/DelegatorDelegations",
1350 );
1351 self.inner.unary(request.into_request(), path, codec).await
1352 }
1353 pub async fn delegator_unbonding_delegations(
1356 &mut self,
1357 request: impl tonic::IntoRequest<super::QueryDelegatorUnbondingDelegationsRequest>,
1358 ) -> Result<tonic::Response<super::QueryDelegatorUnbondingDelegationsResponse>, tonic::Status>
1359 {
1360 self.inner.ready().await.map_err(|e| {
1361 tonic::Status::new(
1362 tonic::Code::Unknown,
1363 format!("Service was not ready: {}", e.into()),
1364 )
1365 })?;
1366 let codec = tonic::codec::ProstCodec::default();
1367 let path = http::uri::PathAndQuery::from_static(
1368 "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations",
1369 );
1370 self.inner.unary(request.into_request(), path, codec).await
1371 }
1372 pub async fn redelegations(
1374 &mut self,
1375 request: impl tonic::IntoRequest<super::QueryRedelegationsRequest>,
1376 ) -> Result<tonic::Response<super::QueryRedelegationsResponse>, tonic::Status> {
1377 self.inner.ready().await.map_err(|e| {
1378 tonic::Status::new(
1379 tonic::Code::Unknown,
1380 format!("Service was not ready: {}", e.into()),
1381 )
1382 })?;
1383 let codec = tonic::codec::ProstCodec::default();
1384 let path =
1385 http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Redelegations");
1386 self.inner.unary(request.into_request(), path, codec).await
1387 }
1388 pub async fn delegator_validators(
1391 &mut self,
1392 request: impl tonic::IntoRequest<super::QueryDelegatorValidatorsRequest>,
1393 ) -> Result<tonic::Response<super::QueryDelegatorValidatorsResponse>, tonic::Status>
1394 {
1395 self.inner.ready().await.map_err(|e| {
1396 tonic::Status::new(
1397 tonic::Code::Unknown,
1398 format!("Service was not ready: {}", e.into()),
1399 )
1400 })?;
1401 let codec = tonic::codec::ProstCodec::default();
1402 let path = http::uri::PathAndQuery::from_static(
1403 "/cosmos.staking.v1beta1.Query/DelegatorValidators",
1404 );
1405 self.inner.unary(request.into_request(), path, codec).await
1406 }
1407 pub async fn delegator_validator(
1410 &mut self,
1411 request: impl tonic::IntoRequest<super::QueryDelegatorValidatorRequest>,
1412 ) -> Result<tonic::Response<super::QueryDelegatorValidatorResponse>, tonic::Status>
1413 {
1414 self.inner.ready().await.map_err(|e| {
1415 tonic::Status::new(
1416 tonic::Code::Unknown,
1417 format!("Service was not ready: {}", e.into()),
1418 )
1419 })?;
1420 let codec = tonic::codec::ProstCodec::default();
1421 let path = http::uri::PathAndQuery::from_static(
1422 "/cosmos.staking.v1beta1.Query/DelegatorValidator",
1423 );
1424 self.inner.unary(request.into_request(), path, codec).await
1425 }
1426 pub async fn historical_info(
1428 &mut self,
1429 request: impl tonic::IntoRequest<super::QueryHistoricalInfoRequest>,
1430 ) -> Result<tonic::Response<super::QueryHistoricalInfoResponse>, tonic::Status> {
1431 self.inner.ready().await.map_err(|e| {
1432 tonic::Status::new(
1433 tonic::Code::Unknown,
1434 format!("Service was not ready: {}", e.into()),
1435 )
1436 })?;
1437 let codec = tonic::codec::ProstCodec::default();
1438 let path = http::uri::PathAndQuery::from_static(
1439 "/cosmos.staking.v1beta1.Query/HistoricalInfo",
1440 );
1441 self.inner.unary(request.into_request(), path, codec).await
1442 }
1443 pub async fn pool(
1445 &mut self,
1446 request: impl tonic::IntoRequest<super::QueryPoolRequest>,
1447 ) -> Result<tonic::Response<super::QueryPoolResponse>, tonic::Status> {
1448 self.inner.ready().await.map_err(|e| {
1449 tonic::Status::new(
1450 tonic::Code::Unknown,
1451 format!("Service was not ready: {}", e.into()),
1452 )
1453 })?;
1454 let codec = tonic::codec::ProstCodec::default();
1455 let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Pool");
1456 self.inner.unary(request.into_request(), path, codec).await
1457 }
1458 pub async fn params(
1460 &mut self,
1461 request: impl tonic::IntoRequest<super::QueryParamsRequest>,
1462 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status> {
1463 self.inner.ready().await.map_err(|e| {
1464 tonic::Status::new(
1465 tonic::Code::Unknown,
1466 format!("Service was not ready: {}", e.into()),
1467 )
1468 })?;
1469 let codec = tonic::codec::ProstCodec::default();
1470 let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Params");
1471 self.inner.unary(request.into_request(), path, codec).await
1472 }
1473 }
1474}
1475#[cfg(feature = "grpc")]
1477#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
1478pub mod query_server {
1479 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
1480 use tonic::codegen::*;
1481 #[async_trait]
1483 pub trait Query: Send + Sync + 'static {
1484 async fn validators(
1486 &self,
1487 request: tonic::Request<super::QueryValidatorsRequest>,
1488 ) -> Result<tonic::Response<super::QueryValidatorsResponse>, tonic::Status>;
1489 async fn validator(
1491 &self,
1492 request: tonic::Request<super::QueryValidatorRequest>,
1493 ) -> Result<tonic::Response<super::QueryValidatorResponse>, tonic::Status>;
1494 async fn validator_delegations(
1496 &self,
1497 request: tonic::Request<super::QueryValidatorDelegationsRequest>,
1498 ) -> Result<tonic::Response<super::QueryValidatorDelegationsResponse>, tonic::Status>;
1499 async fn validator_unbonding_delegations(
1501 &self,
1502 request: tonic::Request<super::QueryValidatorUnbondingDelegationsRequest>,
1503 ) -> Result<tonic::Response<super::QueryValidatorUnbondingDelegationsResponse>, tonic::Status>;
1504 async fn delegation(
1506 &self,
1507 request: tonic::Request<super::QueryDelegationRequest>,
1508 ) -> Result<tonic::Response<super::QueryDelegationResponse>, tonic::Status>;
1509 async fn unbonding_delegation(
1512 &self,
1513 request: tonic::Request<super::QueryUnbondingDelegationRequest>,
1514 ) -> Result<tonic::Response<super::QueryUnbondingDelegationResponse>, tonic::Status>;
1515 async fn delegator_delegations(
1517 &self,
1518 request: tonic::Request<super::QueryDelegatorDelegationsRequest>,
1519 ) -> Result<tonic::Response<super::QueryDelegatorDelegationsResponse>, tonic::Status>;
1520 async fn delegator_unbonding_delegations(
1523 &self,
1524 request: tonic::Request<super::QueryDelegatorUnbondingDelegationsRequest>,
1525 ) -> Result<tonic::Response<super::QueryDelegatorUnbondingDelegationsResponse>, tonic::Status>;
1526 async fn redelegations(
1528 &self,
1529 request: tonic::Request<super::QueryRedelegationsRequest>,
1530 ) -> Result<tonic::Response<super::QueryRedelegationsResponse>, tonic::Status>;
1531 async fn delegator_validators(
1534 &self,
1535 request: tonic::Request<super::QueryDelegatorValidatorsRequest>,
1536 ) -> Result<tonic::Response<super::QueryDelegatorValidatorsResponse>, tonic::Status>;
1537 async fn delegator_validator(
1540 &self,
1541 request: tonic::Request<super::QueryDelegatorValidatorRequest>,
1542 ) -> Result<tonic::Response<super::QueryDelegatorValidatorResponse>, tonic::Status>;
1543 async fn historical_info(
1545 &self,
1546 request: tonic::Request<super::QueryHistoricalInfoRequest>,
1547 ) -> Result<tonic::Response<super::QueryHistoricalInfoResponse>, tonic::Status>;
1548 async fn pool(
1550 &self,
1551 request: tonic::Request<super::QueryPoolRequest>,
1552 ) -> Result<tonic::Response<super::QueryPoolResponse>, tonic::Status>;
1553 async fn params(
1555 &self,
1556 request: tonic::Request<super::QueryParamsRequest>,
1557 ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
1558 }
1559 #[derive(Debug)]
1561 pub struct QueryServer<T: Query> {
1562 inner: _Inner<T>,
1563 accept_compression_encodings: EnabledCompressionEncodings,
1564 send_compression_encodings: EnabledCompressionEncodings,
1565 }
1566 struct _Inner<T>(Arc<T>);
1567 impl<T: Query> QueryServer<T> {
1568 pub fn new(inner: T) -> Self {
1569 Self::from_arc(Arc::new(inner))
1570 }
1571 pub fn from_arc(inner: Arc<T>) -> Self {
1572 let inner = _Inner(inner);
1573 Self {
1574 inner,
1575 accept_compression_encodings: Default::default(),
1576 send_compression_encodings: Default::default(),
1577 }
1578 }
1579 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
1580 where
1581 F: tonic::service::Interceptor,
1582 {
1583 InterceptedService::new(Self::new(inner), interceptor)
1584 }
1585 #[must_use]
1587 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1588 self.accept_compression_encodings.enable(encoding);
1589 self
1590 }
1591 #[must_use]
1593 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1594 self.send_compression_encodings.enable(encoding);
1595 self
1596 }
1597 }
1598 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
1599 where
1600 T: Query,
1601 B: Body + Send + 'static,
1602 B::Error: Into<StdError> + Send + 'static,
1603 {
1604 type Response = http::Response<tonic::body::BoxBody>;
1605 type Error = std::convert::Infallible;
1606 type Future = BoxFuture<Self::Response, Self::Error>;
1607 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
1608 Poll::Ready(Ok(()))
1609 }
1610 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1611 let inner = self.inner.clone();
1612 match req.uri().path() {
1613 "/cosmos.staking.v1beta1.Query/Validators" => {
1614 #[allow(non_camel_case_types)]
1615 struct ValidatorsSvc<T: Query>(pub Arc<T>);
1616 impl<T: Query> tonic::server::UnaryService<super::QueryValidatorsRequest> for ValidatorsSvc<T> {
1617 type Response = super::QueryValidatorsResponse;
1618 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1619 fn call(
1620 &mut self,
1621 request: tonic::Request<super::QueryValidatorsRequest>,
1622 ) -> Self::Future {
1623 let inner = self.0.clone();
1624 let fut = async move { (*inner).validators(request).await };
1625 Box::pin(fut)
1626 }
1627 }
1628 let accept_compression_encodings = self.accept_compression_encodings;
1629 let send_compression_encodings = self.send_compression_encodings;
1630 let inner = self.inner.clone();
1631 let fut = async move {
1632 let inner = inner.0;
1633 let method = ValidatorsSvc(inner);
1634 let codec = tonic::codec::ProstCodec::default();
1635 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1636 accept_compression_encodings,
1637 send_compression_encodings,
1638 );
1639 let res = grpc.unary(method, req).await;
1640 Ok(res)
1641 };
1642 Box::pin(fut)
1643 }
1644 "/cosmos.staking.v1beta1.Query/Validator" => {
1645 #[allow(non_camel_case_types)]
1646 struct ValidatorSvc<T: Query>(pub Arc<T>);
1647 impl<T: Query> tonic::server::UnaryService<super::QueryValidatorRequest> for ValidatorSvc<T> {
1648 type Response = super::QueryValidatorResponse;
1649 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1650 fn call(
1651 &mut self,
1652 request: tonic::Request<super::QueryValidatorRequest>,
1653 ) -> Self::Future {
1654 let inner = self.0.clone();
1655 let fut = async move { (*inner).validator(request).await };
1656 Box::pin(fut)
1657 }
1658 }
1659 let accept_compression_encodings = self.accept_compression_encodings;
1660 let send_compression_encodings = self.send_compression_encodings;
1661 let inner = self.inner.clone();
1662 let fut = async move {
1663 let inner = inner.0;
1664 let method = ValidatorSvc(inner);
1665 let codec = tonic::codec::ProstCodec::default();
1666 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1667 accept_compression_encodings,
1668 send_compression_encodings,
1669 );
1670 let res = grpc.unary(method, req).await;
1671 Ok(res)
1672 };
1673 Box::pin(fut)
1674 }
1675 "/cosmos.staking.v1beta1.Query/ValidatorDelegations" => {
1676 #[allow(non_camel_case_types)]
1677 struct ValidatorDelegationsSvc<T: Query>(pub Arc<T>);
1678 impl<T: Query>
1679 tonic::server::UnaryService<super::QueryValidatorDelegationsRequest>
1680 for ValidatorDelegationsSvc<T>
1681 {
1682 type Response = super::QueryValidatorDelegationsResponse;
1683 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1684 fn call(
1685 &mut self,
1686 request: tonic::Request<super::QueryValidatorDelegationsRequest>,
1687 ) -> Self::Future {
1688 let inner = self.0.clone();
1689 let fut = async move { (*inner).validator_delegations(request).await };
1690 Box::pin(fut)
1691 }
1692 }
1693 let accept_compression_encodings = self.accept_compression_encodings;
1694 let send_compression_encodings = self.send_compression_encodings;
1695 let inner = self.inner.clone();
1696 let fut = async move {
1697 let inner = inner.0;
1698 let method = ValidatorDelegationsSvc(inner);
1699 let codec = tonic::codec::ProstCodec::default();
1700 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1701 accept_compression_encodings,
1702 send_compression_encodings,
1703 );
1704 let res = grpc.unary(method, req).await;
1705 Ok(res)
1706 };
1707 Box::pin(fut)
1708 }
1709 "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => {
1710 #[allow(non_camel_case_types)]
1711 struct ValidatorUnbondingDelegationsSvc<T: Query>(pub Arc<T>);
1712 impl<T: Query>
1713 tonic::server::UnaryService<
1714 super::QueryValidatorUnbondingDelegationsRequest,
1715 > for ValidatorUnbondingDelegationsSvc<T>
1716 {
1717 type Response = super::QueryValidatorUnbondingDelegationsResponse;
1718 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1719 fn call(
1720 &mut self,
1721 request: tonic::Request<
1722 super::QueryValidatorUnbondingDelegationsRequest,
1723 >,
1724 ) -> Self::Future {
1725 let inner = self.0.clone();
1726 let fut = async move {
1727 (*inner).validator_unbonding_delegations(request).await
1728 };
1729 Box::pin(fut)
1730 }
1731 }
1732 let accept_compression_encodings = self.accept_compression_encodings;
1733 let send_compression_encodings = self.send_compression_encodings;
1734 let inner = self.inner.clone();
1735 let fut = async move {
1736 let inner = inner.0;
1737 let method = ValidatorUnbondingDelegationsSvc(inner);
1738 let codec = tonic::codec::ProstCodec::default();
1739 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1740 accept_compression_encodings,
1741 send_compression_encodings,
1742 );
1743 let res = grpc.unary(method, req).await;
1744 Ok(res)
1745 };
1746 Box::pin(fut)
1747 }
1748 "/cosmos.staking.v1beta1.Query/Delegation" => {
1749 #[allow(non_camel_case_types)]
1750 struct DelegationSvc<T: Query>(pub Arc<T>);
1751 impl<T: Query> tonic::server::UnaryService<super::QueryDelegationRequest> for DelegationSvc<T> {
1752 type Response = super::QueryDelegationResponse;
1753 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1754 fn call(
1755 &mut self,
1756 request: tonic::Request<super::QueryDelegationRequest>,
1757 ) -> Self::Future {
1758 let inner = self.0.clone();
1759 let fut = async move { (*inner).delegation(request).await };
1760 Box::pin(fut)
1761 }
1762 }
1763 let accept_compression_encodings = self.accept_compression_encodings;
1764 let send_compression_encodings = self.send_compression_encodings;
1765 let inner = self.inner.clone();
1766 let fut = async move {
1767 let inner = inner.0;
1768 let method = DelegationSvc(inner);
1769 let codec = tonic::codec::ProstCodec::default();
1770 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1771 accept_compression_encodings,
1772 send_compression_encodings,
1773 );
1774 let res = grpc.unary(method, req).await;
1775 Ok(res)
1776 };
1777 Box::pin(fut)
1778 }
1779 "/cosmos.staking.v1beta1.Query/UnbondingDelegation" => {
1780 #[allow(non_camel_case_types)]
1781 struct UnbondingDelegationSvc<T: Query>(pub Arc<T>);
1782 impl<T: Query>
1783 tonic::server::UnaryService<super::QueryUnbondingDelegationRequest>
1784 for UnbondingDelegationSvc<T>
1785 {
1786 type Response = super::QueryUnbondingDelegationResponse;
1787 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1788 fn call(
1789 &mut self,
1790 request: tonic::Request<super::QueryUnbondingDelegationRequest>,
1791 ) -> Self::Future {
1792 let inner = self.0.clone();
1793 let fut = async move { (*inner).unbonding_delegation(request).await };
1794 Box::pin(fut)
1795 }
1796 }
1797 let accept_compression_encodings = self.accept_compression_encodings;
1798 let send_compression_encodings = self.send_compression_encodings;
1799 let inner = self.inner.clone();
1800 let fut = async move {
1801 let inner = inner.0;
1802 let method = UnbondingDelegationSvc(inner);
1803 let codec = tonic::codec::ProstCodec::default();
1804 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1805 accept_compression_encodings,
1806 send_compression_encodings,
1807 );
1808 let res = grpc.unary(method, req).await;
1809 Ok(res)
1810 };
1811 Box::pin(fut)
1812 }
1813 "/cosmos.staking.v1beta1.Query/DelegatorDelegations" => {
1814 #[allow(non_camel_case_types)]
1815 struct DelegatorDelegationsSvc<T: Query>(pub Arc<T>);
1816 impl<T: Query>
1817 tonic::server::UnaryService<super::QueryDelegatorDelegationsRequest>
1818 for DelegatorDelegationsSvc<T>
1819 {
1820 type Response = super::QueryDelegatorDelegationsResponse;
1821 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1822 fn call(
1823 &mut self,
1824 request: tonic::Request<super::QueryDelegatorDelegationsRequest>,
1825 ) -> Self::Future {
1826 let inner = self.0.clone();
1827 let fut = async move { (*inner).delegator_delegations(request).await };
1828 Box::pin(fut)
1829 }
1830 }
1831 let accept_compression_encodings = self.accept_compression_encodings;
1832 let send_compression_encodings = self.send_compression_encodings;
1833 let inner = self.inner.clone();
1834 let fut = async move {
1835 let inner = inner.0;
1836 let method = DelegatorDelegationsSvc(inner);
1837 let codec = tonic::codec::ProstCodec::default();
1838 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1839 accept_compression_encodings,
1840 send_compression_encodings,
1841 );
1842 let res = grpc.unary(method, req).await;
1843 Ok(res)
1844 };
1845 Box::pin(fut)
1846 }
1847 "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => {
1848 #[allow(non_camel_case_types)]
1849 struct DelegatorUnbondingDelegationsSvc<T: Query>(pub Arc<T>);
1850 impl<T: Query>
1851 tonic::server::UnaryService<
1852 super::QueryDelegatorUnbondingDelegationsRequest,
1853 > for DelegatorUnbondingDelegationsSvc<T>
1854 {
1855 type Response = super::QueryDelegatorUnbondingDelegationsResponse;
1856 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1857 fn call(
1858 &mut self,
1859 request: tonic::Request<
1860 super::QueryDelegatorUnbondingDelegationsRequest,
1861 >,
1862 ) -> Self::Future {
1863 let inner = self.0.clone();
1864 let fut = async move {
1865 (*inner).delegator_unbonding_delegations(request).await
1866 };
1867 Box::pin(fut)
1868 }
1869 }
1870 let accept_compression_encodings = self.accept_compression_encodings;
1871 let send_compression_encodings = self.send_compression_encodings;
1872 let inner = self.inner.clone();
1873 let fut = async move {
1874 let inner = inner.0;
1875 let method = DelegatorUnbondingDelegationsSvc(inner);
1876 let codec = tonic::codec::ProstCodec::default();
1877 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1878 accept_compression_encodings,
1879 send_compression_encodings,
1880 );
1881 let res = grpc.unary(method, req).await;
1882 Ok(res)
1883 };
1884 Box::pin(fut)
1885 }
1886 "/cosmos.staking.v1beta1.Query/Redelegations" => {
1887 #[allow(non_camel_case_types)]
1888 struct RedelegationsSvc<T: Query>(pub Arc<T>);
1889 impl<T: Query> tonic::server::UnaryService<super::QueryRedelegationsRequest>
1890 for RedelegationsSvc<T>
1891 {
1892 type Response = super::QueryRedelegationsResponse;
1893 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1894 fn call(
1895 &mut self,
1896 request: tonic::Request<super::QueryRedelegationsRequest>,
1897 ) -> Self::Future {
1898 let inner = self.0.clone();
1899 let fut = async move { (*inner).redelegations(request).await };
1900 Box::pin(fut)
1901 }
1902 }
1903 let accept_compression_encodings = self.accept_compression_encodings;
1904 let send_compression_encodings = self.send_compression_encodings;
1905 let inner = self.inner.clone();
1906 let fut = async move {
1907 let inner = inner.0;
1908 let method = RedelegationsSvc(inner);
1909 let codec = tonic::codec::ProstCodec::default();
1910 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1911 accept_compression_encodings,
1912 send_compression_encodings,
1913 );
1914 let res = grpc.unary(method, req).await;
1915 Ok(res)
1916 };
1917 Box::pin(fut)
1918 }
1919 "/cosmos.staking.v1beta1.Query/DelegatorValidators" => {
1920 #[allow(non_camel_case_types)]
1921 struct DelegatorValidatorsSvc<T: Query>(pub Arc<T>);
1922 impl<T: Query>
1923 tonic::server::UnaryService<super::QueryDelegatorValidatorsRequest>
1924 for DelegatorValidatorsSvc<T>
1925 {
1926 type Response = super::QueryDelegatorValidatorsResponse;
1927 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1928 fn call(
1929 &mut self,
1930 request: tonic::Request<super::QueryDelegatorValidatorsRequest>,
1931 ) -> Self::Future {
1932 let inner = self.0.clone();
1933 let fut = async move { (*inner).delegator_validators(request).await };
1934 Box::pin(fut)
1935 }
1936 }
1937 let accept_compression_encodings = self.accept_compression_encodings;
1938 let send_compression_encodings = self.send_compression_encodings;
1939 let inner = self.inner.clone();
1940 let fut = async move {
1941 let inner = inner.0;
1942 let method = DelegatorValidatorsSvc(inner);
1943 let codec = tonic::codec::ProstCodec::default();
1944 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1945 accept_compression_encodings,
1946 send_compression_encodings,
1947 );
1948 let res = grpc.unary(method, req).await;
1949 Ok(res)
1950 };
1951 Box::pin(fut)
1952 }
1953 "/cosmos.staking.v1beta1.Query/DelegatorValidator" => {
1954 #[allow(non_camel_case_types)]
1955 struct DelegatorValidatorSvc<T: Query>(pub Arc<T>);
1956 impl<T: Query>
1957 tonic::server::UnaryService<super::QueryDelegatorValidatorRequest>
1958 for DelegatorValidatorSvc<T>
1959 {
1960 type Response = super::QueryDelegatorValidatorResponse;
1961 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1962 fn call(
1963 &mut self,
1964 request: tonic::Request<super::QueryDelegatorValidatorRequest>,
1965 ) -> Self::Future {
1966 let inner = self.0.clone();
1967 let fut = async move { (*inner).delegator_validator(request).await };
1968 Box::pin(fut)
1969 }
1970 }
1971 let accept_compression_encodings = self.accept_compression_encodings;
1972 let send_compression_encodings = self.send_compression_encodings;
1973 let inner = self.inner.clone();
1974 let fut = async move {
1975 let inner = inner.0;
1976 let method = DelegatorValidatorSvc(inner);
1977 let codec = tonic::codec::ProstCodec::default();
1978 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
1979 accept_compression_encodings,
1980 send_compression_encodings,
1981 );
1982 let res = grpc.unary(method, req).await;
1983 Ok(res)
1984 };
1985 Box::pin(fut)
1986 }
1987 "/cosmos.staking.v1beta1.Query/HistoricalInfo" => {
1988 #[allow(non_camel_case_types)]
1989 struct HistoricalInfoSvc<T: Query>(pub Arc<T>);
1990 impl<T: Query> tonic::server::UnaryService<super::QueryHistoricalInfoRequest>
1991 for HistoricalInfoSvc<T>
1992 {
1993 type Response = super::QueryHistoricalInfoResponse;
1994 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
1995 fn call(
1996 &mut self,
1997 request: tonic::Request<super::QueryHistoricalInfoRequest>,
1998 ) -> Self::Future {
1999 let inner = self.0.clone();
2000 let fut = async move { (*inner).historical_info(request).await };
2001 Box::pin(fut)
2002 }
2003 }
2004 let accept_compression_encodings = self.accept_compression_encodings;
2005 let send_compression_encodings = self.send_compression_encodings;
2006 let inner = self.inner.clone();
2007 let fut = async move {
2008 let inner = inner.0;
2009 let method = HistoricalInfoSvc(inner);
2010 let codec = tonic::codec::ProstCodec::default();
2011 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
2012 accept_compression_encodings,
2013 send_compression_encodings,
2014 );
2015 let res = grpc.unary(method, req).await;
2016 Ok(res)
2017 };
2018 Box::pin(fut)
2019 }
2020 "/cosmos.staking.v1beta1.Query/Pool" => {
2021 #[allow(non_camel_case_types)]
2022 struct PoolSvc<T: Query>(pub Arc<T>);
2023 impl<T: Query> tonic::server::UnaryService<super::QueryPoolRequest> for PoolSvc<T> {
2024 type Response = super::QueryPoolResponse;
2025 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
2026 fn call(
2027 &mut self,
2028 request: tonic::Request<super::QueryPoolRequest>,
2029 ) -> Self::Future {
2030 let inner = self.0.clone();
2031 let fut = async move { (*inner).pool(request).await };
2032 Box::pin(fut)
2033 }
2034 }
2035 let accept_compression_encodings = self.accept_compression_encodings;
2036 let send_compression_encodings = self.send_compression_encodings;
2037 let inner = self.inner.clone();
2038 let fut = async move {
2039 let inner = inner.0;
2040 let method = PoolSvc(inner);
2041 let codec = tonic::codec::ProstCodec::default();
2042 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
2043 accept_compression_encodings,
2044 send_compression_encodings,
2045 );
2046 let res = grpc.unary(method, req).await;
2047 Ok(res)
2048 };
2049 Box::pin(fut)
2050 }
2051 "/cosmos.staking.v1beta1.Query/Params" => {
2052 #[allow(non_camel_case_types)]
2053 struct ParamsSvc<T: Query>(pub Arc<T>);
2054 impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest> for ParamsSvc<T> {
2055 type Response = super::QueryParamsResponse;
2056 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
2057 fn call(
2058 &mut self,
2059 request: tonic::Request<super::QueryParamsRequest>,
2060 ) -> Self::Future {
2061 let inner = self.0.clone();
2062 let fut = async move { (*inner).params(request).await };
2063 Box::pin(fut)
2064 }
2065 }
2066 let accept_compression_encodings = self.accept_compression_encodings;
2067 let send_compression_encodings = self.send_compression_encodings;
2068 let inner = self.inner.clone();
2069 let fut = async move {
2070 let inner = inner.0;
2071 let method = ParamsSvc(inner);
2072 let codec = tonic::codec::ProstCodec::default();
2073 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
2074 accept_compression_encodings,
2075 send_compression_encodings,
2076 );
2077 let res = grpc.unary(method, req).await;
2078 Ok(res)
2079 };
2080 Box::pin(fut)
2081 }
2082 _ => Box::pin(async move {
2083 Ok(http::Response::builder()
2084 .status(200)
2085 .header("grpc-status", "12")
2086 .header("content-type", "application/grpc")
2087 .body(empty_body())
2088 .unwrap())
2089 }),
2090 }
2091 }
2092 }
2093 impl<T: Query> Clone for QueryServer<T> {
2094 fn clone(&self) -> Self {
2095 let inner = self.inner.clone();
2096 Self {
2097 inner,
2098 accept_compression_encodings: self.accept_compression_encodings,
2099 send_compression_encodings: self.send_compression_encodings,
2100 }
2101 }
2102 }
2103 impl<T: Query> Clone for _Inner<T> {
2104 fn clone(&self) -> Self {
2105 Self(self.0.clone())
2106 }
2107 }
2108 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
2109 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2110 write!(f, "{:?}", self.0)
2111 }
2112 }
2113 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
2114 const NAME: &'static str = "cosmos.staking.v1beta1.Query";
2115 }
2116}
2117#[allow(clippy::derive_partial_eq_without_eq)]
2121#[derive(Clone, PartialEq, ::prost::Message)]
2122pub struct StakeAuthorization {
2123 #[prost(message, optional, tag = "1")]
2126 pub max_tokens: ::core::option::Option<super::super::base::v1beta1::Coin>,
2127 #[prost(enumeration = "AuthorizationType", tag = "4")]
2129 pub authorization_type: i32,
2130 #[prost(oneof = "stake_authorization::Policy", tags = "2, 3")]
2132 pub validators: ::core::option::Option<stake_authorization::Policy>,
2133}
2134pub mod stake_authorization {
2136 #[allow(clippy::derive_partial_eq_without_eq)]
2138 #[derive(Clone, PartialEq, ::prost::Message)]
2139 pub struct Validators {
2140 #[prost(string, repeated, tag = "1")]
2141 pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
2142 }
2143 #[allow(clippy::derive_partial_eq_without_eq)]
2145 #[derive(Clone, PartialEq, ::prost::Oneof)]
2146 pub enum Policy {
2147 #[prost(message, tag = "2")]
2150 AllowList(Validators),
2151 #[prost(message, tag = "3")]
2153 DenyList(Validators),
2154 }
2155}
2156#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2160#[repr(i32)]
2161pub enum AuthorizationType {
2162 Unspecified = 0,
2164 Delegate = 1,
2166 Undelegate = 2,
2168 Redelegate = 3,
2170}
2171impl AuthorizationType {
2172 pub fn as_str_name(&self) -> &'static str {
2177 match self {
2178 AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED",
2179 AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE",
2180 AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE",
2181 AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE",
2182 }
2183 }
2184 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
2186 match value {
2187 "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified),
2188 "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate),
2189 "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate),
2190 "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate),
2191 _ => None,
2192 }
2193 }
2194}
2195#[allow(clippy::derive_partial_eq_without_eq)]
2197#[derive(Clone, PartialEq, ::prost::Message)]
2198pub struct GenesisState {
2199 #[prost(message, optional, tag = "1")]
2201 pub params: ::core::option::Option<Params>,
2202 #[prost(bytes = "vec", tag = "2")]
2205 pub last_total_power: ::prost::alloc::vec::Vec<u8>,
2206 #[prost(message, repeated, tag = "3")]
2209 pub last_validator_powers: ::prost::alloc::vec::Vec<LastValidatorPower>,
2210 #[prost(message, repeated, tag = "4")]
2212 pub validators: ::prost::alloc::vec::Vec<Validator>,
2213 #[prost(message, repeated, tag = "5")]
2215 pub delegations: ::prost::alloc::vec::Vec<Delegation>,
2216 #[prost(message, repeated, tag = "6")]
2218 pub unbonding_delegations: ::prost::alloc::vec::Vec<UnbondingDelegation>,
2219 #[prost(message, repeated, tag = "7")]
2221 pub redelegations: ::prost::alloc::vec::Vec<Redelegation>,
2222 #[prost(bool, tag = "8")]
2223 pub exported: bool,
2224}
2225#[allow(clippy::derive_partial_eq_without_eq)]
2227#[derive(Clone, PartialEq, ::prost::Message)]
2228pub struct LastValidatorPower {
2229 #[prost(string, tag = "1")]
2231 pub address: ::prost::alloc::string::String,
2232 #[prost(int64, tag = "2")]
2234 pub power: i64,
2235}