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

1/// HistoricalInfo contains header and validator information for a given block.
2/// It is stored as part of staking module's state, which persists the `n` most
3/// recent HistoricalInfo
4/// (`n` is set by the staking module's `historical_entries` parameter).
5#[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/// CommissionRates defines the initial commission rates to be used for creating
14/// a validator.
15#[allow(clippy::derive_partial_eq_without_eq)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct CommissionRates {
18    /// rate is the commission rate charged to delegators, as a fraction.
19    #[prost(string, tag = "1")]
20    pub rate: ::prost::alloc::string::String,
21    /// max_rate defines the maximum commission rate which validator can ever charge, as a fraction.
22    #[prost(string, tag = "2")]
23    pub max_rate: ::prost::alloc::string::String,
24    /// max_change_rate defines the maximum daily increase of the validator commission, as a fraction.
25    #[prost(string, tag = "3")]
26    pub max_change_rate: ::prost::alloc::string::String,
27}
28/// Commission defines commission parameters for a given validator.
29#[allow(clippy::derive_partial_eq_without_eq)]
30#[derive(Clone, PartialEq, ::prost::Message)]
31pub struct Commission {
32    /// commission_rates defines the initial commission rates to be used for creating a validator.
33    #[prost(message, optional, tag = "1")]
34    pub commission_rates: ::core::option::Option<CommissionRates>,
35    /// update_time is the last time the commission rate was changed.
36    #[prost(message, optional, tag = "2")]
37    pub update_time: ::core::option::Option<::prost_types::Timestamp>,
38}
39/// Description defines a validator description.
40#[allow(clippy::derive_partial_eq_without_eq)]
41#[derive(Clone, PartialEq, ::prost::Message)]
42pub struct Description {
43    /// moniker defines a human-readable name for the validator.
44    #[prost(string, tag = "1")]
45    pub moniker: ::prost::alloc::string::String,
46    /// identity defines an optional identity signature (ex. UPort or Keybase).
47    #[prost(string, tag = "2")]
48    pub identity: ::prost::alloc::string::String,
49    /// website defines an optional website link.
50    #[prost(string, tag = "3")]
51    pub website: ::prost::alloc::string::String,
52    /// security_contact defines an optional email for security contact.
53    #[prost(string, tag = "4")]
54    pub security_contact: ::prost::alloc::string::String,
55    /// details define other optional details.
56    #[prost(string, tag = "5")]
57    pub details: ::prost::alloc::string::String,
58}
59/// Validator defines a validator, together with the total amount of the
60/// Validator's bond shares and their exchange rate to coins. Slashing results in
61/// a decrease in the exchange rate, allowing correct calculation of future
62/// undelegations without iterating over delegators. When coins are delegated to
63/// this validator, the validator is credited with a delegation whose number of
64/// bond shares is based on the amount of coins delegated divided by the current
65/// exchange rate. Voting power can be calculated as total bonded shares
66/// multiplied by exchange rate.
67#[allow(clippy::derive_partial_eq_without_eq)]
68#[derive(Clone, PartialEq, ::prost::Message)]
69pub struct Validator {
70    /// operator_address defines the address of the validator's operator; bech encoded in JSON.
71    #[prost(string, tag = "1")]
72    pub operator_address: ::prost::alloc::string::String,
73    /// consensus_pubkey is the consensus public key of the validator, as a Protobuf Any.
74    #[prost(message, optional, tag = "2")]
75    pub consensus_pubkey: ::core::option::Option<::prost_types::Any>,
76    /// jailed defined whether the validator has been jailed from bonded status or not.
77    #[prost(bool, tag = "3")]
78    pub jailed: bool,
79    /// status is the validator status (bonded/unbonding/unbonded).
80    #[prost(enumeration = "BondStatus", tag = "4")]
81    pub status: i32,
82    /// tokens define the delegated tokens (incl. self-delegation).
83    #[prost(string, tag = "5")]
84    pub tokens: ::prost::alloc::string::String,
85    /// delegator_shares defines total shares issued to a validator's delegators.
86    #[prost(string, tag = "6")]
87    pub delegator_shares: ::prost::alloc::string::String,
88    /// description defines the description terms for the validator.
89    #[prost(message, optional, tag = "7")]
90    pub description: ::core::option::Option<Description>,
91    /// unbonding_height defines, if unbonding, the height at which this validator has begun unbonding.
92    #[prost(int64, tag = "8")]
93    pub unbonding_height: i64,
94    /// unbonding_time defines, if unbonding, the min time for the validator to complete unbonding.
95    #[prost(message, optional, tag = "9")]
96    pub unbonding_time: ::core::option::Option<::prost_types::Timestamp>,
97    /// commission defines the commission parameters.
98    #[prost(message, optional, tag = "10")]
99    pub commission: ::core::option::Option<Commission>,
100    /// min_self_delegation is the validator's self declared minimum self delegation.
101    #[prost(string, tag = "11")]
102    pub min_self_delegation: ::prost::alloc::string::String,
103}
104/// ValAddresses defines a repeated set of validator addresses.
105#[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/// DVPair is struct that just has a delegator-validator pair with no other data.
112/// It is intended to be used as a marshalable pointer. For example, a DVPair can
113/// be used to construct the key to getting an UnbondingDelegation from state.
114#[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/// DVPairs defines an array of DVPair objects.
123#[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/// DVVTriplet is struct that just has a delegator-validator-validator triplet
130/// with no other data. It is intended to be used as a marshalable pointer. For
131/// example, a DVVTriplet can be used to construct the key to getting a
132/// Redelegation from state.
133#[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/// DVVTriplets defines an array of DVVTriplet objects.
144#[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/// Delegation represents the bond with tokens held by an account. It is
151/// owned by one delegator, and is associated with the voting power of one
152/// validator.
153#[allow(clippy::derive_partial_eq_without_eq)]
154#[derive(Clone, PartialEq, ::prost::Message)]
155pub struct Delegation {
156    /// delegator_address is the bech32-encoded address of the delegator.
157    #[prost(string, tag = "1")]
158    pub delegator_address: ::prost::alloc::string::String,
159    /// validator_address is the bech32-encoded address of the validator.
160    #[prost(string, tag = "2")]
161    pub validator_address: ::prost::alloc::string::String,
162    /// shares define the delegation shares received.
163    #[prost(string, tag = "3")]
164    pub shares: ::prost::alloc::string::String,
165}
166/// UnbondingDelegation stores all of a single delegator's unbonding bonds
167/// for a single validator in an time-ordered list.
168#[allow(clippy::derive_partial_eq_without_eq)]
169#[derive(Clone, PartialEq, ::prost::Message)]
170pub struct UnbondingDelegation {
171    /// delegator_address is the bech32-encoded address of the delegator.
172    #[prost(string, tag = "1")]
173    pub delegator_address: ::prost::alloc::string::String,
174    /// validator_address is the bech32-encoded address of the validator.
175    #[prost(string, tag = "2")]
176    pub validator_address: ::prost::alloc::string::String,
177    /// entries are the unbonding delegation entries.
178    ///
179    /// unbonding delegation entries
180    #[prost(message, repeated, tag = "3")]
181    pub entries: ::prost::alloc::vec::Vec<UnbondingDelegationEntry>,
182}
183/// UnbondingDelegationEntry defines an unbonding object with relevant metadata.
184#[allow(clippy::derive_partial_eq_without_eq)]
185#[derive(Clone, PartialEq, ::prost::Message)]
186pub struct UnbondingDelegationEntry {
187    /// creation_height is the height which the unbonding took place.
188    #[prost(int64, tag = "1")]
189    pub creation_height: i64,
190    /// completion_time is the unix time for unbonding completion.
191    #[prost(message, optional, tag = "2")]
192    pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
193    /// initial_balance defines the tokens initially scheduled to receive at completion.
194    #[prost(string, tag = "3")]
195    pub initial_balance: ::prost::alloc::string::String,
196    /// balance defines the tokens to receive at completion.
197    #[prost(string, tag = "4")]
198    pub balance: ::prost::alloc::string::String,
199}
200/// RedelegationEntry defines a redelegation object with relevant metadata.
201#[allow(clippy::derive_partial_eq_without_eq)]
202#[derive(Clone, PartialEq, ::prost::Message)]
203pub struct RedelegationEntry {
204    /// creation_height  defines the height which the redelegation took place.
205    #[prost(int64, tag = "1")]
206    pub creation_height: i64,
207    /// completion_time defines the unix time for redelegation completion.
208    #[prost(message, optional, tag = "2")]
209    pub completion_time: ::core::option::Option<::prost_types::Timestamp>,
210    /// initial_balance defines the initial balance when redelegation started.
211    #[prost(string, tag = "3")]
212    pub initial_balance: ::prost::alloc::string::String,
213    /// shares_dst is the amount of destination-validator shares created by redelegation.
214    #[prost(string, tag = "4")]
215    pub shares_dst: ::prost::alloc::string::String,
216}
217/// Redelegation contains the list of a particular delegator's redelegating bonds
218/// from a particular source validator to a particular destination validator.
219#[allow(clippy::derive_partial_eq_without_eq)]
220#[derive(Clone, PartialEq, ::prost::Message)]
221pub struct Redelegation {
222    /// delegator_address is the bech32-encoded address of the delegator.
223    #[prost(string, tag = "1")]
224    pub delegator_address: ::prost::alloc::string::String,
225    /// validator_src_address is the validator redelegation source operator address.
226    #[prost(string, tag = "2")]
227    pub validator_src_address: ::prost::alloc::string::String,
228    /// validator_dst_address is the validator redelegation destination operator address.
229    #[prost(string, tag = "3")]
230    pub validator_dst_address: ::prost::alloc::string::String,
231    /// entries are the redelegation entries.
232    ///
233    /// redelegation entries
234    #[prost(message, repeated, tag = "4")]
235    pub entries: ::prost::alloc::vec::Vec<RedelegationEntry>,
236}
237/// Params defines the parameters for the staking module.
238#[allow(clippy::derive_partial_eq_without_eq)]
239#[derive(Clone, PartialEq, ::prost::Message)]
240pub struct Params {
241    /// unbonding_time is the time duration of unbonding.
242    #[prost(message, optional, tag = "1")]
243    pub unbonding_time: ::core::option::Option<::prost_types::Duration>,
244    /// max_validators is the maximum number of validators.
245    #[prost(uint32, tag = "2")]
246    pub max_validators: u32,
247    /// max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio).
248    #[prost(uint32, tag = "3")]
249    pub max_entries: u32,
250    /// historical_entries is the number of historical entries to persist.
251    #[prost(uint32, tag = "4")]
252    pub historical_entries: u32,
253    /// bond_denom defines the bondable coin denomination.
254    #[prost(string, tag = "5")]
255    pub bond_denom: ::prost::alloc::string::String,
256}
257/// DelegationResponse is equivalent to Delegation except that it contains a
258/// balance in addition to shares which is more suitable for client responses.
259#[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/// RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
268/// contains a balance in addition to shares which is more suitable for client
269/// responses.
270#[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/// RedelegationResponse is equivalent to a Redelegation except that its entries
279/// contain a balance in addition to shares which is more suitable for client
280/// responses.
281#[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/// Pool is used for tracking bonded and not-bonded token supply of the bond
290/// denomination.
291#[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/// BondStatus is the status of a validator.
300#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
301#[repr(i32)]
302pub enum BondStatus {
303    /// UNSPECIFIED defines an invalid validator status.
304    Unspecified = 0,
305    /// UNBONDED defines a validator that is not bonded.
306    Unbonded = 1,
307    /// UNBONDING defines a validator that is unbonding.
308    Unbonding = 2,
309    /// BONDED defines a validator that is bonded.
310    Bonded = 3,
311}
312impl BondStatus {
313    /// String value of the enum field names used in the ProtoBuf definition.
314    ///
315    /// The values are not transformed in any way and thus are considered stable
316    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
317    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    /// Creates an enum from field names used in the ProtoBuf definition.
326    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/// MsgCreateValidator defines a SDK message for creating a new validator.
337#[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/// MsgCreateValidatorResponse defines the Msg/CreateValidator response type.
356#[allow(clippy::derive_partial_eq_without_eq)]
357#[derive(Clone, PartialEq, ::prost::Message)]
358pub struct MsgCreateValidatorResponse {}
359/// MsgEditValidator defines a SDK message for editing an existing validator.
360#[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    /// We pass a reference to the new commission rate and min self delegation as
368    /// it's not mandatory to update. If not updated, the deserialized rate will be
369    /// zero with no way to distinguish if an update was intended.
370    /// REF: #2373
371    #[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/// MsgEditValidatorResponse defines the Msg/EditValidator response type.
377#[allow(clippy::derive_partial_eq_without_eq)]
378#[derive(Clone, PartialEq, ::prost::Message)]
379pub struct MsgEditValidatorResponse {}
380/// MsgDelegate defines a SDK message for performing a delegation of coins
381/// from a delegator to a validator.
382#[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/// MsgDelegateResponse defines the Msg/Delegate response type.
393#[allow(clippy::derive_partial_eq_without_eq)]
394#[derive(Clone, PartialEq, ::prost::Message)]
395pub struct MsgDelegateResponse {}
396/// MsgBeginRedelegate defines a SDK message for performing a redelegation
397/// of coins from a delegator and source validator to a destination validator.
398#[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/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
411#[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/// MsgUndelegate defines a SDK message for performing an undelegation from a
418/// delegate and a validator.
419#[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/// MsgUndelegateResponse defines the Msg/Undelegate response type.
430#[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/// Generated client implementations.
437#[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    /// Msg defines the staking Msg service.
444    #[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        /// Attempt to create a new client by connecting to a given endpoint.
452        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        /// Compress requests with the given encoding.
492        ///
493        /// This requires the server to support it otherwise it might respond with an
494        /// error.
495        #[must_use]
496        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
497            self.inner = self.inner.send_compressed(encoding);
498            self
499        }
500        /// Enable decompressing responses.
501        #[must_use]
502        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
503            self.inner = self.inner.accept_compressed(encoding);
504            self
505        }
506        /// CreateValidator defines a method for creating a new validator.
507        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        /// EditValidator defines a method for editing an existing validator.
523        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        /// Delegate defines a method for performing a delegation of coins
539        /// from a delegator to a validator.
540        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        /// BeginRedelegate defines a method for performing a redelegation
555        /// of coins from a delegator and source validator to a destination validator.
556        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        /// Undelegate defines a method for performing an undelegation from a
572        /// delegate and a validator.
573        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/// Generated server implementations.
591#[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    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
597    #[async_trait]
598    pub trait Msg: Send + Sync + 'static {
599        /// CreateValidator defines a method for creating a new validator.
600        async fn create_validator(
601            &self,
602            request: tonic::Request<super::MsgCreateValidator>,
603        ) -> Result<tonic::Response<super::MsgCreateValidatorResponse>, tonic::Status>;
604        /// EditValidator defines a method for editing an existing validator.
605        async fn edit_validator(
606            &self,
607            request: tonic::Request<super::MsgEditValidator>,
608        ) -> Result<tonic::Response<super::MsgEditValidatorResponse>, tonic::Status>;
609        /// Delegate defines a method for performing a delegation of coins
610        /// from a delegator to a validator.
611        async fn delegate(
612            &self,
613            request: tonic::Request<super::MsgDelegate>,
614        ) -> Result<tonic::Response<super::MsgDelegateResponse>, tonic::Status>;
615        /// BeginRedelegate defines a method for performing a redelegation
616        /// of coins from a delegator and source validator to a destination validator.
617        async fn begin_redelegate(
618            &self,
619            request: tonic::Request<super::MsgBeginRedelegate>,
620        ) -> Result<tonic::Response<super::MsgBeginRedelegateResponse>, tonic::Status>;
621        /// Undelegate defines a method for performing an undelegation from a
622        /// delegate and a validator.
623        async fn undelegate(
624            &self,
625            request: tonic::Request<super::MsgUndelegate>,
626        ) -> Result<tonic::Response<super::MsgUndelegateResponse>, tonic::Status>;
627    }
628    /// Msg defines the staking Msg service.
629    #[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        /// Enable decompressing requests with the given encoding.
655        #[must_use]
656        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
657            self.accept_compression_encodings.enable(encoding);
658            self
659        }
660        /// Compress responses with the given encoding, if the client supports it.
661        #[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/// QueryValidatorsRequest is request type for Query/Validators RPC method.
873#[allow(clippy::derive_partial_eq_without_eq)]
874#[derive(Clone, PartialEq, ::prost::Message)]
875pub struct QueryValidatorsRequest {
876    /// status enables to query for validators matching a given status.
877    #[prost(string, tag = "1")]
878    pub status: ::prost::alloc::string::String,
879    /// pagination defines an optional pagination for the request.
880    #[prost(message, optional, tag = "2")]
881    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
882}
883/// QueryValidatorsResponse is response type for the Query/Validators RPC method
884#[allow(clippy::derive_partial_eq_without_eq)]
885#[derive(Clone, PartialEq, ::prost::Message)]
886pub struct QueryValidatorsResponse {
887    /// validators contains all the queried validators.
888    #[prost(message, repeated, tag = "1")]
889    pub validators: ::prost::alloc::vec::Vec<Validator>,
890    /// pagination defines the pagination in the response.
891    #[prost(message, optional, tag = "2")]
892    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
893}
894/// QueryValidatorRequest is response type for the Query/Validator RPC method
895#[allow(clippy::derive_partial_eq_without_eq)]
896#[derive(Clone, PartialEq, ::prost::Message)]
897pub struct QueryValidatorRequest {
898    /// validator_addr defines the validator address to query for.
899    #[prost(string, tag = "1")]
900    pub validator_addr: ::prost::alloc::string::String,
901}
902/// QueryValidatorResponse is response type for the Query/Validator RPC method
903#[allow(clippy::derive_partial_eq_without_eq)]
904#[derive(Clone, PartialEq, ::prost::Message)]
905pub struct QueryValidatorResponse {
906    /// validator defines the the validator info.
907    #[prost(message, optional, tag = "1")]
908    pub validator: ::core::option::Option<Validator>,
909}
910/// QueryValidatorDelegationsRequest is request type for the
911/// Query/ValidatorDelegations RPC method
912#[allow(clippy::derive_partial_eq_without_eq)]
913#[derive(Clone, PartialEq, ::prost::Message)]
914pub struct QueryValidatorDelegationsRequest {
915    /// validator_addr defines the validator address to query for.
916    #[prost(string, tag = "1")]
917    pub validator_addr: ::prost::alloc::string::String,
918    /// pagination defines an optional pagination for the request.
919    #[prost(message, optional, tag = "2")]
920    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
921}
922/// QueryValidatorDelegationsResponse is response type for the
923/// Query/ValidatorDelegations RPC method
924#[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    /// pagination defines the pagination in the response.
930    #[prost(message, optional, tag = "2")]
931    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
932}
933/// QueryValidatorUnbondingDelegationsRequest is required type for the
934/// Query/ValidatorUnbondingDelegations RPC method
935#[allow(clippy::derive_partial_eq_without_eq)]
936#[derive(Clone, PartialEq, ::prost::Message)]
937pub struct QueryValidatorUnbondingDelegationsRequest {
938    /// validator_addr defines the validator address to query for.
939    #[prost(string, tag = "1")]
940    pub validator_addr: ::prost::alloc::string::String,
941    /// pagination defines an optional pagination for the request.
942    #[prost(message, optional, tag = "2")]
943    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
944}
945/// QueryValidatorUnbondingDelegationsResponse is response type for the
946/// Query/ValidatorUnbondingDelegations RPC method.
947#[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    /// pagination defines the pagination in the response.
953    #[prost(message, optional, tag = "2")]
954    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
955}
956/// QueryDelegationRequest is request type for the Query/Delegation RPC method.
957#[allow(clippy::derive_partial_eq_without_eq)]
958#[derive(Clone, PartialEq, ::prost::Message)]
959pub struct QueryDelegationRequest {
960    /// delegator_addr defines the delegator address to query for.
961    #[prost(string, tag = "1")]
962    pub delegator_addr: ::prost::alloc::string::String,
963    /// validator_addr defines the validator address to query for.
964    #[prost(string, tag = "2")]
965    pub validator_addr: ::prost::alloc::string::String,
966}
967/// QueryDelegationResponse is response type for the Query/Delegation RPC method.
968#[allow(clippy::derive_partial_eq_without_eq)]
969#[derive(Clone, PartialEq, ::prost::Message)]
970pub struct QueryDelegationResponse {
971    /// delegation_responses defines the delegation info of a delegation.
972    #[prost(message, optional, tag = "1")]
973    pub delegation_response: ::core::option::Option<DelegationResponse>,
974}
975/// QueryUnbondingDelegationRequest is request type for the
976/// Query/UnbondingDelegation RPC method.
977#[allow(clippy::derive_partial_eq_without_eq)]
978#[derive(Clone, PartialEq, ::prost::Message)]
979pub struct QueryUnbondingDelegationRequest {
980    /// delegator_addr defines the delegator address to query for.
981    #[prost(string, tag = "1")]
982    pub delegator_addr: ::prost::alloc::string::String,
983    /// validator_addr defines the validator address to query for.
984    #[prost(string, tag = "2")]
985    pub validator_addr: ::prost::alloc::string::String,
986}
987/// QueryDelegationResponse is response type for the Query/UnbondingDelegation
988/// RPC method.
989#[allow(clippy::derive_partial_eq_without_eq)]
990#[derive(Clone, PartialEq, ::prost::Message)]
991pub struct QueryUnbondingDelegationResponse {
992    /// unbond defines the unbonding information of a delegation.
993    #[prost(message, optional, tag = "1")]
994    pub unbond: ::core::option::Option<UnbondingDelegation>,
995}
996/// QueryDelegatorDelegationsRequest is request type for the
997/// Query/DelegatorDelegations RPC method.
998#[allow(clippy::derive_partial_eq_without_eq)]
999#[derive(Clone, PartialEq, ::prost::Message)]
1000pub struct QueryDelegatorDelegationsRequest {
1001    /// delegator_addr defines the delegator address to query for.
1002    #[prost(string, tag = "1")]
1003    pub delegator_addr: ::prost::alloc::string::String,
1004    /// pagination defines an optional pagination for the request.
1005    #[prost(message, optional, tag = "2")]
1006    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1007}
1008/// QueryDelegatorDelegationsResponse is response type for the
1009/// Query/DelegatorDelegations RPC method.
1010#[allow(clippy::derive_partial_eq_without_eq)]
1011#[derive(Clone, PartialEq, ::prost::Message)]
1012pub struct QueryDelegatorDelegationsResponse {
1013    /// delegation_responses defines all the delegations' info of a delegator.
1014    #[prost(message, repeated, tag = "1")]
1015    pub delegation_responses: ::prost::alloc::vec::Vec<DelegationResponse>,
1016    /// pagination defines the pagination in the response.
1017    #[prost(message, optional, tag = "2")]
1018    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1019}
1020/// QueryDelegatorUnbondingDelegationsRequest is request type for the
1021/// Query/DelegatorUnbondingDelegations RPC method.
1022#[allow(clippy::derive_partial_eq_without_eq)]
1023#[derive(Clone, PartialEq, ::prost::Message)]
1024pub struct QueryDelegatorUnbondingDelegationsRequest {
1025    /// delegator_addr defines the delegator address to query for.
1026    #[prost(string, tag = "1")]
1027    pub delegator_addr: ::prost::alloc::string::String,
1028    /// pagination defines an optional pagination for the request.
1029    #[prost(message, optional, tag = "2")]
1030    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1031}
1032/// QueryUnbondingDelegatorDelegationsResponse is response type for the
1033/// Query/UnbondingDelegatorDelegations RPC method.
1034#[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    /// pagination defines the pagination in the response.
1040    #[prost(message, optional, tag = "2")]
1041    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1042}
1043/// QueryRedelegationsRequest is request type for the Query/Redelegations RPC
1044/// method.
1045#[allow(clippy::derive_partial_eq_without_eq)]
1046#[derive(Clone, PartialEq, ::prost::Message)]
1047pub struct QueryRedelegationsRequest {
1048    /// delegator_addr defines the delegator address to query for.
1049    #[prost(string, tag = "1")]
1050    pub delegator_addr: ::prost::alloc::string::String,
1051    /// src_validator_addr defines the validator address to redelegate from.
1052    #[prost(string, tag = "2")]
1053    pub src_validator_addr: ::prost::alloc::string::String,
1054    /// dst_validator_addr defines the validator address to redelegate to.
1055    #[prost(string, tag = "3")]
1056    pub dst_validator_addr: ::prost::alloc::string::String,
1057    /// pagination defines an optional pagination for the request.
1058    #[prost(message, optional, tag = "4")]
1059    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1060}
1061/// QueryRedelegationsResponse is response type for the Query/Redelegations RPC
1062/// method.
1063#[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    /// pagination defines the pagination in the response.
1069    #[prost(message, optional, tag = "2")]
1070    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1071}
1072/// QueryDelegatorValidatorsRequest is request type for the
1073/// Query/DelegatorValidators RPC method.
1074#[allow(clippy::derive_partial_eq_without_eq)]
1075#[derive(Clone, PartialEq, ::prost::Message)]
1076pub struct QueryDelegatorValidatorsRequest {
1077    /// delegator_addr defines the delegator address to query for.
1078    #[prost(string, tag = "1")]
1079    pub delegator_addr: ::prost::alloc::string::String,
1080    /// pagination defines an optional pagination for the request.
1081    #[prost(message, optional, tag = "2")]
1082    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
1083}
1084/// QueryDelegatorValidatorsResponse is response type for the
1085/// Query/DelegatorValidators RPC method.
1086#[allow(clippy::derive_partial_eq_without_eq)]
1087#[derive(Clone, PartialEq, ::prost::Message)]
1088pub struct QueryDelegatorValidatorsResponse {
1089    /// validators defines the the validators' info of a delegator.
1090    #[prost(message, repeated, tag = "1")]
1091    pub validators: ::prost::alloc::vec::Vec<Validator>,
1092    /// pagination defines the pagination in the response.
1093    #[prost(message, optional, tag = "2")]
1094    pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
1095}
1096/// QueryDelegatorValidatorRequest is request type for the
1097/// Query/DelegatorValidator RPC method.
1098#[allow(clippy::derive_partial_eq_without_eq)]
1099#[derive(Clone, PartialEq, ::prost::Message)]
1100pub struct QueryDelegatorValidatorRequest {
1101    /// delegator_addr defines the delegator address to query for.
1102    #[prost(string, tag = "1")]
1103    pub delegator_addr: ::prost::alloc::string::String,
1104    /// validator_addr defines the validator address to query for.
1105    #[prost(string, tag = "2")]
1106    pub validator_addr: ::prost::alloc::string::String,
1107}
1108/// QueryDelegatorValidatorResponse response type for the
1109/// Query/DelegatorValidator RPC method.
1110#[allow(clippy::derive_partial_eq_without_eq)]
1111#[derive(Clone, PartialEq, ::prost::Message)]
1112pub struct QueryDelegatorValidatorResponse {
1113    /// validator defines the the validator info.
1114    #[prost(message, optional, tag = "1")]
1115    pub validator: ::core::option::Option<Validator>,
1116}
1117/// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC
1118/// method.
1119#[allow(clippy::derive_partial_eq_without_eq)]
1120#[derive(Clone, PartialEq, ::prost::Message)]
1121pub struct QueryHistoricalInfoRequest {
1122    /// height defines at which height to query the historical info.
1123    #[prost(int64, tag = "1")]
1124    pub height: i64,
1125}
1126/// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC
1127/// method.
1128#[allow(clippy::derive_partial_eq_without_eq)]
1129#[derive(Clone, PartialEq, ::prost::Message)]
1130pub struct QueryHistoricalInfoResponse {
1131    /// hist defines the historical info at the given height.
1132    #[prost(message, optional, tag = "1")]
1133    pub hist: ::core::option::Option<HistoricalInfo>,
1134}
1135/// QueryPoolRequest is request type for the Query/Pool RPC method.
1136#[allow(clippy::derive_partial_eq_without_eq)]
1137#[derive(Clone, PartialEq, ::prost::Message)]
1138pub struct QueryPoolRequest {}
1139/// QueryPoolResponse is response type for the Query/Pool RPC method.
1140#[allow(clippy::derive_partial_eq_without_eq)]
1141#[derive(Clone, PartialEq, ::prost::Message)]
1142pub struct QueryPoolResponse {
1143    /// pool defines the pool info.
1144    #[prost(message, optional, tag = "1")]
1145    pub pool: ::core::option::Option<Pool>,
1146}
1147/// QueryParamsRequest is request type for the Query/Params RPC method.
1148#[allow(clippy::derive_partial_eq_without_eq)]
1149#[derive(Clone, PartialEq, ::prost::Message)]
1150pub struct QueryParamsRequest {}
1151/// QueryParamsResponse is response type for the Query/Params RPC method.
1152#[allow(clippy::derive_partial_eq_without_eq)]
1153#[derive(Clone, PartialEq, ::prost::Message)]
1154pub struct QueryParamsResponse {
1155    /// params holds all the parameters of this module.
1156    #[prost(message, optional, tag = "1")]
1157    pub params: ::core::option::Option<Params>,
1158}
1159/// Generated client implementations.
1160#[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    /// Query defines the gRPC querier service.
1167    #[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        /// Attempt to create a new client by connecting to a given endpoint.
1175        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        /// Compress requests with the given encoding.
1218        ///
1219        /// This requires the server to support it otherwise it might respond with an
1220        /// error.
1221        #[must_use]
1222        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1223            self.inner = self.inner.send_compressed(encoding);
1224            self
1225        }
1226        /// Enable decompressing responses.
1227        #[must_use]
1228        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1229            self.inner = self.inner.accept_compressed(encoding);
1230            self
1231        }
1232        /// Validators queries all validators that match the given status.
1233        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        /// Validator queries validator info for given validator address.
1249        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        /// ValidatorDelegations queries delegate info for given validator.
1265        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        /// ValidatorUnbondingDelegations queries unbonding delegations of a validator.
1283        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        /// Delegation queries delegate info for given validator delegator pair.
1301        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        /// UnbondingDelegation queries unbonding info for given validator delegator
1317        /// pair.
1318        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        /// DelegatorDelegations queries all delegations of a given delegator address.
1336        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        /// DelegatorUnbondingDelegations queries all unbonding delegations of a given
1354        /// delegator address.
1355        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        /// Redelegations queries redelegations of given address.
1373        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        /// DelegatorValidators queries all validators info for given delegator
1389        /// address.
1390        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        /// DelegatorValidator queries validator info for given delegator validator
1408        /// pair.
1409        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        /// HistoricalInfo queries the historical info for given height.
1427        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        /// Pool queries the pool info.
1444        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        /// Parameters queries the staking parameters.
1459        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/// Generated server implementations.
1476#[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    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
1482    #[async_trait]
1483    pub trait Query: Send + Sync + 'static {
1484        /// Validators queries all validators that match the given status.
1485        async fn validators(
1486            &self,
1487            request: tonic::Request<super::QueryValidatorsRequest>,
1488        ) -> Result<tonic::Response<super::QueryValidatorsResponse>, tonic::Status>;
1489        /// Validator queries validator info for given validator address.
1490        async fn validator(
1491            &self,
1492            request: tonic::Request<super::QueryValidatorRequest>,
1493        ) -> Result<tonic::Response<super::QueryValidatorResponse>, tonic::Status>;
1494        /// ValidatorDelegations queries delegate info for given validator.
1495        async fn validator_delegations(
1496            &self,
1497            request: tonic::Request<super::QueryValidatorDelegationsRequest>,
1498        ) -> Result<tonic::Response<super::QueryValidatorDelegationsResponse>, tonic::Status>;
1499        /// ValidatorUnbondingDelegations queries unbonding delegations of a validator.
1500        async fn validator_unbonding_delegations(
1501            &self,
1502            request: tonic::Request<super::QueryValidatorUnbondingDelegationsRequest>,
1503        ) -> Result<tonic::Response<super::QueryValidatorUnbondingDelegationsResponse>, tonic::Status>;
1504        /// Delegation queries delegate info for given validator delegator pair.
1505        async fn delegation(
1506            &self,
1507            request: tonic::Request<super::QueryDelegationRequest>,
1508        ) -> Result<tonic::Response<super::QueryDelegationResponse>, tonic::Status>;
1509        /// UnbondingDelegation queries unbonding info for given validator delegator
1510        /// pair.
1511        async fn unbonding_delegation(
1512            &self,
1513            request: tonic::Request<super::QueryUnbondingDelegationRequest>,
1514        ) -> Result<tonic::Response<super::QueryUnbondingDelegationResponse>, tonic::Status>;
1515        /// DelegatorDelegations queries all delegations of a given delegator address.
1516        async fn delegator_delegations(
1517            &self,
1518            request: tonic::Request<super::QueryDelegatorDelegationsRequest>,
1519        ) -> Result<tonic::Response<super::QueryDelegatorDelegationsResponse>, tonic::Status>;
1520        /// DelegatorUnbondingDelegations queries all unbonding delegations of a given
1521        /// delegator address.
1522        async fn delegator_unbonding_delegations(
1523            &self,
1524            request: tonic::Request<super::QueryDelegatorUnbondingDelegationsRequest>,
1525        ) -> Result<tonic::Response<super::QueryDelegatorUnbondingDelegationsResponse>, tonic::Status>;
1526        /// Redelegations queries redelegations of given address.
1527        async fn redelegations(
1528            &self,
1529            request: tonic::Request<super::QueryRedelegationsRequest>,
1530        ) -> Result<tonic::Response<super::QueryRedelegationsResponse>, tonic::Status>;
1531        /// DelegatorValidators queries all validators info for given delegator
1532        /// address.
1533        async fn delegator_validators(
1534            &self,
1535            request: tonic::Request<super::QueryDelegatorValidatorsRequest>,
1536        ) -> Result<tonic::Response<super::QueryDelegatorValidatorsResponse>, tonic::Status>;
1537        /// DelegatorValidator queries validator info for given delegator validator
1538        /// pair.
1539        async fn delegator_validator(
1540            &self,
1541            request: tonic::Request<super::QueryDelegatorValidatorRequest>,
1542        ) -> Result<tonic::Response<super::QueryDelegatorValidatorResponse>, tonic::Status>;
1543        /// HistoricalInfo queries the historical info for given height.
1544        async fn historical_info(
1545            &self,
1546            request: tonic::Request<super::QueryHistoricalInfoRequest>,
1547        ) -> Result<tonic::Response<super::QueryHistoricalInfoResponse>, tonic::Status>;
1548        /// Pool queries the pool info.
1549        async fn pool(
1550            &self,
1551            request: tonic::Request<super::QueryPoolRequest>,
1552        ) -> Result<tonic::Response<super::QueryPoolResponse>, tonic::Status>;
1553        /// Parameters queries the staking parameters.
1554        async fn params(
1555            &self,
1556            request: tonic::Request<super::QueryParamsRequest>,
1557        ) -> Result<tonic::Response<super::QueryParamsResponse>, tonic::Status>;
1558    }
1559    /// Query defines the gRPC querier service.
1560    #[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        /// Enable decompressing requests with the given encoding.
1586        #[must_use]
1587        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1588            self.accept_compression_encodings.enable(encoding);
1589            self
1590        }
1591        /// Compress responses with the given encoding, if the client supports it.
1592        #[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/// StakeAuthorization defines authorization for delegate/undelegate/redelegate.
2118///
2119/// Since: cosmos-sdk 0.43
2120#[allow(clippy::derive_partial_eq_without_eq)]
2121#[derive(Clone, PartialEq, ::prost::Message)]
2122pub struct StakeAuthorization {
2123    /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is
2124    /// empty, there is no spend limit and any amount of coins can be delegated.
2125    #[prost(message, optional, tag = "1")]
2126    pub max_tokens: ::core::option::Option<super::super::base::v1beta1::Coin>,
2127    /// authorization_type defines one of AuthorizationType.
2128    #[prost(enumeration = "AuthorizationType", tag = "4")]
2129    pub authorization_type: i32,
2130    /// validators is the oneof that represents either allow_list or deny_list
2131    #[prost(oneof = "stake_authorization::Policy", tags = "2, 3")]
2132    pub validators: ::core::option::Option<stake_authorization::Policy>,
2133}
2134/// Nested message and enum types in `StakeAuthorization`.
2135pub mod stake_authorization {
2136    /// Validators defines list of validator addresses.
2137    #[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    /// validators is the oneof that represents either allow_list or deny_list
2144    #[allow(clippy::derive_partial_eq_without_eq)]
2145    #[derive(Clone, PartialEq, ::prost::Oneof)]
2146    pub enum Policy {
2147        /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's
2148        /// account.
2149        #[prost(message, tag = "2")]
2150        AllowList(Validators),
2151        /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens.
2152        #[prost(message, tag = "3")]
2153        DenyList(Validators),
2154    }
2155}
2156/// AuthorizationType defines the type of staking module authorization type
2157///
2158/// Since: cosmos-sdk 0.43
2159#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
2160#[repr(i32)]
2161pub enum AuthorizationType {
2162    /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type
2163    Unspecified = 0,
2164    /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate
2165    Delegate = 1,
2166    /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate
2167    Undelegate = 2,
2168    /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate
2169    Redelegate = 3,
2170}
2171impl AuthorizationType {
2172    /// String value of the enum field names used in the ProtoBuf definition.
2173    ///
2174    /// The values are not transformed in any way and thus are considered stable
2175    /// (if the ProtoBuf definition does not change) and safe for programmatic use.
2176    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    /// Creates an enum from field names used in the ProtoBuf definition.
2185    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/// GenesisState defines the staking module's genesis state.
2196#[allow(clippy::derive_partial_eq_without_eq)]
2197#[derive(Clone, PartialEq, ::prost::Message)]
2198pub struct GenesisState {
2199    /// params defines all the paramaters of related to deposit.
2200    #[prost(message, optional, tag = "1")]
2201    pub params: ::core::option::Option<Params>,
2202    /// last_total_power tracks the total amounts of bonded tokens recorded during
2203    /// the previous end block.
2204    #[prost(bytes = "vec", tag = "2")]
2205    pub last_total_power: ::prost::alloc::vec::Vec<u8>,
2206    /// last_validator_powers is a special index that provides a historical list
2207    /// of the last-block's bonded validators.
2208    #[prost(message, repeated, tag = "3")]
2209    pub last_validator_powers: ::prost::alloc::vec::Vec<LastValidatorPower>,
2210    /// delegations defines the validator set at genesis.
2211    #[prost(message, repeated, tag = "4")]
2212    pub validators: ::prost::alloc::vec::Vec<Validator>,
2213    /// delegations defines the delegations active at genesis.
2214    #[prost(message, repeated, tag = "5")]
2215    pub delegations: ::prost::alloc::vec::Vec<Delegation>,
2216    /// unbonding_delegations defines the unbonding delegations active at genesis.
2217    #[prost(message, repeated, tag = "6")]
2218    pub unbonding_delegations: ::prost::alloc::vec::Vec<UnbondingDelegation>,
2219    /// redelegations defines the redelegations active at genesis.
2220    #[prost(message, repeated, tag = "7")]
2221    pub redelegations: ::prost::alloc::vec::Vec<Redelegation>,
2222    #[prost(bool, tag = "8")]
2223    pub exported: bool,
2224}
2225/// LastValidatorPower required for validator set update logic.
2226#[allow(clippy::derive_partial_eq_without_eq)]
2227#[derive(Clone, PartialEq, ::prost::Message)]
2228pub struct LastValidatorPower {
2229    /// address is the address of the validator.
2230    #[prost(string, tag = "1")]
2231    pub address: ::prost::alloc::string::String,
2232    /// power defines the power of the validator.
2233    #[prost(int64, tag = "2")]
2234    pub power: i64,
2235}