juno_rust_proto/prost/ibc-go/
ibc.core.client.v1.rs

1/// IdentifiedClientState defines a client state with an additional client
2/// identifier field.
3#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct IdentifiedClientState {
6    /// client identifier
7    #[prost(string, tag = "1")]
8    pub client_id: ::prost::alloc::string::String,
9    /// client state
10    #[prost(message, optional, tag = "2")]
11    pub client_state: ::core::option::Option<::prost_types::Any>,
12}
13/// ConsensusStateWithHeight defines a consensus state with an additional height
14/// field.
15#[allow(clippy::derive_partial_eq_without_eq)]
16#[derive(Clone, PartialEq, ::prost::Message)]
17pub struct ConsensusStateWithHeight {
18    /// consensus state height
19    #[prost(message, optional, tag = "1")]
20    pub height: ::core::option::Option<Height>,
21    /// consensus state
22    #[prost(message, optional, tag = "2")]
23    pub consensus_state: ::core::option::Option<::prost_types::Any>,
24}
25/// ClientConsensusStates defines all the stored consensus states for a given
26/// client.
27#[allow(clippy::derive_partial_eq_without_eq)]
28#[derive(Clone, PartialEq, ::prost::Message)]
29pub struct ClientConsensusStates {
30    /// client identifier
31    #[prost(string, tag = "1")]
32    pub client_id: ::prost::alloc::string::String,
33    /// consensus states and their heights associated with the client
34    #[prost(message, repeated, tag = "2")]
35    pub consensus_states: ::prost::alloc::vec::Vec<ConsensusStateWithHeight>,
36}
37/// ClientUpdateProposal is a governance proposal. If it passes, the substitute
38/// client's latest consensus state is copied over to the subject client. The proposal
39/// handler may fail if the subject and the substitute do not match in client and
40/// chain parameters (with exception to latest height, frozen height, and chain-id).
41#[allow(clippy::derive_partial_eq_without_eq)]
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct ClientUpdateProposal {
44    /// the title of the update proposal
45    #[prost(string, tag = "1")]
46    pub title: ::prost::alloc::string::String,
47    /// the description of the proposal
48    #[prost(string, tag = "2")]
49    pub description: ::prost::alloc::string::String,
50    /// the client identifier for the client to be updated if the proposal passes
51    #[prost(string, tag = "3")]
52    pub subject_client_id: ::prost::alloc::string::String,
53    /// the substitute client identifier for the client standing in for the subject
54    /// client
55    #[prost(string, tag = "4")]
56    pub substitute_client_id: ::prost::alloc::string::String,
57}
58/// UpgradeProposal is a gov Content type for initiating an IBC breaking
59/// upgrade.
60#[allow(clippy::derive_partial_eq_without_eq)]
61#[derive(Clone, PartialEq, ::prost::Message)]
62pub struct UpgradeProposal {
63    #[prost(string, tag = "1")]
64    pub title: ::prost::alloc::string::String,
65    #[prost(string, tag = "2")]
66    pub description: ::prost::alloc::string::String,
67    #[prost(message, optional, tag = "3")]
68    pub plan: ::core::option::Option<super::super::super::super::cosmos::upgrade::v1beta1::Plan>,
69    /// An UpgradedClientState must be provided to perform an IBC breaking upgrade.
70    /// This will make the chain commit to the correct upgraded (self) client state
71    /// before the upgrade occurs, so that connecting chains can verify that the
72    /// new upgraded client is valid by verifying a proof on the previous version
73    /// of the chain. This will allow IBC connections to persist smoothly across
74    /// planned chain upgrades
75    #[prost(message, optional, tag = "4")]
76    pub upgraded_client_state: ::core::option::Option<::prost_types::Any>,
77}
78/// Height is a monotonically increasing data type
79/// that can be compared against another Height for the purposes of updating and
80/// freezing clients
81///
82/// Normally the RevisionHeight is incremented at each height while keeping
83/// RevisionNumber the same. However some consensus algorithms may choose to
84/// reset the height in certain conditions e.g. hard forks, state-machine
85/// breaking changes In these cases, the RevisionNumber is incremented so that
86/// height continues to be monitonically increasing even as the RevisionHeight
87/// gets reset
88#[allow(clippy::derive_partial_eq_without_eq)]
89#[derive(Clone, PartialEq, ::prost::Message)]
90pub struct Height {
91    /// the revision that the client is currently on
92    #[prost(uint64, tag = "1")]
93    pub revision_number: u64,
94    /// the height within the given revision
95    #[prost(uint64, tag = "2")]
96    pub revision_height: u64,
97}
98/// Params defines the set of IBC light client parameters.
99#[allow(clippy::derive_partial_eq_without_eq)]
100#[derive(Clone, PartialEq, ::prost::Message)]
101pub struct Params {
102    /// allowed_clients defines the list of allowed client state types.
103    #[prost(string, repeated, tag = "1")]
104    pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
105}
106/// MsgCreateClient defines a message to create an IBC client
107#[allow(clippy::derive_partial_eq_without_eq)]
108#[derive(Clone, PartialEq, ::prost::Message)]
109pub struct MsgCreateClient {
110    /// light client state
111    #[prost(message, optional, tag = "1")]
112    pub client_state: ::core::option::Option<::prost_types::Any>,
113    /// consensus state associated with the client that corresponds to a given
114    /// height.
115    #[prost(message, optional, tag = "2")]
116    pub consensus_state: ::core::option::Option<::prost_types::Any>,
117    /// signer address
118    #[prost(string, tag = "3")]
119    pub signer: ::prost::alloc::string::String,
120}
121/// MsgCreateClientResponse defines the Msg/CreateClient response type.
122#[allow(clippy::derive_partial_eq_without_eq)]
123#[derive(Clone, PartialEq, ::prost::Message)]
124pub struct MsgCreateClientResponse {}
125/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using
126/// the given header.
127#[allow(clippy::derive_partial_eq_without_eq)]
128#[derive(Clone, PartialEq, ::prost::Message)]
129pub struct MsgUpdateClient {
130    /// client unique identifier
131    #[prost(string, tag = "1")]
132    pub client_id: ::prost::alloc::string::String,
133    /// header to update the light client
134    #[prost(message, optional, tag = "2")]
135    pub header: ::core::option::Option<::prost_types::Any>,
136    /// signer address
137    #[prost(string, tag = "3")]
138    pub signer: ::prost::alloc::string::String,
139}
140/// MsgUpdateClientResponse defines the Msg/UpdateClient response type.
141#[allow(clippy::derive_partial_eq_without_eq)]
142#[derive(Clone, PartialEq, ::prost::Message)]
143pub struct MsgUpdateClientResponse {}
144/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client
145/// state
146#[allow(clippy::derive_partial_eq_without_eq)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct MsgUpgradeClient {
149    /// client unique identifier
150    #[prost(string, tag = "1")]
151    pub client_id: ::prost::alloc::string::String,
152    /// upgraded client state
153    #[prost(message, optional, tag = "2")]
154    pub client_state: ::core::option::Option<::prost_types::Any>,
155    /// upgraded consensus state, only contains enough information to serve as a
156    /// basis of trust in update logic
157    #[prost(message, optional, tag = "3")]
158    pub consensus_state: ::core::option::Option<::prost_types::Any>,
159    /// proof that old chain committed to new client
160    #[prost(bytes = "vec", tag = "4")]
161    pub proof_upgrade_client: ::prost::alloc::vec::Vec<u8>,
162    /// proof that old chain committed to new consensus state
163    #[prost(bytes = "vec", tag = "5")]
164    pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec<u8>,
165    /// signer address
166    #[prost(string, tag = "6")]
167    pub signer: ::prost::alloc::string::String,
168}
169/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type.
170#[allow(clippy::derive_partial_eq_without_eq)]
171#[derive(Clone, PartialEq, ::prost::Message)]
172pub struct MsgUpgradeClientResponse {}
173/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for
174/// light client misbehaviour.
175#[allow(clippy::derive_partial_eq_without_eq)]
176#[derive(Clone, PartialEq, ::prost::Message)]
177pub struct MsgSubmitMisbehaviour {
178    /// client unique identifier
179    #[prost(string, tag = "1")]
180    pub client_id: ::prost::alloc::string::String,
181    /// misbehaviour used for freezing the light client
182    #[prost(message, optional, tag = "2")]
183    pub misbehaviour: ::core::option::Option<::prost_types::Any>,
184    /// signer address
185    #[prost(string, tag = "3")]
186    pub signer: ::prost::alloc::string::String,
187}
188/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response
189/// type.
190#[allow(clippy::derive_partial_eq_without_eq)]
191#[derive(Clone, PartialEq, ::prost::Message)]
192pub struct MsgSubmitMisbehaviourResponse {}
193/// Generated client implementations.
194#[cfg(feature = "grpc")]
195#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
196pub mod msg_client {
197    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
198    use tonic::codegen::http::Uri;
199    use tonic::codegen::*;
200    /// Msg defines the ibc/client Msg service.
201    #[derive(Debug, Clone)]
202    pub struct MsgClient<T> {
203        inner: tonic::client::Grpc<T>,
204    }
205    #[cfg(feature = "grpc-transport")]
206    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
207    impl MsgClient<tonic::transport::Channel> {
208        /// Attempt to create a new client by connecting to a given endpoint.
209        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
210        where
211            D: std::convert::TryInto<tonic::transport::Endpoint>,
212            D::Error: Into<StdError>,
213        {
214            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
215            Ok(Self::new(conn))
216        }
217    }
218    impl<T> MsgClient<T>
219    where
220        T: tonic::client::GrpcService<tonic::body::BoxBody>,
221        T::Error: Into<StdError>,
222        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
223        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
224    {
225        pub fn new(inner: T) -> Self {
226            let inner = tonic::client::Grpc::new(inner);
227            Self { inner }
228        }
229        pub fn with_origin(inner: T, origin: Uri) -> Self {
230            let inner = tonic::client::Grpc::with_origin(inner, origin);
231            Self { inner }
232        }
233        pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
234        where
235            F: tonic::service::Interceptor,
236            T::ResponseBody: Default,
237            T: tonic::codegen::Service<
238                http::Request<tonic::body::BoxBody>,
239                Response = http::Response<
240                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
241                >,
242            >,
243            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
244                Into<StdError> + Send + Sync,
245        {
246            MsgClient::new(InterceptedService::new(inner, interceptor))
247        }
248        /// Compress requests with the given encoding.
249        ///
250        /// This requires the server to support it otherwise it might respond with an
251        /// error.
252        #[must_use]
253        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
254            self.inner = self.inner.send_compressed(encoding);
255            self
256        }
257        /// Enable decompressing responses.
258        #[must_use]
259        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
260            self.inner = self.inner.accept_compressed(encoding);
261            self
262        }
263        /// CreateClient defines a rpc handler method for MsgCreateClient.
264        pub async fn create_client(
265            &mut self,
266            request: impl tonic::IntoRequest<super::MsgCreateClient>,
267        ) -> Result<tonic::Response<super::MsgCreateClientResponse>, tonic::Status> {
268            self.inner.ready().await.map_err(|e| {
269                tonic::Status::new(
270                    tonic::Code::Unknown,
271                    format!("Service was not ready: {}", e.into()),
272                )
273            })?;
274            let codec = tonic::codec::ProstCodec::default();
275            let path = http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/CreateClient");
276            self.inner.unary(request.into_request(), path, codec).await
277        }
278        /// UpdateClient defines a rpc handler method for MsgUpdateClient.
279        pub async fn update_client(
280            &mut self,
281            request: impl tonic::IntoRequest<super::MsgUpdateClient>,
282        ) -> Result<tonic::Response<super::MsgUpdateClientResponse>, tonic::Status> {
283            self.inner.ready().await.map_err(|e| {
284                tonic::Status::new(
285                    tonic::Code::Unknown,
286                    format!("Service was not ready: {}", e.into()),
287                )
288            })?;
289            let codec = tonic::codec::ProstCodec::default();
290            let path = http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/UpdateClient");
291            self.inner.unary(request.into_request(), path, codec).await
292        }
293        /// UpgradeClient defines a rpc handler method for MsgUpgradeClient.
294        pub async fn upgrade_client(
295            &mut self,
296            request: impl tonic::IntoRequest<super::MsgUpgradeClient>,
297        ) -> Result<tonic::Response<super::MsgUpgradeClientResponse>, tonic::Status> {
298            self.inner.ready().await.map_err(|e| {
299                tonic::Status::new(
300                    tonic::Code::Unknown,
301                    format!("Service was not ready: {}", e.into()),
302                )
303            })?;
304            let codec = tonic::codec::ProstCodec::default();
305            let path =
306                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/UpgradeClient");
307            self.inner.unary(request.into_request(), path, codec).await
308        }
309        /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour.
310        pub async fn submit_misbehaviour(
311            &mut self,
312            request: impl tonic::IntoRequest<super::MsgSubmitMisbehaviour>,
313        ) -> Result<tonic::Response<super::MsgSubmitMisbehaviourResponse>, tonic::Status> {
314            self.inner.ready().await.map_err(|e| {
315                tonic::Status::new(
316                    tonic::Code::Unknown,
317                    format!("Service was not ready: {}", e.into()),
318                )
319            })?;
320            let codec = tonic::codec::ProstCodec::default();
321            let path =
322                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Msg/SubmitMisbehaviour");
323            self.inner.unary(request.into_request(), path, codec).await
324        }
325    }
326}
327/// QueryClientStateRequest is the request type for the Query/ClientState RPC
328/// method
329#[allow(clippy::derive_partial_eq_without_eq)]
330#[derive(Clone, PartialEq, ::prost::Message)]
331pub struct QueryClientStateRequest {
332    /// client state unique identifier
333    #[prost(string, tag = "1")]
334    pub client_id: ::prost::alloc::string::String,
335}
336/// QueryClientStateResponse is the response type for the Query/ClientState RPC
337/// method. Besides the client state, it includes a proof and the height from
338/// which the proof was retrieved.
339#[allow(clippy::derive_partial_eq_without_eq)]
340#[derive(Clone, PartialEq, ::prost::Message)]
341pub struct QueryClientStateResponse {
342    /// client state associated with the request identifier
343    #[prost(message, optional, tag = "1")]
344    pub client_state: ::core::option::Option<::prost_types::Any>,
345    /// merkle proof of existence
346    #[prost(bytes = "vec", tag = "2")]
347    pub proof: ::prost::alloc::vec::Vec<u8>,
348    /// height at which the proof was retrieved
349    #[prost(message, optional, tag = "3")]
350    pub proof_height: ::core::option::Option<Height>,
351}
352/// QueryClientStatesRequest is the request type for the Query/ClientStates RPC
353/// method
354#[allow(clippy::derive_partial_eq_without_eq)]
355#[derive(Clone, PartialEq, ::prost::Message)]
356pub struct QueryClientStatesRequest {
357    /// pagination request
358    #[prost(message, optional, tag = "1")]
359    pub pagination: ::core::option::Option<
360        super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
361    >,
362}
363/// QueryClientStatesResponse is the response type for the Query/ClientStates RPC
364/// method.
365#[allow(clippy::derive_partial_eq_without_eq)]
366#[derive(Clone, PartialEq, ::prost::Message)]
367pub struct QueryClientStatesResponse {
368    /// list of stored ClientStates of the chain.
369    #[prost(message, repeated, tag = "1")]
370    pub client_states: ::prost::alloc::vec::Vec<IdentifiedClientState>,
371    /// pagination response
372    #[prost(message, optional, tag = "2")]
373    pub pagination: ::core::option::Option<
374        super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
375    >,
376}
377/// QueryConsensusStateRequest is the request type for the Query/ConsensusState
378/// RPC method. Besides the consensus state, it includes a proof and the height
379/// from which the proof was retrieved.
380#[allow(clippy::derive_partial_eq_without_eq)]
381#[derive(Clone, PartialEq, ::prost::Message)]
382pub struct QueryConsensusStateRequest {
383    /// client identifier
384    #[prost(string, tag = "1")]
385    pub client_id: ::prost::alloc::string::String,
386    /// consensus state revision number
387    #[prost(uint64, tag = "2")]
388    pub revision_number: u64,
389    /// consensus state revision height
390    #[prost(uint64, tag = "3")]
391    pub revision_height: u64,
392    /// latest_height overrrides the height field and queries the latest stored
393    /// ConsensusState
394    #[prost(bool, tag = "4")]
395    pub latest_height: bool,
396}
397/// QueryConsensusStateResponse is the response type for the Query/ConsensusState
398/// RPC method
399#[allow(clippy::derive_partial_eq_without_eq)]
400#[derive(Clone, PartialEq, ::prost::Message)]
401pub struct QueryConsensusStateResponse {
402    /// consensus state associated with the client identifier at the given height
403    #[prost(message, optional, tag = "1")]
404    pub consensus_state: ::core::option::Option<::prost_types::Any>,
405    /// merkle proof of existence
406    #[prost(bytes = "vec", tag = "2")]
407    pub proof: ::prost::alloc::vec::Vec<u8>,
408    /// height at which the proof was retrieved
409    #[prost(message, optional, tag = "3")]
410    pub proof_height: ::core::option::Option<Height>,
411}
412/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates
413/// RPC method.
414#[allow(clippy::derive_partial_eq_without_eq)]
415#[derive(Clone, PartialEq, ::prost::Message)]
416pub struct QueryConsensusStatesRequest {
417    /// client identifier
418    #[prost(string, tag = "1")]
419    pub client_id: ::prost::alloc::string::String,
420    /// pagination request
421    #[prost(message, optional, tag = "2")]
422    pub pagination: ::core::option::Option<
423        super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
424    >,
425}
426/// QueryConsensusStatesResponse is the response type for the
427/// Query/ConsensusStates RPC method
428#[allow(clippy::derive_partial_eq_without_eq)]
429#[derive(Clone, PartialEq, ::prost::Message)]
430pub struct QueryConsensusStatesResponse {
431    /// consensus states associated with the identifier
432    #[prost(message, repeated, tag = "1")]
433    pub consensus_states: ::prost::alloc::vec::Vec<ConsensusStateWithHeight>,
434    /// pagination response
435    #[prost(message, optional, tag = "2")]
436    pub pagination: ::core::option::Option<
437        super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
438    >,
439}
440/// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC
441/// method
442#[allow(clippy::derive_partial_eq_without_eq)]
443#[derive(Clone, PartialEq, ::prost::Message)]
444pub struct QueryClientStatusRequest {
445    /// client unique identifier
446    #[prost(string, tag = "1")]
447    pub client_id: ::prost::alloc::string::String,
448}
449/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC
450/// method. It returns the current status of the IBC client.
451#[allow(clippy::derive_partial_eq_without_eq)]
452#[derive(Clone, PartialEq, ::prost::Message)]
453pub struct QueryClientStatusResponse {
454    #[prost(string, tag = "1")]
455    pub status: ::prost::alloc::string::String,
456}
457/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC
458/// method.
459#[allow(clippy::derive_partial_eq_without_eq)]
460#[derive(Clone, PartialEq, ::prost::Message)]
461pub struct QueryClientParamsRequest {}
462/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC
463/// method.
464#[allow(clippy::derive_partial_eq_without_eq)]
465#[derive(Clone, PartialEq, ::prost::Message)]
466pub struct QueryClientParamsResponse {
467    /// params defines the parameters of the module.
468    #[prost(message, optional, tag = "1")]
469    pub params: ::core::option::Option<Params>,
470}
471/// QueryUpgradedClientStateRequest is the request type for the
472/// Query/UpgradedClientState RPC method
473#[allow(clippy::derive_partial_eq_without_eq)]
474#[derive(Clone, PartialEq, ::prost::Message)]
475pub struct QueryUpgradedClientStateRequest {}
476/// QueryUpgradedClientStateResponse is the response type for the
477/// Query/UpgradedClientState RPC method.
478#[allow(clippy::derive_partial_eq_without_eq)]
479#[derive(Clone, PartialEq, ::prost::Message)]
480pub struct QueryUpgradedClientStateResponse {
481    /// client state associated with the request identifier
482    #[prost(message, optional, tag = "1")]
483    pub upgraded_client_state: ::core::option::Option<::prost_types::Any>,
484}
485/// QueryUpgradedConsensusStateRequest is the request type for the
486/// Query/UpgradedConsensusState RPC method
487#[allow(clippy::derive_partial_eq_without_eq)]
488#[derive(Clone, PartialEq, ::prost::Message)]
489pub struct QueryUpgradedConsensusStateRequest {}
490/// QueryUpgradedConsensusStateResponse is the response type for the
491/// Query/UpgradedConsensusState RPC method.
492#[allow(clippy::derive_partial_eq_without_eq)]
493#[derive(Clone, PartialEq, ::prost::Message)]
494pub struct QueryUpgradedConsensusStateResponse {
495    /// Consensus state associated with the request identifier
496    #[prost(message, optional, tag = "1")]
497    pub upgraded_consensus_state: ::core::option::Option<::prost_types::Any>,
498}
499/// Generated client implementations.
500#[cfg(feature = "grpc")]
501#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
502pub mod query_client {
503    #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
504    use tonic::codegen::http::Uri;
505    use tonic::codegen::*;
506    /// Query provides defines the gRPC querier service
507    #[derive(Debug, Clone)]
508    pub struct QueryClient<T> {
509        inner: tonic::client::Grpc<T>,
510    }
511    #[cfg(feature = "grpc-transport")]
512    #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
513    impl QueryClient<tonic::transport::Channel> {
514        /// Attempt to create a new client by connecting to a given endpoint.
515        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
516        where
517            D: std::convert::TryInto<tonic::transport::Endpoint>,
518            D::Error: Into<StdError>,
519        {
520            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
521            Ok(Self::new(conn))
522        }
523    }
524    impl<T> QueryClient<T>
525    where
526        T: tonic::client::GrpcService<tonic::body::BoxBody>,
527        T::Error: Into<StdError>,
528        T::ResponseBody: Body<Data = Bytes> + Send + 'static,
529        <T::ResponseBody as Body>::Error: Into<StdError> + Send,
530    {
531        pub fn new(inner: T) -> Self {
532            let inner = tonic::client::Grpc::new(inner);
533            Self { inner }
534        }
535        pub fn with_origin(inner: T, origin: Uri) -> Self {
536            let inner = tonic::client::Grpc::with_origin(inner, origin);
537            Self { inner }
538        }
539        pub fn with_interceptor<F>(
540            inner: T,
541            interceptor: F,
542        ) -> QueryClient<InterceptedService<T, F>>
543        where
544            F: tonic::service::Interceptor,
545            T::ResponseBody: Default,
546            T: tonic::codegen::Service<
547                http::Request<tonic::body::BoxBody>,
548                Response = http::Response<
549                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
550                >,
551            >,
552            <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
553                Into<StdError> + Send + Sync,
554        {
555            QueryClient::new(InterceptedService::new(inner, interceptor))
556        }
557        /// Compress requests with the given encoding.
558        ///
559        /// This requires the server to support it otherwise it might respond with an
560        /// error.
561        #[must_use]
562        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
563            self.inner = self.inner.send_compressed(encoding);
564            self
565        }
566        /// Enable decompressing responses.
567        #[must_use]
568        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
569            self.inner = self.inner.accept_compressed(encoding);
570            self
571        }
572        /// ClientState queries an IBC light client.
573        pub async fn client_state(
574            &mut self,
575            request: impl tonic::IntoRequest<super::QueryClientStateRequest>,
576        ) -> Result<tonic::Response<super::QueryClientStateResponse>, 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("/ibc.core.client.v1.Query/ClientState");
586            self.inner.unary(request.into_request(), path, codec).await
587        }
588        /// ClientStates queries all the IBC light clients of a chain.
589        pub async fn client_states(
590            &mut self,
591            request: impl tonic::IntoRequest<super::QueryClientStatesRequest>,
592        ) -> Result<tonic::Response<super::QueryClientStatesResponse>, tonic::Status> {
593            self.inner.ready().await.map_err(|e| {
594                tonic::Status::new(
595                    tonic::Code::Unknown,
596                    format!("Service was not ready: {}", e.into()),
597                )
598            })?;
599            let codec = tonic::codec::ProstCodec::default();
600            let path =
601                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientStates");
602            self.inner.unary(request.into_request(), path, codec).await
603        }
604        /// ConsensusState queries a consensus state associated with a client state at
605        /// a given height.
606        pub async fn consensus_state(
607            &mut self,
608            request: impl tonic::IntoRequest<super::QueryConsensusStateRequest>,
609        ) -> Result<tonic::Response<super::QueryConsensusStateResponse>, tonic::Status> {
610            self.inner.ready().await.map_err(|e| {
611                tonic::Status::new(
612                    tonic::Code::Unknown,
613                    format!("Service was not ready: {}", e.into()),
614                )
615            })?;
616            let codec = tonic::codec::ProstCodec::default();
617            let path =
618                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ConsensusState");
619            self.inner.unary(request.into_request(), path, codec).await
620        }
621        /// ConsensusStates queries all the consensus state associated with a given
622        /// client.
623        pub async fn consensus_states(
624            &mut self,
625            request: impl tonic::IntoRequest<super::QueryConsensusStatesRequest>,
626        ) -> Result<tonic::Response<super::QueryConsensusStatesResponse>, tonic::Status> {
627            self.inner.ready().await.map_err(|e| {
628                tonic::Status::new(
629                    tonic::Code::Unknown,
630                    format!("Service was not ready: {}", e.into()),
631                )
632            })?;
633            let codec = tonic::codec::ProstCodec::default();
634            let path =
635                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ConsensusStates");
636            self.inner.unary(request.into_request(), path, codec).await
637        }
638        /// Status queries the status of an IBC client.
639        pub async fn client_status(
640            &mut self,
641            request: impl tonic::IntoRequest<super::QueryClientStatusRequest>,
642        ) -> Result<tonic::Response<super::QueryClientStatusResponse>, tonic::Status> {
643            self.inner.ready().await.map_err(|e| {
644                tonic::Status::new(
645                    tonic::Code::Unknown,
646                    format!("Service was not ready: {}", e.into()),
647                )
648            })?;
649            let codec = tonic::codec::ProstCodec::default();
650            let path =
651                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientStatus");
652            self.inner.unary(request.into_request(), path, codec).await
653        }
654        /// ClientParams queries all parameters of the ibc client.
655        pub async fn client_params(
656            &mut self,
657            request: impl tonic::IntoRequest<super::QueryClientParamsRequest>,
658        ) -> Result<tonic::Response<super::QueryClientParamsResponse>, tonic::Status> {
659            self.inner.ready().await.map_err(|e| {
660                tonic::Status::new(
661                    tonic::Code::Unknown,
662                    format!("Service was not ready: {}", e.into()),
663                )
664            })?;
665            let codec = tonic::codec::ProstCodec::default();
666            let path =
667                http::uri::PathAndQuery::from_static("/ibc.core.client.v1.Query/ClientParams");
668            self.inner.unary(request.into_request(), path, codec).await
669        }
670        /// UpgradedClientState queries an Upgraded IBC light client.
671        pub async fn upgraded_client_state(
672            &mut self,
673            request: impl tonic::IntoRequest<super::QueryUpgradedClientStateRequest>,
674        ) -> Result<tonic::Response<super::QueryUpgradedClientStateResponse>, tonic::Status>
675        {
676            self.inner.ready().await.map_err(|e| {
677                tonic::Status::new(
678                    tonic::Code::Unknown,
679                    format!("Service was not ready: {}", e.into()),
680                )
681            })?;
682            let codec = tonic::codec::ProstCodec::default();
683            let path = http::uri::PathAndQuery::from_static(
684                "/ibc.core.client.v1.Query/UpgradedClientState",
685            );
686            self.inner.unary(request.into_request(), path, codec).await
687        }
688        /// UpgradedConsensusState queries an Upgraded IBC consensus state.
689        pub async fn upgraded_consensus_state(
690            &mut self,
691            request: impl tonic::IntoRequest<super::QueryUpgradedConsensusStateRequest>,
692        ) -> Result<tonic::Response<super::QueryUpgradedConsensusStateResponse>, tonic::Status>
693        {
694            self.inner.ready().await.map_err(|e| {
695                tonic::Status::new(
696                    tonic::Code::Unknown,
697                    format!("Service was not ready: {}", e.into()),
698                )
699            })?;
700            let codec = tonic::codec::ProstCodec::default();
701            let path = http::uri::PathAndQuery::from_static(
702                "/ibc.core.client.v1.Query/UpgradedConsensusState",
703            );
704            self.inner.unary(request.into_request(), path, codec).await
705        }
706    }
707}
708/// GenesisState defines the ibc client submodule's genesis state.
709#[allow(clippy::derive_partial_eq_without_eq)]
710#[derive(Clone, PartialEq, ::prost::Message)]
711pub struct GenesisState {
712    /// client states with their corresponding identifiers
713    #[prost(message, repeated, tag = "1")]
714    pub clients: ::prost::alloc::vec::Vec<IdentifiedClientState>,
715    /// consensus states from each client
716    #[prost(message, repeated, tag = "2")]
717    pub clients_consensus: ::prost::alloc::vec::Vec<ClientConsensusStates>,
718    /// metadata from each client
719    #[prost(message, repeated, tag = "3")]
720    pub clients_metadata: ::prost::alloc::vec::Vec<IdentifiedGenesisMetadata>,
721    #[prost(message, optional, tag = "4")]
722    pub params: ::core::option::Option<Params>,
723    /// create localhost on initialization
724    #[prost(bool, tag = "5")]
725    pub create_localhost: bool,
726    /// the sequence for the next generated client identifier
727    #[prost(uint64, tag = "6")]
728    pub next_client_sequence: u64,
729}
730/// GenesisMetadata defines the genesis type for metadata that clients may return
731/// with ExportMetadata
732#[allow(clippy::derive_partial_eq_without_eq)]
733#[derive(Clone, PartialEq, ::prost::Message)]
734pub struct GenesisMetadata {
735    /// store key of metadata without clientID-prefix
736    #[prost(bytes = "vec", tag = "1")]
737    pub key: ::prost::alloc::vec::Vec<u8>,
738    /// metadata value
739    #[prost(bytes = "vec", tag = "2")]
740    pub value: ::prost::alloc::vec::Vec<u8>,
741}
742/// IdentifiedGenesisMetadata has the client metadata with the corresponding
743/// client id.
744#[allow(clippy::derive_partial_eq_without_eq)]
745#[derive(Clone, PartialEq, ::prost::Message)]
746pub struct IdentifiedGenesisMetadata {
747    #[prost(string, tag = "1")]
748    pub client_id: ::prost::alloc::string::String,
749    #[prost(message, repeated, tag = "2")]
750    pub client_metadata: ::prost::alloc::vec::Vec<GenesisMetadata>,
751}