#[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<::prost_types::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<crate::tendermint::types::BlockId>,
#[prost(message, optional, tag="2")]
pub block: ::core::option::Option<crate::tendermint::types::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<crate::tendermint::types::BlockId>,
#[prost(message, optional, tag="2")]
pub block: ::core::option::Option<crate::tendermint::types::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<crate::tendermint::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,
}
pub mod service_client {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[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_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_gzip(mut self) -> Self {
self.inner = self.inner.send_gzip();
self
}
#[must_use]
pub fn accept_gzip(mut self) -> Self {
self.inner = self.inner.accept_gzip();
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
}
}
}