/// Block is tendermint type Block, with the Header proposer address /// field converted to bech32 string. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Block { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, #[prost(message, optional, tag = "2")] pub data: ::core::option::Option<::tendermint_proto::types::Data>, #[prost(message, optional, tag = "3")] pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>, #[prost(message, optional, tag = "4")] pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>, } /// Header defines the structure of a Tendermint block header. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { /// basic block info #[prost(message, optional, tag = "1")] pub version: ::core::option::Option<::tendermint_proto::version::Consensus>, #[prost(string, tag = "2")] pub chain_id: ::prost::alloc::string::String, #[prost(int64, tag = "3")] pub height: i64, #[prost(message, optional, tag = "4")] pub time: ::core::option::Option<::prost_types::Timestamp>, /// prev block info #[prost(message, optional, tag = "5")] pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, /// hashes of block data /// /// commit from validators from the last block #[prost(bytes = "vec", tag = "6")] pub last_commit_hash: ::prost::alloc::vec::Vec, /// transactions #[prost(bytes = "vec", tag = "7")] pub data_hash: ::prost::alloc::vec::Vec, /// hashes from the app output from the prev block /// /// validators for the current block #[prost(bytes = "vec", tag = "8")] pub validators_hash: ::prost::alloc::vec::Vec, /// validators for the next block #[prost(bytes = "vec", tag = "9")] pub next_validators_hash: ::prost::alloc::vec::Vec, /// consensus params for current block #[prost(bytes = "vec", tag = "10")] pub consensus_hash: ::prost::alloc::vec::Vec, /// state after txs from the previous block #[prost(bytes = "vec", tag = "11")] pub app_hash: ::prost::alloc::vec::Vec, /// root hash of all results from the txs from the previous block #[prost(bytes = "vec", tag = "12")] pub last_results_hash: ::prost::alloc::vec::Vec, /// consensus info /// /// evidence included in the block #[prost(bytes = "vec", tag = "13")] pub evidence_hash: ::prost::alloc::vec::Vec, /// proposer_address is the original block proposer address, formatted as a Bech32 string. /// In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string /// for better UX. /// /// original proposer of the block #[prost(string, tag = "14")] pub proposer_address: ::prost::alloc::string::String, } /// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightRequest { #[prost(int64, tag = "1")] pub height: i64, /// pagination defines an pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } /// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightResponse { #[prost(int64, tag = "1")] pub block_height: i64, #[prost(message, repeated, tag = "2")] pub validators: ::prost::alloc::vec::Vec, /// pagination defines an pagination for the response. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } /// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetRequest { /// pagination defines an pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } /// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetResponse { #[prost(int64, tag = "1")] pub block_height: i64, #[prost(message, repeated, tag = "2")] pub validators: ::prost::alloc::vec::Vec, /// pagination defines an pagination for the response. #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } /// Validator is the type for the validator-set. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Validator { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub pub_key: ::core::option::Option<::prost_types::Any>, #[prost(int64, tag = "3")] pub voting_power: i64, #[prost(int64, tag = "4")] pub proposer_priority: i64, } /// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightRequest { #[prost(int64, tag = "1")] pub height: i64, } /// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "1")] pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] pub block: ::core::option::Option<::tendermint_proto::types::Block>, /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, } /// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockRequest {} /// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { #[prost(message, optional, tag = "1")] pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] pub block: ::core::option::Option<::tendermint_proto::types::Block>, /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, } /// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingRequest {} /// GetSyncingResponse is the response type for the Query/GetSyncing RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetSyncingResponse { #[prost(bool, tag = "1")] pub syncing: bool, } /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest {} /// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { #[prost(message, optional, tag = "1")] pub default_node_info: ::core::option::Option<::tendermint_proto::p2p::DefaultNodeInfo>, #[prost(message, optional, tag = "2")] pub application_version: ::core::option::Option, } /// VersionInfo is the type for the GetNodeInfoResponse message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct VersionInfo { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub app_name: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, #[prost(string, tag = "4")] pub git_commit: ::prost::alloc::string::String, #[prost(string, tag = "5")] pub build_tags: ::prost::alloc::string::String, #[prost(string, tag = "6")] pub go_version: ::prost::alloc::string::String, #[prost(message, repeated, tag = "7")] pub build_deps: ::prost::alloc::vec::Vec, /// Since: cosmos-sdk 0.43 #[prost(string, tag = "8")] pub cosmos_sdk_version: ::prost::alloc::string::String, } /// Module is the type for VersionInfo #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { /// module path #[prost(string, tag = "1")] pub path: ::prost::alloc::string::String, /// module version #[prost(string, tag = "2")] pub version: ::prost::alloc::string::String, /// checksum #[prost(string, tag = "3")] pub sum: ::prost::alloc::string::String, } /// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryRequest { #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, #[prost(string, tag = "2")] pub path: ::prost::alloc::string::String, #[prost(int64, tag = "3")] pub height: i64, #[prost(bool, tag = "4")] pub prove: bool, } /// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC query. /// /// Note: This type is a duplicate of the ResponseQuery proto type defined in /// Tendermint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AbciQueryResponse { #[prost(uint32, tag = "1")] pub code: u32, /// nondeterministic #[prost(string, tag = "3")] pub log: ::prost::alloc::string::String, /// nondeterministic #[prost(string, tag = "4")] pub info: ::prost::alloc::string::String, #[prost(int64, tag = "5")] pub index: i64, #[prost(bytes = "vec", tag = "6")] pub key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "7")] pub value: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "8")] pub proof_ops: ::core::option::Option, #[prost(int64, tag = "9")] pub height: i64, #[prost(string, tag = "10")] pub codespace: ::prost::alloc::string::String, } /// ProofOp defines an operation used for calculating Merkle root. The data could /// be arbitrary format, providing necessary data for example neighbouring node /// hash. /// /// Note: This type is a duplicate of the ProofOp proto type defined in Tendermint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOp { #[prost(string, tag = "1")] pub r#type: ::prost::alloc::string::String, #[prost(bytes = "vec", tag = "2")] pub key: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] pub data: ::prost::alloc::vec::Vec, } /// ProofOps is Merkle proof defined by the list of ProofOps. /// /// Note: This type is a duplicate of the ProofOps proto type defined in Tendermint. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ProofOps { #[prost(message, repeated, tag = "1")] pub ops: ::prost::alloc::vec::Vec, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod service_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Service defines the gRPC querier service for tendermint queries. #[derive(Debug, Clone)] pub struct ServiceClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl ServiceClient { /// 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 ServiceClient 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, ) -> ServiceClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { ServiceClient::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 } /// GetNodeInfo queries the current node info. pub async fn get_node_info( &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.base.tendermint.v1beta1.Service/GetNodeInfo", ); self.inner.unary(request.into_request(), path, codec).await } /// GetSyncing queries node syncing. pub async fn get_syncing( &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.base.tendermint.v1beta1.Service/GetSyncing", ); self.inner.unary(request.into_request(), path, codec).await } /// GetLatestBlock returns the latest block. pub async fn get_latest_block( &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.base.tendermint.v1beta1.Service/GetLatestBlock", ); self.inner.unary(request.into_request(), path, codec).await } /// GetBlockByHeight queries block for given height. pub async fn get_block_by_height( &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.base.tendermint.v1beta1.Service/GetBlockByHeight", ); self.inner.unary(request.into_request(), path, codec).await } /// GetLatestValidatorSet queries latest validator-set. pub async fn get_latest_validator_set( &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.base.tendermint.v1beta1.Service/GetLatestValidatorSet", ); self.inner.unary(request.into_request(), path, codec).await } /// GetValidatorSetByHeight queries validator-set at a given height. pub async fn get_validator_set_by_height( &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.base.tendermint.v1beta1.Service/GetValidatorSetByHeight", ); self.inner.unary(request.into_request(), path, codec).await } /// ABCIQuery defines a query handler that supports ABCI queries directly to the /// application, bypassing Tendermint completely. The ABCI query must contain /// a valid and supported path, including app, custom, p2p, and store. /// /// Since: cosmos-sdk 0.46 pub async fn abci_query( &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.base.tendermint.v1beta1.Service/ABCIQuery", ); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod service_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 ServiceServer. #[async_trait] pub trait Service: Send + Sync + 'static { /// GetNodeInfo queries the current node info. async fn get_node_info( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GetSyncing queries node syncing. async fn get_syncing( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GetLatestBlock returns the latest block. async fn get_latest_block( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GetBlockByHeight queries block for given height. async fn get_block_by_height( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GetLatestValidatorSet queries latest validator-set. async fn get_latest_validator_set( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// GetValidatorSetByHeight queries validator-set at a given height. async fn get_validator_set_by_height( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ABCIQuery defines a query handler that supports ABCI queries directly to the /// application, bypassing Tendermint completely. The ABCI query must contain /// a valid and supported path, including app, custom, p2p, and store. /// /// Since: cosmos-sdk 0.46 async fn abci_query( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Service defines the gRPC querier service for tendermint queries. #[derive(Debug)] pub struct ServiceServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl ServiceServer { 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 ServiceServer where T: Service, 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.base.tendermint.v1beta1.Service/GetNodeInfo" => { #[allow(non_camel_case_types)] struct GetNodeInfoSvc(pub Arc); impl tonic::server::UnaryService for GetNodeInfoSvc { type Response = super::GetNodeInfoResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_node_info(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 = GetNodeInfoSvc(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.base.tendermint.v1beta1.Service/GetSyncing" => { #[allow(non_camel_case_types)] struct GetSyncingSvc(pub Arc); impl tonic::server::UnaryService for GetSyncingSvc { type Response = super::GetSyncingResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_syncing(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 = GetSyncingSvc(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.base.tendermint.v1beta1.Service/GetLatestBlock" => { #[allow(non_camel_case_types)] struct GetLatestBlockSvc(pub Arc); impl tonic::server::UnaryService for GetLatestBlockSvc { type Response = super::GetLatestBlockResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_latest_block(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 = GetLatestBlockSvc(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.base.tendermint.v1beta1.Service/GetBlockByHeight" => { #[allow(non_camel_case_types)] struct GetBlockByHeightSvc(pub Arc); impl tonic::server::UnaryService for GetBlockByHeightSvc { type Response = super::GetBlockByHeightResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_block_by_height(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 = GetBlockByHeightSvc(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.base.tendermint.v1beta1.Service/GetLatestValidatorSet" => { #[allow(non_camel_case_types)] struct GetLatestValidatorSetSvc(pub Arc); impl tonic::server::UnaryService for GetLatestValidatorSetSvc { type Response = super::GetLatestValidatorSetResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_latest_validator_set(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 = GetLatestValidatorSetSvc(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.base.tendermint.v1beta1.Service/GetValidatorSetByHeight" => { #[allow(non_camel_case_types)] struct GetValidatorSetByHeightSvc(pub Arc); impl tonic::server::UnaryService for GetValidatorSetByHeightSvc { type Response = super::GetValidatorSetByHeightResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).get_validator_set_by_height(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 = GetValidatorSetByHeightSvc(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.base.tendermint.v1beta1.Service/ABCIQuery" => { #[allow(non_camel_case_types)] struct ABCIQuerySvc(pub Arc); impl tonic::server::UnaryService for ABCIQuerySvc { type Response = super::AbciQueryResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).abci_query(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 = ABCIQuerySvc(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 ServiceServer { 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 ServiceServer { const NAME: &'static str = "cosmos.base.tendermint.v1beta1.Service"; } }