#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgStoreCode {
#[prost(string, tag = "1")]
pub signer: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub wasm_byte_code: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for MsgStoreCode {
const NAME: &'static str = "MsgStoreCode";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgStoreCode".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgStoreCode".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgStoreCodeResponse {
#[prost(bytes = "vec", tag = "1")]
pub checksum: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for MsgStoreCodeResponse {
const NAME: &'static str = "MsgStoreCodeResponse";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgStoreCodeResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgStoreCodeResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgRemoveChecksum {
#[prost(string, tag = "1")]
pub signer: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "2")]
pub checksum: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for MsgRemoveChecksum {
const NAME: &'static str = "MsgRemoveChecksum";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgRemoveChecksum".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgRemoveChecksum".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgRemoveChecksumResponse {}
impl ::prost::Name for MsgRemoveChecksumResponse {
const NAME: &'static str = "MsgRemoveChecksumResponse";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgMigrateContract {
#[prost(string, tag = "1")]
pub signer: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub client_id: ::prost::alloc::string::String,
#[prost(bytes = "vec", tag = "3")]
pub checksum: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "4")]
pub msg: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for MsgMigrateContract {
const NAME: &'static str = "MsgMigrateContract";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgMigrateContract".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgMigrateContract".into()
}
}
#[derive(Clone, Copy, PartialEq, ::prost::Message)]
pub struct MsgMigrateContractResponse {}
impl ::prost::Name for MsgMigrateContractResponse {
const NAME: &'static str = "MsgMigrateContractResponse";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.MsgMigrateContractResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.MsgMigrateContractResponse".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 store_code(
&mut self,
request: impl tonic::IntoRequest<super::MsgStoreCode>,
) -> std::result::Result<
tonic::Response<super::MsgStoreCodeResponse>,
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(
"/ibc.lightclients.wasm.v1.Msg/StoreCode",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "StoreCode"));
self.inner.unary(req, path, codec).await
}
pub async fn remove_checksum(
&mut self,
request: impl tonic::IntoRequest<super::MsgRemoveChecksum>,
) -> std::result::Result<
tonic::Response<super::MsgRemoveChecksumResponse>,
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(
"/ibc.lightclients.wasm.v1.Msg/RemoveChecksum",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "RemoveChecksum"),
);
self.inner.unary(req, path, codec).await
}
pub async fn migrate_contract(
&mut self,
request: impl tonic::IntoRequest<super::MsgMigrateContract>,
) -> std::result::Result<
tonic::Response<super::MsgMigrateContractResponse>,
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(
"/ibc.lightclients.wasm.v1.Msg/MigrateContract",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "MigrateContract"),
);
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 store_code(
&self,
request: tonic::Request<super::MsgStoreCode>,
) -> std::result::Result<
tonic::Response<super::MsgStoreCodeResponse>,
tonic::Status,
>;
async fn remove_checksum(
&self,
request: tonic::Request<super::MsgRemoveChecksum>,
) -> std::result::Result<
tonic::Response<super::MsgRemoveChecksumResponse>,
tonic::Status,
>;
async fn migrate_contract(
&self,
request: tonic::Request<super::MsgMigrateContract>,
) -> std::result::Result<
tonic::Response<super::MsgMigrateContractResponse>,
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() {
"/ibc.lightclients.wasm.v1.Msg/StoreCode" => {
#[allow(non_camel_case_types)]
struct StoreCodeSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgStoreCode>
for StoreCodeSvc<T> {
type Response = super::MsgStoreCodeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgStoreCode>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::store_code(&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 = StoreCodeSvc(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)
}
"/ibc.lightclients.wasm.v1.Msg/RemoveChecksum" => {
#[allow(non_camel_case_types)]
struct RemoveChecksumSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgRemoveChecksum>
for RemoveChecksumSvc<T> {
type Response = super::MsgRemoveChecksumResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgRemoveChecksum>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::remove_checksum(&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 = RemoveChecksumSvc(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)
}
"/ibc.lightclients.wasm.v1.Msg/MigrateContract" => {
#[allow(non_camel_case_types)]
struct MigrateContractSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgMigrateContract>
for MigrateContractSvc<T> {
type Response = super::MsgMigrateContractResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgMigrateContract>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::migrate_contract(&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 = MigrateContractSvc(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 = "ibc.lightclients.wasm.v1.Msg";
impl<T> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = SERVICE_NAME;
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryChecksumsRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<
super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryChecksumsRequest {
const NAME: &'static str = "QueryChecksumsRequest";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.QueryChecksumsRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.QueryChecksumsRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryChecksumsResponse {
#[prost(string, repeated, tag = "1")]
pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryChecksumsResponse {
const NAME: &'static str = "QueryChecksumsResponse";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.QueryChecksumsResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.QueryChecksumsResponse".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryCodeRequest {
#[prost(string, tag = "1")]
pub checksum: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryCodeRequest {
const NAME: &'static str = "QueryCodeRequest";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.QueryCodeRequest".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.QueryCodeRequest".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryCodeResponse {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for QueryCodeResponse {
const NAME: &'static str = "QueryCodeResponse";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.QueryCodeResponse".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.QueryCodeResponse".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 checksums(
&mut self,
request: impl tonic::IntoRequest<super::QueryChecksumsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryChecksumsResponse>,
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(
"/ibc.lightclients.wasm.v1.Query/Checksums",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Checksums"));
self.inner.unary(req, path, codec).await
}
pub async fn code(
&mut self,
request: impl tonic::IntoRequest<super::QueryCodeRequest>,
) -> std::result::Result<
tonic::Response<super::QueryCodeResponse>,
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(
"/ibc.lightclients.wasm.v1.Query/Code",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Code"));
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 checksums(
&self,
request: tonic::Request<super::QueryChecksumsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryChecksumsResponse>,
tonic::Status,
>;
async fn code(
&self,
request: tonic::Request<super::QueryCodeRequest>,
) -> std::result::Result<
tonic::Response<super::QueryCodeResponse>,
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() {
"/ibc.lightclients.wasm.v1.Query/Checksums" => {
#[allow(non_camel_case_types)]
struct ChecksumsSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryChecksumsRequest>
for ChecksumsSvc<T> {
type Response = super::QueryChecksumsResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryChecksumsRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::checksums(&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 = ChecksumsSvc(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)
}
"/ibc.lightclients.wasm.v1.Query/Code" => {
#[allow(non_camel_case_types)]
struct CodeSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryCodeRequest>
for CodeSvc<T> {
type Response = super::QueryCodeResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryCodeRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::code(&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 = CodeSvc(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 = "ibc.lightclients.wasm.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, repeated, tag = "1")]
pub contracts: ::prost::alloc::vec::Vec<Contract>,
}
impl ::prost::Name for GenesisState {
const NAME: &'static str = "GenesisState";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.GenesisState".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.GenesisState".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Contract {
#[prost(bytes = "vec", tag = "1")]
pub code_bytes: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for Contract {
const NAME: &'static str = "Contract";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.Contract".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.Contract".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientState {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
#[prost(bytes = "vec", tag = "2")]
pub checksum: ::prost::alloc::vec::Vec<u8>,
#[prost(message, optional, tag = "3")]
pub latest_height: ::core::option::Option<
super::super::super::core::client::v1::Height,
>,
}
impl ::prost::Name for ClientState {
const NAME: &'static str = "ClientState";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.ClientState".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.ClientState".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ConsensusState {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ConsensusState {
const NAME: &'static str = "ConsensusState";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.ConsensusState".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.ConsensusState".into()
}
}
#[cfg_attr(
all(feature = "json-schema", feature = "serde"),
derive(::schemars::JsonSchema)
)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientMessage {
#[prost(bytes = "vec", tag = "1")]
pub data: ::prost::alloc::vec::Vec<u8>,
}
impl ::prost::Name for ClientMessage {
const NAME: &'static str = "ClientMessage";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.ClientMessage".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.ClientMessage".into()
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Checksums {
#[prost(bytes = "vec", repeated, tag = "1")]
pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec<u8>>,
}
impl ::prost::Name for Checksums {
const NAME: &'static str = "Checksums";
const PACKAGE: &'static str = "ibc.lightclients.wasm.v1";
fn full_name() -> ::prost::alloc::string::String {
"ibc.lightclients.wasm.v1.Checksums".into()
}
fn type_url() -> ::prost::alloc::string::String {
"/ibc.lightclients.wasm.v1.Checksums".into()
}
}