1#[allow(clippy::derive_partial_eq_without_eq)]
4#[derive(Clone, PartialEq, ::prost::Message)]
5pub struct Equivocation {
6 #[prost(int64, tag = "1")]
7 pub height: i64,
8 #[prost(message, optional, tag = "2")]
9 pub time: ::core::option::Option<::prost_types::Timestamp>,
10 #[prost(int64, tag = "3")]
11 pub power: i64,
12 #[prost(string, tag = "4")]
13 pub consensus_address: ::prost::alloc::string::String,
14}
15#[allow(clippy::derive_partial_eq_without_eq)]
18#[derive(Clone, PartialEq, ::prost::Message)]
19pub struct MsgSubmitEvidence {
20 #[prost(string, tag = "1")]
21 pub submitter: ::prost::alloc::string::String,
22 #[prost(message, optional, tag = "2")]
23 pub evidence: ::core::option::Option<::prost_types::Any>,
24}
25#[allow(clippy::derive_partial_eq_without_eq)]
27#[derive(Clone, PartialEq, ::prost::Message)]
28pub struct MsgSubmitEvidenceResponse {
29 #[prost(bytes = "vec", tag = "4")]
31 pub hash: ::prost::alloc::vec::Vec<u8>,
32}
33#[cfg(feature = "grpc")]
35#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
36pub mod msg_client {
37 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
38 use tonic::codegen::http::Uri;
39 use tonic::codegen::*;
40 #[derive(Debug, Clone)]
42 pub struct MsgClient<T> {
43 inner: tonic::client::Grpc<T>,
44 }
45 #[cfg(feature = "grpc-transport")]
46 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
47 impl MsgClient<tonic::transport::Channel> {
48 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
50 where
51 D: std::convert::TryInto<tonic::transport::Endpoint>,
52 D::Error: Into<StdError>,
53 {
54 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
55 Ok(Self::new(conn))
56 }
57 }
58 impl<T> MsgClient<T>
59 where
60 T: tonic::client::GrpcService<tonic::body::BoxBody>,
61 T::Error: Into<StdError>,
62 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
63 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
64 {
65 pub fn new(inner: T) -> Self {
66 let inner = tonic::client::Grpc::new(inner);
67 Self { inner }
68 }
69 pub fn with_origin(inner: T, origin: Uri) -> Self {
70 let inner = tonic::client::Grpc::with_origin(inner, origin);
71 Self { inner }
72 }
73 pub fn with_interceptor<F>(inner: T, interceptor: F) -> MsgClient<InterceptedService<T, F>>
74 where
75 F: tonic::service::Interceptor,
76 T::ResponseBody: Default,
77 T: tonic::codegen::Service<
78 http::Request<tonic::body::BoxBody>,
79 Response = http::Response<
80 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
81 >,
82 >,
83 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
84 Into<StdError> + Send + Sync,
85 {
86 MsgClient::new(InterceptedService::new(inner, interceptor))
87 }
88 #[must_use]
93 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
94 self.inner = self.inner.send_compressed(encoding);
95 self
96 }
97 #[must_use]
99 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
100 self.inner = self.inner.accept_compressed(encoding);
101 self
102 }
103 pub async fn submit_evidence(
106 &mut self,
107 request: impl tonic::IntoRequest<super::MsgSubmitEvidence>,
108 ) -> Result<tonic::Response<super::MsgSubmitEvidenceResponse>, tonic::Status> {
109 self.inner.ready().await.map_err(|e| {
110 tonic::Status::new(
111 tonic::Code::Unknown,
112 format!("Service was not ready: {}", e.into()),
113 )
114 })?;
115 let codec = tonic::codec::ProstCodec::default();
116 let path =
117 http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Msg/SubmitEvidence");
118 self.inner.unary(request.into_request(), path, codec).await
119 }
120 }
121}
122#[cfg(feature = "grpc")]
124#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
125pub mod msg_server {
126 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
127 use tonic::codegen::*;
128 #[async_trait]
130 pub trait Msg: Send + Sync + 'static {
131 async fn submit_evidence(
134 &self,
135 request: tonic::Request<super::MsgSubmitEvidence>,
136 ) -> Result<tonic::Response<super::MsgSubmitEvidenceResponse>, tonic::Status>;
137 }
138 #[derive(Debug)]
140 pub struct MsgServer<T: Msg> {
141 inner: _Inner<T>,
142 accept_compression_encodings: EnabledCompressionEncodings,
143 send_compression_encodings: EnabledCompressionEncodings,
144 }
145 struct _Inner<T>(Arc<T>);
146 impl<T: Msg> MsgServer<T> {
147 pub fn new(inner: T) -> Self {
148 Self::from_arc(Arc::new(inner))
149 }
150 pub fn from_arc(inner: Arc<T>) -> Self {
151 let inner = _Inner(inner);
152 Self {
153 inner,
154 accept_compression_encodings: Default::default(),
155 send_compression_encodings: Default::default(),
156 }
157 }
158 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
159 where
160 F: tonic::service::Interceptor,
161 {
162 InterceptedService::new(Self::new(inner), interceptor)
163 }
164 #[must_use]
166 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
167 self.accept_compression_encodings.enable(encoding);
168 self
169 }
170 #[must_use]
172 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
173 self.send_compression_encodings.enable(encoding);
174 self
175 }
176 }
177 impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
178 where
179 T: Msg,
180 B: Body + Send + 'static,
181 B::Error: Into<StdError> + Send + 'static,
182 {
183 type Response = http::Response<tonic::body::BoxBody>;
184 type Error = std::convert::Infallible;
185 type Future = BoxFuture<Self::Response, Self::Error>;
186 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
187 Poll::Ready(Ok(()))
188 }
189 fn call(&mut self, req: http::Request<B>) -> Self::Future {
190 let inner = self.inner.clone();
191 match req.uri().path() {
192 "/cosmos.evidence.v1beta1.Msg/SubmitEvidence" => {
193 #[allow(non_camel_case_types)]
194 struct SubmitEvidenceSvc<T: Msg>(pub Arc<T>);
195 impl<T: Msg> tonic::server::UnaryService<super::MsgSubmitEvidence> for SubmitEvidenceSvc<T> {
196 type Response = super::MsgSubmitEvidenceResponse;
197 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
198 fn call(
199 &mut self,
200 request: tonic::Request<super::MsgSubmitEvidence>,
201 ) -> Self::Future {
202 let inner = self.0.clone();
203 let fut = async move { (*inner).submit_evidence(request).await };
204 Box::pin(fut)
205 }
206 }
207 let accept_compression_encodings = self.accept_compression_encodings;
208 let send_compression_encodings = self.send_compression_encodings;
209 let inner = self.inner.clone();
210 let fut = async move {
211 let inner = inner.0;
212 let method = SubmitEvidenceSvc(inner);
213 let codec = tonic::codec::ProstCodec::default();
214 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
215 accept_compression_encodings,
216 send_compression_encodings,
217 );
218 let res = grpc.unary(method, req).await;
219 Ok(res)
220 };
221 Box::pin(fut)
222 }
223 _ => Box::pin(async move {
224 Ok(http::Response::builder()
225 .status(200)
226 .header("grpc-status", "12")
227 .header("content-type", "application/grpc")
228 .body(empty_body())
229 .unwrap())
230 }),
231 }
232 }
233 }
234 impl<T: Msg> Clone for MsgServer<T> {
235 fn clone(&self) -> Self {
236 let inner = self.inner.clone();
237 Self {
238 inner,
239 accept_compression_encodings: self.accept_compression_encodings,
240 send_compression_encodings: self.send_compression_encodings,
241 }
242 }
243 }
244 impl<T: Msg> Clone for _Inner<T> {
245 fn clone(&self) -> Self {
246 Self(self.0.clone())
247 }
248 }
249 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
250 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
251 write!(f, "{:?}", self.0)
252 }
253 }
254 impl<T: Msg> tonic::server::NamedService for MsgServer<T> {
255 const NAME: &'static str = "cosmos.evidence.v1beta1.Msg";
256 }
257}
258#[allow(clippy::derive_partial_eq_without_eq)]
260#[derive(Clone, PartialEq, ::prost::Message)]
261pub struct QueryEvidenceRequest {
262 #[prost(bytes = "vec", tag = "1")]
264 pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
265}
266#[allow(clippy::derive_partial_eq_without_eq)]
268#[derive(Clone, PartialEq, ::prost::Message)]
269pub struct QueryEvidenceResponse {
270 #[prost(message, optional, tag = "1")]
272 pub evidence: ::core::option::Option<::prost_types::Any>,
273}
274#[allow(clippy::derive_partial_eq_without_eq)]
277#[derive(Clone, PartialEq, ::prost::Message)]
278pub struct QueryAllEvidenceRequest {
279 #[prost(message, optional, tag = "1")]
281 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageRequest>,
282}
283#[allow(clippy::derive_partial_eq_without_eq)]
286#[derive(Clone, PartialEq, ::prost::Message)]
287pub struct QueryAllEvidenceResponse {
288 #[prost(message, repeated, tag = "1")]
290 pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>,
291 #[prost(message, optional, tag = "2")]
293 pub pagination: ::core::option::Option<super::super::base::query::v1beta1::PageResponse>,
294}
295#[cfg(feature = "grpc")]
297#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
298pub mod query_client {
299 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
300 use tonic::codegen::http::Uri;
301 use tonic::codegen::*;
302 #[derive(Debug, Clone)]
304 pub struct QueryClient<T> {
305 inner: tonic::client::Grpc<T>,
306 }
307 #[cfg(feature = "grpc-transport")]
308 #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))]
309 impl QueryClient<tonic::transport::Channel> {
310 pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
312 where
313 D: std::convert::TryInto<tonic::transport::Endpoint>,
314 D::Error: Into<StdError>,
315 {
316 let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
317 Ok(Self::new(conn))
318 }
319 }
320 impl<T> QueryClient<T>
321 where
322 T: tonic::client::GrpcService<tonic::body::BoxBody>,
323 T::Error: Into<StdError>,
324 T::ResponseBody: Body<Data = Bytes> + Send + 'static,
325 <T::ResponseBody as Body>::Error: Into<StdError> + Send,
326 {
327 pub fn new(inner: T) -> Self {
328 let inner = tonic::client::Grpc::new(inner);
329 Self { inner }
330 }
331 pub fn with_origin(inner: T, origin: Uri) -> Self {
332 let inner = tonic::client::Grpc::with_origin(inner, origin);
333 Self { inner }
334 }
335 pub fn with_interceptor<F>(
336 inner: T,
337 interceptor: F,
338 ) -> QueryClient<InterceptedService<T, F>>
339 where
340 F: tonic::service::Interceptor,
341 T::ResponseBody: Default,
342 T: tonic::codegen::Service<
343 http::Request<tonic::body::BoxBody>,
344 Response = http::Response<
345 <T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
346 >,
347 >,
348 <T as tonic::codegen::Service<http::Request<tonic::body::BoxBody>>>::Error:
349 Into<StdError> + Send + Sync,
350 {
351 QueryClient::new(InterceptedService::new(inner, interceptor))
352 }
353 #[must_use]
358 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
359 self.inner = self.inner.send_compressed(encoding);
360 self
361 }
362 #[must_use]
364 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
365 self.inner = self.inner.accept_compressed(encoding);
366 self
367 }
368 pub async fn evidence(
370 &mut self,
371 request: impl tonic::IntoRequest<super::QueryEvidenceRequest>,
372 ) -> Result<tonic::Response<super::QueryEvidenceResponse>, tonic::Status> {
373 self.inner.ready().await.map_err(|e| {
374 tonic::Status::new(
375 tonic::Code::Unknown,
376 format!("Service was not ready: {}", e.into()),
377 )
378 })?;
379 let codec = tonic::codec::ProstCodec::default();
380 let path =
381 http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Query/Evidence");
382 self.inner.unary(request.into_request(), path, codec).await
383 }
384 pub async fn all_evidence(
386 &mut self,
387 request: impl tonic::IntoRequest<super::QueryAllEvidenceRequest>,
388 ) -> Result<tonic::Response<super::QueryAllEvidenceResponse>, tonic::Status> {
389 self.inner.ready().await.map_err(|e| {
390 tonic::Status::new(
391 tonic::Code::Unknown,
392 format!("Service was not ready: {}", e.into()),
393 )
394 })?;
395 let codec = tonic::codec::ProstCodec::default();
396 let path =
397 http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Query/AllEvidence");
398 self.inner.unary(request.into_request(), path, codec).await
399 }
400 }
401}
402#[cfg(feature = "grpc")]
404#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))]
405pub mod query_server {
406 #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
407 use tonic::codegen::*;
408 #[async_trait]
410 pub trait Query: Send + Sync + 'static {
411 async fn evidence(
413 &self,
414 request: tonic::Request<super::QueryEvidenceRequest>,
415 ) -> Result<tonic::Response<super::QueryEvidenceResponse>, tonic::Status>;
416 async fn all_evidence(
418 &self,
419 request: tonic::Request<super::QueryAllEvidenceRequest>,
420 ) -> Result<tonic::Response<super::QueryAllEvidenceResponse>, tonic::Status>;
421 }
422 #[derive(Debug)]
424 pub struct QueryServer<T: Query> {
425 inner: _Inner<T>,
426 accept_compression_encodings: EnabledCompressionEncodings,
427 send_compression_encodings: EnabledCompressionEncodings,
428 }
429 struct _Inner<T>(Arc<T>);
430 impl<T: Query> QueryServer<T> {
431 pub fn new(inner: T) -> Self {
432 Self::from_arc(Arc::new(inner))
433 }
434 pub fn from_arc(inner: Arc<T>) -> Self {
435 let inner = _Inner(inner);
436 Self {
437 inner,
438 accept_compression_encodings: Default::default(),
439 send_compression_encodings: Default::default(),
440 }
441 }
442 pub fn with_interceptor<F>(inner: T, interceptor: F) -> InterceptedService<Self, F>
443 where
444 F: tonic::service::Interceptor,
445 {
446 InterceptedService::new(Self::new(inner), interceptor)
447 }
448 #[must_use]
450 pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
451 self.accept_compression_encodings.enable(encoding);
452 self
453 }
454 #[must_use]
456 pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
457 self.send_compression_encodings.enable(encoding);
458 self
459 }
460 }
461 impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
462 where
463 T: Query,
464 B: Body + Send + 'static,
465 B::Error: Into<StdError> + Send + 'static,
466 {
467 type Response = http::Response<tonic::body::BoxBody>;
468 type Error = std::convert::Infallible;
469 type Future = BoxFuture<Self::Response, Self::Error>;
470 fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
471 Poll::Ready(Ok(()))
472 }
473 fn call(&mut self, req: http::Request<B>) -> Self::Future {
474 let inner = self.inner.clone();
475 match req.uri().path() {
476 "/cosmos.evidence.v1beta1.Query/Evidence" => {
477 #[allow(non_camel_case_types)]
478 struct EvidenceSvc<T: Query>(pub Arc<T>);
479 impl<T: Query> tonic::server::UnaryService<super::QueryEvidenceRequest> for EvidenceSvc<T> {
480 type Response = super::QueryEvidenceResponse;
481 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
482 fn call(
483 &mut self,
484 request: tonic::Request<super::QueryEvidenceRequest>,
485 ) -> Self::Future {
486 let inner = self.0.clone();
487 let fut = async move { (*inner).evidence(request).await };
488 Box::pin(fut)
489 }
490 }
491 let accept_compression_encodings = self.accept_compression_encodings;
492 let send_compression_encodings = self.send_compression_encodings;
493 let inner = self.inner.clone();
494 let fut = async move {
495 let inner = inner.0;
496 let method = EvidenceSvc(inner);
497 let codec = tonic::codec::ProstCodec::default();
498 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
499 accept_compression_encodings,
500 send_compression_encodings,
501 );
502 let res = grpc.unary(method, req).await;
503 Ok(res)
504 };
505 Box::pin(fut)
506 }
507 "/cosmos.evidence.v1beta1.Query/AllEvidence" => {
508 #[allow(non_camel_case_types)]
509 struct AllEvidenceSvc<T: Query>(pub Arc<T>);
510 impl<T: Query> tonic::server::UnaryService<super::QueryAllEvidenceRequest> for AllEvidenceSvc<T> {
511 type Response = super::QueryAllEvidenceResponse;
512 type Future = BoxFuture<tonic::Response<Self::Response>, tonic::Status>;
513 fn call(
514 &mut self,
515 request: tonic::Request<super::QueryAllEvidenceRequest>,
516 ) -> Self::Future {
517 let inner = self.0.clone();
518 let fut = async move { (*inner).all_evidence(request).await };
519 Box::pin(fut)
520 }
521 }
522 let accept_compression_encodings = self.accept_compression_encodings;
523 let send_compression_encodings = self.send_compression_encodings;
524 let inner = self.inner.clone();
525 let fut = async move {
526 let inner = inner.0;
527 let method = AllEvidenceSvc(inner);
528 let codec = tonic::codec::ProstCodec::default();
529 let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config(
530 accept_compression_encodings,
531 send_compression_encodings,
532 );
533 let res = grpc.unary(method, req).await;
534 Ok(res)
535 };
536 Box::pin(fut)
537 }
538 _ => Box::pin(async move {
539 Ok(http::Response::builder()
540 .status(200)
541 .header("grpc-status", "12")
542 .header("content-type", "application/grpc")
543 .body(empty_body())
544 .unwrap())
545 }),
546 }
547 }
548 }
549 impl<T: Query> Clone for QueryServer<T> {
550 fn clone(&self) -> Self {
551 let inner = self.inner.clone();
552 Self {
553 inner,
554 accept_compression_encodings: self.accept_compression_encodings,
555 send_compression_encodings: self.send_compression_encodings,
556 }
557 }
558 }
559 impl<T: Query> Clone for _Inner<T> {
560 fn clone(&self) -> Self {
561 Self(self.0.clone())
562 }
563 }
564 impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
565 fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
566 write!(f, "{:?}", self.0)
567 }
568 }
569 impl<T: Query> tonic::server::NamedService for QueryServer<T> {
570 const NAME: &'static str = "cosmos.evidence.v1beta1.Query";
571 }
572}
573#[allow(clippy::derive_partial_eq_without_eq)]
575#[derive(Clone, PartialEq, ::prost::Message)]
576pub struct GenesisState {
577 #[prost(message, repeated, tag = "1")]
579 pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>,
580}