/// ConnectionEnd defines a stateful object on a chain connected to another /// separate one. /// NOTE: there must only be 2 defined ConnectionEnds to establish /// a connection between two chains. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionEnd { /// client associated with this connection. #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, /// IBC version which can be utilised to determine encodings or protocols for /// channels or packets utilising this connection. #[prost(message, repeated, tag = "2")] pub versions: ::prost::alloc::vec::Vec, /// current state of the connection end. #[prost(enumeration = "State", tag = "3")] pub state: i32, /// counterparty chain associated with this connection. #[prost(message, optional, tag = "4")] pub counterparty: ::core::option::Option, /// delay period that must pass before a consensus state can be used for /// packet-verification NOTE: delay period logic is only implemented by some /// clients. #[prost(uint64, tag = "5")] pub delay_period: u64, } /// IdentifiedConnection defines a connection with additional connection /// identifier field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IdentifiedConnection { /// connection identifier. #[prost(string, tag = "1")] pub id: ::prost::alloc::string::String, /// client associated with this connection. #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, /// IBC version which can be utilised to determine encodings or protocols for /// channels or packets utilising this connection #[prost(message, repeated, tag = "3")] pub versions: ::prost::alloc::vec::Vec, /// current state of the connection end. #[prost(enumeration = "State", tag = "4")] pub state: i32, /// counterparty chain associated with this connection. #[prost(message, optional, tag = "5")] pub counterparty: ::core::option::Option, /// delay period associated with this connection. #[prost(uint64, tag = "6")] pub delay_period: u64, } /// Counterparty defines the counterparty chain associated with a connection end. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Counterparty { /// identifies the client on the counterparty chain associated with a given /// connection. #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, /// identifies the connection end on the counterparty chain associated with a /// given connection. #[prost(string, tag = "2")] pub connection_id: ::prost::alloc::string::String, /// commitment merkle prefix of the counterparty chain. #[prost(message, optional, tag = "3")] pub prefix: ::core::option::Option, } /// ClientPaths define all the connection paths for a client state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientPaths { /// list of connection paths #[prost(string, repeated, tag = "1")] pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// ConnectionPaths define all the connection paths for a given client state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ConnectionPaths { /// client state unique identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, /// list of connection paths #[prost(string, repeated, tag = "2")] pub paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Version defines the versioning scheme used to negotiate the IBC verison in /// the connection handshake. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Version { /// unique version identifier #[prost(string, tag = "1")] pub identifier: ::prost::alloc::string::String, /// list of features compatible with the specified identifier #[prost(string, repeated, tag = "2")] pub features: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// Params defines the set of Connection parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { /// maximum expected time per block (in nanoseconds), used to enforce block delay. This parameter should reflect the /// largest amount of time that the chain might reasonably take to produce the next block under normal operating /// conditions. A safe choice is 3-5x the expected time per block. #[prost(uint64, tag = "1")] pub max_expected_time_per_block: u64, } /// State defines if a connection is in one of the following states: /// INIT, TRYOPEN, OPEN or UNINITIALIZED. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { /// Default State UninitializedUnspecified = 0, /// A connection end has just started the opening handshake. Init = 1, /// A connection end has acknowledged the handshake step on the counterparty /// chain. Tryopen = 2, /// A connection end has completed the handshake. Open = 3, } impl State { /// String value of the enum field names used in the ProtoBuf definition. /// /// The values are not transformed in any way and thus are considered stable /// (if the ProtoBuf definition does not change) and safe for programmatic use. pub fn as_str_name(&self) -> &'static str { match self { State::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", State::Init => "STATE_INIT", State::Tryopen => "STATE_TRYOPEN", State::Open => "STATE_OPEN", } } /// Creates an enum from field names used in the ProtoBuf definition. pub fn from_str_name(value: &str) -> ::core::option::Option { match value { "STATE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), "STATE_INIT" => Some(Self::Init), "STATE_TRYOPEN" => Some(Self::Tryopen), "STATE_OPEN" => Some(Self::Open), _ => None, } } } /// GenesisState defines the ibc connection submodule's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GenesisState { #[prost(message, repeated, tag = "1")] pub connections: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "2")] pub client_connection_paths: ::prost::alloc::vec::Vec, /// the sequence for the next generated connection identifier #[prost(uint64, tag = "3")] pub next_connection_sequence: u64, #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } /// QueryConnectionRequest is the request type for the Query/Connection RPC /// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionRequest { /// connection unique identifier #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, } /// QueryConnectionResponse is the response type for the Query/Connection RPC /// method. Besides the connection end, it includes a proof and the height from /// which the proof was retrieved. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionResponse { /// connection associated with the request identifier #[prost(message, optional, tag = "1")] pub connection: ::core::option::Option, /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] pub proof: ::prost::alloc::vec::Vec, /// height at which the proof was retrieved #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } /// QueryConnectionsRequest is the request type for the Query/Connections RPC /// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsRequest { #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option< super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, } /// QueryConnectionsResponse is the response type for the Query/Connections RPC /// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionsResponse { /// list of stored connections of the chain. #[prost(message, repeated, tag = "1")] pub connections: ::prost::alloc::vec::Vec, /// pagination response #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option< super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, /// query block height #[prost(message, optional, tag = "3")] pub height: ::core::option::Option, } /// QueryClientConnectionsRequest is the request type for the /// Query/ClientConnections RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsRequest { /// client identifier associated with a connection #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, } /// QueryClientConnectionsResponse is the response type for the /// Query/ClientConnections RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryClientConnectionsResponse { /// slice of all the connection paths associated with a client. #[prost(string, repeated, tag = "1")] pub connection_paths: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] pub proof: ::prost::alloc::vec::Vec, /// height at which the proof was generated #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } /// QueryConnectionClientStateRequest is the request type for the /// Query/ConnectionClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateRequest { /// connection identifier #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, } /// QueryConnectionClientStateResponse is the response type for the /// Query/ConnectionClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionClientStateResponse { /// client state associated with the channel #[prost(message, optional, tag = "1")] pub identified_client_state: ::core::option::Option, /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] pub proof: ::prost::alloc::vec::Vec, /// height at which the proof was retrieved #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } /// QueryConnectionConsensusStateRequest is the request type for the /// Query/ConnectionConsensusState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateRequest { /// connection identifier #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, #[prost(uint64, tag = "2")] pub revision_number: u64, #[prost(uint64, tag = "3")] pub revision_height: u64, } /// QueryConnectionConsensusStateResponse is the response type for the /// Query/ConnectionConsensusState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionConsensusStateResponse { /// consensus state associated with the channel #[prost(message, optional, tag = "1")] pub consensus_state: ::core::option::Option<::prost_types::Any>, /// client ID associated with the consensus state #[prost(string, tag = "2")] pub client_id: ::prost::alloc::string::String, /// merkle proof of existence #[prost(bytes = "vec", tag = "3")] pub proof: ::prost::alloc::vec::Vec, /// height at which the proof was retrieved #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, } /// QueryConnectionParamsRequest is the request type for the Query/ConnectionParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsRequest {} /// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConnectionParamsResponse { /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + 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( inner: T, interceptor: F, ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// Connection queries an IBC connection end. pub async fn connection( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/Connection"); self.inner.unary(request.into_request(), path, codec).await } /// Connections queries all the IBC connections of a chain. pub async fn connections( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/Connections"); self.inner.unary(request.into_request(), path, codec).await } /// ClientConnections queries the connection paths associated with a client /// state. pub async fn client_connections( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/ClientConnections", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionClientState queries the client state associated with the /// connection. pub async fn connection_client_state( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/ConnectionClientState", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionConsensusState queries the consensus state associated with the /// connection. pub async fn connection_consensus_state( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/ConnectionConsensusState", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionParams queries all parameters of the ibc connection submodule. pub async fn connection_params( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Query/ConnectionParams", ); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod query_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { /// Connection queries an IBC connection end. async fn connection( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// Connections queries all the IBC connections of a chain. async fn connections( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ClientConnections queries the connection paths associated with a client /// state. async fn client_connections( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionClientState queries the client state associated with the /// connection. async fn connection_client_state( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionConsensusState queries the consensus state associated with the /// connection. async fn connection_consensus_state( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionParams queries all parameters of the ibc connection submodule. async fn connection_params( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Query provides defines the gRPC querier service #[derive(Debug)] pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for QueryServer where T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/ibc.core.connection.v1.Query/Connection" => { #[allow(non_camel_case_types)] struct ConnectionSvc(pub Arc); impl tonic::server::UnaryService for ConnectionSvc { type Response = super::QueryConnectionResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Query/Connections" => { #[allow(non_camel_case_types)] struct ConnectionsSvc(pub Arc); impl tonic::server::UnaryService for ConnectionsSvc { type Response = super::QueryConnectionsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connections(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Query/ClientConnections" => { #[allow(non_camel_case_types)] struct ClientConnectionsSvc(pub Arc); impl tonic::server::UnaryService for ClientConnectionsSvc { type Response = super::QueryClientConnectionsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).client_connections(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ClientConnectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Query/ConnectionClientState" => { #[allow(non_camel_case_types)] struct ConnectionClientStateSvc(pub Arc); impl tonic::server::UnaryService for ConnectionClientStateSvc { type Response = super::QueryConnectionClientStateResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_client_state(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionClientStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Query/ConnectionConsensusState" => { #[allow(non_camel_case_types)] struct ConnectionConsensusStateSvc(pub Arc); impl tonic::server::UnaryService for ConnectionConsensusStateSvc { type Response = super::QueryConnectionConsensusStateResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_consensus_state(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionConsensusStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Query/ConnectionParams" => { #[allow(non_camel_case_types)] struct ConnectionParamsSvc(pub Arc); impl tonic::server::UnaryService for ConnectionParamsSvc { type Response = super::QueryConnectionParamsResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_params(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for QueryServer { const NAME: &'static str = "ibc.core.connection.v1.Query"; } } /// MsgConnectionOpenInit defines the msg sent by an account on Chain A to /// initialize a connection with Chain B. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInit { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] pub counterparty: ::core::option::Option, #[prost(message, optional, tag = "3")] pub version: ::core::option::Option, #[prost(uint64, tag = "4")] pub delay_period: u64, #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, } /// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response /// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenInitResponse {} /// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a /// connection on Chain B. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTry { #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, /// Deprecated: this field is unused. Crossing hellos are no longer supported in core IBC. #[deprecated] #[prost(string, tag = "2")] pub previous_connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] pub client_state: ::core::option::Option<::prost_types::Any>, #[prost(message, optional, tag = "4")] pub counterparty: ::core::option::Option, #[prost(uint64, tag = "5")] pub delay_period: u64, #[prost(message, repeated, tag = "6")] pub counterparty_versions: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "7")] pub proof_height: ::core::option::Option, /// proof of the initialization the connection on Chain A: `UNITIALIZED -> /// INIT` #[prost(bytes = "vec", tag = "8")] pub proof_init: ::prost::alloc::vec::Vec, /// proof of client state included in message #[prost(bytes = "vec", tag = "9")] pub proof_client: ::prost::alloc::vec::Vec, /// proof of client consensus state #[prost(bytes = "vec", tag = "10")] pub proof_consensus: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "11")] pub consensus_height: ::core::option::Option, #[prost(string, tag = "12")] pub signer: ::prost::alloc::string::String, /// optional proof data for host state machines that are unable to introspect their own consensus state #[prost(bytes = "vec", tag = "13")] pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenTryResponse {} /// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to /// acknowledge the change of connection state to TRYOPEN on Chain B. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAck { #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub counterparty_connection_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "3")] pub version: ::core::option::Option, #[prost(message, optional, tag = "4")] pub client_state: ::core::option::Option<::prost_types::Any>, #[prost(message, optional, tag = "5")] pub proof_height: ::core::option::Option, /// proof of the initialization the connection on Chain B: `UNITIALIZED -> /// TRYOPEN` #[prost(bytes = "vec", tag = "6")] pub proof_try: ::prost::alloc::vec::Vec, /// proof of client state included in message #[prost(bytes = "vec", tag = "7")] pub proof_client: ::prost::alloc::vec::Vec, /// proof of client consensus state #[prost(bytes = "vec", tag = "8")] pub proof_consensus: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "9")] pub consensus_height: ::core::option::Option, #[prost(string, tag = "10")] pub signer: ::prost::alloc::string::String, /// optional proof data for host state machines that are unable to introspect their own consensus state #[prost(bytes = "vec", tag = "11")] pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenAckResponse {} /// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to /// acknowledge the change of connection state to OPEN on Chain A. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirm { #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, /// proof for the change of the connection state on Chain A: `INIT -> OPEN` #[prost(bytes = "vec", tag = "2")] pub proof_ack: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, #[prost(string, tag = "4")] pub signer: ::prost::alloc::string::String, } /// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm /// response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} /// Generated client implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /// Msg defines the ibc/connection Msg service. #[derive(Debug, Clone)] pub struct MsgClient { inner: tonic::client::Grpc, } #[cfg(feature = "grpc-transport")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where D: std::convert::TryInto, D::Error: Into, { let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; Ok(Self::new(conn)) } } impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, T::ResponseBody: Body + Send + 'static, ::Error: Into + 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(inner: T, interceptor: F) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< http::Request, Response = http::Response< >::ResponseBody, >, >, >>::Error: Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// /// This requires the server to support it otherwise it might respond with an /// error. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.send_compressed(encoding); self } /// Enable decompressing responses. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.inner = self.inner.accept_compressed(encoding); self } /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. pub async fn connection_open_init( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Msg/ConnectionOpenInit", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. pub async fn connection_open_try( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Msg/ConnectionOpenTry", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. pub async fn connection_open_ack( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Msg/ConnectionOpenAck", ); self.inner.unary(request.into_request(), path, codec).await } /// ConnectionOpenConfirm defines a rpc handler method for /// MsgConnectionOpenConfirm. pub async fn connection_open_confirm( &mut self, request: impl tonic::IntoRequest, ) -> Result, 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.core.connection.v1.Msg/ConnectionOpenConfirm", ); self.inner.unary(request.into_request(), path, codec).await } } } /// Generated server implementations. #[cfg(feature = "grpc")] #[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] pub mod msg_server { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] pub trait Msg: Send + Sync + 'static { /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. async fn connection_open_init( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. async fn connection_open_try( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. async fn connection_open_ack( &self, request: tonic::Request, ) -> Result, tonic::Status>; /// ConnectionOpenConfirm defines a rpc handler method for /// MsgConnectionOpenConfirm. async fn connection_open_confirm( &self, request: tonic::Request, ) -> Result, tonic::Status>; } /// Msg defines the ibc/connection Msg service. #[derive(Debug)] pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, } struct _Inner(Arc); impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } pub fn from_arc(inner: Arc) -> Self { let inner = _Inner(inner); Self { inner, accept_compression_encodings: Default::default(), send_compression_encodings: Default::default(), } } pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService where F: tonic::service::Interceptor, { InterceptedService::new(Self::new(inner), interceptor) } /// Enable decompressing requests with the given encoding. #[must_use] pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { self.accept_compression_encodings.enable(encoding); self } /// Compress responses with the given encoding, if the client supports it. #[must_use] pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { self.send_compression_encodings.enable(encoding); self } } impl tonic::codegen::Service> for MsgServer where T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { "/ibc.core.connection.v1.Msg/ConnectionOpenInit" => { #[allow(non_camel_case_types)] struct ConnectionOpenInitSvc(pub Arc); impl tonic::server::UnaryService for ConnectionOpenInitSvc { type Response = super::MsgConnectionOpenInitResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_open_init(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionOpenInitSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Msg/ConnectionOpenTry" => { #[allow(non_camel_case_types)] struct ConnectionOpenTrySvc(pub Arc); impl tonic::server::UnaryService for ConnectionOpenTrySvc { type Response = super::MsgConnectionOpenTryResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_open_try(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionOpenTrySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Msg/ConnectionOpenAck" => { #[allow(non_camel_case_types)] struct ConnectionOpenAckSvc(pub Arc); impl tonic::server::UnaryService for ConnectionOpenAckSvc { type Response = super::MsgConnectionOpenAckResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_open_ack(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionOpenAckSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm" => { #[allow(non_camel_case_types)] struct ConnectionOpenConfirmSvc(pub Arc); impl tonic::server::UnaryService for ConnectionOpenConfirmSvc { type Response = super::MsgConnectionOpenConfirmResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, request: tonic::Request, ) -> Self::Future { let inner = self.0.clone(); let fut = async move { (*inner).connection_open_confirm(request).await }; Box::pin(fut) } } let accept_compression_encodings = self.accept_compression_encodings; let send_compression_encodings = self.send_compression_encodings; let inner = self.inner.clone(); let fut = async move { let inner = inner.0; let method = ConnectionOpenConfirmSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( accept_compression_encodings, send_compression_encodings, ); let res = grpc.unary(method, req).await; Ok(res) }; Box::pin(fut) } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) .header("grpc-status", "12") .header("content-type", "application/grpc") .body(empty_body()) .unwrap()) }), } } } impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { inner, accept_compression_encodings: self.accept_compression_encodings, send_compression_encodings: self.send_compression_encodings, } } } impl Clone for _Inner { fn clone(&self) -> Self { Self(self.0.clone()) } } impl std::fmt::Debug for _Inner { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!(f, "{:?}", self.0) } } impl tonic::server::NamedService for MsgServer { const NAME: &'static str = "ibc.core.connection.v1.Msg"; } }