1#[cfg_attr(
7 all(feature = "json-schema", feature = "serde"),
8 derive(::schemars::JsonSchema)
9)]
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct ConnectionEnd {
12 #[prost(string, tag = "1")]
14 pub client_id: ::prost::alloc::string::String,
15 #[prost(message, repeated, tag = "2")]
18 pub versions: ::prost::alloc::vec::Vec<Version>,
19 #[prost(enumeration = "State", tag = "3")]
21 pub state: i32,
22 #[prost(message, optional, tag = "4")]
24 pub counterparty: ::core::option::Option<Counterparty>,
25 #[prost(uint64, tag = "5")]
29 pub delay_period: u64,
30}
31impl ::prost::Name for ConnectionEnd {
32 const NAME: &'static str = "ConnectionEnd";
33 const PACKAGE: &'static str = "ibc.core.connection.v1";
34 fn full_name() -> ::prost::alloc::string::String {
35 "ibc.core.connection.v1.ConnectionEnd".into()
36 }
37 fn type_url() -> ::prost::alloc::string::String {
38 "/ibc.core.connection.v1.ConnectionEnd".into()
39 }
40}
41#[derive(Clone, PartialEq, ::prost::Message)]
44pub struct IdentifiedConnection {
45 #[prost(string, tag = "1")]
47 pub id: ::prost::alloc::string::String,
48 #[prost(string, tag = "2")]
50 pub client_id: ::prost::alloc::string::String,
51 #[prost(message, repeated, tag = "3")]
54 pub versions: ::prost::alloc::vec::Vec<Version>,
55 #[prost(enumeration = "State", tag = "4")]
57 pub state: i32,
58 #[prost(message, optional, tag = "5")]
60 pub counterparty: ::core::option::Option<Counterparty>,
61 #[prost(uint64, tag = "6")]
63 pub delay_period: u64,
64}
65impl ::prost::Name for IdentifiedConnection {
66 const NAME: &'static str = "IdentifiedConnection";
67 const PACKAGE: &'static str = "ibc.core.connection.v1";
68 fn full_name() -> ::prost::alloc::string::String {
69 "ibc.core.connection.v1.IdentifiedConnection".into()
70 }
71 fn type_url() -> ::prost::alloc::string::String {
72 "/ibc.core.connection.v1.IdentifiedConnection".into()
73 }
74}
75#[cfg_attr(
77 all(feature = "json-schema", feature = "serde"),
78 derive(::schemars::JsonSchema)
79)]
80#[derive(Clone, PartialEq, ::prost::Message)]
81pub struct Counterparty {
82 #[prost(string, tag = "1")]
85 pub client_id: ::prost::alloc::string::String,
86 #[prost(string, tag = "2")]
89 pub connection_id: ::prost::alloc::string::String,
90 #[prost(message, optional, tag = "3")]
92 pub prefix: ::core::option::Option<super::super::commitment::v1::MerklePrefix>,
93}
94impl ::prost::Name for Counterparty {
95 const NAME: &'static str = "Counterparty";
96 const PACKAGE: &'static str = "ibc.core.connection.v1";
97 fn full_name() -> ::prost::alloc::string::String {
98 "ibc.core.connection.v1.Counterparty".into()
99 }
100 fn type_url() -> ::prost::alloc::string::String {
101 "/ibc.core.connection.v1.Counterparty".into()
102 }
103}
104#[derive(Clone, PartialEq, ::prost::Message)]
106pub struct ClientPaths {
107 #[prost(string, repeated, tag = "1")]
109 pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
110}
111impl ::prost::Name for ClientPaths {
112 const NAME: &'static str = "ClientPaths";
113 const PACKAGE: &'static str = "ibc.core.connection.v1";
114 fn full_name() -> ::prost::alloc::string::String {
115 "ibc.core.connection.v1.ClientPaths".into()
116 }
117 fn type_url() -> ::prost::alloc::string::String {
118 "/ibc.core.connection.v1.ClientPaths".into()
119 }
120}
121#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct ConnectionPaths {
124 #[prost(string, tag = "1")]
126 pub client_id: ::prost::alloc::string::String,
127 #[prost(string, repeated, tag = "2")]
129 pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
130}
131impl ::prost::Name for ConnectionPaths {
132 const NAME: &'static str = "ConnectionPaths";
133 const PACKAGE: &'static str = "ibc.core.connection.v1";
134 fn full_name() -> ::prost::alloc::string::String {
135 "ibc.core.connection.v1.ConnectionPaths".into()
136 }
137 fn type_url() -> ::prost::alloc::string::String {
138 "/ibc.core.connection.v1.ConnectionPaths".into()
139 }
140}
141#[cfg_attr(
144 all(feature = "json-schema", feature = "serde"),
145 derive(::schemars::JsonSchema)
146)]
147#[derive(Clone, PartialEq, ::prost::Message)]
148pub struct Version {
149 #[prost(string, tag = "1")]
151 pub identifier: ::prost::alloc::string::String,
152 #[prost(string, repeated, tag = "2")]
154 pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
155}
156impl ::prost::Name for Version {
157 const NAME: &'static str = "Version";
158 const PACKAGE: &'static str = "ibc.core.connection.v1";
159 fn full_name() -> ::prost::alloc::string::String {
160 "ibc.core.connection.v1.Version".into()
161 }
162 fn type_url() -> ::prost::alloc::string::String {
163 "/ibc.core.connection.v1.Version".into()
164 }
165}
166#[derive(Clone, Copy, PartialEq, ::prost::Message)]
168pub struct Params {
169 #[prost(uint64, tag = "1")]
173 pub max_expected_time_per_block: u64,
174}
175impl ::prost::Name for Params {
176 const NAME: &'static str = "Params";
177 const PACKAGE: &'static str = "ibc.core.connection.v1";
178 fn full_name() -> ::prost::alloc::string::String {
179 "ibc.core.connection.v1.Params".into()
180 }
181 fn type_url() -> ::prost::alloc::string::String {
182 "/ibc.core.connection.v1.Params".into()
183 }
184}
185#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)]
188#[repr(i32)]
189pub enum State {
190 UninitializedUnspecified = 0,
192 Init = 1,
194 Tryopen = 2,
197 Open = 3,
199}
200impl State {
201 pub fn as_str_name(&self) -> &'static str {
206 match self {
207 Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED",
208 Self::Init => "STATE_INIT",
209 Self::Tryopen => "STATE_TRYOPEN",
210 Self::Open => "STATE_OPEN",
211 }
212 }
213 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
215 match value {
216 "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified),
217 "STATE_INIT" => Some(Self::Init),
218 "STATE_TRYOPEN" => Some(Self::Tryopen),
219 "STATE_OPEN" => Some(Self::Open),
220 _ => None,
221 }
222 }
223}
224#[derive(Clone, PartialEq, ::prost::Message)]
226pub struct GenesisState {
227 #[prost(message, repeated, tag = "1")]
228 pub connections: ::prost::alloc::vec::Vec<IdentifiedConnection>,
229 #[prost(message, repeated, tag = "2")]
230 pub client_connection_paths: ::prost::alloc::vec::Vec<ConnectionPaths>,
231 #[prost(uint64, tag = "3")]
233 pub next_connection_sequence: u64,
234 #[prost(message, optional, tag = "4")]
235 pub params: ::core::option::Option<Params>,
236}
237impl ::prost::Name for GenesisState {
238 const NAME: &'static str = "GenesisState";
239 const PACKAGE: &'static str = "ibc.core.connection.v1";
240 fn full_name() -> ::prost::alloc::string::String {
241 "ibc.core.connection.v1.GenesisState".into()
242 }
243 fn type_url() -> ::prost::alloc::string::String {
244 "/ibc.core.connection.v1.GenesisState".into()
245 }
246}
247#[derive(Clone, PartialEq, ::prost::Message)]
250pub struct MsgConnectionOpenInit {
251 #[prost(string, tag = "1")]
252 pub client_id: ::prost::alloc::string::String,
253 #[prost(message, optional, tag = "2")]
254 pub counterparty: ::core::option::Option<Counterparty>,
255 #[prost(message, optional, tag = "3")]
256 pub version: ::core::option::Option<Version>,
257 #[prost(uint64, tag = "4")]
258 pub delay_period: u64,
259 #[prost(string, tag = "5")]
260 pub signer: ::prost::alloc::string::String,
261}
262impl ::prost::Name for MsgConnectionOpenInit {
263 const NAME: &'static str = "MsgConnectionOpenInit";
264 const PACKAGE: &'static str = "ibc.core.connection.v1";
265 fn full_name() -> ::prost::alloc::string::String {
266 "ibc.core.connection.v1.MsgConnectionOpenInit".into()
267 }
268 fn type_url() -> ::prost::alloc::string::String {
269 "/ibc.core.connection.v1.MsgConnectionOpenInit".into()
270 }
271}
272#[derive(Clone, Copy, PartialEq, ::prost::Message)]
275pub struct MsgConnectionOpenInitResponse {}
276impl ::prost::Name for MsgConnectionOpenInitResponse {
277 const NAME: &'static str = "MsgConnectionOpenInitResponse";
278 const PACKAGE: &'static str = "ibc.core.connection.v1";
279 fn full_name() -> ::prost::alloc::string::String {
280 "ibc.core.connection.v1.MsgConnectionOpenInitResponse".into()
281 }
282 fn type_url() -> ::prost::alloc::string::String {
283 "/ibc.core.connection.v1.MsgConnectionOpenInitResponse".into()
284 }
285}
286#[derive(Clone, PartialEq, ::prost::Message)]
289pub struct MsgConnectionOpenTry {
290 #[prost(string, tag = "1")]
291 pub client_id: ::prost::alloc::string::String,
292 #[deprecated]
294 #[prost(string, tag = "2")]
295 pub previous_connection_id: ::prost::alloc::string::String,
296 #[prost(message, optional, tag = "3")]
297 pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>,
298 #[prost(message, optional, tag = "4")]
299 pub counterparty: ::core::option::Option<Counterparty>,
300 #[prost(uint64, tag = "5")]
301 pub delay_period: u64,
302 #[prost(message, repeated, tag = "6")]
303 pub counterparty_versions: ::prost::alloc::vec::Vec<Version>,
304 #[prost(message, optional, tag = "7")]
305 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
306 #[prost(bytes = "vec", tag = "8")]
309 pub proof_init: ::prost::alloc::vec::Vec<u8>,
310 #[prost(bytes = "vec", tag = "9")]
312 pub proof_client: ::prost::alloc::vec::Vec<u8>,
313 #[prost(bytes = "vec", tag = "10")]
315 pub proof_consensus: ::prost::alloc::vec::Vec<u8>,
316 #[prost(message, optional, tag = "11")]
317 pub consensus_height: ::core::option::Option<super::super::client::v1::Height>,
318 #[prost(string, tag = "12")]
319 pub signer: ::prost::alloc::string::String,
320 #[prost(bytes = "vec", tag = "13")]
322 pub host_consensus_state_proof: ::prost::alloc::vec::Vec<u8>,
323}
324impl ::prost::Name for MsgConnectionOpenTry {
325 const NAME: &'static str = "MsgConnectionOpenTry";
326 const PACKAGE: &'static str = "ibc.core.connection.v1";
327 fn full_name() -> ::prost::alloc::string::String {
328 "ibc.core.connection.v1.MsgConnectionOpenTry".into()
329 }
330 fn type_url() -> ::prost::alloc::string::String {
331 "/ibc.core.connection.v1.MsgConnectionOpenTry".into()
332 }
333}
334#[derive(Clone, Copy, PartialEq, ::prost::Message)]
336pub struct MsgConnectionOpenTryResponse {}
337impl ::prost::Name for MsgConnectionOpenTryResponse {
338 const NAME: &'static str = "MsgConnectionOpenTryResponse";
339 const PACKAGE: &'static str = "ibc.core.connection.v1";
340 fn full_name() -> ::prost::alloc::string::String {
341 "ibc.core.connection.v1.MsgConnectionOpenTryResponse".into()
342 }
343 fn type_url() -> ::prost::alloc::string::String {
344 "/ibc.core.connection.v1.MsgConnectionOpenTryResponse".into()
345 }
346}
347#[derive(Clone, PartialEq, ::prost::Message)]
350pub struct MsgConnectionOpenAck {
351 #[prost(string, tag = "1")]
352 pub connection_id: ::prost::alloc::string::String,
353 #[prost(string, tag = "2")]
354 pub counterparty_connection_id: ::prost::alloc::string::String,
355 #[prost(message, optional, tag = "3")]
356 pub version: ::core::option::Option<Version>,
357 #[prost(message, optional, tag = "4")]
358 pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>,
359 #[prost(message, optional, tag = "5")]
360 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
361 #[prost(bytes = "vec", tag = "6")]
364 pub proof_try: ::prost::alloc::vec::Vec<u8>,
365 #[prost(bytes = "vec", tag = "7")]
367 pub proof_client: ::prost::alloc::vec::Vec<u8>,
368 #[prost(bytes = "vec", tag = "8")]
370 pub proof_consensus: ::prost::alloc::vec::Vec<u8>,
371 #[prost(message, optional, tag = "9")]
372 pub consensus_height: ::core::option::Option<super::super::client::v1::Height>,
373 #[prost(string, tag = "10")]
374 pub signer: ::prost::alloc::string::String,
375 #[prost(bytes = "vec", tag = "11")]
377 pub host_consensus_state_proof: ::prost::alloc::vec::Vec<u8>,
378}
379impl ::prost::Name for MsgConnectionOpenAck {
380 const NAME: &'static str = "MsgConnectionOpenAck";
381 const PACKAGE: &'static str = "ibc.core.connection.v1";
382 fn full_name() -> ::prost::alloc::string::String {
383 "ibc.core.connection.v1.MsgConnectionOpenAck".into()
384 }
385 fn type_url() -> ::prost::alloc::string::String {
386 "/ibc.core.connection.v1.MsgConnectionOpenAck".into()
387 }
388}
389#[derive(Clone, Copy, PartialEq, ::prost::Message)]
391pub struct MsgConnectionOpenAckResponse {}
392impl ::prost::Name for MsgConnectionOpenAckResponse {
393 const NAME: &'static str = "MsgConnectionOpenAckResponse";
394 const PACKAGE: &'static str = "ibc.core.connection.v1";
395 fn full_name() -> ::prost::alloc::string::String {
396 "ibc.core.connection.v1.MsgConnectionOpenAckResponse".into()
397 }
398 fn type_url() -> ::prost::alloc::string::String {
399 "/ibc.core.connection.v1.MsgConnectionOpenAckResponse".into()
400 }
401}
402#[derive(Clone, PartialEq, ::prost::Message)]
405pub struct MsgConnectionOpenConfirm {
406 #[prost(string, tag = "1")]
407 pub connection_id: ::prost::alloc::string::String,
408 #[prost(bytes = "vec", tag = "2")]
410 pub proof_ack: ::prost::alloc::vec::Vec<u8>,
411 #[prost(message, optional, tag = "3")]
412 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
413 #[prost(string, tag = "4")]
414 pub signer: ::prost::alloc::string::String,
415}
416impl ::prost::Name for MsgConnectionOpenConfirm {
417 const NAME: &'static str = "MsgConnectionOpenConfirm";
418 const PACKAGE: &'static str = "ibc.core.connection.v1";
419 fn full_name() -> ::prost::alloc::string::String {
420 "ibc.core.connection.v1.MsgConnectionOpenConfirm".into()
421 }
422 fn type_url() -> ::prost::alloc::string::String {
423 "/ibc.core.connection.v1.MsgConnectionOpenConfirm".into()
424 }
425}
426#[derive(Clone, Copy, PartialEq, ::prost::Message)]
429pub struct MsgConnectionOpenConfirmResponse {}
430impl ::prost::Name for MsgConnectionOpenConfirmResponse {
431 const NAME: &'static str = "MsgConnectionOpenConfirmResponse";
432 const PACKAGE: &'static str = "ibc.core.connection.v1";
433 fn full_name() -> ::prost::alloc::string::String {
434 "ibc.core.connection.v1.MsgConnectionOpenConfirmResponse".into()
435 }
436 fn type_url() -> ::prost::alloc::string::String {
437 "/ibc.core.connection.v1.MsgConnectionOpenConfirmResponse".into()
438 }
439}
440#[derive(Clone, PartialEq, ::prost::Message)]
442pub struct MsgUpdateParams {
443 #[prost(string, tag = "1")]
445 pub signer: ::prost::alloc::string::String,
446 #[prost(message, optional, tag = "2")]
450 pub params: ::core::option::Option<Params>,
451}
452impl ::prost::Name for MsgUpdateParams {
453 const NAME: &'static str = "MsgUpdateParams";
454 const PACKAGE: &'static str = "ibc.core.connection.v1";
455 fn full_name() -> ::prost::alloc::string::String {
456 "ibc.core.connection.v1.MsgUpdateParams".into()
457 }
458 fn type_url() -> ::prost::alloc::string::String {
459 "/ibc.core.connection.v1.MsgUpdateParams".into()
460 }
461}
462#[derive(Clone, Copy, PartialEq, ::prost::Message)]
464pub struct MsgUpdateParamsResponse {}
465impl ::prost::Name for MsgUpdateParamsResponse {
466 const NAME: &'static str = "MsgUpdateParamsResponse";
467 const PACKAGE: &'static str = "ibc.core.connection.v1";
468 fn full_name() -> ::prost::alloc::string::String {
469 "ibc.core.connection.v1.MsgUpdateParamsResponse".into()
470 }
471 fn type_url() -> ::prost::alloc::string::String {
472 "/ibc.core.connection.v1.MsgUpdateParamsResponse".into()
473 }
474}
475#[cfg(feature = "client")]
477pub mod msg_client {
478 #![allow(
479 unused_variables,
480 dead_code,
481 missing_docs,
482 clippy::wildcard_imports,
483 clippy::let_unit_value,
484 )]
485 use tonic::codegen::*;
486 use tonic::codegen::http::Uri;
487 #[derive(Debug, Clone)]
489 pub struct MsgClient<T> {
490 inner: tonic::client::Grpc<T>,
491 }
492 #[cfg(feature = "transport")]
493 impl MsgClient<tonic::transport::Channel> {
494 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
496 where
497 D: TryInto<tonic::transport::Endpoint>,
498 D::Error: Into<StdError>,
499 {
500 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
501 Ok(Self::new(conn))
502 }
503 }
504 impl<T> MsgClient<T>
505 where
506 T: tonic::client::GrpcService<tonic::body::Body>,
507 T::Error: Into<StdError>,
508 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
509 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
510 {
511 pub fn new(inner: T) -> Self {
512 let inner = tonic::client::Grpc::new(inner);
513 Self { inner }
514 }
515 pub fn with_origin(inner: T, origin: Uri) -> Self {
516 let inner = tonic::client::Grpc::with_origin(inner, origin);
517 Self { inner }
518 }
519 pub fn with_interceptor<F>(
520 inner: T,
521 interceptor: F,
522 ) -> MsgClient<InterceptedService<T, F>>
523 where
524 F: tonic::service::Interceptor,
525 T::ResponseBody: Default,
526 T: tonic::codegen::Service<
527 http::Request<tonic::body::Body>,
528 Response = http::Response<
529 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
530 >,
531 >,
532 <T as tonic::codegen::Service<
533 http::Request<tonic::body::Body>,
534 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
535 {
536 MsgClient::new(InterceptedService::new(inner, interceptor))
537 }
538 #[must_use]
543 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
544 self.inner = self.inner.send_compressed(encoding);
545 self
546 }
547 #[must_use]
549 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
550 self.inner = self.inner.accept_compressed(encoding);
551 self
552 }
553 #[must_use]
557 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
558 self.inner = self.inner.max_decoding_message_size(limit);
559 self
560 }
561 #[must_use]
565 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
566 self.inner = self.inner.max_encoding_message_size(limit);
567 self
568 }
569 pub async fn connection_open_init(
571 &mut self,
572 request: impl tonic::IntoRequest<super::MsgConnectionOpenInit>,
573 ) -> std::result::Result<
574 tonic::Response<super::MsgConnectionOpenInitResponse>,
575 tonic::Status,
576 > {
577 self.inner
578 .ready()
579 .await
580 .map_err(|e| {
581 tonic::Status::unknown(
582 format!("Service was not ready: {}", e.into()),
583 )
584 })?;
585 let codec = tonic::codec::ProstCodec::default();
586 let path = http::uri::PathAndQuery::from_static(
587 "/ibc.core.connection.v1.Msg/ConnectionOpenInit",
588 );
589 let mut req = request.into_request();
590 req.extensions_mut()
591 .insert(
592 GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenInit"),
593 );
594 self.inner.unary(req, path, codec).await
595 }
596 pub async fn connection_open_try(
598 &mut self,
599 request: impl tonic::IntoRequest<super::MsgConnectionOpenTry>,
600 ) -> std::result::Result<
601 tonic::Response<super::MsgConnectionOpenTryResponse>,
602 tonic::Status,
603 > {
604 self.inner
605 .ready()
606 .await
607 .map_err(|e| {
608 tonic::Status::unknown(
609 format!("Service was not ready: {}", e.into()),
610 )
611 })?;
612 let codec = tonic::codec::ProstCodec::default();
613 let path = http::uri::PathAndQuery::from_static(
614 "/ibc.core.connection.v1.Msg/ConnectionOpenTry",
615 );
616 let mut req = request.into_request();
617 req.extensions_mut()
618 .insert(
619 GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenTry"),
620 );
621 self.inner.unary(req, path, codec).await
622 }
623 pub async fn connection_open_ack(
625 &mut self,
626 request: impl tonic::IntoRequest<super::MsgConnectionOpenAck>,
627 ) -> std::result::Result<
628 tonic::Response<super::MsgConnectionOpenAckResponse>,
629 tonic::Status,
630 > {
631 self.inner
632 .ready()
633 .await
634 .map_err(|e| {
635 tonic::Status::unknown(
636 format!("Service was not ready: {}", e.into()),
637 )
638 })?;
639 let codec = tonic::codec::ProstCodec::default();
640 let path = http::uri::PathAndQuery::from_static(
641 "/ibc.core.connection.v1.Msg/ConnectionOpenAck",
642 );
643 let mut req = request.into_request();
644 req.extensions_mut()
645 .insert(
646 GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenAck"),
647 );
648 self.inner.unary(req, path, codec).await
649 }
650 pub async fn connection_open_confirm(
653 &mut self,
654 request: impl tonic::IntoRequest<super::MsgConnectionOpenConfirm>,
655 ) -> std::result::Result<
656 tonic::Response<super::MsgConnectionOpenConfirmResponse>,
657 tonic::Status,
658 > {
659 self.inner
660 .ready()
661 .await
662 .map_err(|e| {
663 tonic::Status::unknown(
664 format!("Service was not ready: {}", e.into()),
665 )
666 })?;
667 let codec = tonic::codec::ProstCodec::default();
668 let path = http::uri::PathAndQuery::from_static(
669 "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm",
670 );
671 let mut req = request.into_request();
672 req.extensions_mut()
673 .insert(
674 GrpcMethod::new(
675 "ibc.core.connection.v1.Msg",
676 "ConnectionOpenConfirm",
677 ),
678 );
679 self.inner.unary(req, path, codec).await
680 }
681 pub async fn update_connection_params(
684 &mut self,
685 request: impl tonic::IntoRequest<super::MsgUpdateParams>,
686 ) -> std::result::Result<
687 tonic::Response<super::MsgUpdateParamsResponse>,
688 tonic::Status,
689 > {
690 self.inner
691 .ready()
692 .await
693 .map_err(|e| {
694 tonic::Status::unknown(
695 format!("Service was not ready: {}", e.into()),
696 )
697 })?;
698 let codec = tonic::codec::ProstCodec::default();
699 let path = http::uri::PathAndQuery::from_static(
700 "/ibc.core.connection.v1.Msg/UpdateConnectionParams",
701 );
702 let mut req = request.into_request();
703 req.extensions_mut()
704 .insert(
705 GrpcMethod::new(
706 "ibc.core.connection.v1.Msg",
707 "UpdateConnectionParams",
708 ),
709 );
710 self.inner.unary(req, path, codec).await
711 }
712 }
713}
714#[cfg(feature = "server")]
716pub mod msg_server {
717 #![allow(
718 unused_variables,
719 dead_code,
720 missing_docs,
721 clippy::wildcard_imports,
722 clippy::let_unit_value,
723 )]
724 use tonic::codegen::*;
725 #[async_trait]
727 pub trait Msg: std::marker::Send + std::marker::Sync + 'static {
728 async fn connection_open_init(
730 &self,
731 request: tonic::Request<super::MsgConnectionOpenInit>,
732 ) -> std::result::Result<
733 tonic::Response<super::MsgConnectionOpenInitResponse>,
734 tonic::Status,
735 >;
736 async fn connection_open_try(
738 &self,
739 request: tonic::Request<super::MsgConnectionOpenTry>,
740 ) -> std::result::Result<
741 tonic::Response<super::MsgConnectionOpenTryResponse>,
742 tonic::Status,
743 >;
744 async fn connection_open_ack(
746 &self,
747 request: tonic::Request<super::MsgConnectionOpenAck>,
748 ) -> std::result::Result<
749 tonic::Response<super::MsgConnectionOpenAckResponse>,
750 tonic::Status,
751 >;
752 async fn connection_open_confirm(
755 &self,
756 request: tonic::Request<super::MsgConnectionOpenConfirm>,
757 ) -> std::result::Result<
758 tonic::Response<super::MsgConnectionOpenConfirmResponse>,
759 tonic::Status,
760 >;
761 async fn update_connection_params(
764 &self,
765 request: tonic::Request<super::MsgUpdateParams>,
766 ) -> std::result::Result<
767 tonic::Response<super::MsgUpdateParamsResponse>,
768 tonic::Status,
769 >;
770 }
771 #[derive(Debug)]
773 pub struct MsgServer<T> {
774 inner: Arc<T>,
775 accept_compression_encodings: EnabledCompressionEncodings,
776 send_compression_encodings: EnabledCompressionEncodings,
777 max_decoding_message_size: Option<usize>,
778 max_encoding_message_size: Option<usize>,
779 }
780 impl<T> MsgServer<T> {
781 pub fn new(inner: T) -> Self {
782 Self::from_arc(Arc::new(inner))
783 }
784 pub fn from_arc(inner: Arc<T>) -> Self {
785 Self {
786 inner,
787 accept_compression_encodings: Default::default(),
788 send_compression_encodings: Default::default(),
789 max_decoding_message_size: None,
790 max_encoding_message_size: None,
791 }
792 }
793 pub fn with_interceptor<F>(
794 inner: T,
795 interceptor: F,
796 ) -> InterceptedService<Self, F>
797 where
798 F: tonic::service::Interceptor,
799 {
800 InterceptedService::new(Self::new(inner), interceptor)
801 }
802 #[must_use]
804 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
805 self.accept_compression_encodings.enable(encoding);
806 self
807 }
808 #[must_use]
810 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
811 self.send_compression_encodings.enable(encoding);
812 self
813 }
814 #[must_use]
818 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
819 self.max_decoding_message_size = Some(limit);
820 self
821 }
822 #[must_use]
826 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
827 self.max_encoding_message_size = Some(limit);
828 self
829 }
830 }
831 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
832 where
833 T: Msg,
834 B: Body + std::marker::Send + 'static,
835 B::Error: Into<StdError> + std::marker::Send + 'static,
836 {
837 type Response = http::Response<tonic::body::Body>;
838 type Error = std::convert::Infallible;
839 type Future = BoxFuture<Self::Response, Self::Error>;
840 fn poll_ready(
841 &mut self,
842 _cx: &mut Context<'_>,
843 ) -> Poll<std::result::Result<(), Self::Error>> {
844 Poll::Ready(Ok(()))
845 }
846 fn call(&mut self, req: http::Request<B>) -> Self::Future {
847 match req.uri().path() {
848 "/ibc.core.connection.v1.Msg/ConnectionOpenInit" => {
849 #[allow(non_camel_case_types)]
850 struct ConnectionOpenInitSvc<T: Msg>(pub Arc<T>);
851 impl<
852 T: Msg,
853 > tonic::server::UnaryService<super::MsgConnectionOpenInit>
854 for ConnectionOpenInitSvc<T> {
855 type Response = super::MsgConnectionOpenInitResponse;
856 type Future = BoxFuture<
857 tonic::Response<Self::Response>,
858 tonic::Status,
859 >;
860 fn call(
861 &mut self,
862 request: tonic::Request<super::MsgConnectionOpenInit>,
863 ) -> Self::Future {
864 let inner = Arc::clone(&self.0);
865 let fut = async move {
866 <T as Msg>::connection_open_init(&inner, request).await
867 };
868 Box::pin(fut)
869 }
870 }
871 let accept_compression_encodings = self.accept_compression_encodings;
872 let send_compression_encodings = self.send_compression_encodings;
873 let max_decoding_message_size = self.max_decoding_message_size;
874 let max_encoding_message_size = self.max_encoding_message_size;
875 let inner = self.inner.clone();
876 let fut = async move {
877 let method = ConnectionOpenInitSvc(inner);
878 let codec = tonic::codec::ProstCodec::default();
879 let mut grpc = tonic::server::Grpc::new(codec)
880 .apply_compression_config(
881 accept_compression_encodings,
882 send_compression_encodings,
883 )
884 .apply_max_message_size_config(
885 max_decoding_message_size,
886 max_encoding_message_size,
887 );
888 let res = grpc.unary(method, req).await;
889 Ok(res)
890 };
891 Box::pin(fut)
892 }
893 "/ibc.core.connection.v1.Msg/ConnectionOpenTry" => {
894 #[allow(non_camel_case_types)]
895 struct ConnectionOpenTrySvc<T: Msg>(pub Arc<T>);
896 impl<T: Msg> tonic::server::UnaryService<super::MsgConnectionOpenTry>
897 for ConnectionOpenTrySvc<T> {
898 type Response = super::MsgConnectionOpenTryResponse;
899 type Future = BoxFuture<
900 tonic::Response<Self::Response>,
901 tonic::Status,
902 >;
903 fn call(
904 &mut self,
905 request: tonic::Request<super::MsgConnectionOpenTry>,
906 ) -> Self::Future {
907 let inner = Arc::clone(&self.0);
908 let fut = async move {
909 <T as Msg>::connection_open_try(&inner, request).await
910 };
911 Box::pin(fut)
912 }
913 }
914 let accept_compression_encodings = self.accept_compression_encodings;
915 let send_compression_encodings = self.send_compression_encodings;
916 let max_decoding_message_size = self.max_decoding_message_size;
917 let max_encoding_message_size = self.max_encoding_message_size;
918 let inner = self.inner.clone();
919 let fut = async move {
920 let method = ConnectionOpenTrySvc(inner);
921 let codec = tonic::codec::ProstCodec::default();
922 let mut grpc = tonic::server::Grpc::new(codec)
923 .apply_compression_config(
924 accept_compression_encodings,
925 send_compression_encodings,
926 )
927 .apply_max_message_size_config(
928 max_decoding_message_size,
929 max_encoding_message_size,
930 );
931 let res = grpc.unary(method, req).await;
932 Ok(res)
933 };
934 Box::pin(fut)
935 }
936 "/ibc.core.connection.v1.Msg/ConnectionOpenAck" => {
937 #[allow(non_camel_case_types)]
938 struct ConnectionOpenAckSvc<T: Msg>(pub Arc<T>);
939 impl<T: Msg> tonic::server::UnaryService<super::MsgConnectionOpenAck>
940 for ConnectionOpenAckSvc<T> {
941 type Response = super::MsgConnectionOpenAckResponse;
942 type Future = BoxFuture<
943 tonic::Response<Self::Response>,
944 tonic::Status,
945 >;
946 fn call(
947 &mut self,
948 request: tonic::Request<super::MsgConnectionOpenAck>,
949 ) -> Self::Future {
950 let inner = Arc::clone(&self.0);
951 let fut = async move {
952 <T as Msg>::connection_open_ack(&inner, request).await
953 };
954 Box::pin(fut)
955 }
956 }
957 let accept_compression_encodings = self.accept_compression_encodings;
958 let send_compression_encodings = self.send_compression_encodings;
959 let max_decoding_message_size = self.max_decoding_message_size;
960 let max_encoding_message_size = self.max_encoding_message_size;
961 let inner = self.inner.clone();
962 let fut = async move {
963 let method = ConnectionOpenAckSvc(inner);
964 let codec = tonic::codec::ProstCodec::default();
965 let mut grpc = tonic::server::Grpc::new(codec)
966 .apply_compression_config(
967 accept_compression_encodings,
968 send_compression_encodings,
969 )
970 .apply_max_message_size_config(
971 max_decoding_message_size,
972 max_encoding_message_size,
973 );
974 let res = grpc.unary(method, req).await;
975 Ok(res)
976 };
977 Box::pin(fut)
978 }
979 "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm" => {
980 #[allow(non_camel_case_types)]
981 struct ConnectionOpenConfirmSvc<T: Msg>(pub Arc<T>);
982 impl<
983 T: Msg,
984 > tonic::server::UnaryService<super::MsgConnectionOpenConfirm>
985 for ConnectionOpenConfirmSvc<T> {
986 type Response = super::MsgConnectionOpenConfirmResponse;
987 type Future = BoxFuture<
988 tonic::Response<Self::Response>,
989 tonic::Status,
990 >;
991 fn call(
992 &mut self,
993 request: tonic::Request<super::MsgConnectionOpenConfirm>,
994 ) -> Self::Future {
995 let inner = Arc::clone(&self.0);
996 let fut = async move {
997 <T as Msg>::connection_open_confirm(&inner, request).await
998 };
999 Box::pin(fut)
1000 }
1001 }
1002 let accept_compression_encodings = self.accept_compression_encodings;
1003 let send_compression_encodings = self.send_compression_encodings;
1004 let max_decoding_message_size = self.max_decoding_message_size;
1005 let max_encoding_message_size = self.max_encoding_message_size;
1006 let inner = self.inner.clone();
1007 let fut = async move {
1008 let method = ConnectionOpenConfirmSvc(inner);
1009 let codec = tonic::codec::ProstCodec::default();
1010 let mut grpc = tonic::server::Grpc::new(codec)
1011 .apply_compression_config(
1012 accept_compression_encodings,
1013 send_compression_encodings,
1014 )
1015 .apply_max_message_size_config(
1016 max_decoding_message_size,
1017 max_encoding_message_size,
1018 );
1019 let res = grpc.unary(method, req).await;
1020 Ok(res)
1021 };
1022 Box::pin(fut)
1023 }
1024 "/ibc.core.connection.v1.Msg/UpdateConnectionParams" => {
1025 #[allow(non_camel_case_types)]
1026 struct UpdateConnectionParamsSvc<T: Msg>(pub Arc<T>);
1027 impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
1028 for UpdateConnectionParamsSvc<T> {
1029 type Response = super::MsgUpdateParamsResponse;
1030 type Future = BoxFuture<
1031 tonic::Response<Self::Response>,
1032 tonic::Status,
1033 >;
1034 fn call(
1035 &mut self,
1036 request: tonic::Request<super::MsgUpdateParams>,
1037 ) -> Self::Future {
1038 let inner = Arc::clone(&self.0);
1039 let fut = async move {
1040 <T as Msg>::update_connection_params(&inner, request).await
1041 };
1042 Box::pin(fut)
1043 }
1044 }
1045 let accept_compression_encodings = self.accept_compression_encodings;
1046 let send_compression_encodings = self.send_compression_encodings;
1047 let max_decoding_message_size = self.max_decoding_message_size;
1048 let max_encoding_message_size = self.max_encoding_message_size;
1049 let inner = self.inner.clone();
1050 let fut = async move {
1051 let method = UpdateConnectionParamsSvc(inner);
1052 let codec = tonic::codec::ProstCodec::default();
1053 let mut grpc = tonic::server::Grpc::new(codec)
1054 .apply_compression_config(
1055 accept_compression_encodings,
1056 send_compression_encodings,
1057 )
1058 .apply_max_message_size_config(
1059 max_decoding_message_size,
1060 max_encoding_message_size,
1061 );
1062 let res = grpc.unary(method, req).await;
1063 Ok(res)
1064 };
1065 Box::pin(fut)
1066 }
1067 _ => {
1068 Box::pin(async move {
1069 let mut response = http::Response::new(
1070 tonic::body::Body::default(),
1071 );
1072 let headers = response.headers_mut();
1073 headers
1074 .insert(
1075 tonic::Status::GRPC_STATUS,
1076 (tonic::Code::Unimplemented as i32).into(),
1077 );
1078 headers
1079 .insert(
1080 http::header::CONTENT_TYPE,
1081 tonic::metadata::GRPC_CONTENT_TYPE,
1082 );
1083 Ok(response)
1084 })
1085 }
1086 }
1087 }
1088 }
1089 impl<T> Clone for MsgServer<T> {
1090 fn clone(&self) -> Self {
1091 let inner = self.inner.clone();
1092 Self {
1093 inner,
1094 accept_compression_encodings: self.accept_compression_encodings,
1095 send_compression_encodings: self.send_compression_encodings,
1096 max_decoding_message_size: self.max_decoding_message_size,
1097 max_encoding_message_size: self.max_encoding_message_size,
1098 }
1099 }
1100 }
1101 pub const SERVICE_NAME: &str = "ibc.core.connection.v1.Msg";
1103 impl<T> tonic::server::NamedService for MsgServer<T> {
1104 const NAME: &'static str = SERVICE_NAME;
1105 }
1106}
1107#[derive(Clone, PartialEq, ::prost::Message)]
1110pub struct QueryConnectionRequest {
1111 #[prost(string, tag = "1")]
1113 pub connection_id: ::prost::alloc::string::String,
1114}
1115impl ::prost::Name for QueryConnectionRequest {
1116 const NAME: &'static str = "QueryConnectionRequest";
1117 const PACKAGE: &'static str = "ibc.core.connection.v1";
1118 fn full_name() -> ::prost::alloc::string::String {
1119 "ibc.core.connection.v1.QueryConnectionRequest".into()
1120 }
1121 fn type_url() -> ::prost::alloc::string::String {
1122 "/ibc.core.connection.v1.QueryConnectionRequest".into()
1123 }
1124}
1125#[derive(Clone, PartialEq, ::prost::Message)]
1129pub struct QueryConnectionResponse {
1130 #[prost(message, optional, tag = "1")]
1132 pub connection: ::core::option::Option<ConnectionEnd>,
1133 #[prost(bytes = "vec", tag = "2")]
1135 pub proof: ::prost::alloc::vec::Vec<u8>,
1136 #[prost(message, optional, tag = "3")]
1138 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
1139}
1140impl ::prost::Name for QueryConnectionResponse {
1141 const NAME: &'static str = "QueryConnectionResponse";
1142 const PACKAGE: &'static str = "ibc.core.connection.v1";
1143 fn full_name() -> ::prost::alloc::string::String {
1144 "ibc.core.connection.v1.QueryConnectionResponse".into()
1145 }
1146 fn type_url() -> ::prost::alloc::string::String {
1147 "/ibc.core.connection.v1.QueryConnectionResponse".into()
1148 }
1149}
1150#[derive(Clone, PartialEq, ::prost::Message)]
1153pub struct QueryConnectionsRequest {
1154 #[prost(message, optional, tag = "1")]
1155 pub pagination: ::core::option::Option<
1156 super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
1157 >,
1158}
1159impl ::prost::Name for QueryConnectionsRequest {
1160 const NAME: &'static str = "QueryConnectionsRequest";
1161 const PACKAGE: &'static str = "ibc.core.connection.v1";
1162 fn full_name() -> ::prost::alloc::string::String {
1163 "ibc.core.connection.v1.QueryConnectionsRequest".into()
1164 }
1165 fn type_url() -> ::prost::alloc::string::String {
1166 "/ibc.core.connection.v1.QueryConnectionsRequest".into()
1167 }
1168}
1169#[derive(Clone, PartialEq, ::prost::Message)]
1172pub struct QueryConnectionsResponse {
1173 #[prost(message, repeated, tag = "1")]
1175 pub connections: ::prost::alloc::vec::Vec<IdentifiedConnection>,
1176 #[prost(message, optional, tag = "2")]
1178 pub pagination: ::core::option::Option<
1179 super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
1180 >,
1181 #[prost(message, optional, tag = "3")]
1183 pub height: ::core::option::Option<super::super::client::v1::Height>,
1184}
1185impl ::prost::Name for QueryConnectionsResponse {
1186 const NAME: &'static str = "QueryConnectionsResponse";
1187 const PACKAGE: &'static str = "ibc.core.connection.v1";
1188 fn full_name() -> ::prost::alloc::string::String {
1189 "ibc.core.connection.v1.QueryConnectionsResponse".into()
1190 }
1191 fn type_url() -> ::prost::alloc::string::String {
1192 "/ibc.core.connection.v1.QueryConnectionsResponse".into()
1193 }
1194}
1195#[derive(Clone, PartialEq, ::prost::Message)]
1198pub struct QueryClientConnectionsRequest {
1199 #[prost(string, tag = "1")]
1201 pub client_id: ::prost::alloc::string::String,
1202}
1203impl ::prost::Name for QueryClientConnectionsRequest {
1204 const NAME: &'static str = "QueryClientConnectionsRequest";
1205 const PACKAGE: &'static str = "ibc.core.connection.v1";
1206 fn full_name() -> ::prost::alloc::string::String {
1207 "ibc.core.connection.v1.QueryClientConnectionsRequest".into()
1208 }
1209 fn type_url() -> ::prost::alloc::string::String {
1210 "/ibc.core.connection.v1.QueryClientConnectionsRequest".into()
1211 }
1212}
1213#[derive(Clone, PartialEq, ::prost::Message)]
1216pub struct QueryClientConnectionsResponse {
1217 #[prost(string, repeated, tag = "1")]
1219 pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
1220 #[prost(bytes = "vec", tag = "2")]
1222 pub proof: ::prost::alloc::vec::Vec<u8>,
1223 #[prost(message, optional, tag = "3")]
1225 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
1226}
1227impl ::prost::Name for QueryClientConnectionsResponse {
1228 const NAME: &'static str = "QueryClientConnectionsResponse";
1229 const PACKAGE: &'static str = "ibc.core.connection.v1";
1230 fn full_name() -> ::prost::alloc::string::String {
1231 "ibc.core.connection.v1.QueryClientConnectionsResponse".into()
1232 }
1233 fn type_url() -> ::prost::alloc::string::String {
1234 "/ibc.core.connection.v1.QueryClientConnectionsResponse".into()
1235 }
1236}
1237#[derive(Clone, PartialEq, ::prost::Message)]
1240pub struct QueryConnectionClientStateRequest {
1241 #[prost(string, tag = "1")]
1243 pub connection_id: ::prost::alloc::string::String,
1244}
1245impl ::prost::Name for QueryConnectionClientStateRequest {
1246 const NAME: &'static str = "QueryConnectionClientStateRequest";
1247 const PACKAGE: &'static str = "ibc.core.connection.v1";
1248 fn full_name() -> ::prost::alloc::string::String {
1249 "ibc.core.connection.v1.QueryConnectionClientStateRequest".into()
1250 }
1251 fn type_url() -> ::prost::alloc::string::String {
1252 "/ibc.core.connection.v1.QueryConnectionClientStateRequest".into()
1253 }
1254}
1255#[derive(Clone, PartialEq, ::prost::Message)]
1258pub struct QueryConnectionClientStateResponse {
1259 #[prost(message, optional, tag = "1")]
1261 pub identified_client_state: ::core::option::Option<
1262 super::super::client::v1::IdentifiedClientState,
1263 >,
1264 #[prost(bytes = "vec", tag = "2")]
1266 pub proof: ::prost::alloc::vec::Vec<u8>,
1267 #[prost(message, optional, tag = "3")]
1269 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
1270}
1271impl ::prost::Name for QueryConnectionClientStateResponse {
1272 const NAME: &'static str = "QueryConnectionClientStateResponse";
1273 const PACKAGE: &'static str = "ibc.core.connection.v1";
1274 fn full_name() -> ::prost::alloc::string::String {
1275 "ibc.core.connection.v1.QueryConnectionClientStateResponse".into()
1276 }
1277 fn type_url() -> ::prost::alloc::string::String {
1278 "/ibc.core.connection.v1.QueryConnectionClientStateResponse".into()
1279 }
1280}
1281#[derive(Clone, PartialEq, ::prost::Message)]
1284pub struct QueryConnectionConsensusStateRequest {
1285 #[prost(string, tag = "1")]
1287 pub connection_id: ::prost::alloc::string::String,
1288 #[prost(uint64, tag = "2")]
1289 pub revision_number: u64,
1290 #[prost(uint64, tag = "3")]
1291 pub revision_height: u64,
1292}
1293impl ::prost::Name for QueryConnectionConsensusStateRequest {
1294 const NAME: &'static str = "QueryConnectionConsensusStateRequest";
1295 const PACKAGE: &'static str = "ibc.core.connection.v1";
1296 fn full_name() -> ::prost::alloc::string::String {
1297 "ibc.core.connection.v1.QueryConnectionConsensusStateRequest".into()
1298 }
1299 fn type_url() -> ::prost::alloc::string::String {
1300 "/ibc.core.connection.v1.QueryConnectionConsensusStateRequest".into()
1301 }
1302}
1303#[derive(Clone, PartialEq, ::prost::Message)]
1306pub struct QueryConnectionConsensusStateResponse {
1307 #[prost(message, optional, tag = "1")]
1309 pub consensus_state: ::core::option::Option<
1310 ::tendermint_proto::google::protobuf::Any,
1311 >,
1312 #[prost(string, tag = "2")]
1314 pub client_id: ::prost::alloc::string::String,
1315 #[prost(bytes = "vec", tag = "3")]
1317 pub proof: ::prost::alloc::vec::Vec<u8>,
1318 #[prost(message, optional, tag = "4")]
1320 pub proof_height: ::core::option::Option<super::super::client::v1::Height>,
1321}
1322impl ::prost::Name for QueryConnectionConsensusStateResponse {
1323 const NAME: &'static str = "QueryConnectionConsensusStateResponse";
1324 const PACKAGE: &'static str = "ibc.core.connection.v1";
1325 fn full_name() -> ::prost::alloc::string::String {
1326 "ibc.core.connection.v1.QueryConnectionConsensusStateResponse".into()
1327 }
1328 fn type_url() -> ::prost::alloc::string::String {
1329 "/ibc.core.connection.v1.QueryConnectionConsensusStateResponse".into()
1330 }
1331}
1332#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1334pub struct QueryConnectionParamsRequest {}
1335impl ::prost::Name for QueryConnectionParamsRequest {
1336 const NAME: &'static str = "QueryConnectionParamsRequest";
1337 const PACKAGE: &'static str = "ibc.core.connection.v1";
1338 fn full_name() -> ::prost::alloc::string::String {
1339 "ibc.core.connection.v1.QueryConnectionParamsRequest".into()
1340 }
1341 fn type_url() -> ::prost::alloc::string::String {
1342 "/ibc.core.connection.v1.QueryConnectionParamsRequest".into()
1343 }
1344}
1345#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1347pub struct QueryConnectionParamsResponse {
1348 #[prost(message, optional, tag = "1")]
1350 pub params: ::core::option::Option<Params>,
1351}
1352impl ::prost::Name for QueryConnectionParamsResponse {
1353 const NAME: &'static str = "QueryConnectionParamsResponse";
1354 const PACKAGE: &'static str = "ibc.core.connection.v1";
1355 fn full_name() -> ::prost::alloc::string::String {
1356 "ibc.core.connection.v1.QueryConnectionParamsResponse".into()
1357 }
1358 fn type_url() -> ::prost::alloc::string::String {
1359 "/ibc.core.connection.v1.QueryConnectionParamsResponse".into()
1360 }
1361}
1362#[cfg(feature = "client")]
1364pub mod query_client {
1365 #![allow(
1366 unused_variables,
1367 dead_code,
1368 missing_docs,
1369 clippy::wildcard_imports,
1370 clippy::let_unit_value,
1371 )]
1372 use tonic::codegen::*;
1373 use tonic::codegen::http::Uri;
1374 #[derive(Debug, Clone)]
1376 pub struct QueryClient<T> {
1377 inner: tonic::client::Grpc<T>,
1378 }
1379 #[cfg(feature = "transport")]
1380 impl QueryClient<tonic::transport::Channel> {
1381 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
1383 where
1384 D: TryInto<tonic::transport::Endpoint>,
1385 D::Error: Into<StdError>,
1386 {
1387 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
1388 Ok(Self::new(conn))
1389 }
1390 }
1391 impl<T> QueryClient<T>
1392 where
1393 T: tonic::client::GrpcService<tonic::body::Body>,
1394 T::Error: Into<StdError>,
1395 T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
1396 <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
1397 {
1398 pub fn new(inner: T) -> Self {
1399 let inner = tonic::client::Grpc::new(inner);
1400 Self { inner }
1401 }
1402 pub fn with_origin(inner: T, origin: Uri) -> Self {
1403 let inner = tonic::client::Grpc::with_origin(inner, origin);
1404 Self { inner }
1405 }
1406 pub fn with_interceptor<F>(
1407 inner: T,
1408 interceptor: F,
1409 ) -> QueryClient<InterceptedService<T, F>>
1410 where
1411 F: tonic::service::Interceptor,
1412 T::ResponseBody: Default,
1413 T: tonic::codegen::Service<
1414 http::Request<tonic::body::Body>,
1415 Response = http::Response<
1416 <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
1417 >,
1418 >,
1419 <T as tonic::codegen::Service<
1420 http::Request<tonic::body::Body>,
1421 >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
1422 {
1423 QueryClient::new(InterceptedService::new(inner, interceptor))
1424 }
1425 #[must_use]
1430 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1431 self.inner = self.inner.send_compressed(encoding);
1432 self
1433 }
1434 #[must_use]
1436 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1437 self.inner = self.inner.accept_compressed(encoding);
1438 self
1439 }
1440 #[must_use]
1444 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1445 self.inner = self.inner.max_decoding_message_size(limit);
1446 self
1447 }
1448 #[must_use]
1452 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1453 self.inner = self.inner.max_encoding_message_size(limit);
1454 self
1455 }
1456 pub async fn connection(
1458 &mut self,
1459 request: impl tonic::IntoRequest<super::QueryConnectionRequest>,
1460 ) -> std::result::Result<
1461 tonic::Response<super::QueryConnectionResponse>,
1462 tonic::Status,
1463 > {
1464 self.inner
1465 .ready()
1466 .await
1467 .map_err(|e| {
1468 tonic::Status::unknown(
1469 format!("Service was not ready: {}", e.into()),
1470 )
1471 })?;
1472 let codec = tonic::codec::ProstCodec::default();
1473 let path = http::uri::PathAndQuery::from_static(
1474 "/ibc.core.connection.v1.Query/Connection",
1475 );
1476 let mut req = request.into_request();
1477 req.extensions_mut()
1478 .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connection"));
1479 self.inner.unary(req, path, codec).await
1480 }
1481 pub async fn connections(
1483 &mut self,
1484 request: impl tonic::IntoRequest<super::QueryConnectionsRequest>,
1485 ) -> std::result::Result<
1486 tonic::Response<super::QueryConnectionsResponse>,
1487 tonic::Status,
1488 > {
1489 self.inner
1490 .ready()
1491 .await
1492 .map_err(|e| {
1493 tonic::Status::unknown(
1494 format!("Service was not ready: {}", e.into()),
1495 )
1496 })?;
1497 let codec = tonic::codec::ProstCodec::default();
1498 let path = http::uri::PathAndQuery::from_static(
1499 "/ibc.core.connection.v1.Query/Connections",
1500 );
1501 let mut req = request.into_request();
1502 req.extensions_mut()
1503 .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connections"));
1504 self.inner.unary(req, path, codec).await
1505 }
1506 pub async fn client_connections(
1509 &mut self,
1510 request: impl tonic::IntoRequest<super::QueryClientConnectionsRequest>,
1511 ) -> std::result::Result<
1512 tonic::Response<super::QueryClientConnectionsResponse>,
1513 tonic::Status,
1514 > {
1515 self.inner
1516 .ready()
1517 .await
1518 .map_err(|e| {
1519 tonic::Status::unknown(
1520 format!("Service was not ready: {}", e.into()),
1521 )
1522 })?;
1523 let codec = tonic::codec::ProstCodec::default();
1524 let path = http::uri::PathAndQuery::from_static(
1525 "/ibc.core.connection.v1.Query/ClientConnections",
1526 );
1527 let mut req = request.into_request();
1528 req.extensions_mut()
1529 .insert(
1530 GrpcMethod::new("ibc.core.connection.v1.Query", "ClientConnections"),
1531 );
1532 self.inner.unary(req, path, codec).await
1533 }
1534 pub async fn connection_client_state(
1537 &mut self,
1538 request: impl tonic::IntoRequest<super::QueryConnectionClientStateRequest>,
1539 ) -> std::result::Result<
1540 tonic::Response<super::QueryConnectionClientStateResponse>,
1541 tonic::Status,
1542 > {
1543 self.inner
1544 .ready()
1545 .await
1546 .map_err(|e| {
1547 tonic::Status::unknown(
1548 format!("Service was not ready: {}", e.into()),
1549 )
1550 })?;
1551 let codec = tonic::codec::ProstCodec::default();
1552 let path = http::uri::PathAndQuery::from_static(
1553 "/ibc.core.connection.v1.Query/ConnectionClientState",
1554 );
1555 let mut req = request.into_request();
1556 req.extensions_mut()
1557 .insert(
1558 GrpcMethod::new(
1559 "ibc.core.connection.v1.Query",
1560 "ConnectionClientState",
1561 ),
1562 );
1563 self.inner.unary(req, path, codec).await
1564 }
1565 pub async fn connection_consensus_state(
1568 &mut self,
1569 request: impl tonic::IntoRequest<super::QueryConnectionConsensusStateRequest>,
1570 ) -> std::result::Result<
1571 tonic::Response<super::QueryConnectionConsensusStateResponse>,
1572 tonic::Status,
1573 > {
1574 self.inner
1575 .ready()
1576 .await
1577 .map_err(|e| {
1578 tonic::Status::unknown(
1579 format!("Service was not ready: {}", e.into()),
1580 )
1581 })?;
1582 let codec = tonic::codec::ProstCodec::default();
1583 let path = http::uri::PathAndQuery::from_static(
1584 "/ibc.core.connection.v1.Query/ConnectionConsensusState",
1585 );
1586 let mut req = request.into_request();
1587 req.extensions_mut()
1588 .insert(
1589 GrpcMethod::new(
1590 "ibc.core.connection.v1.Query",
1591 "ConnectionConsensusState",
1592 ),
1593 );
1594 self.inner.unary(req, path, codec).await
1595 }
1596 pub async fn connection_params(
1598 &mut self,
1599 request: impl tonic::IntoRequest<super::QueryConnectionParamsRequest>,
1600 ) -> std::result::Result<
1601 tonic::Response<super::QueryConnectionParamsResponse>,
1602 tonic::Status,
1603 > {
1604 self.inner
1605 .ready()
1606 .await
1607 .map_err(|e| {
1608 tonic::Status::unknown(
1609 format!("Service was not ready: {}", e.into()),
1610 )
1611 })?;
1612 let codec = tonic::codec::ProstCodec::default();
1613 let path = http::uri::PathAndQuery::from_static(
1614 "/ibc.core.connection.v1.Query/ConnectionParams",
1615 );
1616 let mut req = request.into_request();
1617 req.extensions_mut()
1618 .insert(
1619 GrpcMethod::new("ibc.core.connection.v1.Query", "ConnectionParams"),
1620 );
1621 self.inner.unary(req, path, codec).await
1622 }
1623 }
1624}
1625#[cfg(feature = "server")]
1627pub mod query_server {
1628 #![allow(
1629 unused_variables,
1630 dead_code,
1631 missing_docs,
1632 clippy::wildcard_imports,
1633 clippy::let_unit_value,
1634 )]
1635 use tonic::codegen::*;
1636 #[async_trait]
1638 pub trait Query: std::marker::Send + std::marker::Sync + 'static {
1639 async fn connection(
1641 &self,
1642 request: tonic::Request<super::QueryConnectionRequest>,
1643 ) -> std::result::Result<
1644 tonic::Response<super::QueryConnectionResponse>,
1645 tonic::Status,
1646 >;
1647 async fn connections(
1649 &self,
1650 request: tonic::Request<super::QueryConnectionsRequest>,
1651 ) -> std::result::Result<
1652 tonic::Response<super::QueryConnectionsResponse>,
1653 tonic::Status,
1654 >;
1655 async fn client_connections(
1658 &self,
1659 request: tonic::Request<super::QueryClientConnectionsRequest>,
1660 ) -> std::result::Result<
1661 tonic::Response<super::QueryClientConnectionsResponse>,
1662 tonic::Status,
1663 >;
1664 async fn connection_client_state(
1667 &self,
1668 request: tonic::Request<super::QueryConnectionClientStateRequest>,
1669 ) -> std::result::Result<
1670 tonic::Response<super::QueryConnectionClientStateResponse>,
1671 tonic::Status,
1672 >;
1673 async fn connection_consensus_state(
1676 &self,
1677 request: tonic::Request<super::QueryConnectionConsensusStateRequest>,
1678 ) -> std::result::Result<
1679 tonic::Response<super::QueryConnectionConsensusStateResponse>,
1680 tonic::Status,
1681 >;
1682 async fn connection_params(
1684 &self,
1685 request: tonic::Request<super::QueryConnectionParamsRequest>,
1686 ) -> std::result::Result<
1687 tonic::Response<super::QueryConnectionParamsResponse>,
1688 tonic::Status,
1689 >;
1690 }
1691 #[derive(Debug)]
1693 pub struct QueryServer<T> {
1694 inner: Arc<T>,
1695 accept_compression_encodings: EnabledCompressionEncodings,
1696 send_compression_encodings: EnabledCompressionEncodings,
1697 max_decoding_message_size: Option<usize>,
1698 max_encoding_message_size: Option<usize>,
1699 }
1700 impl<T> QueryServer<T> {
1701 pub fn new(inner: T) -> Self {
1702 Self::from_arc(Arc::new(inner))
1703 }
1704 pub fn from_arc(inner: Arc<T>) -> Self {
1705 Self {
1706 inner,
1707 accept_compression_encodings: Default::default(),
1708 send_compression_encodings: Default::default(),
1709 max_decoding_message_size: None,
1710 max_encoding_message_size: None,
1711 }
1712 }
1713 pub fn with_interceptor<F>(
1714 inner: T,
1715 interceptor: F,
1716 ) -> InterceptedService<Self, F>
1717 where
1718 F: tonic::service::Interceptor,
1719 {
1720 InterceptedService::new(Self::new(inner), interceptor)
1721 }
1722 #[must_use]
1724 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
1725 self.accept_compression_encodings.enable(encoding);
1726 self
1727 }
1728 #[must_use]
1730 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
1731 self.send_compression_encodings.enable(encoding);
1732 self
1733 }
1734 #[must_use]
1738 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
1739 self.max_decoding_message_size = Some(limit);
1740 self
1741 }
1742 #[must_use]
1746 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
1747 self.max_encoding_message_size = Some(limit);
1748 self
1749 }
1750 }
1751 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
1752 where
1753 T: Query,
1754 B: Body + std::marker::Send + 'static,
1755 B::Error: Into<StdError> + std::marker::Send + 'static,
1756 {
1757 type Response = http::Response<tonic::body::Body>;
1758 type Error = std::convert::Infallible;
1759 type Future = BoxFuture<Self::Response, Self::Error>;
1760 fn poll_ready(
1761 &mut self,
1762 _cx: &mut Context<'_>,
1763 ) -> Poll<std::result::Result<(), Self::Error>> {
1764 Poll::Ready(Ok(()))
1765 }
1766 fn call(&mut self, req: http::Request<B>) -> Self::Future {
1767 match req.uri().path() {
1768 "/ibc.core.connection.v1.Query/Connection" => {
1769 #[allow(non_camel_case_types)]
1770 struct ConnectionSvc<T: Query>(pub Arc<T>);
1771 impl<
1772 T: Query,
1773 > tonic::server::UnaryService<super::QueryConnectionRequest>
1774 for ConnectionSvc<T> {
1775 type Response = super::QueryConnectionResponse;
1776 type Future = BoxFuture<
1777 tonic::Response<Self::Response>,
1778 tonic::Status,
1779 >;
1780 fn call(
1781 &mut self,
1782 request: tonic::Request<super::QueryConnectionRequest>,
1783 ) -> Self::Future {
1784 let inner = Arc::clone(&self.0);
1785 let fut = async move {
1786 <T as Query>::connection(&inner, request).await
1787 };
1788 Box::pin(fut)
1789 }
1790 }
1791 let accept_compression_encodings = self.accept_compression_encodings;
1792 let send_compression_encodings = self.send_compression_encodings;
1793 let max_decoding_message_size = self.max_decoding_message_size;
1794 let max_encoding_message_size = self.max_encoding_message_size;
1795 let inner = self.inner.clone();
1796 let fut = async move {
1797 let method = ConnectionSvc(inner);
1798 let codec = tonic::codec::ProstCodec::default();
1799 let mut grpc = tonic::server::Grpc::new(codec)
1800 .apply_compression_config(
1801 accept_compression_encodings,
1802 send_compression_encodings,
1803 )
1804 .apply_max_message_size_config(
1805 max_decoding_message_size,
1806 max_encoding_message_size,
1807 );
1808 let res = grpc.unary(method, req).await;
1809 Ok(res)
1810 };
1811 Box::pin(fut)
1812 }
1813 "/ibc.core.connection.v1.Query/Connections" => {
1814 #[allow(non_camel_case_types)]
1815 struct ConnectionsSvc<T: Query>(pub Arc<T>);
1816 impl<
1817 T: Query,
1818 > tonic::server::UnaryService<super::QueryConnectionsRequest>
1819 for ConnectionsSvc<T> {
1820 type Response = super::QueryConnectionsResponse;
1821 type Future = BoxFuture<
1822 tonic::Response<Self::Response>,
1823 tonic::Status,
1824 >;
1825 fn call(
1826 &mut self,
1827 request: tonic::Request<super::QueryConnectionsRequest>,
1828 ) -> Self::Future {
1829 let inner = Arc::clone(&self.0);
1830 let fut = async move {
1831 <T as Query>::connections(&inner, request).await
1832 };
1833 Box::pin(fut)
1834 }
1835 }
1836 let accept_compression_encodings = self.accept_compression_encodings;
1837 let send_compression_encodings = self.send_compression_encodings;
1838 let max_decoding_message_size = self.max_decoding_message_size;
1839 let max_encoding_message_size = self.max_encoding_message_size;
1840 let inner = self.inner.clone();
1841 let fut = async move {
1842 let method = ConnectionsSvc(inner);
1843 let codec = tonic::codec::ProstCodec::default();
1844 let mut grpc = tonic::server::Grpc::new(codec)
1845 .apply_compression_config(
1846 accept_compression_encodings,
1847 send_compression_encodings,
1848 )
1849 .apply_max_message_size_config(
1850 max_decoding_message_size,
1851 max_encoding_message_size,
1852 );
1853 let res = grpc.unary(method, req).await;
1854 Ok(res)
1855 };
1856 Box::pin(fut)
1857 }
1858 "/ibc.core.connection.v1.Query/ClientConnections" => {
1859 #[allow(non_camel_case_types)]
1860 struct ClientConnectionsSvc<T: Query>(pub Arc<T>);
1861 impl<
1862 T: Query,
1863 > tonic::server::UnaryService<super::QueryClientConnectionsRequest>
1864 for ClientConnectionsSvc<T> {
1865 type Response = super::QueryClientConnectionsResponse;
1866 type Future = BoxFuture<
1867 tonic::Response<Self::Response>,
1868 tonic::Status,
1869 >;
1870 fn call(
1871 &mut self,
1872 request: tonic::Request<super::QueryClientConnectionsRequest>,
1873 ) -> Self::Future {
1874 let inner = Arc::clone(&self.0);
1875 let fut = async move {
1876 <T as Query>::client_connections(&inner, request).await
1877 };
1878 Box::pin(fut)
1879 }
1880 }
1881 let accept_compression_encodings = self.accept_compression_encodings;
1882 let send_compression_encodings = self.send_compression_encodings;
1883 let max_decoding_message_size = self.max_decoding_message_size;
1884 let max_encoding_message_size = self.max_encoding_message_size;
1885 let inner = self.inner.clone();
1886 let fut = async move {
1887 let method = ClientConnectionsSvc(inner);
1888 let codec = tonic::codec::ProstCodec::default();
1889 let mut grpc = tonic::server::Grpc::new(codec)
1890 .apply_compression_config(
1891 accept_compression_encodings,
1892 send_compression_encodings,
1893 )
1894 .apply_max_message_size_config(
1895 max_decoding_message_size,
1896 max_encoding_message_size,
1897 );
1898 let res = grpc.unary(method, req).await;
1899 Ok(res)
1900 };
1901 Box::pin(fut)
1902 }
1903 "/ibc.core.connection.v1.Query/ConnectionClientState" => {
1904 #[allow(non_camel_case_types)]
1905 struct ConnectionClientStateSvc<T: Query>(pub Arc<T>);
1906 impl<
1907 T: Query,
1908 > tonic::server::UnaryService<
1909 super::QueryConnectionClientStateRequest,
1910 > for ConnectionClientStateSvc<T> {
1911 type Response = super::QueryConnectionClientStateResponse;
1912 type Future = BoxFuture<
1913 tonic::Response<Self::Response>,
1914 tonic::Status,
1915 >;
1916 fn call(
1917 &mut self,
1918 request: tonic::Request<
1919 super::QueryConnectionClientStateRequest,
1920 >,
1921 ) -> Self::Future {
1922 let inner = Arc::clone(&self.0);
1923 let fut = async move {
1924 <T as Query>::connection_client_state(&inner, request).await
1925 };
1926 Box::pin(fut)
1927 }
1928 }
1929 let accept_compression_encodings = self.accept_compression_encodings;
1930 let send_compression_encodings = self.send_compression_encodings;
1931 let max_decoding_message_size = self.max_decoding_message_size;
1932 let max_encoding_message_size = self.max_encoding_message_size;
1933 let inner = self.inner.clone();
1934 let fut = async move {
1935 let method = ConnectionClientStateSvc(inner);
1936 let codec = tonic::codec::ProstCodec::default();
1937 let mut grpc = tonic::server::Grpc::new(codec)
1938 .apply_compression_config(
1939 accept_compression_encodings,
1940 send_compression_encodings,
1941 )
1942 .apply_max_message_size_config(
1943 max_decoding_message_size,
1944 max_encoding_message_size,
1945 );
1946 let res = grpc.unary(method, req).await;
1947 Ok(res)
1948 };
1949 Box::pin(fut)
1950 }
1951 "/ibc.core.connection.v1.Query/ConnectionConsensusState" => {
1952 #[allow(non_camel_case_types)]
1953 struct ConnectionConsensusStateSvc<T: Query>(pub Arc<T>);
1954 impl<
1955 T: Query,
1956 > tonic::server::UnaryService<
1957 super::QueryConnectionConsensusStateRequest,
1958 > for ConnectionConsensusStateSvc<T> {
1959 type Response = super::QueryConnectionConsensusStateResponse;
1960 type Future = BoxFuture<
1961 tonic::Response<Self::Response>,
1962 tonic::Status,
1963 >;
1964 fn call(
1965 &mut self,
1966 request: tonic::Request<
1967 super::QueryConnectionConsensusStateRequest,
1968 >,
1969 ) -> Self::Future {
1970 let inner = Arc::clone(&self.0);
1971 let fut = async move {
1972 <T as Query>::connection_consensus_state(&inner, request)
1973 .await
1974 };
1975 Box::pin(fut)
1976 }
1977 }
1978 let accept_compression_encodings = self.accept_compression_encodings;
1979 let send_compression_encodings = self.send_compression_encodings;
1980 let max_decoding_message_size = self.max_decoding_message_size;
1981 let max_encoding_message_size = self.max_encoding_message_size;
1982 let inner = self.inner.clone();
1983 let fut = async move {
1984 let method = ConnectionConsensusStateSvc(inner);
1985 let codec = tonic::codec::ProstCodec::default();
1986 let mut grpc = tonic::server::Grpc::new(codec)
1987 .apply_compression_config(
1988 accept_compression_encodings,
1989 send_compression_encodings,
1990 )
1991 .apply_max_message_size_config(
1992 max_decoding_message_size,
1993 max_encoding_message_size,
1994 );
1995 let res = grpc.unary(method, req).await;
1996 Ok(res)
1997 };
1998 Box::pin(fut)
1999 }
2000 "/ibc.core.connection.v1.Query/ConnectionParams" => {
2001 #[allow(non_camel_case_types)]
2002 struct ConnectionParamsSvc<T: Query>(pub Arc<T>);
2003 impl<
2004 T: Query,
2005 > tonic::server::UnaryService<super::QueryConnectionParamsRequest>
2006 for ConnectionParamsSvc<T> {
2007 type Response = super::QueryConnectionParamsResponse;
2008 type Future = BoxFuture<
2009 tonic::Response<Self::Response>,
2010 tonic::Status,
2011 >;
2012 fn call(
2013 &mut self,
2014 request: tonic::Request<super::QueryConnectionParamsRequest>,
2015 ) -> Self::Future {
2016 let inner = Arc::clone(&self.0);
2017 let fut = async move {
2018 <T as Query>::connection_params(&inner, request).await
2019 };
2020 Box::pin(fut)
2021 }
2022 }
2023 let accept_compression_encodings = self.accept_compression_encodings;
2024 let send_compression_encodings = self.send_compression_encodings;
2025 let max_decoding_message_size = self.max_decoding_message_size;
2026 let max_encoding_message_size = self.max_encoding_message_size;
2027 let inner = self.inner.clone();
2028 let fut = async move {
2029 let method = ConnectionParamsSvc(inner);
2030 let codec = tonic::codec::ProstCodec::default();
2031 let mut grpc = tonic::server::Grpc::new(codec)
2032 .apply_compression_config(
2033 accept_compression_encodings,
2034 send_compression_encodings,
2035 )
2036 .apply_max_message_size_config(
2037 max_decoding_message_size,
2038 max_encoding_message_size,
2039 );
2040 let res = grpc.unary(method, req).await;
2041 Ok(res)
2042 };
2043 Box::pin(fut)
2044 }
2045 _ => {
2046 Box::pin(async move {
2047 let mut response = http::Response::new(
2048 tonic::body::Body::default(),
2049 );
2050 let headers = response.headers_mut();
2051 headers
2052 .insert(
2053 tonic::Status::GRPC_STATUS,
2054 (tonic::Code::Unimplemented as i32).into(),
2055 );
2056 headers
2057 .insert(
2058 http::header::CONTENT_TYPE,
2059 tonic::metadata::GRPC_CONTENT_TYPE,
2060 );
2061 Ok(response)
2062 })
2063 }
2064 }
2065 }
2066 }
2067 impl<T> Clone for QueryServer<T> {
2068 fn clone(&self) -> Self {
2069 let inner = self.inner.clone();
2070 Self {
2071 inner,
2072 accept_compression_encodings: self.accept_compression_encodings,
2073 send_compression_encodings: self.send_compression_encodings,
2074 max_decoding_message_size: self.max_decoding_message_size,
2075 max_encoding_message_size: self.max_encoding_message_size,
2076 }
2077 }
2078 }
2079 pub const SERVICE_NAME: &str = "ibc.core.connection.v1.Query";
2081 impl<T> tonic::server::NamedService for QueryServer<T> {
2082 const NAME: &'static str = SERVICE_NAME;
2083 }
2084}