#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClassTrace {
#[prost(string, tag = "1")]
pub path: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub base_class_id: ::prost::alloc::string::String,
}
impl ::prost::Name for ClassTrace {
const NAME: &'static str = "ClassTrace";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Params {
#[prost(bool, tag = "1")]
pub send_enabled: bool,
#[prost(bool, tag = "2")]
pub receive_enabled: bool,
}
impl ::prost::Name for Params {
const NAME: &'static str = "Params";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTransfer {
#[prost(string, tag = "1")]
pub source_port: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub source_channel: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_id: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "4")]
pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "5")]
pub sender: ::prost::alloc::string::String,
#[prost(string, tag = "6")]
pub receiver: ::prost::alloc::string::String,
#[prost(message, optional, tag = "7")]
pub timeout_height: ::core::option::Option<
super::super::super::core::client::v1::Height,
>,
#[prost(uint64, tag = "8")]
pub timeout_timestamp: u64,
#[prost(string, tag = "9")]
pub memo: ::prost::alloc::string::String,
}
impl ::prost::Name for MsgTransfer {
const NAME: &'static str = "MsgTransfer";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgTransferResponse {
#[prost(uint64, tag = "1")]
pub sequence: u64,
}
impl ::prost::Name for MsgTransferResponse {
const NAME: &'static str = "MsgTransferResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[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<Params>,
}
impl ::prost::Name for MsgUpdateParams {
const NAME: &'static str = "MsgUpdateParams";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MsgUpdateParamsResponse {}
impl ::prost::Name for MsgUpdateParamsResponse {
const NAME: &'static str = "MsgUpdateParamsResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[cfg(feature = "client")]
pub mod msg_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 MsgClient<T> {
inner: tonic::client::Grpc<T>,
}
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::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,
) -> MsgClient<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,
{
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 transfer(
&mut self,
request: impl tonic::IntoRequest<super::MsgTransfer>,
) -> std::result::Result<
tonic::Response<super::MsgTransferResponse>,
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(
"/ibc.applications.nft_transfer.v1.Msg/Transfer",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("ibc.applications.nft_transfer.v1.Msg", "Transfer"),
);
self.inner.unary(req, path, codec).await
}
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::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ibc.applications.nft_transfer.v1.Msg/UpdateParams",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"ibc.applications.nft_transfer.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::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Msg: Send + Sync + 'static {
async fn transfer(
&self,
request: tonic::Request<super::MsgTransfer>,
) -> std::result::Result<
tonic::Response<super::MsgTransferResponse>,
tonic::Status,
>;
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: Msg> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Msg> MsgServer<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(),
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 + 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<std::result::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() {
"/ibc.applications.nft_transfer.v1.Msg/Transfer" => {
#[allow(non_camel_case_types)]
struct TransferSvc<T: Msg>(pub Arc<T>);
impl<T: Msg> tonic::server::UnaryService<super::MsgTransfer>
for TransferSvc<T> {
type Response = super::MsgTransferResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::MsgTransfer>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Msg>::transfer(&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 inner = inner.0;
let method = TransferSvc(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.applications.nft_transfer.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 inner = inner.0;
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 {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Msg> 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,
}
}
}
impl<T: Msg> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
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: Msg> tonic::server::NamedService for MsgServer<T> {
const NAME: &'static str = "ibc.applications.nft_transfer.v1.Msg";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NonFungibleTokenPacketData {
#[prost(string, tag = "1")]
pub class_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub class_uri: ::prost::alloc::string::String,
#[prost(string, tag = "3")]
pub class_data: ::prost::alloc::string::String,
#[prost(string, repeated, tag = "4")]
pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "5")]
pub token_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, repeated, tag = "6")]
pub token_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
#[prost(string, tag = "7")]
pub sender: ::prost::alloc::string::String,
#[prost(string, tag = "8")]
pub receiver: ::prost::alloc::string::String,
#[prost(string, tag = "9")]
pub memo: ::prost::alloc::string::String,
}
impl ::prost::Name for NonFungibleTokenPacketData {
const NAME: &'static str = "NonFungibleTokenPacketData";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassTraceRequest {
#[prost(string, tag = "1")]
pub hash: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryClassTraceRequest {
const NAME: &'static str = "QueryClassTraceRequest";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassTraceResponse {
#[prost(message, optional, tag = "1")]
pub class_trace: ::core::option::Option<ClassTrace>,
}
impl ::prost::Name for QueryClassTraceResponse {
const NAME: &'static str = "QueryClassTraceResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassTracesRequest {
#[prost(message, optional, tag = "1")]
pub pagination: ::core::option::Option<
super::super::super::super::cosmos::base::query::v1beta1::PageRequest,
>,
}
impl ::prost::Name for QueryClassTracesRequest {
const NAME: &'static str = "QueryClassTracesRequest";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassTracesResponse {
#[prost(message, repeated, tag = "1")]
pub class_traces: ::prost::alloc::vec::Vec<ClassTrace>,
#[prost(message, optional, tag = "2")]
pub pagination: ::core::option::Option<
super::super::super::super::cosmos::base::query::v1beta1::PageResponse,
>,
}
impl ::prost::Name for QueryClassTracesResponse {
const NAME: &'static str = "QueryClassTracesResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassHashRequest {
#[prost(string, tag = "1")]
pub trace: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryClassHashRequest {
const NAME: &'static str = "QueryClassHashRequest";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryClassHashResponse {
#[prost(string, tag = "1")]
pub hash: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryClassHashResponse {
const NAME: &'static str = "QueryClassHashResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryEscrowAddressRequest {
#[prost(string, tag = "1")]
pub port_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub channel_id: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryEscrowAddressRequest {
const NAME: &'static str = "QueryEscrowAddressRequest";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryEscrowAddressResponse {
#[prost(string, tag = "1")]
pub escrow_address: ::prost::alloc::string::String,
}
impl ::prost::Name for QueryEscrowAddressResponse {
const NAME: &'static str = "QueryEscrowAddressResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsRequest {}
impl ::prost::Name for QueryParamsRequest {
const NAME: &'static str = "QueryParamsRequest";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct QueryParamsResponse {
#[prost(message, optional, tag = "1")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for QueryParamsResponse {
const NAME: &'static str = "QueryParamsResponse";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}
#[cfg(feature = "client")]
pub mod query_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 QueryClient<T> {
inner: tonic::client::Grpc<T>,
}
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::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,
) -> QueryClient<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,
{
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 class_trace(
&mut self,
request: impl tonic::IntoRequest<super::QueryClassTraceRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassTraceResponse>,
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(
"/ibc.applications.nft_transfer.v1.Query/ClassTrace",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"ibc.applications.nft_transfer.v1.Query",
"ClassTrace",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn class_traces(
&mut self,
request: impl tonic::IntoRequest<super::QueryClassTracesRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassTracesResponse>,
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(
"/ibc.applications.nft_transfer.v1.Query/ClassTraces",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"ibc.applications.nft_transfer.v1.Query",
"ClassTraces",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn class_hash(
&mut self,
request: impl tonic::IntoRequest<super::QueryClassHashRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassHashResponse>,
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(
"/ibc.applications.nft_transfer.v1.Query/ClassHash",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"ibc.applications.nft_transfer.v1.Query",
"ClassHash",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn escrow_address(
&mut self,
request: impl tonic::IntoRequest<super::QueryEscrowAddressRequest>,
) -> std::result::Result<
tonic::Response<super::QueryEscrowAddressResponse>,
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(
"/ibc.applications.nft_transfer.v1.Query/EscrowAddress",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new(
"ibc.applications.nft_transfer.v1.Query",
"EscrowAddress",
),
);
self.inner.unary(req, path, codec).await
}
pub async fn 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::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/ibc.applications.nft_transfer.v1.Query/Params",
);
let mut req = request.into_request();
req.extensions_mut()
.insert(
GrpcMethod::new("ibc.applications.nft_transfer.v1.Query", "Params"),
);
self.inner.unary(req, path, codec).await
}
}
}
#[cfg(feature = "server")]
pub mod query_server {
#![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)]
use tonic::codegen::*;
#[async_trait]
pub trait Query: Send + Sync + 'static {
async fn class_trace(
&self,
request: tonic::Request<super::QueryClassTraceRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassTraceResponse>,
tonic::Status,
>;
async fn class_traces(
&self,
request: tonic::Request<super::QueryClassTracesRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassTracesResponse>,
tonic::Status,
>;
async fn class_hash(
&self,
request: tonic::Request<super::QueryClassHashRequest>,
) -> std::result::Result<
tonic::Response<super::QueryClassHashResponse>,
tonic::Status,
>;
async fn escrow_address(
&self,
request: tonic::Request<super::QueryEscrowAddressRequest>,
) -> std::result::Result<
tonic::Response<super::QueryEscrowAddressResponse>,
tonic::Status,
>;
async fn params(
&self,
request: tonic::Request<super::QueryParamsRequest>,
) -> std::result::Result<
tonic::Response<super::QueryParamsResponse>,
tonic::Status,
>;
}
#[derive(Debug)]
pub struct QueryServer<T: Query> {
inner: _Inner<T>,
accept_compression_encodings: EnabledCompressionEncodings,
send_compression_encodings: EnabledCompressionEncodings,
max_decoding_message_size: Option<usize>,
max_encoding_message_size: Option<usize>,
}
struct _Inner<T>(Arc<T>);
impl<T: Query> QueryServer<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(),
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 + 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<std::result::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() {
"/ibc.applications.nft_transfer.v1.Query/ClassTrace" => {
#[allow(non_camel_case_types)]
struct ClassTraceSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryClassTraceRequest>
for ClassTraceSvc<T> {
type Response = super::QueryClassTraceResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryClassTraceRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::class_trace(&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 inner = inner.0;
let method = ClassTraceSvc(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.applications.nft_transfer.v1.Query/ClassTraces" => {
#[allow(non_camel_case_types)]
struct ClassTracesSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryClassTracesRequest>
for ClassTracesSvc<T> {
type Response = super::QueryClassTracesResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryClassTracesRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::class_traces(&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 inner = inner.0;
let method = ClassTracesSvc(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.applications.nft_transfer.v1.Query/ClassHash" => {
#[allow(non_camel_case_types)]
struct ClassHashSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryClassHashRequest>
for ClassHashSvc<T> {
type Response = super::QueryClassHashResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryClassHashRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::class_hash(&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 inner = inner.0;
let method = ClassHashSvc(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.applications.nft_transfer.v1.Query/EscrowAddress" => {
#[allow(non_camel_case_types)]
struct EscrowAddressSvc<T: Query>(pub Arc<T>);
impl<
T: Query,
> tonic::server::UnaryService<super::QueryEscrowAddressRequest>
for EscrowAddressSvc<T> {
type Response = super::QueryEscrowAddressResponse;
type Future = BoxFuture<
tonic::Response<Self::Response>,
tonic::Status,
>;
fn call(
&mut self,
request: tonic::Request<super::QueryEscrowAddressRequest>,
) -> Self::Future {
let inner = Arc::clone(&self.0);
let fut = async move {
<T as Query>::escrow_address(&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 inner = inner.0;
let method = EscrowAddressSvc(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.applications.nft_transfer.v1.Query/Params" => {
#[allow(non_camel_case_types)]
struct ParamsSvc<T: Query>(pub Arc<T>);
impl<T: Query> tonic::server::UnaryService<super::QueryParamsRequest>
for ParamsSvc<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>::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 inner = inner.0;
let method = ParamsSvc(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 {
Ok(
http::Response::builder()
.status(200)
.header("grpc-status", "12")
.header("content-type", "application/grpc")
.body(empty_body())
.unwrap(),
)
})
}
}
}
}
impl<T: Query> 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,
}
}
}
impl<T: Query> Clone for _Inner<T> {
fn clone(&self) -> Self {
Self(Arc::clone(&self.0))
}
}
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: Query> tonic::server::NamedService for QueryServer<T> {
const NAME: &'static str = "ibc.applications.nft_transfer.v1.Query";
}
}
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct GenesisState {
#[prost(string, tag = "1")]
pub port_id: ::prost::alloc::string::String,
#[prost(message, repeated, tag = "2")]
pub traces: ::prost::alloc::vec::Vec<ClassTrace>,
#[prost(message, optional, tag = "3")]
pub params: ::core::option::Option<Params>,
}
impl ::prost::Name for GenesisState {
const NAME: &'static str = "GenesisState";
const PACKAGE: &'static str = "ibc.applications.nft_transfer.v1";
fn full_name() -> ::prost::alloc::string::String {
::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME)
}
}