1#[allow(clippy::derive_partial_eq_without_eq)]
5#[derive(Clone, PartialEq, ::prost::Message)]
6pub struct Params {
7 #[prost(bool, tag = "1")]
9 pub host_enabled: bool,
10 #[prost(string, repeated, tag = "2")]
12 pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
13}
14impl ::prost::Name for Params {
15 const NAME: &'static str = "Params";
16 const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1";
17 fn full_name() -> ::prost::alloc::string::String {
18 "ibc.applications.interchain_accounts.host.v1.Params".into()
19 }
20 fn type_url() -> ::prost::alloc::string::String {
21 "/ibc.applications.interchain_accounts.host.v1.Params".into()
22 }
23}
24#[allow(clippy::derive_partial_eq_without_eq)]
26#[derive(Clone, PartialEq, ::prost::Message)]
27pub struct MsgUpdateParams {
28 #[prost(string, tag = "1")]
30 pub signer: ::prost::alloc::string::String,
31 #[prost(message, optional, tag = "2")]
35 pub params: ::core::option::Option<Params>,
36}
37impl ::prost::Name for MsgUpdateParams {
38 const NAME: &'static str = "MsgUpdateParams";
39 const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1";
40 fn full_name() -> ::prost::alloc::string::String {
41 "ibc.applications.interchain_accounts.host.v1.MsgUpdateParams".into()
42 }
43 fn type_url() -> ::prost::alloc::string::String {
44 "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParams".into()
45 }
46}
47#[allow(clippy::derive_partial_eq_without_eq)]
49#[derive(Clone, Copy, PartialEq, ::prost::Message)]
50pub struct MsgUpdateParamsResponse {}
51impl ::prost::Name for MsgUpdateParamsResponse {
52 const NAME: &'static str = "MsgUpdateParamsResponse";
53 const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1";
54 fn full_name() -> ::prost::alloc::string::String {
55 "ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse".into()
56 }
57 fn type_url() -> ::prost::alloc::string::String {
58 "/ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse".into()
59 }
60}
61#[cfg(feature = "client")]
63pub mod msg_client {
64 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
65 use tonic::codegen::*;
66 use tonic::codegen::http::Uri;
67 #[derive(Debug, Clone)]
69 pub struct MsgClient<T> {
70 inner: tonic::client::Grpc<T>,
71 }
72 #[cfg(feature = "transport")]
73 impl MsgClient<tonic::transport::Channel> {
74 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
76 where
77 D: TryInto<tonic::transport::Endpoint>,
78 D::Error: Into<StdError>,
79 {
80 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
81 Ok(Self::new(conn))
82 }
83 }
84 impl<T> MsgClient<T>
85 where
86 T: tonic::client::GrpcService<tonic::body::BoxBody>,
87 T::Error: Into<StdError>,
88 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
89 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
90 {
91 pub fn new(inner: T) -> Self {
92 let inner = tonic::client::Grpc::new(inner);
93 Self { inner }
94 }
95 pub fn with_origin(inner: T, origin: Uri) -> Self {
96 let inner = tonic::client::Grpc::with_origin(inner, origin);
97 Self { inner }
98 }
99 pub fn with_interceptor<F>(
100 inner: T,
101 interceptor: F,
102 ) -> MsgClient<InterceptedService<T, F>>
103 where
104 F: tonic::service::Interceptor,
105 T::ResponseBody: Default,
106 T: tonic::codegen::Service<
107 http::Request<tonic::body::BoxBody>,
108 Response = http::Response<
109 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
110 >,
111 >,
112 <T as tonic::codegen::Service<
113 http::Request<tonic::body::BoxBody>,
114 >>::Error: Into<StdError> + Send + Sync,
115 {
116 MsgClient::new(InterceptedService::new(inner, interceptor))
117 }
118 #[must_use]
123 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
124 self.inner = self.inner.send_compressed(encoding);
125 self
126 }
127 #[must_use]
129 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
130 self.inner = self.inner.accept_compressed(encoding);
131 self
132 }
133 #[must_use]
137 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
138 self.inner = self.inner.max_decoding_message_size(limit);
139 self
140 }
141 #[must_use]
145 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
146 self.inner = self.inner.max_encoding_message_size(limit);
147 self
148 }
149 pub async fn update_params(
151 &mut self,
152 request: impl tonic::IntoRequest<super::MsgUpdateParams>,
153 ) -> std::result::Result<
154 tonic::Response<super::MsgUpdateParamsResponse>,
155 tonic::Status,
156 > {
157 self.inner
158 .ready()
159 .await
160 .map_err(|e| {
161 tonic::Status::new(
162 tonic::Code::Unknown,
163 format!("Service was not ready: {}", e.into()),
164 )
165 })?;
166 let codec = tonic::codec::ProstCodec::default();
167 let path = http::uri::PathAndQuery::from_static(
168 "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams",
169 );
170 let mut req = request.into_request();
171 req.extensions_mut()
172 .insert(
173 GrpcMethod::new(
174 "ibc.applications.interchain_accounts.host.v1.Msg",
175 "UpdateParams",
176 ),
177 );
178 self.inner.unary(req, path, codec).await
179 }
180 }
181}
182#[cfg(feature = "server")]
184pub mod msg_server {
185 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
186 use tonic::codegen::*;
187 #[async_trait]
189 pub trait Msg: Send + Sync + 'static {
190 async fn update_params(
192 &self,
193 request: tonic::Request<super::MsgUpdateParams>,
194 ) -> std::result::Result<
195 tonic::Response<super::MsgUpdateParamsResponse>,
196 tonic::Status,
197 >;
198 }
199 #[derive(Debug)]
201 pub struct MsgServer<T: Msg> {
202 inner: Arc<T>,
203 accept_compression_encodings: EnabledCompressionEncodings,
204 send_compression_encodings: EnabledCompressionEncodings,
205 max_decoding_message_size: Option<usize>,
206 max_encoding_message_size: Option<usize>,
207 }
208 impl<T: Msg> MsgServer<T> {
209 pub fn new(inner: T) -> Self {
210 Self::from_arc(Arc::new(inner))
211 }
212 pub fn from_arc(inner: Arc<T>) -> Self {
213 Self {
214 inner,
215 accept_compression_encodings: Default::default(),
216 send_compression_encodings: Default::default(),
217 max_decoding_message_size: None,
218 max_encoding_message_size: None,
219 }
220 }
221 pub fn with_interceptor<F>(
222 inner: T,
223 interceptor: F,
224 ) -> InterceptedService<Self, F>
225 where
226 F: tonic::service::Interceptor,
227 {
228 InterceptedService::new(Self::new(inner), interceptor)
229 }
230 #[must_use]
232 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
233 self.accept_compression_encodings.enable(encoding);
234 self
235 }
236 #[must_use]
238 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
239 self.send_compression_encodings.enable(encoding);
240 self
241 }
242 #[must_use]
246 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
247 self.max_decoding_message_size = Some(limit);
248 self
249 }
250 #[must_use]
254 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
255 self.max_encoding_message_size = Some(limit);
256 self
257 }
258 }
259 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
260 where
261 T: Msg,
262 B: Body + Send + 'static,
263 B::Error: Into<StdError> + Send + 'static,
264 {
265 type Response = http::Response<tonic::body::BoxBody>;
266 type Error = std::convert::Infallible;
267 type Future = BoxFuture<Self::Response, Self::Error>;
268 fn poll_ready(
269 &mut self,
270 _cx: &mut Context<'_>,
271 ) -> Poll<std::result::Result<(), Self::Error>> {
272 Poll::Ready(Ok(()))
273 }
274 fn call(&mut self, req: http::Request<B>) -> Self::Future {
275 match req.uri().path() {
276 "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams" => {
277 #[allow(non_camel_case_types)]
278 struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
279 impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
280 for UpdateParamsSvc<T> {
281 type Response = super::MsgUpdateParamsResponse;
282 type Future = BoxFuture<
283 tonic::Response<Self::Response>,
284 tonic::Status,
285 >;
286 fn call(
287 &mut self,
288 request: tonic::Request<super::MsgUpdateParams>,
289 ) -> Self::Future {
290 let inner = Arc::clone(&self.0);
291 let fut = async move {
292 <T as Msg>::update_params(&inner, request).await
293 };
294 Box::pin(fut)
295 }
296 }
297 let accept_compression_encodings = self.accept_compression_encodings;
298 let send_compression_encodings = self.send_compression_encodings;
299 let max_decoding_message_size = self.max_decoding_message_size;
300 let max_encoding_message_size = self.max_encoding_message_size;
301 let inner = self.inner.clone();
302 let fut = async move {
303 let method = UpdateParamsSvc(inner);
304 let codec = tonic::codec::ProstCodec::default();
305 let mut grpc = tonic::server::Grpc::new(codec)
306 .apply_compression_config(
307 accept_compression_encodings,
308 send_compression_encodings,
309 )
310 .apply_max_message_size_config(
311 max_decoding_message_size,
312 max_encoding_message_size,
313 );
314 let res = grpc.unary(method, req).await;
315 Ok(res)
316 };
317 Box::pin(fut)
318 }
319 _ => {
320 Box::pin(async move {
321 Ok(
322 http::Response::builder()
323 .status(200)
324 .header("grpc-status", tonic::Code::Unimplemented as i32)
325 .header(
326 http::header::CONTENT_TYPE,
327 tonic::metadata::GRPC_CONTENT_TYPE,
328 )
329 .body(empty_body())
330 .unwrap(),
331 )
332 })
333 }
334 }
335 }
336 }
337 impl<T: Msg> Clone for MsgServer<T> {
338 fn clone(&self) -> Self {
339 let inner = self.inner.clone();
340 Self {
341 inner,
342 accept_compression_encodings: self.accept_compression_encodings,
343 send_compression_encodings: self.send_compression_encodings,
344 max_decoding_message_size: self.max_decoding_message_size,
345 max_encoding_message_size: self.max_encoding_message_size,
346 }
347 }
348 }
349 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
350 const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Msg";
351 }
352}
353#[allow(clippy::derive_partial_eq_without_eq)]
355#[derive(Clone, Copy, PartialEq, ::prost::Message)]
356pub struct QueryParamsRequest {}
357impl ::prost::Name for QueryParamsRequest {
358 const NAME: &'static str = "QueryParamsRequest";
359 const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1";
360 fn full_name() -> ::prost::alloc::string::String {
361 "ibc.applications.interchain_accounts.host.v1.QueryParamsRequest".into()
362 }
363 fn type_url() -> ::prost::alloc::string::String {
364 "/ibc.applications.interchain_accounts.host.v1.QueryParamsRequest".into()
365 }
366}
367#[allow(clippy::derive_partial_eq_without_eq)]
369#[derive(Clone, PartialEq, ::prost::Message)]
370pub struct QueryParamsResponse {
371 #[prost(message, optional, tag = "1")]
373 pub params: ::core::option::Option<Params>,
374}
375impl ::prost::Name for QueryParamsResponse {
376 const NAME: &'static str = "QueryParamsResponse";
377 const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1";
378 fn full_name() -> ::prost::alloc::string::String {
379 "ibc.applications.interchain_accounts.host.v1.QueryParamsResponse".into()
380 }
381 fn type_url() -> ::prost::alloc::string::String {
382 "/ibc.applications.interchain_accounts.host.v1.QueryParamsResponse".into()
383 }
384}
385#[cfg(feature = "client")]
387pub mod query_client {
388 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
389 use tonic::codegen::*;
390 use tonic::codegen::http::Uri;
391 #[derive(Debug, Clone)]
393 pub struct QueryClient<T> {
394 inner: tonic::client::Grpc<T>,
395 }
396 #[cfg(feature = "transport")]
397 impl QueryClient<tonic::transport::Channel> {
398 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
400 where
401 D: TryInto<tonic::transport::Endpoint>,
402 D::Error: Into<StdError>,
403 {
404 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
405 Ok(Self::new(conn))
406 }
407 }
408 impl<T> QueryClient<T>
409 where
410 T: tonic::client::GrpcService<tonic::body::BoxBody>,
411 T::Error: Into<StdError>,
412 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
413 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
414 {
415 pub fn new(inner: T) -> Self {
416 let inner = tonic::client::Grpc::new(inner);
417 Self { inner }
418 }
419 pub fn with_origin(inner: T, origin: Uri) -> Self {
420 let inner = tonic::client::Grpc::with_origin(inner, origin);
421 Self { inner }
422 }
423 pub fn with_interceptor<F>(
424 inner: T,
425 interceptor: F,
426 ) -> QueryClient<InterceptedService<T, F>>
427 where
428 F: tonic::service::Interceptor,
429 T::ResponseBody: Default,
430 T: tonic::codegen::Service<
431 http::Request<tonic::body::BoxBody>,
432 Response = http::Response<
433 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
434 >,
435 >,
436 <T as tonic::codegen::Service<
437 http::Request<tonic::body::BoxBody>,
438 >>::Error: Into<StdError> + Send + Sync,
439 {
440 QueryClient::new(InterceptedService::new(inner, interceptor))
441 }
442 #[must_use]
447 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
448 self.inner = self.inner.send_compressed(encoding);
449 self
450 }
451 #[must_use]
453 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
454 self.inner = self.inner.accept_compressed(encoding);
455 self
456 }
457 #[must_use]
461 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
462 self.inner = self.inner.max_decoding_message_size(limit);
463 self
464 }
465 #[must_use]
469 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
470 self.inner = self.inner.max_encoding_message_size(limit);
471 self
472 }
473 pub async fn params(
475 &mut self,
476 request: impl tonic::IntoRequest<super::QueryParamsRequest>,
477 ) -> std::result::Result<
478 tonic::Response<super::QueryParamsResponse>,
479 tonic::Status,
480 > {
481 self.inner
482 .ready()
483 .await
484 .map_err(|e| {
485 tonic::Status::new(
486 tonic::Code::Unknown,
487 format!("Service was not ready: {}", e.into()),
488 )
489 })?;
490 let codec = tonic::codec::ProstCodec::default();
491 let path = http::uri::PathAndQuery::from_static(
492 "/ibc.applications.interchain_accounts.host.v1.Query/Params",
493 );
494 let mut req = request.into_request();
495 req.extensions_mut()
496 .insert(
497 GrpcMethod::new(
498 "ibc.applications.interchain_accounts.host.v1.Query",
499 "Params",
500 ),
501 );
502 self.inner.unary(req, path, codec).await
503 }
504 }
505}
506#[cfg(feature = "server")]
508pub mod query_server {
509 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
510 use tonic::codegen::*;
511 #[async_trait]
513 pub trait Query: Send + Sync + 'static {
514 async fn params(
516 &self,
517 request: tonic::Request<super::QueryParamsRequest>,
518 ) -> std::result::Result<
519 tonic::Response<super::QueryParamsResponse>,
520 tonic::Status,
521 >;
522 }
523 #[derive(Debug)]
525 pub struct QueryServer<T: Query> {
526 inner: Arc<T>,
527 accept_compression_encodings: EnabledCompressionEncodings,
528 send_compression_encodings: EnabledCompressionEncodings,
529 max_decoding_message_size: Option<usize>,
530 max_encoding_message_size: Option<usize>,
531 }
532 impl<T: Query> QueryServer<T> {
533 pub fn new(inner: T) -> Self {
534 Self::from_arc(Arc::new(inner))
535 }
536 pub fn from_arc(inner: Arc<T>) -> Self {
537 Self {
538 inner,
539 accept_compression_encodings: Default::default(),
540 send_compression_encodings: Default::default(),
541 max_decoding_message_size: None,
542 max_encoding_message_size: None,
543 }
544 }
545 pub fn with_interceptor<F>(
546 inner: T,
547 interceptor: F,
548 ) -> InterceptedService<Self, F>
549 where
550 F: tonic::service::Interceptor,
551 {
552 InterceptedService::new(Self::new(inner), interceptor)
553 }
554 #[must_use]
556 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
557 self.accept_compression_encodings.enable(encoding);
558 self
559 }
560 #[must_use]
562 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
563 self.send_compression_encodings.enable(encoding);
564 self
565 }
566 #[must_use]
570 pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
571 self.max_decoding_message_size = Some(limit);
572 self
573 }
574 #[must_use]
578 pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
579 self.max_encoding_message_size = Some(limit);
580 self
581 }
582 }
583 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
584 where
585 T: Query,
586 B: Body + Send + 'static,
587 B::Error: Into<StdError> + Send + 'static,
588 {
589 type Response = http::Response<tonic::body::BoxBody>;
590 type Error = std::convert::Infallible;
591 type Future = BoxFuture<Self::Response, Self::Error>;
592 fn poll_ready(
593 &mut self,
594 _cx: &mut Context<'_>,
595 ) -> Poll<std::result::Result<(), Self::Error>> {
596 Poll::Ready(Ok(()))
597 }
598 fn call(&mut self, req: http::Request<B>) -> Self::Future {
599 match req.uri().path() {
600 "/ibc.applications.interchain_accounts.host.v1.Query/Params" => {
601 #[allow(non_camel_case_types)]
602 struct ParamsSvc<T: Query>(pub Arc<T>);
603 impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
604 for ParamsSvc<T> {
605 type Response = super::QueryParamsResponse;
606 type Future = BoxFuture<
607 tonic::Response<Self::Response>,
608 tonic::Status,
609 >;
610 fn call(
611 &mut self,
612 request: tonic::Request<super::QueryParamsRequest>,
613 ) -> Self::Future {
614 let inner = Arc::clone(&self.0);
615 let fut = async move {
616 <T as Query>::params(&inner, request).await
617 };
618 Box::pin(fut)
619 }
620 }
621 let accept_compression_encodings = self.accept_compression_encodings;
622 let send_compression_encodings = self.send_compression_encodings;
623 let max_decoding_message_size = self.max_decoding_message_size;
624 let max_encoding_message_size = self.max_encoding_message_size;
625 let inner = self.inner.clone();
626 let fut = async move {
627 let method = ParamsSvc(inner);
628 let codec = tonic::codec::ProstCodec::default();
629 let mut grpc = tonic::server::Grpc::new(codec)
630 .apply_compression_config(
631 accept_compression_encodings,
632 send_compression_encodings,
633 )
634 .apply_max_message_size_config(
635 max_decoding_message_size,
636 max_encoding_message_size,
637 );
638 let res = grpc.unary(method, req).await;
639 Ok(res)
640 };
641 Box::pin(fut)
642 }
643 _ => {
644 Box::pin(async move {
645 Ok(
646 http::Response::builder()
647 .status(200)
648 .header("grpc-status", tonic::Code::Unimplemented as i32)
649 .header(
650 http::header::CONTENT_TYPE,
651 tonic::metadata::GRPC_CONTENT_TYPE,
652 )
653 .body(empty_body())
654 .unwrap(),
655 )
656 })
657 }
658 }
659 }
660 }
661 impl<T: Query> Clone for QueryServer<T> {
662 fn clone(&self) -> Self {
663 let inner = self.inner.clone();
664 Self {
665 inner,
666 accept_compression_encodings: self.accept_compression_encodings,
667 send_compression_encodings: self.send_compression_encodings,
668 max_decoding_message_size: self.max_decoding_message_size,
669 max_encoding_message_size: self.max_encoding_message_size,
670 }
671 }
672 }
673 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
674 const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Query";
675 }
676}