1#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct MsgUpdateParams {
6 #[prost(string, tag = "1")]
8 pub authority: ::prost::alloc::string::String,
9 #[prost(message, optional, tag = "2")]
11 pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
12}
13impl ::prost::Name for MsgUpdateParams {
14 const NAME: &'static str = "MsgUpdateParams";
15 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
16 fn full_name() -> ::prost::alloc::string::String {
17 "interchain_security.ccv.consumer.v1.MsgUpdateParams".into()
18 }
19 fn type_url() -> ::prost::alloc::string::String {
20 "/interchain_security.ccv.consumer.v1.MsgUpdateParams".into()
21 }
22}
23#[allow(clippy::derive_partial_eq_without_eq)]
24#[derive(Clone, Copy, PartialEq, ::prost::Message)]
25pub struct MsgUpdateParamsResponse {}
26impl ::prost::Name for MsgUpdateParamsResponse {
27 const NAME: &'static str = "MsgUpdateParamsResponse";
28 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
29 fn full_name() -> ::prost::alloc::string::String {
30 "interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse".into()
31 }
32 fn type_url() -> ::prost::alloc::string::String {
33 "/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse".into()
34 }
35}
36#[cfg(feature = "client")]
38pub mod msg_client {
39 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
40 use tonic::codegen::*;
41 use tonic::codegen::http::Uri;
42 #[derive(Debug, Clone)]
44 pub struct MsgClient<T> {
45 inner: tonic::client::Grpc<T>,
46 }
47 #[cfg(feature = "transport")]
48 impl MsgClient<tonic::transport::Channel> {
49 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
51 where
52 D: TryInto<tonic::transport::Endpoint>,
53 D::Error: Into<StdError>,
54 {
55 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
56 Ok(Self::new(conn))
57 }
58 }
59 impl<T> MsgClient<T>
60 where
61 T: tonic::client::GrpcService<tonic::body::BoxBody>,
62 T::Error: Into<StdError>,
63 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
64 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
65 {
66 pub fn new(inner: T) -> Self {
67 let inner = tonic::client::Grpc::new(inner);
68 Self { inner }
69 }
70 pub fn with_origin(inner: T, origin: Uri) -> Self {
71 let inner = tonic::client::Grpc::with_origin(inner, origin);
72 Self { inner }
73 }
74 pub fn with_interceptor<F>(
75 inner: T,
76 interceptor: F,
77 ) -> MsgClient<InterceptedService<T, F>>
78 where
79 F: tonic::service::Interceptor,
80 T::ResponseBody: Default,
81 T: tonic::codegen::Service<
82 http::Request<tonic::body::BoxBody>,
83 Response = http::Response<
84 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
85 >,
86 >,
87 <T as tonic::codegen::Service<
88 http::Request<tonic::body::BoxBody>,
89 >>::Error: Into<StdError> + Send + Sync,
90 {
91 MsgClient::new(InterceptedService::new(inner, interceptor))
92 }
93 #[must_use]
98 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
99 self.inner = self.inner.send_compressed(encoding);
100 self
101 }
102 #[must_use]
104 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
105 self.inner = self.inner.accept_compressed(encoding);
106 self
107 }
108 #[must_use]
112 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
113 self.inner = self.inner.max_decoding_message_size(limit);
114 self
115 }
116 #[must_use]
120 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
121 self.inner = self.inner.max_encoding_message_size(limit);
122 self
123 }
124 pub async fn update_params(
125 &mut self,
126 request: impl tonic::IntoRequest<super::MsgUpdateParams>,
127 ) -> std::result::Result<
128 tonic::Response<super::MsgUpdateParamsResponse>,
129 tonic::Status,
130 > {
131 self.inner
132 .ready()
133 .await
134 .map_err(|e| {
135 tonic::Status::new(
136 tonic::Code::Unknown,
137 format!("Service was not ready: {}", e.into()),
138 )
139 })?;
140 let codec = tonic::codec::ProstCodec::default();
141 let path = http::uri::PathAndQuery::from_static(
142 "/interchain_security.ccv.consumer.v1.Msg/UpdateParams",
143 );
144 let mut req = request.into_request();
145 req.extensions_mut()
146 .insert(
147 GrpcMethod::new(
148 "interchain_security.ccv.consumer.v1.Msg",
149 "UpdateParams",
150 ),
151 );
152 self.inner.unary(req, path, codec).await
153 }
154 }
155}
156#[cfg(feature = "server")]
158pub mod msg_server {
159 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
160 use tonic::codegen::*;
161 #[async_trait]
163 pub trait Msg: Send + Sync + 'static {
164 async fn update_params(
165 &self,
166 request: tonic::Request<super::MsgUpdateParams>,
167 ) -> std::result::Result<
168 tonic::Response<super::MsgUpdateParamsResponse>,
169 tonic::Status,
170 >;
171 }
172 #[derive(Debug)]
174 pub struct MsgServer<T: Msg> {
175 inner: Arc<T>,
176 accept_compression_encodings: EnabledCompressionEncodings,
177 send_compression_encodings: EnabledCompressionEncodings,
178 max_decoding_message_size: Option<usize>,
179 max_encoding_message_size: Option<usize>,
180 }
181 impl<T: Msg> MsgServer<T> {
182 pub fn new(inner: T) -> Self {
183 Self::from_arc(Arc::new(inner))
184 }
185 pub fn from_arc(inner: Arc<T>) -> Self {
186 Self {
187 inner,
188 accept_compression_encodings: Default::default(),
189 send_compression_encodings: Default::default(),
190 max_decoding_message_size: None,
191 max_encoding_message_size: None,
192 }
193 }
194 pub fn with_interceptor<F>(
195 inner: T,
196 interceptor: F,
197 ) -> InterceptedService<Self, F>
198 where
199 F: tonic::service::Interceptor,
200 {
201 InterceptedService::new(Self::new(inner), interceptor)
202 }
203 #[must_use]
205 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
206 self.accept_compression_encodings.enable(encoding);
207 self
208 }
209 #[must_use]
211 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
212 self.send_compression_encodings.enable(encoding);
213 self
214 }
215 #[must_use]
219 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
220 self.max_decoding_message_size = Some(limit);
221 self
222 }
223 #[must_use]
227 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
228 self.max_encoding_message_size = Some(limit);
229 self
230 }
231 }
232 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
233 where
234 T: Msg,
235 B: Body + Send + 'static,
236 B::Error: Into<StdError> + Send + 'static,
237 {
238 type Response = http::Response<tonic::body::BoxBody>;
239 type Error = std::convert::Infallible;
240 type Future = BoxFuture<Self::Response, Self::Error>;
241 fn poll_ready(
242 &mut self,
243 _cx: &mut Context<'_>,
244 ) -> Poll<std::result::Result<(), Self::Error>> {
245 Poll::Ready(Ok(()))
246 }
247 fn call(&mut self, req: http::Request<B>) -> Self::Future {
248 match req.uri().path() {
249 "/interchain_security.ccv.consumer.v1.Msg/UpdateParams" => {
250 #[allow(non_camel_case_types)]
251 struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
252 impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
253 for UpdateParamsSvc<T> {
254 type Response = super::MsgUpdateParamsResponse;
255 type Future = BoxFuture<
256 tonic::Response<Self::Response>,
257 tonic::Status,
258 >;
259 fn call(
260 &mut self,
261 request: tonic::Request<super::MsgUpdateParams>,
262 ) -> Self::Future {
263 let inner = Arc::clone(&self.0);
264 let fut = async move {
265 <T as Msg>::update_params(&inner, request).await
266 };
267 Box::pin(fut)
268 }
269 }
270 let accept_compression_encodings = self.accept_compression_encodings;
271 let send_compression_encodings = self.send_compression_encodings;
272 let max_decoding_message_size = self.max_decoding_message_size;
273 let max_encoding_message_size = self.max_encoding_message_size;
274 let inner = self.inner.clone();
275 let fut = async move {
276 let method = UpdateParamsSvc(inner);
277 let codec = tonic::codec::ProstCodec::default();
278 let mut grpc = tonic::server::Grpc::new(codec)
279 .apply_compression_config(
280 accept_compression_encodings,
281 send_compression_encodings,
282 )
283 .apply_max_message_size_config(
284 max_decoding_message_size,
285 max_encoding_message_size,
286 );
287 let res = grpc.unary(method, req).await;
288 Ok(res)
289 };
290 Box::pin(fut)
291 }
292 _ => {
293 Box::pin(async move {
294 Ok(
295 http::Response::builder()
296 .status(200)
297 .header("grpc-status", tonic::Code::Unimplemented as i32)
298 .header(
299 http::header::CONTENT_TYPE,
300 tonic::metadata::GRPC_CONTENT_TYPE,
301 )
302 .body(empty_body())
303 .unwrap(),
304 )
305 })
306 }
307 }
308 }
309 }
310 impl<T: Msg> Clone for MsgServer<T> {
311 fn clone(&self) -> Self {
312 let inner = self.inner.clone();
313 Self {
314 inner,
315 accept_compression_encodings: self.accept_compression_encodings,
316 send_compression_encodings: self.send_compression_encodings,
317 max_decoding_message_size: self.max_decoding_message_size,
318 max_encoding_message_size: self.max_encoding_message_size,
319 }
320 }
321 }
322 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
323 const NAME: &'static str = "interchain_security.ccv.consumer.v1.Msg";
324 }
325}
326#[allow(clippy::derive_partial_eq_without_eq)]
333#[derive(Clone, PartialEq, ::prost::Message)]
334pub struct CrossChainValidator {
335 #[prost(bytes = "vec", tag = "1")]
336 pub address: ::prost::alloc::vec::Vec<u8>,
337 #[prost(int64, tag = "2")]
338 pub power: i64,
339 #[prost(message, optional, tag = "3")]
341 pub pubkey: ::core::option::Option<::tendermint_proto::google::protobuf::Any>,
342 #[deprecated]
345 #[prost(bool, tag = "4")]
346 pub opted_out: bool,
347}
348impl ::prost::Name for CrossChainValidator {
349 const NAME: &'static str = "CrossChainValidator";
350 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
351 fn full_name() -> ::prost::alloc::string::String {
352 "interchain_security.ccv.consumer.v1.CrossChainValidator".into()
353 }
354 fn type_url() -> ::prost::alloc::string::String {
355 "/interchain_security.ccv.consumer.v1.CrossChainValidator".into()
356 }
357}
358#[allow(clippy::derive_partial_eq_without_eq)]
363#[derive(Clone, Copy, PartialEq, ::prost::Message)]
364pub struct SlashRecord {
365 #[prost(bool, tag = "1")]
366 pub waiting_on_reply: bool,
367 #[prost(message, optional, tag = "2")]
368 pub send_time: ::core::option::Option<
369 ::tendermint_proto::google::protobuf::Timestamp,
370 >,
371}
372impl ::prost::Name for SlashRecord {
373 const NAME: &'static str = "SlashRecord";
374 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
375 fn full_name() -> ::prost::alloc::string::String {
376 "interchain_security.ccv.consumer.v1.SlashRecord".into()
377 }
378 fn type_url() -> ::prost::alloc::string::String {
379 "/interchain_security.ccv.consumer.v1.SlashRecord".into()
380 }
381}
382#[allow(clippy::derive_partial_eq_without_eq)]
384#[derive(Clone, PartialEq, ::prost::Message)]
385pub struct NextFeeDistributionEstimate {
386 #[prost(int64, tag = "1")]
388 pub current_height: i64,
389 #[prost(int64, tag = "2")]
391 pub last_height: i64,
392 #[prost(int64, tag = "3")]
394 pub next_height: i64,
395 #[prost(string, tag = "4")]
397 pub distribution_fraction: ::prost::alloc::string::String,
398 #[prost(string, tag = "5")]
400 pub total: ::prost::alloc::string::String,
401 #[prost(string, tag = "6")]
403 pub to_provider: ::prost::alloc::string::String,
404 #[prost(string, tag = "7")]
406 pub to_consumer: ::prost::alloc::string::String,
407}
408impl ::prost::Name for NextFeeDistributionEstimate {
409 const NAME: &'static str = "NextFeeDistributionEstimate";
410 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
411 fn full_name() -> ::prost::alloc::string::String {
412 "interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate".into()
413 }
414 fn type_url() -> ::prost::alloc::string::String {
415 "/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate".into()
416 }
417}
418#[allow(clippy::derive_partial_eq_without_eq)]
419#[derive(Clone, Copy, PartialEq, ::prost::Message)]
420pub struct QueryNextFeeDistributionEstimateRequest {}
421impl ::prost::Name for QueryNextFeeDistributionEstimateRequest {
422 const NAME: &'static str = "QueryNextFeeDistributionEstimateRequest";
423 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
424 fn full_name() -> ::prost::alloc::string::String {
425 "interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"
426 .into()
427 }
428 fn type_url() -> ::prost::alloc::string::String {
429 "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"
430 .into()
431 }
432}
433#[allow(clippy::derive_partial_eq_without_eq)]
434#[derive(Clone, PartialEq, ::prost::Message)]
435pub struct QueryNextFeeDistributionEstimateResponse {
436 #[prost(message, optional, tag = "1")]
437 pub data: ::core::option::Option<NextFeeDistributionEstimate>,
438}
439impl ::prost::Name for QueryNextFeeDistributionEstimateResponse {
440 const NAME: &'static str = "QueryNextFeeDistributionEstimateResponse";
441 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
442 fn full_name() -> ::prost::alloc::string::String {
443 "interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"
444 .into()
445 }
446 fn type_url() -> ::prost::alloc::string::String {
447 "/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"
448 .into()
449 }
450}
451#[allow(clippy::derive_partial_eq_without_eq)]
452#[derive(Clone, Copy, PartialEq, ::prost::Message)]
453pub struct QueryParamsRequest {}
454impl ::prost::Name for QueryParamsRequest {
455 const NAME: &'static str = "QueryParamsRequest";
456 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
457 fn full_name() -> ::prost::alloc::string::String {
458 "interchain_security.ccv.consumer.v1.QueryParamsRequest".into()
459 }
460 fn type_url() -> ::prost::alloc::string::String {
461 "/interchain_security.ccv.consumer.v1.QueryParamsRequest".into()
462 }
463}
464#[allow(clippy::derive_partial_eq_without_eq)]
466#[derive(Clone, PartialEq, ::prost::Message)]
467pub struct QueryParamsResponse {
468 #[prost(message, optional, tag = "1")]
470 pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
471}
472impl ::prost::Name for QueryParamsResponse {
473 const NAME: &'static str = "QueryParamsResponse";
474 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
475 fn full_name() -> ::prost::alloc::string::String {
476 "interchain_security.ccv.consumer.v1.QueryParamsResponse".into()
477 }
478 fn type_url() -> ::prost::alloc::string::String {
479 "/interchain_security.ccv.consumer.v1.QueryParamsResponse".into()
480 }
481}
482#[allow(clippy::derive_partial_eq_without_eq)]
483#[derive(Clone, Copy, PartialEq, ::prost::Message)]
484pub struct QueryProviderInfoRequest {}
485impl ::prost::Name for QueryProviderInfoRequest {
486 const NAME: &'static str = "QueryProviderInfoRequest";
487 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
488 fn full_name() -> ::prost::alloc::string::String {
489 "interchain_security.ccv.consumer.v1.QueryProviderInfoRequest".into()
490 }
491 fn type_url() -> ::prost::alloc::string::String {
492 "/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest".into()
493 }
494}
495#[allow(clippy::derive_partial_eq_without_eq)]
496#[derive(Clone, PartialEq, ::prost::Message)]
497pub struct QueryProviderInfoResponse {
498 #[prost(message, optional, tag = "1")]
499 pub consumer: ::core::option::Option<ChainInfo>,
500 #[prost(message, optional, tag = "2")]
501 pub provider: ::core::option::Option<ChainInfo>,
502}
503impl ::prost::Name for QueryProviderInfoResponse {
504 const NAME: &'static str = "QueryProviderInfoResponse";
505 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
506 fn full_name() -> ::prost::alloc::string::String {
507 "interchain_security.ccv.consumer.v1.QueryProviderInfoResponse".into()
508 }
509 fn type_url() -> ::prost::alloc::string::String {
510 "/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse".into()
511 }
512}
513#[allow(clippy::derive_partial_eq_without_eq)]
514#[derive(Clone, Copy, PartialEq, ::prost::Message)]
515pub struct QueryThrottleStateRequest {}
516impl ::prost::Name for QueryThrottleStateRequest {
517 const NAME: &'static str = "QueryThrottleStateRequest";
518 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
519 fn full_name() -> ::prost::alloc::string::String {
520 "interchain_security.ccv.consumer.v1.QueryThrottleStateRequest".into()
521 }
522 fn type_url() -> ::prost::alloc::string::String {
523 "/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest".into()
524 }
525}
526#[allow(clippy::derive_partial_eq_without_eq)]
527#[derive(Clone, PartialEq, ::prost::Message)]
528pub struct QueryThrottleStateResponse {
529 #[prost(message, optional, tag = "1")]
530 pub slash_record: ::core::option::Option<SlashRecord>,
531 #[prost(message, repeated, tag = "2")]
532 pub packet_data_queue: ::prost::alloc::vec::Vec<
533 super::super::v1::ConsumerPacketData,
534 >,
535}
536impl ::prost::Name for QueryThrottleStateResponse {
537 const NAME: &'static str = "QueryThrottleStateResponse";
538 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
539 fn full_name() -> ::prost::alloc::string::String {
540 "interchain_security.ccv.consumer.v1.QueryThrottleStateResponse".into()
541 }
542 fn type_url() -> ::prost::alloc::string::String {
543 "/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse".into()
544 }
545}
546#[allow(clippy::derive_partial_eq_without_eq)]
547#[derive(Clone, PartialEq, ::prost::Message)]
548pub struct ChainInfo {
549 #[prost(string, tag = "1")]
550 pub chain_id: ::prost::alloc::string::String,
551 #[prost(string, tag = "2")]
552 pub client_id: ::prost::alloc::string::String,
553 #[prost(string, tag = "3")]
554 pub connection_id: ::prost::alloc::string::String,
555 #[prost(string, tag = "4")]
556 pub channel_id: ::prost::alloc::string::String,
557}
558impl ::prost::Name for ChainInfo {
559 const NAME: &'static str = "ChainInfo";
560 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
561 fn full_name() -> ::prost::alloc::string::String {
562 "interchain_security.ccv.consumer.v1.ChainInfo".into()
563 }
564 fn type_url() -> ::prost::alloc::string::String {
565 "/interchain_security.ccv.consumer.v1.ChainInfo".into()
566 }
567}
568#[cfg(feature = "client")]
570pub mod query_client {
571 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
572 use tonic::codegen::*;
573 use tonic::codegen::http::Uri;
574 #[derive(Debug, Clone)]
575 pub struct QueryClient<T> {
576 inner: tonic::client::Grpc<T>,
577 }
578 #[cfg(feature = "transport")]
579 impl QueryClient<tonic::transport::Channel> {
580 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
582 where
583 D: TryInto<tonic::transport::Endpoint>,
584 D::Error: Into<StdError>,
585 {
586 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
587 Ok(Self::new(conn))
588 }
589 }
590 impl<T> QueryClient<T>
591 where
592 T: tonic::client::GrpcService<tonic::body::BoxBody>,
593 T::Error: Into<StdError>,
594 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
595 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
596 {
597 pub fn new(inner: T) -> Self {
598 let inner = tonic::client::Grpc::new(inner);
599 Self { inner }
600 }
601 pub fn with_origin(inner: T, origin: Uri) -> Self {
602 let inner = tonic::client::Grpc::with_origin(inner, origin);
603 Self { inner }
604 }
605 pub fn with_interceptor<F>(
606 inner: T,
607 interceptor: F,
608 ) -> QueryClient<InterceptedService<T, F>>
609 where
610 F: tonic::service::Interceptor,
611 T::ResponseBody: Default,
612 T: tonic::codegen::Service<
613 http::Request<tonic::body::BoxBody>,
614 Response = http::Response<
615 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
616 >,
617 >,
618 <T as tonic::codegen::Service<
619 http::Request<tonic::body::BoxBody>,
620 >>::Error: Into<StdError> + Send + Sync,
621 {
622 QueryClient::new(InterceptedService::new(inner, interceptor))
623 }
624 #[must_use]
629 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
630 self.inner = self.inner.send_compressed(encoding);
631 self
632 }
633 #[must_use]
635 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
636 self.inner = self.inner.accept_compressed(encoding);
637 self
638 }
639 #[must_use]
643 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
644 self.inner = self.inner.max_decoding_message_size(limit);
645 self
646 }
647 #[must_use]
651 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
652 self.inner = self.inner.max_encoding_message_size(limit);
653 self
654 }
655 pub async fn query_next_fee_distribution(
658 &mut self,
659 request: impl tonic::IntoRequest<
660 super::QueryNextFeeDistributionEstimateRequest,
661 >,
662 ) -> std::result::Result<
663 tonic::Response<super::QueryNextFeeDistributionEstimateResponse>,
664 tonic::Status,
665 > {
666 self.inner
667 .ready()
668 .await
669 .map_err(|e| {
670 tonic::Status::new(
671 tonic::Code::Unknown,
672 format!("Service was not ready: {}", e.into()),
673 )
674 })?;
675 let codec = tonic::codec::ProstCodec::default();
676 let path = http::uri::PathAndQuery::from_static(
677 "/interchain_security.ccv.consumer.v1.Query/QueryNextFeeDistribution",
678 );
679 let mut req = request.into_request();
680 req.extensions_mut()
681 .insert(
682 GrpcMethod::new(
683 "interchain_security.ccv.consumer.v1.Query",
684 "QueryNextFeeDistribution",
685 ),
686 );
687 self.inner.unary(req, path, codec).await
688 }
689 pub async fn query_params(
691 &mut self,
692 request: impl tonic::IntoRequest<super::QueryParamsRequest>,
693 ) -> std::result::Result<
694 tonic::Response<super::QueryParamsResponse>,
695 tonic::Status,
696 > {
697 self.inner
698 .ready()
699 .await
700 .map_err(|e| {
701 tonic::Status::new(
702 tonic::Code::Unknown,
703 format!("Service was not ready: {}", e.into()),
704 )
705 })?;
706 let codec = tonic::codec::ProstCodec::default();
707 let path = http::uri::PathAndQuery::from_static(
708 "/interchain_security.ccv.consumer.v1.Query/QueryParams",
709 );
710 let mut req = request.into_request();
711 req.extensions_mut()
712 .insert(
713 GrpcMethod::new(
714 "interchain_security.ccv.consumer.v1.Query",
715 "QueryParams",
716 ),
717 );
718 self.inner.unary(req, path, codec).await
719 }
720 pub async fn query_provider_info(
721 &mut self,
722 request: impl tonic::IntoRequest<super::QueryProviderInfoRequest>,
723 ) -> std::result::Result<
724 tonic::Response<super::QueryProviderInfoResponse>,
725 tonic::Status,
726 > {
727 self.inner
728 .ready()
729 .await
730 .map_err(|e| {
731 tonic::Status::new(
732 tonic::Code::Unknown,
733 format!("Service was not ready: {}", e.into()),
734 )
735 })?;
736 let codec = tonic::codec::ProstCodec::default();
737 let path = http::uri::PathAndQuery::from_static(
738 "/interchain_security.ccv.consumer.v1.Query/QueryProviderInfo",
739 );
740 let mut req = request.into_request();
741 req.extensions_mut()
742 .insert(
743 GrpcMethod::new(
744 "interchain_security.ccv.consumer.v1.Query",
745 "QueryProviderInfo",
746 ),
747 );
748 self.inner.unary(req, path, codec).await
749 }
750 pub async fn query_throttle_state(
752 &mut self,
753 request: impl tonic::IntoRequest<super::QueryThrottleStateRequest>,
754 ) -> std::result::Result<
755 tonic::Response<super::QueryThrottleStateResponse>,
756 tonic::Status,
757 > {
758 self.inner
759 .ready()
760 .await
761 .map_err(|e| {
762 tonic::Status::new(
763 tonic::Code::Unknown,
764 format!("Service was not ready: {}", e.into()),
765 )
766 })?;
767 let codec = tonic::codec::ProstCodec::default();
768 let path = http::uri::PathAndQuery::from_static(
769 "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState",
770 );
771 let mut req = request.into_request();
772 req.extensions_mut()
773 .insert(
774 GrpcMethod::new(
775 "interchain_security.ccv.consumer.v1.Query",
776 "QueryThrottleState",
777 ),
778 );
779 self.inner.unary(req, path, codec).await
780 }
781 }
782}
783#[cfg(feature = "server")]
785pub mod query_server {
786 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
787 use tonic::codegen::*;
788 #[async_trait]
790 pub trait Query: Send + Sync + 'static {
791 async fn query_next_fee_distribution(
794 &self,
795 request: tonic::Request<super::QueryNextFeeDistributionEstimateRequest>,
796 ) -> std::result::Result<
797 tonic::Response<super::QueryNextFeeDistributionEstimateResponse>,
798 tonic::Status,
799 >;
800 async fn query_params(
802 &self,
803 request: tonic::Request<super::QueryParamsRequest>,
804 ) -> std::result::Result<
805 tonic::Response<super::QueryParamsResponse>,
806 tonic::Status,
807 >;
808 async fn query_provider_info(
809 &self,
810 request: tonic::Request<super::QueryProviderInfoRequest>,
811 ) -> std::result::Result<
812 tonic::Response<super::QueryProviderInfoResponse>,
813 tonic::Status,
814 >;
815 async fn query_throttle_state(
817 &self,
818 request: tonic::Request<super::QueryThrottleStateRequest>,
819 ) -> std::result::Result<
820 tonic::Response<super::QueryThrottleStateResponse>,
821 tonic::Status,
822 >;
823 }
824 #[derive(Debug)]
825 pub struct QueryServer<T: Query> {
826 inner: Arc<T>,
827 accept_compression_encodings: EnabledCompressionEncodings,
828 send_compression_encodings: EnabledCompressionEncodings,
829 max_decoding_message_size: Option<usize>,
830 max_encoding_message_size: Option<usize>,
831 }
832 impl<T: Query> QueryServer<T> {
833 pub fn new(inner: T) -> Self {
834 Self::from_arc(Arc::new(inner))
835 }
836 pub fn from_arc(inner: Arc<T>) -> Self {
837 Self {
838 inner,
839 accept_compression_encodings: Default::default(),
840 send_compression_encodings: Default::default(),
841 max_decoding_message_size: None,
842 max_encoding_message_size: None,
843 }
844 }
845 pub fn with_interceptor<F>(
846 inner: T,
847 interceptor: F,
848 ) -> InterceptedService<Self, F>
849 where
850 F: tonic::service::Interceptor,
851 {
852 InterceptedService::new(Self::new(inner), interceptor)
853 }
854 #[must_use]
856 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
857 self.accept_compression_encodings.enable(encoding);
858 self
859 }
860 #[must_use]
862 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
863 self.send_compression_encodings.enable(encoding);
864 self
865 }
866 #[must_use]
870 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
871 self.max_decoding_message_size = Some(limit);
872 self
873 }
874 #[must_use]
878 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
879 self.max_encoding_message_size = Some(limit);
880 self
881 }
882 }
883 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
884 where
885 T: Query,
886 B: Body + Send + 'static,
887 B::Error: Into<StdError> + Send + 'static,
888 {
889 type Response = http::Response<tonic::body::BoxBody>;
890 type Error = std::convert::Infallible;
891 type Future = BoxFuture<Self::Response, Self::Error>;
892 fn poll_ready(
893 &mut self,
894 _cx: &mut Context<'_>,
895 ) -> Poll<std::result::Result<(), Self::Error>> {
896 Poll::Ready(Ok(()))
897 }
898 fn call(&mut self, req: http::Request<B>) -> Self::Future {
899 match req.uri().path() {
900 "/interchain_security.ccv.consumer.v1.Query/QueryNextFeeDistribution" => {
901 #[allow(non_camel_case_types)]
902 struct QueryNextFeeDistributionSvc<T: Query>(pub Arc<T>);
903 impl<
904 T: Query,
905 > tonic::server::UnaryService<
906 super::QueryNextFeeDistributionEstimateRequest,
907 > for QueryNextFeeDistributionSvc<T> {
908 type Response = super::QueryNextFeeDistributionEstimateResponse;
909 type Future = BoxFuture<
910 tonic::Response<Self::Response>,
911 tonic::Status,
912 >;
913 fn call(
914 &mut self,
915 request: tonic::Request<
916 super::QueryNextFeeDistributionEstimateRequest,
917 >,
918 ) -> Self::Future {
919 let inner = Arc::clone(&self.0);
920 let fut = async move {
921 <T as Query>::query_next_fee_distribution(&inner, request)
922 .await
923 };
924 Box::pin(fut)
925 }
926 }
927 let accept_compression_encodings = self.accept_compression_encodings;
928 let send_compression_encodings = self.send_compression_encodings;
929 let max_decoding_message_size = self.max_decoding_message_size;
930 let max_encoding_message_size = self.max_encoding_message_size;
931 let inner = self.inner.clone();
932 let fut = async move {
933 let method = QueryNextFeeDistributionSvc(inner);
934 let codec = tonic::codec::ProstCodec::default();
935 let mut grpc = tonic::server::Grpc::new(codec)
936 .apply_compression_config(
937 accept_compression_encodings,
938 send_compression_encodings,
939 )
940 .apply_max_message_size_config(
941 max_decoding_message_size,
942 max_encoding_message_size,
943 );
944 let res = grpc.unary(method, req).await;
945 Ok(res)
946 };
947 Box::pin(fut)
948 }
949 "/interchain_security.ccv.consumer.v1.Query/QueryParams" => {
950 #[allow(non_camel_case_types)]
951 struct QueryParamsSvc<T: Query>(pub Arc<T>);
952 impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
953 for QueryParamsSvc<T> {
954 type Response = super::QueryParamsResponse;
955 type Future = BoxFuture<
956 tonic::Response<Self::Response>,
957 tonic::Status,
958 >;
959 fn call(
960 &mut self,
961 request: tonic::Request<super::QueryParamsRequest>,
962 ) -> Self::Future {
963 let inner = Arc::clone(&self.0);
964 let fut = async move {
965 <T as Query>::query_params(&inner, request).await
966 };
967 Box::pin(fut)
968 }
969 }
970 let accept_compression_encodings = self.accept_compression_encodings;
971 let send_compression_encodings = self.send_compression_encodings;
972 let max_decoding_message_size = self.max_decoding_message_size;
973 let max_encoding_message_size = self.max_encoding_message_size;
974 let inner = self.inner.clone();
975 let fut = async move {
976 let method = QueryParamsSvc(inner);
977 let codec = tonic::codec::ProstCodec::default();
978 let mut grpc = tonic::server::Grpc::new(codec)
979 .apply_compression_config(
980 accept_compression_encodings,
981 send_compression_encodings,
982 )
983 .apply_max_message_size_config(
984 max_decoding_message_size,
985 max_encoding_message_size,
986 );
987 let res = grpc.unary(method, req).await;
988 Ok(res)
989 };
990 Box::pin(fut)
991 }
992 "/interchain_security.ccv.consumer.v1.Query/QueryProviderInfo" => {
993 #[allow(non_camel_case_types)]
994 struct QueryProviderInfoSvc<T: Query>(pub Arc<T>);
995 impl<
996 T: Query,
997 > tonic::server::UnaryService<super::QueryProviderInfoRequest>
998 for QueryProviderInfoSvc<T> {
999 type Response = super::QueryProviderInfoResponse;
1000 type Future = BoxFuture<
1001 tonic::Response<Self::Response>,
1002 tonic::Status,
1003 >;
1004 fn call(
1005 &mut self,
1006 request: tonic::Request<super::QueryProviderInfoRequest>,
1007 ) -> Self::Future {
1008 let inner = Arc::clone(&self.0);
1009 let fut = async move {
1010 <T as Query>::query_provider_info(&inner, request).await
1011 };
1012 Box::pin(fut)
1013 }
1014 }
1015 let accept_compression_encodings = self.accept_compression_encodings;
1016 let send_compression_encodings = self.send_compression_encodings;
1017 let max_decoding_message_size = self.max_decoding_message_size;
1018 let max_encoding_message_size = self.max_encoding_message_size;
1019 let inner = self.inner.clone();
1020 let fut = async move {
1021 let method = QueryProviderInfoSvc(inner);
1022 let codec = tonic::codec::ProstCodec::default();
1023 let mut grpc = tonic::server::Grpc::new(codec)
1024 .apply_compression_config(
1025 accept_compression_encodings,
1026 send_compression_encodings,
1027 )
1028 .apply_max_message_size_config(
1029 max_decoding_message_size,
1030 max_encoding_message_size,
1031 );
1032 let res = grpc.unary(method, req).await;
1033 Ok(res)
1034 };
1035 Box::pin(fut)
1036 }
1037 "/interchain_security.ccv.consumer.v1.Query/QueryThrottleState" => {
1038 #[allow(non_camel_case_types)]
1039 struct QueryThrottleStateSvc<T: Query>(pub Arc<T>);
1040 impl<
1041 T: Query,
1042 > tonic::server::UnaryService<super::QueryThrottleStateRequest>
1043 for QueryThrottleStateSvc<T> {
1044 type Response = super::QueryThrottleStateResponse;
1045 type Future = BoxFuture<
1046 tonic::Response<Self::Response>,
1047 tonic::Status,
1048 >;
1049 fn call(
1050 &mut self,
1051 request: tonic::Request<super::QueryThrottleStateRequest>,
1052 ) -> Self::Future {
1053 let inner = Arc::clone(&self.0);
1054 let fut = async move {
1055 <T as Query>::query_throttle_state(&inner, request).await
1056 };
1057 Box::pin(fut)
1058 }
1059 }
1060 let accept_compression_encodings = self.accept_compression_encodings;
1061 let send_compression_encodings = self.send_compression_encodings;
1062 let max_decoding_message_size = self.max_decoding_message_size;
1063 let max_encoding_message_size = self.max_encoding_message_size;
1064 let inner = self.inner.clone();
1065 let fut = async move {
1066 let method = QueryThrottleStateSvc(inner);
1067 let codec = tonic::codec::ProstCodec::default();
1068 let mut grpc = tonic::server::Grpc::new(codec)
1069 .apply_compression_config(
1070 accept_compression_encodings,
1071 send_compression_encodings,
1072 )
1073 .apply_max_message_size_config(
1074 max_decoding_message_size,
1075 max_encoding_message_size,
1076 );
1077 let res = grpc.unary(method, req).await;
1078 Ok(res)
1079 };
1080 Box::pin(fut)
1081 }
1082 _ => {
1083 Box::pin(async move {
1084 Ok(
1085 http::Response::builder()
1086 .status(200)
1087 .header("grpc-status", tonic::Code::Unimplemented as i32)
1088 .header(
1089 http::header::CONTENT_TYPE,
1090 tonic::metadata::GRPC_CONTENT_TYPE,
1091 )
1092 .body(empty_body())
1093 .unwrap(),
1094 )
1095 })
1096 }
1097 }
1098 }
1099 }
1100 impl<T: Query> Clone for QueryServer<T> {
1101 fn clone(&self) -> Self {
1102 let inner = self.inner.clone();
1103 Self {
1104 inner,
1105 accept_compression_encodings: self.accept_compression_encodings,
1106 send_compression_encodings: self.send_compression_encodings,
1107 max_decoding_message_size: self.max_decoding_message_size,
1108 max_encoding_message_size: self.max_encoding_message_size,
1109 }
1110 }
1111 }
1112 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
1113 const NAME: &'static str = "interchain_security.ccv.consumer.v1.Query";
1114 }
1115}
1116#[allow(clippy::derive_partial_eq_without_eq)]
1121#[derive(Clone, PartialEq, ::prost::Message)]
1122pub struct GenesisState {
1123 #[prost(message, optional, tag = "1")]
1125 pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
1126 #[prost(string, tag = "2")]
1128 pub provider_client_id: ::prost::alloc::string::String,
1129 #[prost(string, tag = "3")]
1131 pub provider_channel_id: ::prost::alloc::string::String,
1132 #[prost(bool, tag = "4")]
1134 pub new_chain: bool,
1135 #[deprecated]
1137 #[prost(message, optional, tag = "5")]
1138 pub provider_client_state: ::core::option::Option<
1139 super::super::super::super::ibc::lightclients::tendermint::v1::ClientState,
1140 >,
1141 #[deprecated]
1143 #[prost(message, optional, tag = "6")]
1144 pub provider_consensus_state: ::core::option::Option<
1145 super::super::super::super::ibc::lightclients::tendermint::v1::ConsensusState,
1146 >,
1147 #[prost(message, repeated, tag = "7")]
1149 pub maturing_packets: ::prost::alloc::vec::Vec<MaturingVscPacket>,
1150 #[deprecated]
1152 #[prost(message, repeated, tag = "8")]
1153 pub initial_val_set: ::prost::alloc::vec::Vec<
1154 ::tendermint_proto::abci::ValidatorUpdate,
1155 >,
1156 #[prost(message, repeated, tag = "9")]
1158 pub height_to_valset_update_id: ::prost::alloc::vec::Vec<HeightToValsetUpdateId>,
1159 #[prost(message, repeated, tag = "10")]
1161 pub outstanding_downtime_slashing: ::prost::alloc::vec::Vec<OutstandingDowntime>,
1162 #[prost(message, optional, tag = "11")]
1164 pub pending_consumer_packets: ::core::option::Option<ConsumerPacketDataList>,
1165 #[prost(message, optional, tag = "12")]
1167 pub last_transmission_block_height: ::core::option::Option<
1168 LastTransmissionBlockHeight,
1169 >,
1170 #[prost(bool, tag = "13")]
1172 pub pre_ccv: bool,
1173 #[prost(message, optional, tag = "14")]
1174 pub provider: ::core::option::Option<super::super::v1::ProviderInfo>,
1175}
1176impl ::prost::Name for GenesisState {
1177 const NAME: &'static str = "GenesisState";
1178 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1179 fn full_name() -> ::prost::alloc::string::String {
1180 "interchain_security.ccv.consumer.v1.GenesisState".into()
1181 }
1182 fn type_url() -> ::prost::alloc::string::String {
1183 "/interchain_security.ccv.consumer.v1.GenesisState".into()
1184 }
1185}
1186#[allow(clippy::derive_partial_eq_without_eq)]
1189#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1190pub struct HeightToValsetUpdateId {
1191 #[prost(uint64, tag = "1")]
1192 pub height: u64,
1193 #[prost(uint64, tag = "2")]
1194 pub valset_update_id: u64,
1195}
1196impl ::prost::Name for HeightToValsetUpdateId {
1197 const NAME: &'static str = "HeightToValsetUpdateID";
1198 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1199 fn full_name() -> ::prost::alloc::string::String {
1200 "interchain_security.ccv.consumer.v1.HeightToValsetUpdateID".into()
1201 }
1202 fn type_url() -> ::prost::alloc::string::String {
1203 "/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID".into()
1204 }
1205}
1206#[allow(clippy::derive_partial_eq_without_eq)]
1210#[derive(Clone, PartialEq, ::prost::Message)]
1211pub struct OutstandingDowntime {
1212 #[prost(string, tag = "1")]
1213 pub validator_consensus_address: ::prost::alloc::string::String,
1214}
1215impl ::prost::Name for OutstandingDowntime {
1216 const NAME: &'static str = "OutstandingDowntime";
1217 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1218 fn full_name() -> ::prost::alloc::string::String {
1219 "interchain_security.ccv.consumer.v1.OutstandingDowntime".into()
1220 }
1221 fn type_url() -> ::prost::alloc::string::String {
1222 "/interchain_security.ccv.consumer.v1.OutstandingDowntime".into()
1223 }
1224}
1225#[allow(clippy::derive_partial_eq_without_eq)]
1229#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1230pub struct LastTransmissionBlockHeight {
1231 #[prost(int64, tag = "1")]
1232 pub height: i64,
1233}
1234impl ::prost::Name for LastTransmissionBlockHeight {
1235 const NAME: &'static str = "LastTransmissionBlockHeight";
1236 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1237 fn full_name() -> ::prost::alloc::string::String {
1238 "interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight".into()
1239 }
1240 fn type_url() -> ::prost::alloc::string::String {
1241 "/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight".into()
1242 }
1243}
1244#[allow(clippy::derive_partial_eq_without_eq)]
1248#[derive(Clone, Copy, PartialEq, ::prost::Message)]
1249pub struct MaturingVscPacket {
1250 #[prost(uint64, tag = "1")]
1251 pub vsc_id: u64,
1252 #[prost(message, optional, tag = "2")]
1253 pub maturity_time: ::core::option::Option<
1254 ::tendermint_proto::google::protobuf::Timestamp,
1255 >,
1256}
1257impl ::prost::Name for MaturingVscPacket {
1258 const NAME: &'static str = "MaturingVSCPacket";
1259 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1260 fn full_name() -> ::prost::alloc::string::String {
1261 "interchain_security.ccv.consumer.v1.MaturingVSCPacket".into()
1262 }
1263 fn type_url() -> ::prost::alloc::string::String {
1264 "/interchain_security.ccv.consumer.v1.MaturingVSCPacket".into()
1265 }
1266}
1267#[allow(clippy::derive_partial_eq_without_eq)]
1272#[derive(Clone, PartialEq, ::prost::Message)]
1273pub struct ConsumerPacketDataList {
1274 #[prost(message, repeated, tag = "1")]
1275 pub list: ::prost::alloc::vec::Vec<super::super::v1::ConsumerPacketData>,
1276}
1277impl ::prost::Name for ConsumerPacketDataList {
1278 const NAME: &'static str = "ConsumerPacketDataList";
1279 const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
1280 fn full_name() -> ::prost::alloc::string::String {
1281 "interchain_security.ccv.consumer.v1.ConsumerPacketDataList".into()
1282 }
1283 fn type_url() -> ::prost::alloc::string::String {
1284 "/interchain_security.ccv.consumer.v1.ConsumerPacketDataList".into()
1285 }
1286}