#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Block {
#[prost(message, optional, tag="1")]
pub header: ::core::option::Option<Header>,
#[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>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Header {
#[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<super::super::super::super::google::protobuf::Timestamp>,
#[prost(message, optional, tag="5")]
pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
#[prost(bytes="vec", tag="6")]
pub last_commit_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="7")]
pub data_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="8")]
pub validators_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="9")]
pub next_validators_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="10")]
pub consensus_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="11")]
pub app_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="12")]
pub last_results_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes="vec", tag="13")]
pub evidence_hash: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag="14")]
pub proposer_address: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetValidatorSetByHeightRequest {
#[prost(int64, tag="1")]
pub height: i64,
#[prost(message, optional, tag="2")]
pub pagination: ::core::option::Option<super::super::query::v1beta1::PageRequest>,
}
#[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<Validator>,
#[prost(message, optional, tag="3")]
pub pagination: ::core::option::Option<super::super::query::v1beta1::PageResponse>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLatestValidatorSetRequest {
#[prost(message, optional, tag="1")]
pub pagination: ::core::option::Option<super::super::query::v1beta1::PageRequest>,
}
#[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<Validator>,
#[prost(message, optional, tag="3")]
pub pagination: ::core::option::Option<super::super::query::v1beta1::PageResponse>,
}
#[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<super::super::super::super::google::protobuf::Any>,
#[prost(int64, tag="3")]
pub voting_power: i64,
#[prost(int64, tag="4")]
pub proposer_priority: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBlockByHeightRequest {
#[prost(int64, tag="1")]
pub height: i64,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetBlockByHeightResponse {
#[prost(message, optional, tag="1")]
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
#[prost(message, optional, tag="2")]
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
#[prost(message, optional, tag="3")]
pub sdk_block: ::core::option::Option<Block>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLatestBlockRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetLatestBlockResponse {
#[prost(message, optional, tag="1")]
pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>,
#[prost(message, optional, tag="2")]
pub block: ::core::option::Option<::tendermint_proto::types::Block>,
#[prost(message, optional, tag="3")]
pub sdk_block: ::core::option::Option<Block>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSyncingRequest {
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetSyncingResponse {
#[prost(bool, tag="1")]
pub syncing: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GetNodeInfoRequest {
}
#[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>,
}
#[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<Module>,
#[prost(string, tag="8")]
pub cosmos_sdk_version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Module {
#[prost(string, tag="1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag="2")]
pub version: ::prost::alloc::string::String,
#[prost(string, tag="3")]
pub sum: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbciQueryRequest {
#[prost(bytes="vec", tag="1")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(string, tag="2")]
pub path: ::prost::alloc::string::String,
#[prost(int64, tag="3")]
pub height: i64,
#[prost(bool, tag="4")]
pub prove: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct AbciQueryResponse {
#[prost(uint32, tag="1")]
pub code: u32,
#[prost(string, tag="3")]
pub log: ::prost::alloc::string::String,
#[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<u8>,
#[prost(bytes="vec", tag="7")]
pub value: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag="8")]
pub proof_ops: ::core::option::Option<ProofOps>,
#[prost(int64, tag="9")]
pub height: i64,
#[prost(string, tag="10")]
pub codespace: ::prost::alloc::string::String,
}
#[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<u8>,
#[prost(bytes="vec", tag="3")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ProofOps {
#[prost(message, repeated, tag="1")]
pub ops: ::prost::alloc::vec::Vec<ProofOp>,
}
#[cfg(feature = "client")]
pub mod service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct ServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl ServiceClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> ServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + 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<F>(
inner: T,
interceptor: F,
) -> ServiceClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::BoxBody>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::BoxBody>,
>>::Error: Into<StdError> + Send + Sync,
{
ServiceClient::new(InterceptedService::new(inner, interceptor))
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.send_compressed(encoding);
self
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.inner = self.inner.accept_compressed(encoding);
self
}
pub async fn get_node_info(
&mut self,
request: impl tonic::IntoRequest<super::GetNodeInfoRequest>,
) -> Result<tonic::Response<super::GetNodeInfoResponse>, 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
}
pub async fn get_syncing(
&mut self,
request: impl tonic::IntoRequest<super::GetSyncingRequest>,
) -> Result<tonic::Response<super::GetSyncingResponse>, 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
}
pub async fn get_latest_block(
&mut self,
request: impl tonic::IntoRequest<super::GetLatestBlockRequest>,
) -> Result<tonic::Response<super::GetLatestBlockResponse>, 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
}
pub async fn get_block_by_height(
&mut self,
request: impl tonic::IntoRequest<super::GetBlockByHeightRequest>,
) -> Result<tonic::Response<super::GetBlockByHeightResponse>, 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
}
pub async fn get_latest_validator_set(
&mut self,
request: impl tonic::IntoRequest<super::GetLatestValidatorSetRequest>,
) -> Result<
tonic::Response<super::GetLatestValidatorSetResponse>,
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
}
pub async fn get_validator_set_by_height(
&mut self,
request: impl tonic::IntoRequest<super::GetValidatorSetByHeightRequest>,
) -> Result<
tonic::Response<super::GetValidatorSetByHeightResponse>,
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
}
pub async fn abci_query(
&mut self,
request: impl tonic::IntoRequest<super::AbciQueryRequest>,
) -> Result<tonic::Response<super::AbciQueryResponse>, 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
}
}
}
#[cfg(feature = "server")]
pub mod service_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Service: Send + Sync + 'static {
async fn get_node_info(
&self,
request: tonic::Request<super::GetNodeInfoRequest>,
) -> Result<tonic::Response<super::GetNodeInfoResponse>, tonic::Status>;
async fn get_syncing(
&self,
request: tonic::Request<super::GetSyncingRequest>,
) -> Result<tonic::Response<super::GetSyncingResponse>, tonic::Status>;
async fn get_latest_block(
&self,
request: tonic::Request<super::GetLatestBlockRequest>,
) -> Result<tonic::Response<super::GetLatestBlockResponse>, tonic::Status>;
async fn get_block_by_height(
&self,
request: tonic::Request<super::GetBlockByHeightRequest>,
) -> Result<tonic::Response<super::GetBlockByHeightResponse>, tonic::Status>;
async fn get_latest_validator_set(
&self,
request: tonic::Request<super::GetLatestValidatorSetRequest>,
) -> Result<
tonic::Response<super::GetLatestValidatorSetResponse>,
tonic::Status,
>;
async fn get_validator_set_by_height(
&self,
request: tonic::Request<super::GetValidatorSetByHeightRequest>,
) -> Result<
tonic::Response<super::GetValidatorSetByHeightResponse>,
tonic::Status,
>;
async fn abci_query(
&self,
request: tonic::Request<super::AbciQueryRequest>,
) -> Result<tonic::Response<super::AbciQueryResponse>, tonic::Status>;
}
#[derive(Debug)]
pub struct ServiceServer<T: Service> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
}
struct _Inner<T>(Arc<T>);
impl<T: Service> ServiceServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
let inner = _Inner(inner);
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
}
}
pub fn with_interceptor<F>(
inner: T,
interceptor: F,
) -> InterceptedService<Self, F>
where
F: tonic::service::Interceptor,
{
InterceptedService::new(Self::new(inner), interceptor)
}
#[must_use]
pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.accept_compression_encodings.enable(encoding);
self
}
#[must_use]
pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self {
self.send_compression_encodings.enable(encoding);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for ServiceServer<T>
where
T: Service,
B: Body + Send + 'static,
B::Error: Into<StdError> + Send + 'static,
{
type Response = http::Response<tonic::body::BoxBody>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
let inner = self.inner.clone();
match req.uri().path() {
"/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" => {
#[allow(non_camel_case_types)]
struct GetNodeInfoSvc<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetNodeInfoRequest>
for GetNodeInfoSvc<T> {
type Response = super::GetNodeInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetNodeInfoRequest>,
) -> 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<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetSyncingRequest>
for GetSyncingSvc<T> {
type Response = super::GetSyncingResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetSyncingRequest>,
) -> 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<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetLatestBlockRequest>
for GetLatestBlockSvc<T> {
type Response = super::GetLatestBlockResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetLatestBlockRequest>,
) -> 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<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetBlockByHeightRequest>
for GetBlockByHeightSvc<T> {
type Response = super::GetBlockByHeightResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetBlockByHeightRequest>,
) -> 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<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetLatestValidatorSetRequest>
for GetLatestValidatorSetSvc<T> {
type Response = super::GetLatestValidatorSetResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::GetLatestValidatorSetRequest>,
) -> 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<T: Service>(pub Arc<T>);
impl<
T: Service,
> tonic::server::UnaryService<super::GetValidatorSetByHeightRequest>
for GetValidatorSetByHeightSvc<T> {
type Response = super::GetValidatorSetByHeightResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::GetValidatorSetByHeightRequest,
>,
) -> 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<T: Service>(pub Arc<T>);
impl<T: Service> tonic::server::UnaryService<super::AbciQueryRequest>
for ABCIQuerySvc<T> {
type Response = super::AbciQueryResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::AbciQueryRequest>,
) -> 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<T: Service> Clone for ServiceServer<T> {
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<T: Service> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(self.0.clone())
}
}
impl<T: std::fmt::Debug> std::fmt::Debug for _Inner<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{:?}", self.0)
}
}
impl<T: Service> tonic::server::NamedService for ServiceServer<T> {
const NAME: &'static str = "cosmos.base.tendermint.v1beta1.Service";
}
}