#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParams {
#[prost(string, tag = "1")]
pub authority: ::prost::alloc::string::String,
#[prost(message, optional, tag = "2")]
pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.MsgUpdateParams".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.MsgUpdateParams".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
impl ::prost::Name for MsgUpdateParamsResponse {
const NAME: &'static str = "MsgUpdateParamsResponse";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.MsgUpdateParamsResponse".into()
}
}
#[cfg(feature = "client")]
pub mod msg_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
#[cfg(feature = "transport")]
impl MsgClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> MsgClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> MsgClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
MsgClient::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
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn update_params(
&mut self,
request: impl tonic::IntoRequest<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/interchain_security.ccv.consumer.v1.Msg/UpdateParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"interchain_security.ccv.consumer.v1.Msg",
"UpdateParams",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod msg_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Msg: std::marker::Send + std::marker::Sync + 'static {
async fn update_params(
&self,
request: tonic::Request<super::MsgUpdateParams>,
) -> std::result::Result<
tonic::Response<super::MsgUpdateParamsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct MsgServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> MsgServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
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
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for MsgServer<T>
where
T: Msg,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/interchain_security.ccv.consumer.v1.Msg/UpdateParams" => {
#[allow(non_camel_case_types)]
struct UpdateParamsSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgUpdateParams>
for UpdateParamsSvc<T> {
type Response = super::MsgUpdateParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgUpdateParams>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::update_params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = UpdateParamsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for MsgServer<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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "interchain_security.ccv.consumer.v1.Msg";
impl<T> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct CrossChainValidator {
#[prost(bytes = "vec", tag = "1")]
pub address: ::prost::alloc::vec::Vec<u8>,
#[prost(int64, tag = "2")]
pub power: i64,
#[prost(message, optional, tag = "3")]
pub pubkey: ::core::option::Option<::tendermint_proto::google::protobuf::Any>,
#[deprecated]
#[prost(bool, tag = "4")]
pub opted_out: bool,
}
impl ::prost::Name for CrossChainValidator {
const NAME: &'static str = "CrossChainValidator";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.CrossChainValidator".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.CrossChainValidator".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct SlashRecord {
#[prost(bool, tag = "1")]
pub waiting_on_reply: bool,
#[prost(message, optional, tag = "2")]
pub send_time: ::core::option::Option<
::tendermint_proto::google::protobuf::Timestamp,
>,
}
impl ::prost::Name for SlashRecord {
const NAME: &'static str = "SlashRecord";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.SlashRecord".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.SlashRecord".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NextFeeDistributionEstimate {
#[prost(int64, tag = "1")]
pub current_height: i64,
#[prost(int64, tag = "2")]
pub last_height: i64,
#[prost(int64, tag = "3")]
pub next_height: i64,
#[prost(string, tag = "4")]
pub distribution_fraction: ::prost::alloc::string::String,
#[prost(string, tag = "5")]
pub total: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub to_provider: ::prost::alloc::string::String,
#[prost(string, tag = "7")]
pub to_consumer: ::prost::alloc::string::String,
}
impl ::prost::Name for NextFeeDistributionEstimate {
const NAME: &'static str = "NextFeeDistributionEstimate";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.NextFeeDistributionEstimate".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryNextFeeDistributionEstimateRequest {}
impl ::prost::Name for QueryNextFeeDistributionEstimateRequest {
const NAME: &'static str = "QueryNextFeeDistributionEstimateRequest";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"
.into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateRequest"
.into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryNextFeeDistributionEstimateResponse {
#[prost(message, optional, tag = "1")]
pub data: ::core::option::Option<NextFeeDistributionEstimate>,
}
impl ::prost::Name for QueryNextFeeDistributionEstimateResponse {
const NAME: &'static str = "QueryNextFeeDistributionEstimateResponse";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"
.into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryNextFeeDistributionEstimateResponse"
.into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
impl ::prost::Name for QueryParamsRequest {
const NAME: &'static str = "QueryParamsRequest";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryParamsRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryParamsRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryParamsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryParamsResponse".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryProviderInfoRequest {}
impl ::prost::Name for QueryProviderInfoRequest {
const NAME: &'static str = "QueryProviderInfoRequest";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryProviderInfoRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryProviderInfoRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryProviderInfoResponse {
#[prost(message, optional, tag = "1")]
pub consumer: ::core::option::Option<ChainInfo>,
#[prost(message, optional, tag = "2")]
pub provider: ::core::option::Option<ChainInfo>,
}
impl ::prost::Name for QueryProviderInfoResponse {
const NAME: &'static str = "QueryProviderInfoResponse";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryProviderInfoResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryProviderInfoResponse".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct QueryThrottleStateRequest {}
impl ::prost::Name for QueryThrottleStateRequest {
const NAME: &'static str = "QueryThrottleStateRequest";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryThrottleStateRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryThrottleStateRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryThrottleStateResponse {
#[prost(message, optional, tag = "1")]
pub slash_record: ::core::option::Option<SlashRecord>,
#[prost(message, repeated, tag = "2")]
pub packet_data_queue: ::prost::alloc::vec::Vec<
super::super::v1::ConsumerPacketData,
>,
}
impl ::prost::Name for QueryThrottleStateResponse {
const NAME: &'static str = "QueryThrottleStateResponse";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.QueryThrottleStateResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.QueryThrottleStateResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ChainInfo {
#[prost(string, tag = "1")]
pub chain_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub client_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub connection_id: ::prost::alloc::string::String,
#[prost(string, tag = "4")]
pub channel_id: ::prost::alloc::string::String,
}
impl ::prost::Name for ChainInfo {
const NAME: &'static str = "ChainInfo";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.ChainInfo".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.ChainInfo".into()
}
}
#[cfg(feature = "client")]
pub mod query_client {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#[derive(Debug, Clone)]
pub struct QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
#[cfg(feature = "transport")]
impl QueryClient<tonic::transport::Channel> {
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> QueryClient<T>
where
T: tonic::client::GrpcService<tonic::body::Body>,
T::Error: Into<StdError>,
T::ResponseBody: Body<Data = Bytes> + std::marker::Send + 'static,
<T::ResponseBody as Body>::Error: Into<StdError> + std::marker::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,
) -> QueryClient<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,
T::ResponseBody: Default,
T: tonic::codegen::Service<
http::Request<tonic::body::Body>,
Response = http::Response<
<T as tonic::client::GrpcService<tonic::body::Body>>::ResponseBody,
>,
>,
<T as tonic::codegen::Service<
http::Request<tonic::body::Body>,
>>::Error: Into<StdError> + std::marker::Send + std::marker::Sync,
{
QueryClient::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
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_decoding_message_size(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.inner = self.inner.max_encoding_message_size(limit);
self
}
pub async fn query_next_fee_distribution(
&mut self,
request: impl tonic::IntoRequest<
super::QueryNextFeeDistributionEstimateRequest,
>,
) -> std::result::Result<
tonic::Response<super::QueryNextFeeDistributionEstimateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/interchain_security.ccv.consumer.v1.Query/QueryNextFeeDistribution",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"interchain_security.ccv.consumer.v1.Query",
"QueryNextFeeDistribution",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_params(
&mut self,
request: impl tonic::IntoRequest<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/interchain_security.ccv.consumer.v1.Query/QueryParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"interchain_security.ccv.consumer.v1.Query",
"QueryParams",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_provider_info(
&mut self,
request: impl tonic::IntoRequest<super::QueryProviderInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryProviderInfoResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/interchain_security.ccv.consumer.v1.Query/QueryProviderInfo",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"interchain_security.ccv.consumer.v1.Query",
"QueryProviderInfo",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn query_throttle_state(
&mut self,
request: impl tonic::IntoRequest<super::QueryThrottleStateRequest>,
) -> std::result::Result<
tonic::Response<super::QueryThrottleStateResponse>,
tonic::Status,
> {
self.inner
.ready()
.await
.map_err(|e| {
tonic::Status::unknown(
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/interchain_security.ccv.consumer.v1.Query/QueryThrottleState",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"interchain_security.ccv.consumer.v1.Query",
"QueryThrottleState",
),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod query_server {
#![allow(
unused_variables,
dead_code,
missing_docs,
clippy::wildcard_imports,
clippy::let_unit_value,
)]
use tonic::codegen::*;
#[async_trait]
pub trait Query: std::marker::Send + std::marker::Sync + 'static {
async fn query_next_fee_distribution(
&self,
request: tonic::Request<super::QueryNextFeeDistributionEstimateRequest>,
) -> std::result::Result<
tonic::Response<super::QueryNextFeeDistributionEstimateResponse>,
tonic::Status,
>;
async fn query_params(
&self,
request: tonic::Request<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
>;
async fn query_provider_info(
&self,
request: tonic::Request<super::QueryProviderInfoRequest>,
) -> std::result::Result<
tonic::Response<super::QueryProviderInfoResponse>,
tonic::Status,
>;
async fn query_throttle_state(
&self,
request: tonic::Request<super::QueryThrottleStateRequest>,
) -> std::result::Result<
tonic::Response<super::QueryThrottleStateResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServer<T> {
inner: Arc<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
impl<T> QueryServer<T> {
pub fn new(inner: T) -> Self {
Self::from_arc(Arc::new(inner))
}
pub fn from_arc(inner: Arc<T>) -> Self {
Self {
inner,
accept_compression_encodings: Default::default(),
send_compression_encodings: Default::default(),
max_decoding_message_size: None,
max_encoding_message_size: None,
}
}
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
}
#[must_use]
pub fn max_decoding_message_size(mut self, limit: usize) -> Self {
self.max_decoding_message_size = Some(limit);
self
}
#[must_use]
pub fn max_encoding_message_size(mut self, limit: usize) -> Self {
self.max_encoding_message_size = Some(limit);
self
}
}
impl<T, B> tonic::codegen::Service<http::Request<B>> for QueryServer<T>
where
T: Query,
B: Body + std::marker::Send + 'static,
B::Error: Into<StdError> + std::marker::Send + 'static,
{
type Response = http::Response<tonic::body::Body>;
type Error = std::convert::Infallible;
type Future = BoxFuture<Self::Response, Self::Error>;
fn poll_ready(
&mut self,
_cx: &mut Context<'_>,
) -> Poll<std::result::Result<(), Self::Error>> {
Poll::Ready(Ok(()))
}
fn call(&mut self, req: http::Request<B>) -> Self::Future {
match req.uri().path() {
"/interchain_security.ccv.consumer.v1.Query/QueryNextFeeDistribution" => {
#[allow(non_camel_case_types)]
struct QueryNextFeeDistributionSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<
super::QueryNextFeeDistributionEstimateRequest,
> for QueryNextFeeDistributionSvc<T> {
type Response = super::QueryNextFeeDistributionEstimateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<
super::QueryNextFeeDistributionEstimateRequest,
>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::query_next_fee_distribution(&inner, request)
.await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryNextFeeDistributionSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/interchain_security.ccv.consumer.v1.Query/QueryParams" => {
#[allow(non_camel_case_types)]
struct QueryParamsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
for QueryParamsSvc<T> {
type Response = super::QueryParamsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryParamsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::query_params(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryParamsSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/interchain_security.ccv.consumer.v1.Query/QueryProviderInfo" => {
#[allow(non_camel_case_types)]
struct QueryProviderInfoSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryProviderInfoRequest>
for QueryProviderInfoSvc<T> {
type Response = super::QueryProviderInfoResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryProviderInfoRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::query_provider_info(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryProviderInfoSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
"/interchain_security.ccv.consumer.v1.Query/QueryThrottleState" => {
#[allow(non_camel_case_types)]
struct QueryThrottleStateSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryThrottleStateRequest>
for QueryThrottleStateSvc<T> {
type Response = super::QueryThrottleStateResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryThrottleStateRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::query_throttle_state(&inner, request).await
};
Box::pin(fut)
}
}
let accept_compression_encodings = self.accept_compression_encodings;
let send_compression_encodings = self.send_compression_encodings;
let max_decoding_message_size = self.max_decoding_message_size;
let max_encoding_message_size = self.max_encoding_message_size;
let inner = self.inner.clone();
let fut = async move {
let method = QueryThrottleStateSvc(inner);
let codec = tonic::codec::ProstCodec::default();
let mut grpc = tonic::server::Grpc::new(codec)
.apply_compression_config(
accept_compression_encodings,
send_compression_encodings,
)
.apply_max_message_size_config(
max_decoding_message_size,
max_encoding_message_size,
);
let res = grpc.unary(method, req).await;
Ok(res)
};
Box::pin(fut)
}
_ => {
Box::pin(async move {
let mut response = http::Response::new(
tonic::body::Body::default(),
);
let headers = response.headers_mut();
headers
.insert(
tonic::Status::GRPC_STATUS,
(tonic::Code::Unimplemented as i32).into(),
);
headers
.insert(
http::header::CONTENT_TYPE,
tonic::metadata::GRPC_CONTENT_TYPE,
);
Ok(response)
})
}
}
}
}
impl<T> Clone for QueryServer<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,
max_decoding_message_size: self.max_decoding_message_size,
max_encoding_message_size: self.max_encoding_message_size,
}
}
}
pub const SERVICE_NAME: &str = "interchain_security.ccv.consumer.v1.Query";
impl<T> tonic::server::NamedService for QueryServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<super::super::v1::ConsumerParams>,
#[prost(string, tag = "2")]
pub provider_client_id: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub provider_channel_id: ::prost::alloc::string::String,
#[prost(bool, tag = "4")]
pub new_chain: bool,
#[deprecated]
#[prost(message, optional, tag = "5")]
pub provider_client_state: ::core::option::Option<
super::super::super::super::ibc::lightclients::tendermint::v1::ClientState,
>,
#[deprecated]
#[prost(message, optional, tag = "6")]
pub provider_consensus_state: ::core::option::Option<
super::super::super::super::ibc::lightclients::tendermint::v1::ConsensusState,
>,
#[prost(message, repeated, tag = "7")]
pub maturing_packets: ::prost::alloc::vec::Vec<MaturingVscPacket>,
#[deprecated]
#[prost(message, repeated, tag = "8")]
pub initial_val_set: ::prost::alloc::vec::Vec<
::tendermint_proto::abci::ValidatorUpdate,
>,
#[prost(message, repeated, tag = "9")]
pub height_to_valset_update_id: ::prost::alloc::vec::Vec<HeightToValsetUpdateId>,
#[prost(message, repeated, tag = "10")]
pub outstanding_downtime_slashing: ::prost::alloc::vec::Vec<OutstandingDowntime>,
#[prost(message, optional, tag = "11")]
pub pending_consumer_packets: ::core::option::Option<ConsumerPacketDataList>,
#[prost(message, optional, tag = "12")]
pub last_transmission_block_height: ::core::option::Option<
LastTransmissionBlockHeight,
>,
#[prost(bool, tag = "13")]
pub pre_ccv: bool,
#[prost(message, optional, tag = "14")]
pub provider: ::core::option::Option<super::super::v1::ProviderInfo>,
}
impl ::prost::Name for GenesisState {
const NAME: &'static str = "GenesisState";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.GenesisState".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.GenesisState".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct HeightToValsetUpdateId {
#[prost(uint64, tag = "1")]
pub height: u64,
#[prost(uint64, tag = "2")]
pub valset_update_id: u64,
}
impl ::prost::Name for HeightToValsetUpdateId {
const NAME: &'static str = "HeightToValsetUpdateID";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.HeightToValsetUpdateID".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.HeightToValsetUpdateID".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct OutstandingDowntime {
#[prost(string, tag = "1")]
pub validator_consensus_address: ::prost::alloc::string::String,
}
impl ::prost::Name for OutstandingDowntime {
const NAME: &'static str = "OutstandingDowntime";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.OutstandingDowntime".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.OutstandingDowntime".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct LastTransmissionBlockHeight {
#[prost(int64, tag = "1")]
pub height: i64,
}
impl ::prost::Name for LastTransmissionBlockHeight {
const NAME: &'static str = "LastTransmissionBlockHeight";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.LastTransmissionBlockHeight".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MaturingVscPacket {
#[prost(uint64, tag = "1")]
pub vsc_id: u64,
#[prost(message, optional, tag = "2")]
pub maturity_time: ::core::option::Option<
::tendermint_proto::google::protobuf::Timestamp,
>,
}
impl ::prost::Name for MaturingVscPacket {
const NAME: &'static str = "MaturingVSCPacket";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.MaturingVSCPacket".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.MaturingVSCPacket".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsumerPacketDataList {
#[prost(message, repeated, tag = "1")]
pub list: ::prost::alloc::vec::Vec<super::super::v1::ConsumerPacketData>,
}
impl ::prost::Name for ConsumerPacketDataList {
const NAME: &'static str = "ConsumerPacketDataList";
const PACKAGE: &'static str = "interchain_security.ccv.consumer.v1";
fn full_name() -> ::prost::alloc::string::String {
"interchain_security.ccv.consumer.v1.ConsumerPacketDataList".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/interchain_security.ccv.consumer.v1.ConsumerPacketDataList".into()
}
}