ibc_proto/prost/
ibc.lightclients.wasm.v1.rs

1// This file is @generated by prost-build.
2/// MsgStoreCode defines the request type for the StoreCode rpc.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct MsgStoreCode {
5    /// signer address
6    #[prost(string, tag = "1")]
7    pub signer: ::prost::alloc::string::String,
8    /// wasm byte code of light client contract. It can be raw or gzip compressed
9    #[prost(bytes = "vec", tag = "2")]
10    pub wasm_byte_code: ::prost::alloc::vec::Vec<u8>,
11}
12impl ::prost::Name for MsgStoreCode {
13    const NAME: &'static str = "MsgStoreCode";
14    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
15    fn full_name() -> ::prost::alloc::string::String {
16        "ibc.lightclients.wasm.v1.MsgStoreCode".into()
17    }
18    fn type_url() -> ::prost::alloc::string::String {
19        "/ibc.lightclients.wasm.v1.MsgStoreCode".into()
20    }
21}
22/// MsgStoreCodeResponse defines the response type for the StoreCode rpc
23#[derive(Clone, PartialEq, ::prost::Message)]
24pub struct MsgStoreCodeResponse {
25    /// checksum is the sha256 hash of the stored code
26    #[prost(bytes = "vec", tag = "1")]
27    pub checksum: ::prost::alloc::vec::Vec<u8>,
28}
29impl ::prost::Name for MsgStoreCodeResponse {
30    const NAME: &'static str = "MsgStoreCodeResponse";
31    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
32    fn full_name() -> ::prost::alloc::string::String {
33        "ibc.lightclients.wasm.v1.MsgStoreCodeResponse".into()
34    }
35    fn type_url() -> ::prost::alloc::string::String {
36        "/ibc.lightclients.wasm.v1.MsgStoreCodeResponse".into()
37    }
38}
39/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc.
40#[derive(Clone, PartialEq, ::prost::Message)]
41pub struct MsgRemoveChecksum {
42    /// signer address
43    #[prost(string, tag = "1")]
44    pub signer: ::prost::alloc::string::String,
45    /// checksum is the sha256 hash to be removed from the store
46    #[prost(bytes = "vec", tag = "2")]
47    pub checksum: ::prost::alloc::vec::Vec<u8>,
48}
49impl ::prost::Name for MsgRemoveChecksum {
50    const NAME: &'static str = "MsgRemoveChecksum";
51    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
52    fn full_name() -> ::prost::alloc::string::String {
53        "ibc.lightclients.wasm.v1.MsgRemoveChecksum".into()
54    }
55    fn type_url() -> ::prost::alloc::string::String {
56        "/ibc.lightclients.wasm.v1.MsgRemoveChecksum".into()
57    }
58}
59/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc
60#[derive(Clone, Copy, PartialEq, ::prost::Message)]
61pub struct MsgRemoveChecksumResponse {}
62impl ::prost::Name for MsgRemoveChecksumResponse {
63    const NAME: &'static str = "MsgRemoveChecksumResponse";
64    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
65    fn full_name() -> ::prost::alloc::string::String {
66        "ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse".into()
67    }
68    fn type_url() -> ::prost::alloc::string::String {
69        "/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse".into()
70    }
71}
72/// MsgMigrateContract defines the request type for the MigrateContract rpc.
73#[derive(Clone, PartialEq, ::prost::Message)]
74pub struct MsgMigrateContract {
75    /// signer address
76    #[prost(string, tag = "1")]
77    pub signer: ::prost::alloc::string::String,
78    /// the client id of the contract
79    #[prost(string, tag = "2")]
80    pub client_id: ::prost::alloc::string::String,
81    /// checksum is the sha256 hash of the new wasm byte code for the contract
82    #[prost(bytes = "vec", tag = "3")]
83    pub checksum: ::prost::alloc::vec::Vec<u8>,
84    /// the json encoded message to be passed to the contract on migration
85    #[prost(bytes = "vec", tag = "4")]
86    pub msg: ::prost::alloc::vec::Vec<u8>,
87}
88impl ::prost::Name for MsgMigrateContract {
89    const NAME: &'static str = "MsgMigrateContract";
90    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
91    fn full_name() -> ::prost::alloc::string::String {
92        "ibc.lightclients.wasm.v1.MsgMigrateContract".into()
93    }
94    fn type_url() -> ::prost::alloc::string::String {
95        "/ibc.lightclients.wasm.v1.MsgMigrateContract".into()
96    }
97}
98/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc
99#[derive(Clone, Copy, PartialEq, ::prost::Message)]
100pub struct MsgMigrateContractResponse {}
101impl ::prost::Name for MsgMigrateContractResponse {
102    const NAME: &'static str = "MsgMigrateContractResponse";
103    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
104    fn full_name() -> ::prost::alloc::string::String {
105        "ibc.lightclients.wasm.v1.MsgMigrateContractResponse".into()
106    }
107    fn type_url() -> ::prost::alloc::string::String {
108        "/ibc.lightclients.wasm.v1.MsgMigrateContractResponse".into()
109    }
110}
111/// Generated client implementations.
112#[cfg(feature = "client")]
113pub mod msg_client {
114    #![allow(
115        unused_variables,
116        dead_code,
117        missing_docs,
118        clippy::wildcard_imports,
119        clippy::let_unit_value,
120    )]
121    use tonic::codegen::*;
122    use tonic::codegen::http::Uri;
123    /// Msg defines the ibc/08-wasm Msg service.
124    #[derive(Debug, Clone)]
125    pub struct MsgClient<T> {
126        inner: tonic::client::Grpc<T>,
127    }
128    #[cfg(feature = "transport")]
129    impl MsgClient<tonic::transport::Channel> {
130        /// Attempt to create a new client by connecting to a given endpoint.
131        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
132        where
133            D: TryInto<tonic::transport::Endpoint>,
134            D::Error: Into<StdError>,
135        {
136            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
137            Ok(Self::new(conn))
138        }
139    }
140    impl<T> MsgClient<T>
141    where
142        T: tonic::client::GrpcService<tonic::body::Body>,
143        T::Error: Into<StdError>,
144        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
145        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
146    {
147        pub fn new(inner: T) -> Self {
148            let inner = tonic::client::Grpc::new(inner);
149            Self { inner }
150        }
151        pub fn with_origin(inner: T, origin: Uri) -> Self {
152            let inner = tonic::client::Grpc::with_origin(inner, origin);
153            Self { inner }
154        }
155        pub fn with_interceptor<F>(
156            inner: T,
157            interceptor: F,
158        ) -> MsgClient<InterceptedService<T, F>>
159        where
160            F: tonic::service::Interceptor,
161            T::ResponseBody: Default,
162            T: tonic::codegen::Service<
163                http::Request<tonic::body::Body>,
164                Response = http::Response<
165                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
166                >,
167            >,
168            <T as tonic::codegen::Service<
169                http::Request<tonic::body::Body>,
170            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
171        {
172            MsgClient::new(InterceptedService::new(inner, interceptor))
173        }
174        /// Compress requests with the given encoding.
175        ///
176        /// This requires the server to support it otherwise it might respond with an
177        /// error.
178        #[must_use]
179        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
180            self.inner = self.inner.send_compressed(encoding);
181            self
182        }
183        /// Enable decompressing responses.
184        #[must_use]
185        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
186            self.inner = self.inner.accept_compressed(encoding);
187            self
188        }
189        /// Limits the maximum size of a decoded message.
190        ///
191        /// Default: `4MB`
192        #[must_use]
193        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
194            self.inner = self.inner.max_decoding_message_size(limit);
195            self
196        }
197        /// Limits the maximum size of an encoded message.
198        ///
199        /// Default: `usize::MAX`
200        #[must_use]
201        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
202            self.inner = self.inner.max_encoding_message_size(limit);
203            self
204        }
205        /// StoreCode defines a rpc handler method for MsgStoreCode.
206        pub async fn store_code(
207            &mut self,
208            request: impl tonic::IntoRequest<super::MsgStoreCode>,
209        ) -> std::result::Result<
210            tonic::Response<super::MsgStoreCodeResponse>,
211            tonic::Status,
212        > {
213            self.inner
214                .ready()
215                .await
216                .map_err(|e| {
217                    tonic::Status::unknown(
218                        format!("Service was not ready: {}", e.into()),
219                    )
220                })?;
221            let codec = tonic::codec::ProstCodec::default();
222            let path = http::uri::PathAndQuery::from_static(
223                "/ibc.lightclients.wasm.v1.Msg/StoreCode",
224            );
225            let mut req = request.into_request();
226            req.extensions_mut()
227                .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "StoreCode"));
228            self.inner.unary(req, path, codec).await
229        }
230        /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum.
231        pub async fn remove_checksum(
232            &mut self,
233            request: impl tonic::IntoRequest<super::MsgRemoveChecksum>,
234        ) -> std::result::Result<
235            tonic::Response<super::MsgRemoveChecksumResponse>,
236            tonic::Status,
237        > {
238            self.inner
239                .ready()
240                .await
241                .map_err(|e| {
242                    tonic::Status::unknown(
243                        format!("Service was not ready: {}", e.into()),
244                    )
245                })?;
246            let codec = tonic::codec::ProstCodec::default();
247            let path = http::uri::PathAndQuery::from_static(
248                "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum",
249            );
250            let mut req = request.into_request();
251            req.extensions_mut()
252                .insert(
253                    GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum"),
254                );
255            self.inner.unary(req, path, codec).await
256        }
257        /// MigrateContract defines a rpc handler method for MsgMigrateContract.
258        pub async fn migrate_contract(
259            &mut self,
260            request: impl tonic::IntoRequest<super::MsgMigrateContract>,
261        ) -> std::result::Result<
262            tonic::Response<super::MsgMigrateContractResponse>,
263            tonic::Status,
264        > {
265            self.inner
266                .ready()
267                .await
268                .map_err(|e| {
269                    tonic::Status::unknown(
270                        format!("Service was not ready: {}", e.into()),
271                    )
272                })?;
273            let codec = tonic::codec::ProstCodec::default();
274            let path = http::uri::PathAndQuery::from_static(
275                "/ibc.lightclients.wasm.v1.Msg/MigrateContract",
276            );
277            let mut req = request.into_request();
278            req.extensions_mut()
279                .insert(
280                    GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "MigrateContract"),
281                );
282            self.inner.unary(req, path, codec).await
283        }
284    }
285}
286/// Generated server implementations.
287#[cfg(feature = "server")]
288pub mod msg_server {
289    #![allow(
290        unused_variables,
291        dead_code,
292        missing_docs,
293        clippy::wildcard_imports,
294        clippy::let_unit_value,
295    )]
296    use tonic::codegen::*;
297    /// Generated trait containing gRPC methods that should be implemented for use with MsgServer.
298    #[async_trait]
299    pub trait Msg: std::marker::Send + std::marker::Sync + 'static {
300        /// StoreCode defines a rpc handler method for MsgStoreCode.
301        async fn store_code(
302            &self,
303            request: tonic::Request<super::MsgStoreCode>,
304        ) -> std::result::Result<
305            tonic::Response<super::MsgStoreCodeResponse>,
306            tonic::Status,
307        >;
308        /// RemoveChecksum defines a rpc handler method for MsgRemoveChecksum.
309        async fn remove_checksum(
310            &self,
311            request: tonic::Request<super::MsgRemoveChecksum>,
312        ) -> std::result::Result<
313            tonic::Response<super::MsgRemoveChecksumResponse>,
314            tonic::Status,
315        >;
316        /// MigrateContract defines a rpc handler method for MsgMigrateContract.
317        async fn migrate_contract(
318            &self,
319            request: tonic::Request<super::MsgMigrateContract>,
320        ) -> std::result::Result<
321            tonic::Response<super::MsgMigrateContractResponse>,
322            tonic::Status,
323        >;
324    }
325    /// Msg defines the ibc/08-wasm Msg service.
326    #[derive(Debug)]
327    pub struct MsgServer<T> {
328        inner: Arc<T>,
329        accept_compression_encodings: EnabledCompressionEncodings,
330        send_compression_encodings: EnabledCompressionEncodings,
331        max_decoding_message_size: Option<usize>,
332        max_encoding_message_size: Option<usize>,
333    }
334    impl<T> MsgServer<T> {
335        pub fn new(inner: T) -> Self {
336            Self::from_arc(Arc::new(inner))
337        }
338        pub fn from_arc(inner: Arc<T>) -> Self {
339            Self {
340                inner,
341                accept_compression_encodings: Default::default(),
342                send_compression_encodings: Default::default(),
343                max_decoding_message_size: None,
344                max_encoding_message_size: None,
345            }
346        }
347        pub fn with_interceptor<F>(
348            inner: T,
349            interceptor: F,
350        ) -> InterceptedService<Self, F>
351        where
352            F: tonic::service::Interceptor,
353        {
354            InterceptedService::new(Self::new(inner), interceptor)
355        }
356        /// Enable decompressing requests with the given encoding.
357        #[must_use]
358        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
359            self.accept_compression_encodings.enable(encoding);
360            self
361        }
362        /// Compress responses with the given encoding, if the client supports it.
363        #[must_use]
364        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
365            self.send_compression_encodings.enable(encoding);
366            self
367        }
368        /// Limits the maximum size of a decoded message.
369        ///
370        /// Default: `4MB`
371        #[must_use]
372        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
373            self.max_decoding_message_size = Some(limit);
374            self
375        }
376        /// Limits the maximum size of an encoded message.
377        ///
378        /// Default: `usize::MAX`
379        #[must_use]
380        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
381            self.max_encoding_message_size = Some(limit);
382            self
383        }
384    }
385    impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
386    where
387        T: Msg,
388        B: Body + std::marker::Send + 'static,
389        B::Error: Into<StdError> + std::marker::Send + 'static,
390    {
391        type Response = http::Response<tonic::body::Body>;
392        type Error = std::convert::Infallible;
393        type Future = BoxFuture<Self::Response, Self::Error>;
394        fn poll_ready(
395            &mut self,
396            _cx: &mut Context<'_>,
397        ) -> Poll<std::result::Result<(), Self::Error>> {
398            Poll::Ready(Ok(()))
399        }
400        fn call(&mut self, req: http::Request<B>) -> Self::Future {
401            match req.uri().path() {
402                "/ibc.lightclients.wasm.v1.Msg/StoreCode" => {
403                    #[allow(non_camel_case_types)]
404                    struct StoreCodeSvc<T: Msg>(pub Arc<T>);
405                    impl<T: Msg> tonic::server::UnaryService<super::MsgStoreCode>
406                    for StoreCodeSvc<T> {
407                        type Response = super::MsgStoreCodeResponse;
408                        type Future = BoxFuture<
409                            tonic::Response<Self::Response>,
410                            tonic::Status,
411                        >;
412                        fn call(
413                            &mut self,
414                            request: tonic::Request<super::MsgStoreCode>,
415                        ) -> Self::Future {
416                            let inner = Arc::clone(&self.0);
417                            let fut = async move {
418                                <T as Msg>::store_code(&inner, request).await
419                            };
420                            Box::pin(fut)
421                        }
422                    }
423                    let accept_compression_encodings = self.accept_compression_encodings;
424                    let send_compression_encodings = self.send_compression_encodings;
425                    let max_decoding_message_size = self.max_decoding_message_size;
426                    let max_encoding_message_size = self.max_encoding_message_size;
427                    let inner = self.inner.clone();
428                    let fut = async move {
429                        let method = StoreCodeSvc(inner);
430                        let codec = tonic::codec::ProstCodec::default();
431                        let mut grpc = tonic::server::Grpc::new(codec)
432                            .apply_compression_config(
433                                accept_compression_encodings,
434                                send_compression_encodings,
435                            )
436                            .apply_max_message_size_config(
437                                max_decoding_message_size,
438                                max_encoding_message_size,
439                            );
440                        let res = grpc.unary(method, req).await;
441                        Ok(res)
442                    };
443                    Box::pin(fut)
444                }
445                "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum" => {
446                    #[allow(non_camel_case_types)]
447                    struct RemoveChecksumSvc<T: Msg>(pub Arc<T>);
448                    impl<T: Msg> tonic::server::UnaryService<super::MsgRemoveChecksum>
449                    for RemoveChecksumSvc<T> {
450                        type Response = super::MsgRemoveChecksumResponse;
451                        type Future = BoxFuture<
452                            tonic::Response<Self::Response>,
453                            tonic::Status,
454                        >;
455                        fn call(
456                            &mut self,
457                            request: tonic::Request<super::MsgRemoveChecksum>,
458                        ) -> Self::Future {
459                            let inner = Arc::clone(&self.0);
460                            let fut = async move {
461                                <T as Msg>::remove_checksum(&inner, request).await
462                            };
463                            Box::pin(fut)
464                        }
465                    }
466                    let accept_compression_encodings = self.accept_compression_encodings;
467                    let send_compression_encodings = self.send_compression_encodings;
468                    let max_decoding_message_size = self.max_decoding_message_size;
469                    let max_encoding_message_size = self.max_encoding_message_size;
470                    let inner = self.inner.clone();
471                    let fut = async move {
472                        let method = RemoveChecksumSvc(inner);
473                        let codec = tonic::codec::ProstCodec::default();
474                        let mut grpc = tonic::server::Grpc::new(codec)
475                            .apply_compression_config(
476                                accept_compression_encodings,
477                                send_compression_encodings,
478                            )
479                            .apply_max_message_size_config(
480                                max_decoding_message_size,
481                                max_encoding_message_size,
482                            );
483                        let res = grpc.unary(method, req).await;
484                        Ok(res)
485                    };
486                    Box::pin(fut)
487                }
488                "/ibc.lightclients.wasm.v1.Msg/MigrateContract" => {
489                    #[allow(non_camel_case_types)]
490                    struct MigrateContractSvc<T: Msg>(pub Arc<T>);
491                    impl<T: Msg> tonic::server::UnaryService<super::MsgMigrateContract>
492                    for MigrateContractSvc<T> {
493                        type Response = super::MsgMigrateContractResponse;
494                        type Future = BoxFuture<
495                            tonic::Response<Self::Response>,
496                            tonic::Status,
497                        >;
498                        fn call(
499                            &mut self,
500                            request: tonic::Request<super::MsgMigrateContract>,
501                        ) -> Self::Future {
502                            let inner = Arc::clone(&self.0);
503                            let fut = async move {
504                                <T as Msg>::migrate_contract(&inner, request).await
505                            };
506                            Box::pin(fut)
507                        }
508                    }
509                    let accept_compression_encodings = self.accept_compression_encodings;
510                    let send_compression_encodings = self.send_compression_encodings;
511                    let max_decoding_message_size = self.max_decoding_message_size;
512                    let max_encoding_message_size = self.max_encoding_message_size;
513                    let inner = self.inner.clone();
514                    let fut = async move {
515                        let method = MigrateContractSvc(inner);
516                        let codec = tonic::codec::ProstCodec::default();
517                        let mut grpc = tonic::server::Grpc::new(codec)
518                            .apply_compression_config(
519                                accept_compression_encodings,
520                                send_compression_encodings,
521                            )
522                            .apply_max_message_size_config(
523                                max_decoding_message_size,
524                                max_encoding_message_size,
525                            );
526                        let res = grpc.unary(method, req).await;
527                        Ok(res)
528                    };
529                    Box::pin(fut)
530                }
531                _ => {
532                    Box::pin(async move {
533                        let mut response = http::Response::new(
534                            tonic::body::Body::default(),
535                        );
536                        let headers = response.headers_mut();
537                        headers
538                            .insert(
539                                tonic::Status::GRPC_STATUS,
540                                (tonic::Code::Unimplemented as i32).into(),
541                            );
542                        headers
543                            .insert(
544                                http::header::CONTENT_TYPE,
545                                tonic::metadata::GRPC_CONTENT_TYPE,
546                            );
547                        Ok(response)
548                    })
549                }
550            }
551        }
552    }
553    impl<T> Clone for MsgServer<T> {
554        fn clone(&self) -> Self {
555            let inner = self.inner.clone();
556            Self {
557                inner,
558                accept_compression_encodings: self.accept_compression_encodings,
559                send_compression_encodings: self.send_compression_encodings,
560                max_decoding_message_size: self.max_decoding_message_size,
561                max_encoding_message_size: self.max_encoding_message_size,
562            }
563        }
564    }
565    /// Generated gRPC service name
566    pub const SERVICE_NAME: &str = "ibc.lightclients.wasm.v1.Msg";
567    impl<T> tonic::server::NamedService for MsgServer<T> {
568        const NAME: &'static str = SERVICE_NAME;
569    }
570}
571/// QueryChecksumsRequest is the request type for the Query/Checksums RPC method.
572#[derive(Clone, PartialEq, ::prost::Message)]
573pub struct QueryChecksumsRequest {
574    /// pagination defines an optional pagination for the request.
575    #[prost(message, optional, tag = "1")]
576    pub pagination: ::core::option::Option<
577        super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
578    >,
579}
580impl ::prost::Name for QueryChecksumsRequest {
581    const NAME: &'static str = "QueryChecksumsRequest";
582    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
583    fn full_name() -> ::prost::alloc::string::String {
584        "ibc.lightclients.wasm.v1.QueryChecksumsRequest".into()
585    }
586    fn type_url() -> ::prost::alloc::string::String {
587        "/ibc.lightclients.wasm.v1.QueryChecksumsRequest".into()
588    }
589}
590/// QueryChecksumsResponse is the response type for the Query/Checksums RPC method.
591#[derive(Clone, PartialEq, ::prost::Message)]
592pub struct QueryChecksumsResponse {
593    /// checksums is a list of the hex encoded checksums of all wasm codes stored.
594    #[prost(string, repeated, tag = "1")]
595    pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
596    /// pagination defines the pagination in the response.
597    #[prost(message, optional, tag = "2")]
598    pub pagination: ::core::option::Option<
599        super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
600    >,
601}
602impl ::prost::Name for QueryChecksumsResponse {
603    const NAME: &'static str = "QueryChecksumsResponse";
604    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
605    fn full_name() -> ::prost::alloc::string::String {
606        "ibc.lightclients.wasm.v1.QueryChecksumsResponse".into()
607    }
608    fn type_url() -> ::prost::alloc::string::String {
609        "/ibc.lightclients.wasm.v1.QueryChecksumsResponse".into()
610    }
611}
612/// QueryCodeRequest is the request type for the Query/Code RPC method.
613#[derive(Clone, PartialEq, ::prost::Message)]
614pub struct QueryCodeRequest {
615    /// checksum is a hex encoded string of the code stored.
616    #[prost(string, tag = "1")]
617    pub checksum: ::prost::alloc::string::String,
618}
619impl ::prost::Name for QueryCodeRequest {
620    const NAME: &'static str = "QueryCodeRequest";
621    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
622    fn full_name() -> ::prost::alloc::string::String {
623        "ibc.lightclients.wasm.v1.QueryCodeRequest".into()
624    }
625    fn type_url() -> ::prost::alloc::string::String {
626        "/ibc.lightclients.wasm.v1.QueryCodeRequest".into()
627    }
628}
629/// QueryCodeResponse is the response type for the Query/Code RPC method.
630#[derive(Clone, PartialEq, ::prost::Message)]
631pub struct QueryCodeResponse {
632    #[prost(bytes = "vec", tag = "1")]
633    pub data: ::prost::alloc::vec::Vec<u8>,
634}
635impl ::prost::Name for QueryCodeResponse {
636    const NAME: &'static str = "QueryCodeResponse";
637    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
638    fn full_name() -> ::prost::alloc::string::String {
639        "ibc.lightclients.wasm.v1.QueryCodeResponse".into()
640    }
641    fn type_url() -> ::prost::alloc::string::String {
642        "/ibc.lightclients.wasm.v1.QueryCodeResponse".into()
643    }
644}
645/// Generated client implementations.
646#[cfg(feature = "client")]
647pub mod query_client {
648    #![allow(
649        unused_variables,
650        dead_code,
651        missing_docs,
652        clippy::wildcard_imports,
653        clippy::let_unit_value,
654    )]
655    use tonic::codegen::*;
656    use tonic::codegen::http::Uri;
657    /// Query service for wasm module
658    #[derive(Debug, Clone)]
659    pub struct QueryClient<T> {
660        inner: tonic::client::Grpc<T>,
661    }
662    #[cfg(feature = "transport")]
663    impl QueryClient<tonic::transport::Channel> {
664        /// Attempt to create a new client by connecting to a given endpoint.
665        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
666        where
667            D: TryInto<tonic::transport::Endpoint>,
668            D::Error: Into<StdError>,
669        {
670            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
671            Ok(Self::new(conn))
672        }
673    }
674    impl<T> QueryClient<T>
675    where
676        T: tonic::client::GrpcService<tonic::body::Body>,
677        T::Error: Into<StdError>,
678        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
679        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
680    {
681        pub fn new(inner: T) -> Self {
682            let inner = tonic::client::Grpc::new(inner);
683            Self { inner }
684        }
685        pub fn with_origin(inner: T, origin: Uri) -> Self {
686            let inner = tonic::client::Grpc::with_origin(inner, origin);
687            Self { inner }
688        }
689        pub fn with_interceptor<F>(
690            inner: T,
691            interceptor: F,
692        ) -> QueryClient<InterceptedService<T, F>>
693        where
694            F: tonic::service::Interceptor,
695            T::ResponseBody: Default,
696            T: tonic::codegen::Service<
697                http::Request<tonic::body::Body>,
698                Response = http::Response<
699                    <T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
700                >,
701            >,
702            <T as tonic::codegen::Service<
703                http::Request<tonic::body::Body>,
704            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
705        {
706            QueryClient::new(InterceptedService::new(inner, interceptor))
707        }
708        /// Compress requests with the given encoding.
709        ///
710        /// This requires the server to support it otherwise it might respond with an
711        /// error.
712        #[must_use]
713        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
714            self.inner = self.inner.send_compressed(encoding);
715            self
716        }
717        /// Enable decompressing responses.
718        #[must_use]
719        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
720            self.inner = self.inner.accept_compressed(encoding);
721            self
722        }
723        /// Limits the maximum size of a decoded message.
724        ///
725        /// Default: `4MB`
726        #[must_use]
727        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
728            self.inner = self.inner.max_decoding_message_size(limit);
729            self
730        }
731        /// Limits the maximum size of an encoded message.
732        ///
733        /// Default: `usize::MAX`
734        #[must_use]
735        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
736            self.inner = self.inner.max_encoding_message_size(limit);
737            self
738        }
739        /// Get all Wasm checksums
740        pub async fn checksums(
741            &mut self,
742            request: impl tonic::IntoRequest<super::QueryChecksumsRequest>,
743        ) -> std::result::Result<
744            tonic::Response<super::QueryChecksumsResponse>,
745            tonic::Status,
746        > {
747            self.inner
748                .ready()
749                .await
750                .map_err(|e| {
751                    tonic::Status::unknown(
752                        format!("Service was not ready: {}", e.into()),
753                    )
754                })?;
755            let codec = tonic::codec::ProstCodec::default();
756            let path = http::uri::PathAndQuery::from_static(
757                "/ibc.lightclients.wasm.v1.Query/Checksums",
758            );
759            let mut req = request.into_request();
760            req.extensions_mut()
761                .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Checksums"));
762            self.inner.unary(req, path, codec).await
763        }
764        /// Get Wasm code for given checksum
765        pub async fn code(
766            &mut self,
767            request: impl tonic::IntoRequest<super::QueryCodeRequest>,
768        ) -> std::result::Result<
769            tonic::Response<super::QueryCodeResponse>,
770            tonic::Status,
771        > {
772            self.inner
773                .ready()
774                .await
775                .map_err(|e| {
776                    tonic::Status::unknown(
777                        format!("Service was not ready: {}", e.into()),
778                    )
779                })?;
780            let codec = tonic::codec::ProstCodec::default();
781            let path = http::uri::PathAndQuery::from_static(
782                "/ibc.lightclients.wasm.v1.Query/Code",
783            );
784            let mut req = request.into_request();
785            req.extensions_mut()
786                .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Code"));
787            self.inner.unary(req, path, codec).await
788        }
789    }
790}
791/// Generated server implementations.
792#[cfg(feature = "server")]
793pub mod query_server {
794    #![allow(
795        unused_variables,
796        dead_code,
797        missing_docs,
798        clippy::wildcard_imports,
799        clippy::let_unit_value,
800    )]
801    use tonic::codegen::*;
802    /// Generated trait containing gRPC methods that should be implemented for use with QueryServer.
803    #[async_trait]
804    pub trait Query: std::marker::Send + std::marker::Sync + 'static {
805        /// Get all Wasm checksums
806        async fn checksums(
807            &self,
808            request: tonic::Request<super::QueryChecksumsRequest>,
809        ) -> std::result::Result<
810            tonic::Response<super::QueryChecksumsResponse>,
811            tonic::Status,
812        >;
813        /// Get Wasm code for given checksum
814        async fn code(
815            &self,
816            request: tonic::Request<super::QueryCodeRequest>,
817        ) -> std::result::Result<
818            tonic::Response<super::QueryCodeResponse>,
819            tonic::Status,
820        >;
821    }
822    /// Query service for wasm module
823    #[derive(Debug)]
824    pub struct QueryServer<T> {
825        inner: Arc<T>,
826        accept_compression_encodings: EnabledCompressionEncodings,
827        send_compression_encodings: EnabledCompressionEncodings,
828        max_decoding_message_size: Option<usize>,
829        max_encoding_message_size: Option<usize>,
830    }
831    impl<T> QueryServer<T> {
832        pub fn new(inner: T) -> Self {
833            Self::from_arc(Arc::new(inner))
834        }
835        pub fn from_arc(inner: Arc<T>) -> Self {
836            Self {
837                inner,
838                accept_compression_encodings: Default::default(),
839                send_compression_encodings: Default::default(),
840                max_decoding_message_size: None,
841                max_encoding_message_size: None,
842            }
843        }
844        pub fn with_interceptor<F>(
845            inner: T,
846            interceptor: F,
847        ) -> InterceptedService<Self, F>
848        where
849            F: tonic::service::Interceptor,
850        {
851            InterceptedService::new(Self::new(inner), interceptor)
852        }
853        /// Enable decompressing requests with the given encoding.
854        #[must_use]
855        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
856            self.accept_compression_encodings.enable(encoding);
857            self
858        }
859        /// Compress responses with the given encoding, if the client supports it.
860        #[must_use]
861        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
862            self.send_compression_encodings.enable(encoding);
863            self
864        }
865        /// Limits the maximum size of a decoded message.
866        ///
867        /// Default: `4MB`
868        #[must_use]
869        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
870            self.max_decoding_message_size = Some(limit);
871            self
872        }
873        /// Limits the maximum size of an encoded message.
874        ///
875        /// Default: `usize::MAX`
876        #[must_use]
877        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
878            self.max_encoding_message_size = Some(limit);
879            self
880        }
881    }
882    impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
883    where
884        T: Query,
885        B: Body + std::marker::Send + 'static,
886        B::Error: Into<StdError> + std::marker::Send + 'static,
887    {
888        type Response = http::Response<tonic::body::Body>;
889        type Error = std::convert::Infallible;
890        type Future = BoxFuture<Self::Response, Self::Error>;
891        fn poll_ready(
892            &mut self,
893            _cx: &mut Context<'_>,
894        ) -> Poll<std::result::Result<(), Self::Error>> {
895            Poll::Ready(Ok(()))
896        }
897        fn call(&mut self, req: http::Request<B>) -> Self::Future {
898            match req.uri().path() {
899                "/ibc.lightclients.wasm.v1.Query/Checksums" => {
900                    #[allow(non_camel_case_types)]
901                    struct ChecksumsSvc<T: Query>(pub Arc<T>);
902                    impl<
903                        T: Query,
904                    > tonic::server::UnaryService<super::QueryChecksumsRequest>
905                    for ChecksumsSvc<T> {
906                        type Response = super::QueryChecksumsResponse;
907                        type Future = BoxFuture<
908                            tonic::Response<Self::Response>,
909                            tonic::Status,
910                        >;
911                        fn call(
912                            &mut self,
913                            request: tonic::Request<super::QueryChecksumsRequest>,
914                        ) -> Self::Future {
915                            let inner = Arc::clone(&self.0);
916                            let fut = async move {
917                                <T as Query>::checksums(&inner, request).await
918                            };
919                            Box::pin(fut)
920                        }
921                    }
922                    let accept_compression_encodings = self.accept_compression_encodings;
923                    let send_compression_encodings = self.send_compression_encodings;
924                    let max_decoding_message_size = self.max_decoding_message_size;
925                    let max_encoding_message_size = self.max_encoding_message_size;
926                    let inner = self.inner.clone();
927                    let fut = async move {
928                        let method = ChecksumsSvc(inner);
929                        let codec = tonic::codec::ProstCodec::default();
930                        let mut grpc = tonic::server::Grpc::new(codec)
931                            .apply_compression_config(
932                                accept_compression_encodings,
933                                send_compression_encodings,
934                            )
935                            .apply_max_message_size_config(
936                                max_decoding_message_size,
937                                max_encoding_message_size,
938                            );
939                        let res = grpc.unary(method, req).await;
940                        Ok(res)
941                    };
942                    Box::pin(fut)
943                }
944                "/ibc.lightclients.wasm.v1.Query/Code" => {
945                    #[allow(non_camel_case_types)]
946                    struct CodeSvc<T: Query>(pub Arc<T>);
947                    impl<T: Query> tonic::server::UnaryService<super::QueryCodeRequest>
948                    for CodeSvc<T> {
949                        type Response = super::QueryCodeResponse;
950                        type Future = BoxFuture<
951                            tonic::Response<Self::Response>,
952                            tonic::Status,
953                        >;
954                        fn call(
955                            &mut self,
956                            request: tonic::Request<super::QueryCodeRequest>,
957                        ) -> Self::Future {
958                            let inner = Arc::clone(&self.0);
959                            let fut = async move {
960                                <T as Query>::code(&inner, request).await
961                            };
962                            Box::pin(fut)
963                        }
964                    }
965                    let accept_compression_encodings = self.accept_compression_encodings;
966                    let send_compression_encodings = self.send_compression_encodings;
967                    let max_decoding_message_size = self.max_decoding_message_size;
968                    let max_encoding_message_size = self.max_encoding_message_size;
969                    let inner = self.inner.clone();
970                    let fut = async move {
971                        let method = CodeSvc(inner);
972                        let codec = tonic::codec::ProstCodec::default();
973                        let mut grpc = tonic::server::Grpc::new(codec)
974                            .apply_compression_config(
975                                accept_compression_encodings,
976                                send_compression_encodings,
977                            )
978                            .apply_max_message_size_config(
979                                max_decoding_message_size,
980                                max_encoding_message_size,
981                            );
982                        let res = grpc.unary(method, req).await;
983                        Ok(res)
984                    };
985                    Box::pin(fut)
986                }
987                _ => {
988                    Box::pin(async move {
989                        let mut response = http::Response::new(
990                            tonic::body::Body::default(),
991                        );
992                        let headers = response.headers_mut();
993                        headers
994                            .insert(
995                                tonic::Status::GRPC_STATUS,
996                                (tonic::Code::Unimplemented as i32).into(),
997                            );
998                        headers
999                            .insert(
1000                                http::header::CONTENT_TYPE,
1001                                tonic::metadata::GRPC_CONTENT_TYPE,
1002                            );
1003                        Ok(response)
1004                    })
1005                }
1006            }
1007        }
1008    }
1009    impl<T> Clone for QueryServer<T> {
1010        fn clone(&self) -> Self {
1011            let inner = self.inner.clone();
1012            Self {
1013                inner,
1014                accept_compression_encodings: self.accept_compression_encodings,
1015                send_compression_encodings: self.send_compression_encodings,
1016                max_decoding_message_size: self.max_decoding_message_size,
1017                max_encoding_message_size: self.max_encoding_message_size,
1018            }
1019        }
1020    }
1021    /// Generated gRPC service name
1022    pub const SERVICE_NAME: &str = "ibc.lightclients.wasm.v1.Query";
1023    impl<T> tonic::server::NamedService for QueryServer<T> {
1024        const NAME: &'static str = SERVICE_NAME;
1025    }
1026}
1027/// GenesisState defines 08-wasm's keeper genesis state
1028#[derive(Clone, PartialEq, ::prost::Message)]
1029pub struct GenesisState {
1030    /// uploaded light client wasm contracts
1031    #[prost(message, repeated, tag = "1")]
1032    pub contracts: ::prost::alloc::vec::Vec<Contract>,
1033}
1034impl ::prost::Name for GenesisState {
1035    const NAME: &'static str = "GenesisState";
1036    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1037    fn full_name() -> ::prost::alloc::string::String {
1038        "ibc.lightclients.wasm.v1.GenesisState".into()
1039    }
1040    fn type_url() -> ::prost::alloc::string::String {
1041        "/ibc.lightclients.wasm.v1.GenesisState".into()
1042    }
1043}
1044/// Contract stores contract code
1045#[derive(Clone, PartialEq, ::prost::Message)]
1046pub struct Contract {
1047    /// contract byte code
1048    #[prost(bytes = "vec", tag = "1")]
1049    pub code_bytes: ::prost::alloc::vec::Vec<u8>,
1050}
1051impl ::prost::Name for Contract {
1052    const NAME: &'static str = "Contract";
1053    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1054    fn full_name() -> ::prost::alloc::string::String {
1055        "ibc.lightclients.wasm.v1.Contract".into()
1056    }
1057    fn type_url() -> ::prost::alloc::string::String {
1058        "/ibc.lightclients.wasm.v1.Contract".into()
1059    }
1060}
1061/// Wasm light client's Client state
1062#[derive(Clone, PartialEq, ::prost::Message)]
1063pub struct ClientState {
1064    /// bytes encoding the client state of the underlying light client
1065    /// implemented as a Wasm contract.
1066    #[prost(bytes = "vec", tag = "1")]
1067    pub data: ::prost::alloc::vec::Vec<u8>,
1068    #[prost(bytes = "vec", tag = "2")]
1069    pub checksum: ::prost::alloc::vec::Vec<u8>,
1070    #[prost(message, optional, tag = "3")]
1071    pub latest_height: ::core::option::Option<
1072        super::super::super::core::client::v1::Height,
1073    >,
1074}
1075impl ::prost::Name for ClientState {
1076    const NAME: &'static str = "ClientState";
1077    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1078    fn full_name() -> ::prost::alloc::string::String {
1079        "ibc.lightclients.wasm.v1.ClientState".into()
1080    }
1081    fn type_url() -> ::prost::alloc::string::String {
1082        "/ibc.lightclients.wasm.v1.ClientState".into()
1083    }
1084}
1085/// Wasm light client's ConsensusState
1086#[derive(Clone, PartialEq, ::prost::Message)]
1087pub struct ConsensusState {
1088    /// bytes encoding the consensus state of the underlying light client
1089    /// implemented as a Wasm contract.
1090    #[prost(bytes = "vec", tag = "1")]
1091    pub data: ::prost::alloc::vec::Vec<u8>,
1092}
1093impl ::prost::Name for ConsensusState {
1094    const NAME: &'static str = "ConsensusState";
1095    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1096    fn full_name() -> ::prost::alloc::string::String {
1097        "ibc.lightclients.wasm.v1.ConsensusState".into()
1098    }
1099    fn type_url() -> ::prost::alloc::string::String {
1100        "/ibc.lightclients.wasm.v1.ConsensusState".into()
1101    }
1102}
1103/// Wasm light client message (either header(s) or misbehaviour)
1104#[cfg_attr(
1105    all(feature = "json-schema", feature = "serde"),
1106    derive(::schemars::JsonSchema)
1107)]
1108#[derive(Clone, PartialEq, ::prost::Message)]
1109pub struct ClientMessage {
1110    #[prost(bytes = "vec", tag = "1")]
1111    pub data: ::prost::alloc::vec::Vec<u8>,
1112}
1113impl ::prost::Name for ClientMessage {
1114    const NAME: &'static str = "ClientMessage";
1115    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1116    fn full_name() -> ::prost::alloc::string::String {
1117        "ibc.lightclients.wasm.v1.ClientMessage".into()
1118    }
1119    fn type_url() -> ::prost::alloc::string::String {
1120        "/ibc.lightclients.wasm.v1.ClientMessage".into()
1121    }
1122}
1123/// Checksums defines a list of all checksums that are stored
1124///
1125/// Deprecated: This message is deprecated in favor of storing the checksums
1126/// using a Collections.KeySet.
1127#[derive(Clone, PartialEq, ::prost::Message)]
1128pub struct Checksums {
1129    #[prost(bytes = "vec", repeated, tag = "1")]
1130    pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
1131}
1132impl ::prost::Name for Checksums {
1133    const NAME: &'static str = "Checksums";
1134    const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
1135    fn full_name() -> ::prost::alloc::string::String {
1136        "ibc.lightclients.wasm.v1.Checksums".into()
1137    }
1138    fn type_url() -> ::prost::alloc::string::String {
1139        "/ibc.lightclients.wasm.v1.Checksums".into()
1140    }
1141}