cosmos_sdk_proto_althea/prost/
cosmos.evidence.v1beta1.rs

1// This file is @generated by prost-build.
2/// GenesisState defines the evidence module's genesis state.
3#[derive(Clone, PartialEq, ::prost::Message)]
4pub struct GenesisState {
5    /// evidence defines all the evidence at genesis.
6    #[prost(message, repeated, tag = "1")]
7    pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>,
8}
9/// QueryEvidenceRequest is the request type for the Query/Evidence RPC method.
10#[derive(Clone, PartialEq, ::prost::Message)]
11pub struct QueryEvidenceRequest {
12    /// evidence_hash defines the hash of the requested evidence.
13    /// Deprecated: Use hash, a HEX encoded string, instead.
14    #[deprecated]
15    #[prost(bytes = "vec", tag = "1")]
16    pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
17    /// hash defines the evidence hash of the requested evidence.
18    ///
19    /// Since: cosmos-sdk 0.47
20    #[prost(string, tag = "2")]
21    pub hash: ::prost::alloc::string::String,
22}
23/// QueryEvidenceResponse is the response type for the Query/Evidence RPC method.
24#[derive(Clone, PartialEq, ::prost::Message)]
25pub struct QueryEvidenceResponse {
26    /// evidence returns the requested evidence.
27    #[prost(message, optional, tag = "1")]
28    pub evidence: ::core::option::Option<::prost_types::Any>,
29}
30/// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC
31/// method.
32#[derive(Clone, PartialEq, ::prost::Message)]
33pub struct QueryAllEvidenceRequest {
34    /// pagination defines an optional pagination for the request.
35    #[prost(message, optional, tag = "1")]
36    pub pagination: ::core::option::Option<
37        super::super::base::query::v1beta1::PageRequest,
38    >,
39}
40/// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC
41/// method.
42#[derive(Clone, PartialEq, ::prost::Message)]
43pub struct QueryAllEvidenceResponse {
44    /// evidence returns all evidences.
45    #[prost(message, repeated, tag = "1")]
46    pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>,
47    /// pagination defines the pagination in the response.
48    #[prost(message, optional, tag = "2")]
49    pub pagination: ::core::option::Option<
50        super::super::base::query::v1beta1::PageResponse,
51    >,
52}
53/// Generated client implementations.
54pub mod query_client {
55    #![allow(
56        unused_variables,
57        dead_code,
58        missing_docs,
59        clippy::wildcard_imports,
60        clippy::let_unit_value,
61    )]
62    use tonic::codegen::*;
63    use tonic::codegen::http::Uri;
64    /// Query defines the gRPC querier service.
65    #[derive(Debug, Clone)]
66    pub struct QueryClient<T> {
67        inner: tonic::client::Grpc<T>,
68    }
69    impl QueryClient<tonic::transport::Channel> {
70        /// Attempt to create a new client by connecting to a given endpoint.
71        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
72        where
73            D: TryInto<tonic::transport::Endpoint>,
74            D::Error: Into<StdError>,
75        {
76            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
77            Ok(Self::new(conn))
78        }
79    }
80    impl<T> QueryClient<T>
81    where
82        T: tonic::client::GrpcService<tonic::body::BoxBody>,
83        T::Error: Into<StdError>,
84        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
85        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
86    {
87        pub fn new(inner: T) -> Self {
88            let inner = tonic::client::Grpc::new(inner);
89            Self { inner }
90        }
91        pub fn with_origin(inner: T, origin: Uri) -> Self {
92            let inner = tonic::client::Grpc::with_origin(inner, origin);
93            Self { inner }
94        }
95        pub fn with_interceptor<F>(
96            inner: T,
97            interceptor: F,
98        ) -> QueryClient<InterceptedService<T, F>>
99        where
100            F: tonic::service::Interceptor,
101            T::ResponseBody: Default,
102            T: tonic::codegen::Service<
103                http::Request<tonic::body::BoxBody>,
104                Response = http::Response<
105                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
106                >,
107            >,
108            <T as tonic::codegen::Service<
109                http::Request<tonic::body::BoxBody>,
110            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
111        {
112            QueryClient::new(InterceptedService::new(inner, interceptor))
113        }
114        /// Compress requests with the given encoding.
115        ///
116        /// This requires the server to support it otherwise it might respond with an
117        /// error.
118        #[must_use]
119        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
120            self.inner = self.inner.send_compressed(encoding);
121            self
122        }
123        /// Enable decompressing responses.
124        #[must_use]
125        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
126            self.inner = self.inner.accept_compressed(encoding);
127            self
128        }
129        /// Limits the maximum size of a decoded message.
130        ///
131        /// Default: `4MB`
132        #[must_use]
133        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
134            self.inner = self.inner.max_decoding_message_size(limit);
135            self
136        }
137        /// Limits the maximum size of an encoded message.
138        ///
139        /// Default: `usize::MAX`
140        #[must_use]
141        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
142            self.inner = self.inner.max_encoding_message_size(limit);
143            self
144        }
145        /// Evidence queries evidence based on evidence hash.
146        pub async fn evidence(
147            &mut self,
148            request: impl tonic::IntoRequest<super::QueryEvidenceRequest>,
149        ) -> std::result::Result<
150            tonic::Response<super::QueryEvidenceResponse>,
151            tonic::Status,
152        > {
153            self.inner
154                .ready()
155                .await
156                .map_err(|e| {
157                    tonic::Status::unknown(
158                        format!("Service was not ready: {}", e.into()),
159                    )
160                })?;
161            let codec = tonic::codec::ProstCodec::default();
162            let path = http::uri::PathAndQuery::from_static(
163                "/cosmos.evidence.v1beta1.Query/Evidence",
164            );
165            let mut req = request.into_request();
166            req.extensions_mut()
167                .insert(GrpcMethod::new("cosmos.evidence.v1beta1.Query", "Evidence"));
168            self.inner.unary(req, path, codec).await
169        }
170        /// AllEvidence queries all evidence.
171        pub async fn all_evidence(
172            &mut self,
173            request: impl tonic::IntoRequest<super::QueryAllEvidenceRequest>,
174        ) -> std::result::Result<
175            tonic::Response<super::QueryAllEvidenceResponse>,
176            tonic::Status,
177        > {
178            self.inner
179                .ready()
180                .await
181                .map_err(|e| {
182                    tonic::Status::unknown(
183                        format!("Service was not ready: {}", e.into()),
184                    )
185                })?;
186            let codec = tonic::codec::ProstCodec::default();
187            let path = http::uri::PathAndQuery::from_static(
188                "/cosmos.evidence.v1beta1.Query/AllEvidence",
189            );
190            let mut req = request.into_request();
191            req.extensions_mut()
192                .insert(GrpcMethod::new("cosmos.evidence.v1beta1.Query", "AllEvidence"));
193            self.inner.unary(req, path, codec).await
194        }
195    }
196}
197/// Equivocation implements the Evidence interface and defines evidence of double
198/// signing misbehavior.
199#[derive(Clone, PartialEq, ::prost::Message)]
200pub struct Equivocation {
201    /// height is the equivocation height.
202    #[prost(int64, tag = "1")]
203    pub height: i64,
204    /// time is the equivocation time.
205    #[prost(message, optional, tag = "2")]
206    pub time: ::core::option::Option<::prost_types::Timestamp>,
207    /// power is the equivocation validator power.
208    #[prost(int64, tag = "3")]
209    pub power: i64,
210    /// consensus_address is the equivocation validator consensus address.
211    #[prost(string, tag = "4")]
212    pub consensus_address: ::prost::alloc::string::String,
213}
214/// MsgSubmitEvidence represents a message that supports submitting arbitrary
215/// Evidence of misbehavior such as equivocation or counterfactual signing.
216#[derive(Clone, PartialEq, ::prost::Message)]
217pub struct MsgSubmitEvidence {
218    /// submitter is the signer account address of evidence.
219    #[prost(string, tag = "1")]
220    pub submitter: ::prost::alloc::string::String,
221    /// evidence defines the evidence of misbehavior.
222    #[prost(message, optional, tag = "2")]
223    pub evidence: ::core::option::Option<::prost_types::Any>,
224}
225/// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type.
226#[derive(Clone, PartialEq, ::prost::Message)]
227pub struct MsgSubmitEvidenceResponse {
228    /// hash defines the hash of the evidence.
229    #[prost(bytes = "vec", tag = "4")]
230    pub hash: ::prost::alloc::vec::Vec<u8>,
231}
232/// Generated client implementations.
233pub mod msg_client {
234    #![allow(
235        unused_variables,
236        dead_code,
237        missing_docs,
238        clippy::wildcard_imports,
239        clippy::let_unit_value,
240    )]
241    use tonic::codegen::*;
242    use tonic::codegen::http::Uri;
243    /// Msg defines the evidence Msg service.
244    #[derive(Debug, Clone)]
245    pub struct MsgClient<T> {
246        inner: tonic::client::Grpc<T>,
247    }
248    impl MsgClient<tonic::transport::Channel> {
249        /// Attempt to create a new client by connecting to a given endpoint.
250        pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
251        where
252            D: TryInto<tonic::transport::Endpoint>,
253            D::Error: Into<StdError>,
254        {
255            let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
256            Ok(Self::new(conn))
257        }
258    }
259    impl<T> MsgClient<T>
260    where
261        T: tonic::client::GrpcService<tonic::body::BoxBody>,
262        T::Error: Into<StdError>,
263        T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
264        <T::ResponseBody as Body>::Error: Into<StdError> + std::marker::Send,
265    {
266        pub fn new(inner: T) -> Self {
267            let inner = tonic::client::Grpc::new(inner);
268            Self { inner }
269        }
270        pub fn with_origin(inner: T, origin: Uri) -> Self {
271            let inner = tonic::client::Grpc::with_origin(inner, origin);
272            Self { inner }
273        }
274        pub fn with_interceptor<F>(
275            inner: T,
276            interceptor: F,
277        ) -> MsgClient<InterceptedService<T, F>>
278        where
279            F: tonic::service::Interceptor,
280            T::ResponseBody: Default,
281            T: tonic::codegen::Service<
282                http::Request<tonic::body::BoxBody>,
283                Response = http::Response<
284                    <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
285                >,
286            >,
287            <T as tonic::codegen::Service<
288                http::Request<tonic::body::BoxBody>,
289            >>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
290        {
291            MsgClient::new(InterceptedService::new(inner, interceptor))
292        }
293        /// Compress requests with the given encoding.
294        ///
295        /// This requires the server to support it otherwise it might respond with an
296        /// error.
297        #[must_use]
298        pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
299            self.inner = self.inner.send_compressed(encoding);
300            self
301        }
302        /// Enable decompressing responses.
303        #[must_use]
304        pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
305            self.inner = self.inner.accept_compressed(encoding);
306            self
307        }
308        /// Limits the maximum size of a decoded message.
309        ///
310        /// Default: `4MB`
311        #[must_use]
312        pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
313            self.inner = self.inner.max_decoding_message_size(limit);
314            self
315        }
316        /// Limits the maximum size of an encoded message.
317        ///
318        /// Default: `usize::MAX`
319        #[must_use]
320        pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
321            self.inner = self.inner.max_encoding_message_size(limit);
322            self
323        }
324        /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or
325        /// counterfactual signing.
326        pub async fn submit_evidence(
327            &mut self,
328            request: impl tonic::IntoRequest<super::MsgSubmitEvidence>,
329        ) -> std::result::Result<
330            tonic::Response<super::MsgSubmitEvidenceResponse>,
331            tonic::Status,
332        > {
333            self.inner
334                .ready()
335                .await
336                .map_err(|e| {
337                    tonic::Status::unknown(
338                        format!("Service was not ready: {}", e.into()),
339                    )
340                })?;
341            let codec = tonic::codec::ProstCodec::default();
342            let path = http::uri::PathAndQuery::from_static(
343                "/cosmos.evidence.v1beta1.Msg/SubmitEvidence",
344            );
345            let mut req = request.into_request();
346            req.extensions_mut()
347                .insert(
348                    GrpcMethod::new("cosmos.evidence.v1beta1.Msg", "SubmitEvidence"),
349                );
350            self.inner.unary(req, path, codec).await
351        }
352    }
353}