/// Equivocation implements the Evidence interface and defines evidence of double /// signing misbehavior. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Equivocation { /// height is the equivocation height. #[prost(int64, tag = "1")] pub height: i64, /// time is the equivocation time. #[prost(message, optional, tag = "2")] pub time: ::core::option::Option<::prost_types::Timestamp>, /// power is the equivocation validator power. #[prost(int64, tag = "3")] pub power: i64, /// consensus_address is the equivocation validator consensus address. #[prost(string, tag = "4")] pub consensus_address: ::prost::alloc::string::String, } /// GenesisState defines the evidence module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { /// evidence defines all the evidence at genesis. #[prost(message, repeated, tag = "1")] pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, } /// QueryEvidenceRequest is the request type for the Query/Evidence RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceRequest { /// evidence_hash defines the hash of the requested evidence. /// Deprecated: Use hash, a HEX encoded string, instead. #[deprecated] #[prost(bytes = "vec", tag = "1")] pub evidence_hash: ::prost::alloc::vec::Vec, /// hash defines the evidence hash of the requested evidence. /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "2")] pub hash: ::prost::alloc::string::String, } /// QueryEvidenceResponse is the response type for the Query/Evidence RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryEvidenceResponse { /// evidence returns the requested evidence. #[prost(message, optional, tag = "1")] pub evidence: ::core::option::Option<::prost_types::Any>, } /// QueryEvidenceRequest is the request type for the Query/AllEvidence RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEvidenceRequest { /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } /// QueryAllEvidenceResponse is the response type for the Query/AllEvidence RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllEvidenceResponse { /// evidence returns all evidences. #[prost(message, repeated, tag = "1")] pub evidence: ::prost::alloc::vec::Vec<::prost_types::Any>, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Query defines the gRPC querier service. #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor( inner: T, interceptor: F, ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Evidence queries evidence based on evidence hash. pub async fn evidence( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Query/Evidence"); self.inner.unary(request.into_request(), path, codec).await } /// AllEvidence queries all evidence. pub async fn all_evidence( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Query/AllEvidence"); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { /// Evidence queries evidence based on evidence hash. async fn evidence( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// AllEvidence queries all evidence. async fn all_evidence( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query defines the gRPC querier service. #[derive(Debug)] pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for QueryServer where T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.evidence.v1beta1.Query/Evidence" => { #[allow(non_camel_case_types)] struct EvidenceSvc(pub Arc); impl tonic::server::UnaryService for EvidenceSvc { type Response = super::QueryEvidenceResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).evidence(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = EvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/cosmos.evidence.v1beta1.Query/AllEvidence" => { #[allow(non_camel_case_types)] struct AllEvidenceSvc(pub Arc); impl tonic::server::UnaryService for AllEvidenceSvc { type Response = super::QueryAllEvidenceResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).all_evidence(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = AllEvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "cosmos.evidence.v1beta1.Query"; } } /// MsgSubmitEvidence represents a message that supports submitting arbitrary /// Evidence of misbehavior such as equivocation or counterfactual signing. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidence { /// submitter is the signer account address of evidence. #[prost(string, tag = "1")] pub submitter: ::prost::alloc::string::String, /// evidence defines the evidence of misbehavior. #[prost(message, optional, tag = "2")] pub evidence: ::core::option::Option<::prost_types::Any>, } /// MsgSubmitEvidenceResponse defines the Msg/SubmitEvidence response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitEvidenceResponse { /// hash defines the hash of the evidence. #[prost(bytes = "vec", tag = "4")] pub hash: ::prost::alloc::vec::Vec, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Msg defines the evidence Msg service. #[derive(Debug, Clone)] pub struct MsgClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); Self { inner } } pub fn with_origin(inner: T, origin: Uri) -> Self { let inner = tonic::client::Grpc::with_origin(inner, origin); Self { inner } } pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or /// counterfactual signing. pub async fn submit_evidence( &mut self, request: impl tonic::IntoRequest, ) -> Result, tonic::Status> { self.inner.ready().await.map_err(|e| { tonic::Status::new( tonic::Code::Unknown, format!("Service was not ready: {}", e.into()), ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.evidence.v1beta1.Msg/SubmitEvidence"); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] pub trait Msg: Send + Sync + 'static { /// SubmitEvidence submits an arbitrary Evidence of misbehavior such as equivocation or /// counterfactual signing. async fn submit_evidence( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the evidence Msg service. #[derive(Debug)] pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for MsgServer where T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/cosmos.evidence.v1beta1.Msg/SubmitEvidence" => { #[allow(non_camel_case_types)] struct SubmitEvidenceSvc(pub Arc); impl tonic::server::UnaryService for SubmitEvidenceSvc { type Response = super::MsgSubmitEvidenceResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).submit_evidence(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = SubmitEvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "cosmos.evidence.v1beta1.Msg"; } }