diff --git a/Cargo.toml b/Cargo.toml index 4ccd1005..d940525d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ license = "Apache-2.0" repository = "https://github.com/cosmos/ibc-proto-rs" readme = "README.md" categories = ["cryptography::cryptocurrencies", "encoding", "no-std"] -keywords = ["blockchain", "cosmos", "tendermint", "ibc", "proto"] +keywords = ["blockchain", "cosmos", "interchain", "ibc", "proto"] exclude = ["definitions", "tools", ".changelog", ".github"] description = """ ibc-proto provides Cosmos SDK & IBC Protocol Buffers definitions @@ -47,8 +47,8 @@ scale-info = { version = "2.1.2", default-features = false, features = [ ## For borsh encode or decode, needs to track `anchor-lang` and `near-sdk-rs` borsh version borsh = { version = "0.10", default-features = false, optional = true } -[dependencies.tendermint-proto] -version = "0.34" +[dependencies.cometbft-proto] +version = "0.1.0-alpha.2" default-features = false [dev-dependencies] diff --git a/src/COSMOS_SDK_COMMIT b/src/COSMOS_SDK_COMMIT index 1eef4d5b..eda5dd55 100644 --- a/src/COSMOS_SDK_COMMIT +++ b/src/COSMOS_SDK_COMMIT @@ -1 +1 @@ -2e9e5d6eea24d6c11eddc9c002c66e89ae036187 +7dbed2fc0c3ed7c285645e21cb1037d8810372ae diff --git a/src/lib.rs b/src/lib.rs index bc37dda7..24c3011d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -14,7 +14,7 @@ pub mod google; -pub use tendermint_proto::Protobuf; +pub use cometbft_proto::Protobuf; extern crate alloc; @@ -144,20 +144,6 @@ pub mod cosmos { include_proto!("cosmos.base.tendermint.v1beta1.rs"); } } - pub mod kv { - pub mod v1beta1 { - include_proto!("cosmos.base.kv.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.kv.v1beta1.serde.rs"); - } - } - pub mod snapshots { - pub mod v1beta1 { - include_proto!("cosmos.base.snapshots.v1beta1.rs"); - #[cfg(feature = "serde")] - include_proto!("cosmos.base.snapshots.v1beta1.serde.rs"); - } - } } pub mod crypto { pub mod multisig { diff --git a/src/prost/cosmos.app.v1alpha1.rs b/src/prost/cosmos.app.v1alpha1.rs index b70937bf..ec85bb0b 100644 --- a/src/prost/cosmos.app.v1alpha1.rs +++ b/src/prost/cosmos.app.v1alpha1.rs @@ -51,7 +51,7 @@ pub struct PackageReference { /// /// When a new version of a module is released and items are added to existing /// .proto files, these definitions should contain comments of the form - /// "Since Revision N" where N is an integer revision. + /// "Since: Revision N" where N is an integer revision. /// /// When the module runtime starts up, it will check the pinned proto /// image and panic if there are runtime protobuf definitions that are not diff --git a/src/prost/cosmos.auth.v1beta1.rs b/src/prost/cosmos.auth.v1beta1.rs index b6c3e8d7..ec42e6a6 100644 --- a/src/prost/cosmos.auth.v1beta1.rs +++ b/src/prost/cosmos.auth.v1beta1.rs @@ -81,345 +81,24 @@ impl ::prost::Name for Params { ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 +/// GenesisState defines the auth module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/auth parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, + /// accounts are the accounts present at genesis. + #[prost(message, repeated, tag = "2")] + pub accounts: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) - } -} -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 -#[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"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "cosmos.auth.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the x/auth Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, - } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// UpdateParams defines a (governance) operation for updating the x/auth module - /// parameters. The authority defaults to the x/gov module account. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.auth.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.auth.v1beta1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// UpdateParams defines a (governance) operation for updating the x/auth module - /// parameters. The authority defaults to the x/gov module account. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Msg defines the x/auth Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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() { - "/cosmos.auth.v1beta1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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 = "cosmos.auth.v1beta1.Msg"; - } -} /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. /// /// Since: cosmos-sdk 0.43 @@ -1722,23 +1401,362 @@ pub mod query_server { } "/cosmos.auth.v1beta1.Query/AccountInfo" => { #[allow(non_camel_case_types)] - struct AccountInfoSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AccountInfoSvc { - type Response = super::QueryAccountInfoResponse; + struct AccountInfoSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AccountInfoSvc { + type Response = super::QueryAccountInfoResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::account_info(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountInfoSvc(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 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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 = "cosmos.auth.v1beta1.Query"; + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/auth parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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 = "cosmos.auth.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the x/auth Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// UpdateParams defines a (governance) operation for updating the x/auth module + /// parameters. The authority defaults to the x/gov module account. + /// + /// Since: cosmos-sdk 0.47 + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.auth.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// UpdateParams defines a (governance) operation for updating the x/auth module + /// parameters. The authority defaults to the x/gov module account. + /// + /// Since: cosmos-sdk 0.47 + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the x/auth Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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() { + "/cosmos.auth.v1beta1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::account_info(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -1750,7 +1768,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AccountInfoSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1781,7 +1799,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1793,7 +1811,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1803,25 +1821,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.auth.v1beta1.Query"; - } -} -/// GenesisState defines the auth module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// accounts are the accounts present at genesis. - #[prost(message, repeated, tag = "2")] - pub accounts: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.auth.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.auth.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.auth.v1beta1.Msg"; } } diff --git a/src/prost/cosmos.bank.module.v1.rs b/src/prost/cosmos.bank.module.v1.rs index fe1abca4..68b298e6 100644 --- a/src/prost/cosmos.bank.module.v1.rs +++ b/src/prost/cosmos.bank.module.v1.rs @@ -2,8 +2,8 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { - /// blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. - /// If left empty it defaults to the list of account names supplied in the auth module configuration as + /// blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + /// funds. If left empty it defaults to the list of account names supplied in the auth module configuration as /// module_account_permissions #[prost(string, repeated, tag = "1")] pub blocked_module_accounts_override: ::prost::alloc::vec::Vec< diff --git a/src/prost/cosmos.bank.v1beta1.rs b/src/prost/cosmos.bank.v1beta1.rs index 842fd5c8..5488403c 100644 --- a/src/prost/cosmos.bank.v1beta1.rs +++ b/src/prost/cosmos.bank.v1beta1.rs @@ -1,3 +1,26 @@ +/// SendAuthorization allows the grantee to spend up to spend_limit coins from +/// the granter's account. +/// +/// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SendAuthorization { + #[prost(message, repeated, tag = "1")] + pub spend_limit: ::prost::alloc::vec::Vec, + /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the + /// granter. If omitted, any recipient is allowed. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, repeated, tag = "2")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for SendAuthorization { + const NAME: &'static str = "SendAuthorization"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} /// Params defines the parameters for the bank module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -158,1072 +181,524 @@ impl ::prost::Name for Metadata { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgSend represents a message to send coins from one account to another. +/// GenesisState defines the bank module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSend { - #[prost(string, tag = "1")] - pub from_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub to_address: ::prost::alloc::string::String, +pub struct GenesisState { + /// params defines all the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, + /// balances is an array containing the balances of all the accounts. + #[prost(message, repeated, tag = "2")] + pub balances: ::prost::alloc::vec::Vec, + /// supply represents the total supply. If it is left empty, then supply will be calculated based on the provided + /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, + pub supply: ::prost::alloc::vec::Vec, + /// denom_metadata defines the metadata of the different coins. + #[prost(message, repeated, tag = "4")] + pub denom_metadata: ::prost::alloc::vec::Vec, + /// send_enabled defines the denoms where send is enabled or disabled. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, repeated, tag = "5")] + pub send_enabled: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgSend { - const NAME: &'static str = "MsgSend"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgSendResponse defines the Msg/Send response type. +/// Balance defines an account address and balance pair used in the bank module's +/// genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSendResponse {} -impl ::prost::Name for MsgSendResponse { - const NAME: &'static str = "MsgSendResponse"; +pub struct Balance { + /// address is the address of the balance holder. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// coins defines the different coins this balance holds. + #[prost(message, repeated, tag = "2")] + pub coins: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for Balance { + const NAME: &'static str = "Balance"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +/// QueryBalanceRequest is the request type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgMultiSend { - /// Inputs, despite being `repeated`, only allows one sender input. This is - /// checked in MsgMultiSend's ValidateBasic. - #[prost(message, repeated, tag = "1")] - pub inputs: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub outputs: ::prost::alloc::vec::Vec, +pub struct QueryBalanceRequest { + /// address is the address to query balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// denom is the coin denom to query balances for. + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, } -impl ::prost::Name for MsgMultiSend { - const NAME: &'static str = "MsgMultiSend"; +impl ::prost::Name for QueryBalanceRequest { + const NAME: &'static str = "QueryBalanceRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgMultiSendResponse defines the Msg/MultiSend response type. +/// QueryBalanceResponse is the response type for the Query/Balance RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgMultiSendResponse {} -impl ::prost::Name for MsgMultiSendResponse { - const NAME: &'static str = "MsgMultiSendResponse"; +pub struct QueryBalanceResponse { + /// balance is the balance of the coin. + #[prost(message, optional, tag = "1")] + pub balance: ::core::option::Option, +} +impl ::prost::Name for QueryBalanceResponse { + const NAME: &'static str = "QueryBalanceResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 +/// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). +pub struct QueryAllBalancesRequest { + /// address is the address to query balances for. #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/bank parameters to update. + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, + /// resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. /// - /// NOTE: All parameters must be supplied. + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "3")] + pub resolve_denom: bool, +} +impl ::prost::Name for QueryAllBalancesRequest { + const NAME: &'static str = "QueryAllBalancesRequest"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllBalancesResponse { + /// balances is the balances of all the coins. + #[prost(message, repeated, tag = "1")] + pub balances: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryAllBalancesResponse { + const NAME: &'static str = "QueryAllBalancesResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. +/// QuerySpendableBalancesRequest defines the gRPC request structure for querying +/// an account's spendable balances. /// -/// Since: cosmos-sdk 0.47 +/// Since: cosmos-sdk 0.46 #[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"; +pub struct QuerySpendableBalancesRequest { + /// address is the address to query spendable balances for. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QuerySpendableBalancesRequest { + const NAME: &'static str = "QuerySpendableBalancesRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +/// QuerySpendableBalancesResponse defines the gRPC response structure for querying +/// an account's spendable balances. /// -/// Only entries to add/update/delete need to be included. -/// Existing SendEnabled entries that are not included in this -/// message are left unchanged. +/// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySpendableBalancesResponse { + /// balances is the spendable balances of all the coins. + #[prost(message, repeated, tag = "1")] + pub balances: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QuerySpendableBalancesResponse { + const NAME: &'static str = "QuerySpendableBalancesResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for +/// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSetSendEnabled { +pub struct QuerySpendableBalanceByDenomRequest { + /// address is the address to query balances for. #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// send_enabled is the list of entries to add or update. - #[prost(message, repeated, tag = "2")] - pub send_enabled: ::prost::alloc::vec::Vec, - /// use_default_for is a list of denoms that should use the params.default_send_enabled value. - /// Denoms listed here will have their SendEnabled entries deleted. - /// If a denom is included that doesn't have a SendEnabled entry, - /// it will be ignored. - #[prost(string, repeated, tag = "3")] - pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub address: ::prost::alloc::string::String, + /// denom is the coin denom to query balances for. + #[prost(string, tag = "2")] + pub denom: ::prost::alloc::string::String, } -impl ::prost::Name for MsgSetSendEnabled { - const NAME: &'static str = "MsgSetSendEnabled"; +impl ::prost::Name for QuerySpendableBalanceByDenomRequest { + const NAME: &'static str = "QuerySpendableBalanceByDenomRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +/// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for +/// querying an account's spendable balance for a specific denom. /// /// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSetSendEnabledResponse {} -impl ::prost::Name for MsgSetSendEnabledResponse { - const NAME: &'static str = "MsgSetSendEnabledResponse"; +pub struct QuerySpendableBalanceByDenomResponse { + /// balance is the balance of the coin. + #[prost(message, optional, tag = "1")] + pub balance: ::core::option::Option, +} +impl ::prost::Name for QuerySpendableBalanceByDenomResponse { + const NAME: &'static str = "QuerySpendableBalanceByDenomResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the bank Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, +/// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalSupplyRequest { + /// pagination defines an optional pagination for the request. + /// + /// Since: cosmos-sdk 0.43 + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryTotalSupplyRequest { + const NAME: &'static str = "QueryTotalSupplyRequest"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +} +/// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalSupplyResponse { + /// supply is the supply of the coins + #[prost(message, repeated, tag = "1")] + pub supply: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + /// + /// Since: cosmos-sdk 0.43 + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryTotalSupplyResponse { + const NAME: &'static str = "QueryTotalSupplyResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Send defines a method for sending coins from one account to another account. - pub async fn send( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/Send", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "Send")); - self.inner.unary(req, path, codec).await - } - /// MultiSend defines a method for sending coins from some accounts to other accounts. - pub async fn multi_send( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/MultiSend", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "MultiSend")); - self.inner.unary(req, path, codec).await - } - /// UpdateParams defines a governance operation for updating the x/bank module parameters. - /// The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/UpdateParams", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "UpdateParams")); - self.inner.unary(req, path, codec).await - } - /// SetSendEnabled is a governance operation for setting the SendEnabled flag - /// on any number of Denoms. Only the entries to add or update should be - /// included. Entries that already exist in the store, but that aren't - /// included in this message, will be left unchanged. - /// - /// Since: cosmos-sdk 0.47 - pub async fn set_send_enabled( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.bank.v1beta1.Msg/SetSendEnabled", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "SetSendEnabled")); - self.inner.unary(req, path, codec).await - } +} +/// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySupplyOfRequest { + /// denom is the coin denom to query balances for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +impl ::prost::Name for QuerySupplyOfRequest { + const NAME: &'static str = "QuerySupplyOfRequest"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// Send defines a method for sending coins from one account to another account. - async fn send( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// MultiSend defines a method for sending coins from some accounts to other accounts. - async fn multi_send( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateParams defines a governance operation for updating the x/bank module parameters. - /// The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SetSendEnabled is a governance operation for setting the SendEnabled flag - /// on any number of Denoms. Only the entries to add or update should be - /// included. Entries that already exist in the store, but that aren't - /// included in this message, will be left unchanged. - /// - /// Since: cosmos-sdk 0.47 - async fn set_send_enabled( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; +/// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySupplyOfResponse { + /// amount is the supply of the coin. + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, +} +impl ::prost::Name for QuerySupplyOfResponse { + const NAME: &'static str = "QuerySupplyOfResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - /// Msg defines the bank Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, +} +/// QueryParamsRequest defines the request type for querying x/bank parameters. +#[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 = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - self - } +} +/// QueryParamsResponse defines the response type for querying x/bank parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params provides the parameters of the bank module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - 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() { - "/cosmos.bank.v1beta1.Msg/Send" => { - #[allow(non_camel_case_types)] - struct SendSvc(pub Arc); - impl tonic::server::UnaryService - for SendSvc { - type Response = super::MsgSendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::send(&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 = SendSvc(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) - } - "/cosmos.bank.v1beta1.Msg/MultiSend" => { - #[allow(non_camel_case_types)] - struct MultiSendSvc(pub Arc); - impl tonic::server::UnaryService - for MultiSendSvc { - type Response = super::MsgMultiSendResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::multi_send(&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 = MultiSendSvc(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) - } - "/cosmos.bank.v1beta1.Msg/UpdateParams" => { - #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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) - } - "/cosmos.bank.v1beta1.Msg/SetSendEnabled" => { - #[allow(non_camel_case_types)] - struct SetSendEnabledSvc(pub Arc); - impl tonic::server::UnaryService - for SetSendEnabledSvc { - type Response = super::MsgSetSendEnabledResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::set_send_enabled(&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 = SetSendEnabledSvc(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 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - impl std::fmt::Debug for _Inner { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(f, "{:?}", self.0) - } +} +/// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsMetadataRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDenomsMetadataRequest { + const NAME: &'static str = "QueryDenomsMetadataRequest"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.bank.v1beta1.Msg"; +} +/// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomsMetadataResponse { + /// metadata provides the client information for all the registered tokens. + #[prost(message, repeated, tag = "1")] + pub metadatas: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDenomsMetadataResponse { + const NAME: &'static str = "QueryDenomsMetadataResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QueryBalanceRequest is the request type for the Query/Balance RPC method. +/// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryBalanceRequest { - /// address is the address to query balances for. +pub struct QueryDenomMetadataRequest { + /// denom is the coin denom to query the metadata for. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// denom is the coin denom to query balances for. - #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, } -impl ::prost::Name for QueryBalanceRequest { - const NAME: &'static str = "QueryBalanceRequest"; +impl ::prost::Name for QueryDenomMetadataRequest { + const NAME: &'static str = "QueryDenomMetadataRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QueryBalanceResponse is the response type for the Query/Balance RPC method. +/// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryBalanceResponse { - /// balance is the balance of the coin. +pub struct QueryDenomMetadataResponse { + /// metadata describes and provides all the client information for the requested token. #[prost(message, optional, tag = "1")] - pub balance: ::core::option::Option, + pub metadata: ::core::option::Option, } -impl ::prost::Name for QueryBalanceResponse { - const NAME: &'static str = "QueryBalanceResponse"; +impl ::prost::Name for QueryDenomMetadataResponse { + const NAME: &'static str = "QueryDenomMetadataResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QueryBalanceRequest is the request type for the Query/AllBalances RPC method. +/// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +/// Identical with QueryDenomMetadataRequest but receives denom as query string. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllBalancesRequest { - /// address is the address to query balances for. +pub struct QueryDenomMetadataByQueryStringRequest { + /// denom is the coin denom to query the metadata for. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, + pub denom: ::prost::alloc::string::String, } -impl ::prost::Name for QueryAllBalancesRequest { - const NAME: &'static str = "QueryAllBalancesRequest"; +impl ::prost::Name for QueryDenomMetadataByQueryStringRequest { + const NAME: &'static str = "QueryDenomMetadataByQueryStringRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC -/// method. +/// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +/// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAllBalancesResponse { - /// balances is the balances of all the coins. - #[prost(message, repeated, tag = "1")] - pub balances: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. +pub struct QueryDenomMetadataByQueryStringResponse { + /// metadata describes and provides all the client information for the requested token. + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, +} +impl ::prost::Name for QueryDenomMetadataByQueryStringResponse { + const NAME: &'static str = "QueryDenomMetadataByQueryStringResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +/// which queries for a paginated set of all account holders of a particular +/// denomination. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomOwnersRequest { + /// denom defines the coin denomination to query all account holders for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, + super::super::base::query::v1beta1::PageRequest, >, } -impl ::prost::Name for QueryAllBalancesResponse { - const NAME: &'static str = "QueryAllBalancesResponse"; +impl ::prost::Name for QueryDenomOwnersRequest { + const NAME: &'static str = "QueryDenomOwnersRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QuerySpendableBalancesRequest defines the gRPC request structure for querying -/// an account's spendable balances. +/// DenomOwner defines structure representing an account that owns or holds a +/// particular denominated token. It contains the account address and account +/// balance of the denominated token. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalancesRequest { - /// address is the address to query spendable balances for. +pub struct DenomOwner { + /// address defines the address that owns a particular denomination. #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. + /// balance is the balance of the denominated coin for an account. #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, + pub balance: ::core::option::Option, } -impl ::prost::Name for QuerySpendableBalancesRequest { - const NAME: &'static str = "QuerySpendableBalancesRequest"; +impl ::prost::Name for DenomOwner { + const NAME: &'static str = "DenomOwner"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QuerySpendableBalancesResponse defines the gRPC response structure for querying -/// an account's spendable balances. +/// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalancesResponse { - /// balances is the spendable balances of all the coins. +pub struct QueryDenomOwnersResponse { #[prost(message, repeated, tag = "1")] - pub balances: ::prost::alloc::vec::Vec, + pub denom_owners: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option< super::super::base::query::v1beta1::PageResponse, >, } -impl ::prost::Name for QuerySpendableBalancesResponse { - const NAME: &'static str = "QuerySpendableBalancesResponse"; +impl ::prost::Name for QueryDenomOwnersResponse { + const NAME: &'static str = "QueryDenomOwnersResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for -/// querying an account's spendable balance for a specific denom. +/// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, +/// which queries for a paginated set of all account holders of a particular +/// denomination. /// -/// Since: cosmos-sdk 0.47 +/// Since: cosmos-sdk 0.50.3 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalanceByDenomRequest { - /// address is the address to query balances for. +pub struct QueryDenomOwnersByQueryRequest { + /// denom defines the coin denomination to query all account holders for. #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// denom is the coin denom to query balances for. - #[prost(string, tag = "2")] pub denom: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for QuerySpendableBalanceByDenomRequest { - const NAME: &'static str = "QuerySpendableBalanceByDenomRequest"; +impl ::prost::Name for QueryDenomOwnersByQueryRequest { + const NAME: &'static str = "QueryDenomOwnersByQueryRequest"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) } } -/// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for -/// querying an account's spendable balance for a specific denom. +/// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. /// -/// Since: cosmos-sdk 0.47 +/// Since: cosmos-sdk 0.50.3 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySpendableBalanceByDenomResponse { - /// balance is the balance of the coin. - #[prost(message, optional, tag = "1")] - pub balance: ::core::option::Option, +pub struct QueryDenomOwnersByQueryResponse { + #[prost(message, repeated, tag = "1")] + pub denom_owners: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, } -impl ::prost::Name for QuerySpendableBalanceByDenomResponse { - const NAME: &'static str = "QuerySpendableBalanceByDenomResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryTotalSupplyRequest is the request type for the Query/TotalSupply RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalSupplyRequest { - /// pagination defines an optional pagination for the request. - /// - /// Since: cosmos-sdk 0.43 - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryTotalSupplyRequest { - const NAME: &'static str = "QueryTotalSupplyRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryTotalSupplyResponse is the response type for the Query/TotalSupply RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalSupplyResponse { - /// supply is the supply of the coins - #[prost(message, repeated, tag = "1")] - pub supply: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - /// - /// Since: cosmos-sdk 0.43 - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryTotalSupplyResponse { - const NAME: &'static str = "QueryTotalSupplyResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QuerySupplyOfRequest is the request type for the Query/SupplyOf RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySupplyOfRequest { - /// denom is the coin denom to query balances for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -impl ::prost::Name for QuerySupplyOfRequest { - const NAME: &'static str = "QuerySupplyOfRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QuerySupplyOfResponse is the response type for the Query/SupplyOf RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QuerySupplyOfResponse { - /// amount is the supply of the coin. - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option, -} -impl ::prost::Name for QuerySupplyOfResponse { - const NAME: &'static str = "QuerySupplyOfResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryParamsRequest defines the request type for querying x/bank parameters. -#[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 = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryParamsResponse defines the response type for querying x/bank parameters. -#[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, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomsMetadataRequest is the request type for the Query/DenomsMetadata RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomsMetadataRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDenomsMetadataRequest { - const NAME: &'static str = "QueryDenomsMetadataRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomsMetadataResponse is the response type for the Query/DenomsMetadata RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomsMetadataResponse { - /// metadata provides the client information for all the registered tokens. - #[prost(message, repeated, tag = "1")] - pub metadatas: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDenomsMetadataResponse { - const NAME: &'static str = "QueryDenomsMetadataResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomMetadataRequest is the request type for the Query/DenomMetadata RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomMetadataRequest { - /// denom is the coin denom to query the metadata for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDenomMetadataRequest { - const NAME: &'static str = "QueryDenomMetadataRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomMetadataResponse is the response type for the Query/DenomMetadata RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomMetadataResponse { - /// metadata describes and provides all the client information for the requested token. - #[prost(message, optional, tag = "1")] - pub metadata: ::core::option::Option, -} -impl ::prost::Name for QueryDenomMetadataResponse { - const NAME: &'static str = "QueryDenomMetadataResponse"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, -/// which queries for a paginated set of all account holders of a particular -/// denomination. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomOwnersRequest { - /// denom defines the coin denomination to query all account holders for. - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDenomOwnersRequest { - const NAME: &'static str = "QueryDenomOwnersRequest"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// DenomOwner defines structure representing an account that owns or holds a -/// particular denominated token. It contains the account address and account -/// balance of the denominated token. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DenomOwner { - /// address defines the address that owns a particular denomination. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// balance is the balance of the denominated coin for an account. - #[prost(message, optional, tag = "2")] - pub balance: ::core::option::Option, -} -impl ::prost::Name for DenomOwner { - const NAME: &'static str = "DenomOwner"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomOwnersResponse { - #[prost(message, repeated, tag = "1")] - pub denom_owners: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDenomOwnersResponse { - const NAME: &'static str = "QueryDenomOwnersResponse"; +impl ::prost::Name for QueryDenomOwnersByQueryResponse { + const NAME: &'static str = "QueryDenomOwnersByQueryResponse"; const PACKAGE: &'static str = "cosmos.bank.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) @@ -1571,7 +1046,7 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Params")); self.inner.unary(req, path, codec).await } - /// DenomsMetadata queries the client metadata of a given coin denomination. + /// DenomMetadata queries the client metadata of a given coin denomination. pub async fn denom_metadata( &mut self, request: impl tonic::IntoRequest, @@ -1597,6 +1072,39 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomMetadata")); self.inner.unary(req, path, codec).await } + /// DenomMetadataByQueryString queries the client metadata of a given coin denomination. + pub async fn denom_metadata_by_query_string( + &mut self, + request: impl tonic::IntoRequest< + super::QueryDenomMetadataByQueryStringRequest, + >, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "cosmos.bank.v1beta1.Query", + "DenomMetadataByQueryString", + ), + ); + self.inner.unary(req, path, codec).await + } /// DenomsMetadata queries the client metadata for all registered coin /// denominations. pub async fn denoms_metadata( @@ -1656,6 +1164,37 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwners")); self.inner.unary(req, path, codec).await } + /// DenomOwnersByQuery queries for all account addresses that own a particular token + /// denomination. + /// + /// Since: cosmos-sdk 0.50.3 + pub async fn denom_owners_by_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwnersByQuery"), + ); + self.inner.unary(req, path, codec).await + } /// SendEnabled queries for SendEnabled entries. /// /// This query only returns denominations that have specific SendEnabled settings. @@ -1775,7 +1314,7 @@ pub mod query_server { tonic::Response, tonic::Status, >; - /// DenomsMetadata queries the client metadata of a given coin denomination. + /// DenomMetadata queries the client metadata of a given coin denomination. async fn denom_metadata( &self, request: tonic::Request, @@ -1783,6 +1322,14 @@ pub mod query_server { tonic::Response, tonic::Status, >; + /// DenomMetadataByQueryString queries the client metadata of a given coin denomination. + async fn denom_metadata_by_query_string( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// DenomsMetadata queries the client metadata for all registered coin /// denominations. async fn denoms_metadata( @@ -1806,6 +1353,17 @@ pub mod query_server { tonic::Response, tonic::Status, >; + /// DenomOwnersByQuery queries for all account addresses that own a particular token + /// denomination. + /// + /// Since: cosmos-sdk 0.50.3 + async fn denom_owners_by_query( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// SendEnabled queries for SendEnabled entries. /// /// This query only returns denominations that have specific SendEnabled settings. @@ -2227,23 +1785,811 @@ pub mod query_server { } "/cosmos.bank.v1beta1.Query/DenomMetadata" => { #[allow(non_camel_case_types)] - struct DenomMetadataSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomMetadataSvc { - type Response = super::QueryDenomMetadataResponse; + struct DenomMetadataSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomMetadataSvc { + type Response = super::QueryDenomMetadataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::denom_metadata(&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 = DenomMetadataSvc(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) + } + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString" => { + #[allow(non_camel_case_types)] + struct DenomMetadataByQueryStringSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDenomMetadataByQueryStringRequest, + > for DenomMetadataByQueryStringSvc { + type Response = super::QueryDenomMetadataByQueryStringResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDenomMetadataByQueryStringRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::denom_metadata_by_query_string( + &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 = DenomMetadataByQueryStringSvc(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) + } + "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { + #[allow(non_camel_case_types)] + struct DenomsMetadataSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomsMetadataSvc { + type Response = super::QueryDenomsMetadataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::denoms_metadata(&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 = DenomsMetadataSvc(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) + } + "/cosmos.bank.v1beta1.Query/DenomOwners" => { + #[allow(non_camel_case_types)] + struct DenomOwnersSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomOwnersSvc { + type Response = super::QueryDenomOwnersResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::denom_owners(&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 = DenomOwnersSvc(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) + } + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery" => { + #[allow(non_camel_case_types)] + struct DenomOwnersByQuerySvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomOwnersByQuerySvc { + type Response = super::QueryDenomOwnersByQueryResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDenomOwnersByQueryRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::denom_owners_by_query(&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 = DenomOwnersByQuerySvc(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) + } + "/cosmos.bank.v1beta1.Query/SendEnabled" => { + #[allow(non_camel_case_types)] + struct SendEnabledSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for SendEnabledSvc { + type Response = super::QuerySendEnabledResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::send_enabled(&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 = SendEnabledSvc(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 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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 = "cosmos.bank.v1beta1.Query"; + } +} +/// MsgSend represents a message to send coins from one account to another. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSend { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgSend { + const NAME: &'static str = "MsgSend"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgSendResponse defines the Msg/Send response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSendResponse {} +impl ::prost::Name for MsgSendResponse { + const NAME: &'static str = "MsgSendResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgMultiSend represents an arbitrary multi-in, multi-out send message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSend { + /// Inputs, despite being `repeated`, only allows one sender input. This is + /// checked in MsgMultiSend's ValidateBasic. + #[prost(message, repeated, tag = "1")] + pub inputs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub outputs: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgMultiSend { + const NAME: &'static str = "MsgMultiSend"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgMultiSendResponse defines the Msg/MultiSend response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultiSendResponse {} +impl ::prost::Name for MsgMultiSendResponse { + const NAME: &'static str = "MsgMultiSendResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/bank parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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 = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgSetSendEnabled is the Msg/SetSendEnabled request type. +/// +/// Only entries to add/update/delete need to be included. +/// Existing SendEnabled entries that are not included in this +/// message are left unchanged. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetSendEnabled { + /// authority is the address that controls the module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// send_enabled is the list of entries to add or update. + #[prost(message, repeated, tag = "2")] + pub send_enabled: ::prost::alloc::vec::Vec, + /// use_default_for is a list of denoms that should use the params.default_send_enabled value. + /// Denoms listed here will have their SendEnabled entries deleted. + /// If a denom is included that doesn't have a SendEnabled entry, + /// it will be ignored. + #[prost(string, repeated, tag = "3")] + pub use_default_for: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for MsgSetSendEnabled { + const NAME: &'static str = "MsgSetSendEnabled"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSetSendEnabledResponse {} +impl ::prost::Name for MsgSetSendEnabledResponse { + const NAME: &'static str = "MsgSetSendEnabledResponse"; + const PACKAGE: &'static str = "cosmos.bank.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the bank Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// Send defines a method for sending coins from one account to another account. + pub async fn send( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/Send", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "Send")); + self.inner.unary(req, path, codec).await + } + /// MultiSend defines a method for sending coins from some accounts to other accounts. + pub async fn multi_send( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/MultiSend", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "MultiSend")); + self.inner.unary(req, path, codec).await + } + /// UpdateParams defines a governance operation for updating the x/bank module parameters. + /// The authority is defined in the keeper. + /// + /// Since: cosmos-sdk 0.47 + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + /// SetSendEnabled is a governance operation for setting the SendEnabled flag + /// on any number of Denoms. Only the entries to add or update should be + /// included. Entries that already exist in the store, but that aren't + /// included in this message, will be left unchanged. + /// + /// Since: cosmos-sdk 0.47 + pub async fn set_send_enabled( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Msg/SetSendEnabled", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.bank.v1beta1.Msg", "SetSendEnabled")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// Send defines a method for sending coins from one account to another account. + async fn send( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// MultiSend defines a method for sending coins from some accounts to other accounts. + async fn multi_send( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateParams defines a governance operation for updating the x/bank module parameters. + /// The authority is defined in the keeper. + /// + /// Since: cosmos-sdk 0.47 + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// SetSendEnabled is a governance operation for setting the SendEnabled flag + /// on any number of Denoms. Only the entries to add or update should be + /// included. Entries that already exist in the store, but that aren't + /// included in this message, will be left unchanged. + /// + /// Since: cosmos-sdk 0.47 + async fn set_send_enabled( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the bank Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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() { + "/cosmos.bank.v1beta1.Msg/Send" => { + #[allow(non_camel_case_types)] + struct SendSvc(pub Arc); + impl tonic::server::UnaryService + for SendSvc { + type Response = super::MsgSendResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::denom_metadata(&inner, request).await + ::send(&inner, request).await }; Box::pin(fut) } @@ -2255,7 +2601,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DenomMetadataSvc(inner); + let method = SendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2271,25 +2617,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { + "/cosmos.bank.v1beta1.Msg/MultiSend" => { #[allow(non_camel_case_types)] - struct DenomsMetadataSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomsMetadataSvc { - type Response = super::QueryDenomsMetadataResponse; + struct MultiSendSvc(pub Arc); + impl tonic::server::UnaryService + for MultiSendSvc { + type Response = super::MsgMultiSendResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::denoms_metadata(&inner, request).await + ::multi_send(&inner, request).await }; Box::pin(fut) } @@ -2301,7 +2645,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DenomsMetadataSvc(inner); + let method = MultiSendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2317,25 +2661,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/DenomOwners" => { + "/cosmos.bank.v1beta1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct DenomOwnersSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DenomOwnersSvc { - type Response = super::QueryDenomOwnersResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::denom_owners(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -2347,7 +2689,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DenomOwnersSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2363,25 +2705,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/SendEnabled" => { + "/cosmos.bank.v1beta1.Msg/SetSendEnabled" => { #[allow(non_camel_case_types)] - struct SendEnabledSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for SendEnabledSvc { - type Response = super::QuerySendEnabledResponse; + struct SetSendEnabledSvc(pub Arc); + impl tonic::server::UnaryService + for SetSendEnabledSvc { + type Response = super::MsgSetSendEnabledResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::send_enabled(&inner, request).await + ::set_send_enabled(&inner, request).await }; Box::pin(fut) } @@ -2393,7 +2733,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SendEnabledSvc(inner); + let method = SetSendEnabledSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2424,7 +2764,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2436,7 +2776,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2446,79 +2786,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.bank.v1beta1.Query"; - } -} -/// SendAuthorization allows the grantee to spend up to spend_limit coins from -/// the granter's account. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SendAuthorization { - #[prost(message, repeated, tag = "1")] - pub spend_limit: ::prost::alloc::vec::Vec, - /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the - /// granter. If omitted, any recipient is allowed. - /// - /// Since: cosmos-sdk 0.47 - #[prost(string, repeated, tag = "2")] - pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for SendAuthorization { - const NAME: &'static str = "SendAuthorization"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// GenesisState defines the bank module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// balances is an array containing the balances of all the accounts. - #[prost(message, repeated, tag = "2")] - pub balances: ::prost::alloc::vec::Vec, - /// supply represents the total supply. If it is left empty, then supply will be calculated based on the provided - /// balances. Otherwise, it will be used to validate that the sum of the balances equals this amount. - #[prost(message, repeated, tag = "3")] - pub supply: ::prost::alloc::vec::Vec, - /// denom_metadata defines the metadata of the different coins. - #[prost(message, repeated, tag = "4")] - pub denom_metadata: ::prost::alloc::vec::Vec, - /// send_enabled defines the denoms where send is enabled or disabled. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, repeated, tag = "5")] - pub send_enabled: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) - } -} -/// Balance defines an account address and balance pair used in the bank module's -/// genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Balance { - /// address is the address of the balance holder. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// coins defines the different coins this balance holds. - #[prost(message, repeated, tag = "2")] - pub coins: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Balance { - const NAME: &'static str = "Balance"; - const PACKAGE: &'static str = "cosmos.bank.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.bank.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.bank.v1beta1.Msg"; } } diff --git a/src/prost/cosmos.bank.v1beta1.serde.rs b/src/prost/cosmos.bank.v1beta1.serde.rs index 6fc304d4..bf7c0c94 100644 --- a/src/prost/cosmos.bank.v1beta1.serde.rs +++ b/src/prost/cosmos.bank.v1beta1.serde.rs @@ -1808,6 +1808,9 @@ impl serde::Serialize for QueryAllBalancesRequest { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesRequest", len)?; if true { struct_ser.serialize_field("address", &self.address)?; @@ -1815,6 +1818,9 @@ impl serde::Serialize for QueryAllBalancesRequest { if let Some(v) = self.pagination.as_ref() { struct_ser.serialize_field("pagination", v)?; } + if true { + struct_ser.serialize_field("resolveDenom", &self.resolve_denom)?; + } struct_ser.end() } } @@ -1827,12 +1833,15 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { const FIELDS: &[&str] = &[ "address", "pagination", + "resolve_denom", + "resolveDenom", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Address, Pagination, + ResolveDenom, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -1856,6 +1865,7 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { match value { "address" => Ok(GeneratedField::Address), "pagination" => Ok(GeneratedField::Pagination), + "resolveDenom" | "resolve_denom" => Ok(GeneratedField::ResolveDenom), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1877,6 +1887,7 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { { let mut address__ = None; let mut pagination__ = None; + let mut resolve_denom__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Address => { @@ -1891,11 +1902,18 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { } pagination__ = map_.next_value()?; } + GeneratedField::ResolveDenom => { + if resolve_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("resolveDenom")); + } + resolve_denom__ = Some(map_.next_value()?); + } } } Ok(QueryAllBalancesRequest { address: address__.unwrap_or_default(), pagination: pagination__, + resolve_denom: resolve_denom__.unwrap_or_default(), }) } } @@ -2209,6 +2227,188 @@ impl<'de> serde::Deserialize<'de> for QueryBalanceResponse { deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryBalanceResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for QueryDenomMetadataByQueryStringRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", len)?; + if true { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataByQueryStringRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "denom" => Ok(GeneratedField::Denom), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomMetadataByQueryStringRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Denom => { + if denom__.is_some() { + return Err(serde::de::Error::duplicate_field("denom")); + } + denom__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDenomMetadataByQueryStringRequest { + denom: denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomMetadataByQueryStringResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", len)?; + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataByQueryStringResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "metadata", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Metadata, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomMetadataByQueryStringResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } + } + } + Ok(QueryDenomMetadataByQueryStringResponse { + metadata: metadata__, + }) + } + } + deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for QueryDenomMetadataRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -2391,6 +2591,223 @@ impl<'de> serde::Deserialize<'de> for QueryDenomMetadataResponse { deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomMetadataResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for QueryDenomOwnersByQueryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", len)?; + if true { + struct_ser.serialize_field("denom", &self.denom)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersByQueryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "denom" => Ok(GeneratedField::Denom), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomOwnersByQueryRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Denom => { + if denom__.is_some() { + return Err(serde::de::Error::duplicate_field("denom")); + } + denom__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDenomOwnersByQueryRequest { + denom: denom__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryDenomOwnersByQueryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", len)?; + if true { + struct_ser.serialize_field("denomOwners", &self.denom_owners)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersByQueryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "denom_owners", + "denomOwners", + "pagination", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomOwners, + Pagination, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "denomOwners" | "denom_owners" => Ok(GeneratedField::DenomOwners), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomOwnersByQueryResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom_owners__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DenomOwners => { + if denom_owners__.is_some() { + return Err(serde::de::Error::duplicate_field("denomOwners")); + } + denom_owners__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDenomOwnersByQueryResponse { + denom_owners: denom_owners__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for QueryDenomOwnersRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result diff --git a/src/prost/cosmos.base.abci.v1beta1.rs b/src/prost/cosmos.base.abci.v1beta1.rs index 1097a955..16ca03f0 100644 --- a/src/prost/cosmos.base.abci.v1beta1.rs +++ b/src/prost/cosmos.base.abci.v1beta1.rs @@ -49,7 +49,7 @@ pub struct TxResponse { /// /// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 #[prost(message, repeated, tag = "13")] - pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>, + pub events: ::prost::alloc::vec::Vec<::cometbft_proto::abci::v1beta1::Event>, } impl ::prost::Name for TxResponse { const NAME: &'static str = "TxResponse"; @@ -147,7 +147,7 @@ pub struct Result { /// Events contains a slice of Event objects that were emitted during message /// or handler execution. #[prost(message, repeated, tag = "3")] - pub events: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::abci::Event>, + pub events: ::prost::alloc::vec::Vec<::cometbft_proto::abci::v1beta1::Event>, /// msg_responses contains the Msg handler responses type packed in Anys. /// /// Since: cosmos-sdk 0.46 @@ -251,3 +251,33 @@ impl ::prost::Name for SearchTxsResult { ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) } } +/// SearchBlocksResult defines a structure for querying blocks pageable +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchBlocksResult { + /// Count of all blocks + #[prost(int64, tag = "1")] + pub total_count: i64, + /// Count of blocks in current page + #[prost(int64, tag = "2")] + pub count: i64, + /// Index of current page, start from 1 + #[prost(int64, tag = "3")] + pub page_number: i64, + /// Count of total pages + #[prost(int64, tag = "4")] + pub page_total: i64, + /// Max count blocks per page + #[prost(int64, tag = "5")] + pub limit: i64, + /// List of blocks in current page + #[prost(message, repeated, tag = "6")] + pub blocks: ::prost::alloc::vec::Vec<::cometbft_proto::types::v1::Block>, +} +impl ::prost::Name for SearchBlocksResult { + const NAME: &'static str = "SearchBlocksResult"; + const PACKAGE: &'static str = "cosmos.base.abci.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.base.abci.v1beta1.{}", Self::NAME) + } +} diff --git a/src/prost/cosmos.base.kv.v1beta1.rs b/src/prost/cosmos.base.kv.v1beta1.rs deleted file mode 100644 index 6bd5f9c6..00000000 --- a/src/prost/cosmos.base.kv.v1beta1.rs +++ /dev/null @@ -1,30 +0,0 @@ -/// Pairs defines a repeated slice of Pair objects. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pairs { - #[prost(message, repeated, tag = "1")] - pub pairs: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Pairs { - const NAME: &'static str = "Pairs"; - const PACKAGE: &'static str = "cosmos.base.kv.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.kv.v1beta1.{}", Self::NAME) - } -} -/// Pair defines a key/value bytes tuple. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Pair { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for Pair { - const NAME: &'static str = "Pair"; - const PACKAGE: &'static str = "cosmos.base.kv.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.kv.v1beta1.{}", Self::NAME) - } -} diff --git a/src/prost/cosmos.base.kv.v1beta1.serde.rs b/src/prost/cosmos.base.kv.v1beta1.serde.rs deleted file mode 100644 index 3e2ed8b5..00000000 --- a/src/prost/cosmos.base.kv.v1beta1.serde.rs +++ /dev/null @@ -1,205 +0,0 @@ -impl serde::Serialize for Pair { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pair", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pair; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pair") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(Pair { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pair", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Pairs { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pairs", len)?; - if true { - struct_ser.serialize_field("pairs", &self.pairs)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Pairs { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "pairs", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Pairs, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "pairs" => Ok(GeneratedField::Pairs), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Pairs; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pairs") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut pairs__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Pairs => { - if pairs__.is_some() { - return Err(serde::de::Error::duplicate_field("pairs")); - } - pairs__ = Some(map_.next_value()?); - } - } - } - Ok(Pairs { - pairs: pairs__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pairs", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.node.v1beta1.rs b/src/prost/cosmos.base.node.v1beta1.rs index 69d16e40..0eae005d 100644 --- a/src/prost/cosmos.base.node.v1beta1.rs +++ b/src/prost/cosmos.base.node.v1beta1.rs @@ -15,6 +15,12 @@ impl ::prost::Name for ConfigRequest { pub struct ConfigResponse { #[prost(string, tag = "1")] pub minimum_gas_price: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub pruning_keep_recent: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub pruning_interval: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub halt_height: u64, } impl ::prost::Name for ConfigResponse { const NAME: &'static str = "ConfigResponse"; @@ -23,6 +29,46 @@ impl ::prost::Name for ConfigResponse { ::prost::alloc::format!("cosmos.base.node.v1beta1.{}", Self::NAME) } } +/// StateRequest defines the request structure for the status of a node. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StatusRequest {} +impl ::prost::Name for StatusRequest { + const NAME: &'static str = "StatusRequest"; + const PACKAGE: &'static str = "cosmos.base.node.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.base.node.v1beta1.{}", Self::NAME) + } +} +/// StateResponse defines the response structure for the status of a node. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StatusResponse { + /// earliest block height available in the store + #[prost(uint64, tag = "1")] + pub earliest_store_height: u64, + /// current block height + #[prost(uint64, tag = "2")] + pub height: u64, + /// block height timestamp + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option< + super::super::super::super::google::protobuf::Timestamp, + >, + /// app hash of the current block + #[prost(bytes = "vec", tag = "4")] + pub app_hash: ::prost::alloc::vec::Vec, + /// validator hash provided by the consensus header + #[prost(bytes = "vec", tag = "5")] + pub validator_hash: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for StatusResponse { + const NAME: &'static str = "StatusResponse"; + const PACKAGE: &'static str = "cosmos.base.node.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.base.node.v1beta1.{}", Self::NAME) + } +} /// Generated client implementations. #[cfg(feature = "client")] pub mod service_client { @@ -133,6 +179,29 @@ pub mod service_client { .insert(GrpcMethod::new("cosmos.base.node.v1beta1.Service", "Config")); self.inner.unary(req, path, codec).await } + /// Status queries for the node status. + pub async fn status( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::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( + "/cosmos.base.node.v1beta1.Service/Status", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.base.node.v1beta1.Service", "Status")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -148,6 +217,11 @@ pub mod service_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + /// Status queries for the node status. + async fn status( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } /// Service defines the gRPC querier service for node related queries. #[derive(Debug)] @@ -273,6 +347,50 @@ pub mod service_server { }; Box::pin(fut) } + "/cosmos.base.node.v1beta1.Service/Status" => { + #[allow(non_camel_case_types)] + struct StatusSvc(pub Arc); + impl tonic::server::UnaryService + for StatusSvc { + type Response = super::StatusResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::status(&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 = StatusSvc(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( diff --git a/src/prost/cosmos.base.node.v1beta1.serde.rs b/src/prost/cosmos.base.node.v1beta1.serde.rs index 24a688cd..e5f74e8a 100644 --- a/src/prost/cosmos.base.node.v1beta1.serde.rs +++ b/src/prost/cosmos.base.node.v1beta1.serde.rs @@ -80,10 +80,29 @@ impl serde::Serialize for ConfigResponse { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.ConfigResponse", len)?; if true { struct_ser.serialize_field("minimumGasPrice", &self.minimum_gas_price)?; } + if true { + struct_ser.serialize_field("pruningKeepRecent", &self.pruning_keep_recent)?; + } + if true { + struct_ser.serialize_field("pruningInterval", &self.pruning_interval)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("haltHeight", ::alloc::string::ToString::to_string(&self.halt_height).as_str())?; + } struct_ser.end() } } @@ -96,11 +115,20 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { const FIELDS: &[&str] = &[ "minimum_gas_price", "minimumGasPrice", + "pruning_keep_recent", + "pruningKeepRecent", + "pruning_interval", + "pruningInterval", + "halt_height", + "haltHeight", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { MinimumGasPrice, + PruningKeepRecent, + PruningInterval, + HaltHeight, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -123,6 +151,9 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { { match value { "minimumGasPrice" | "minimum_gas_price" => Ok(GeneratedField::MinimumGasPrice), + "pruningKeepRecent" | "pruning_keep_recent" => Ok(GeneratedField::PruningKeepRecent), + "pruningInterval" | "pruning_interval" => Ok(GeneratedField::PruningInterval), + "haltHeight" | "halt_height" => Ok(GeneratedField::HaltHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -143,6 +174,9 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { V: serde::de::MapAccess<'de>, { let mut minimum_gas_price__ = None; + let mut pruning_keep_recent__ = None; + let mut pruning_interval__ = None; + let mut halt_height__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::MinimumGasPrice => { @@ -151,13 +185,281 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { } minimum_gas_price__ = Some(map_.next_value()?); } + GeneratedField::PruningKeepRecent => { + if pruning_keep_recent__.is_some() { + return Err(serde::de::Error::duplicate_field("pruningKeepRecent")); + } + pruning_keep_recent__ = Some(map_.next_value()?); + } + GeneratedField::PruningInterval => { + if pruning_interval__.is_some() { + return Err(serde::de::Error::duplicate_field("pruningInterval")); + } + pruning_interval__ = Some(map_.next_value()?); + } + GeneratedField::HaltHeight => { + if halt_height__.is_some() { + return Err(serde::de::Error::duplicate_field("haltHeight")); + } + halt_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } } } Ok(ConfigResponse { minimum_gas_price: minimum_gas_price__.unwrap_or_default(), + pruning_keep_recent: pruning_keep_recent__.unwrap_or_default(), + pruning_interval: pruning_interval__.unwrap_or_default(), + halt_height: halt_height__.unwrap_or_default(), }) } } deserializer.deserialize_struct("cosmos.base.node.v1beta1.ConfigResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for StatusRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.StatusRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StatusRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StatusRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.StatusRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(StatusRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.base.node.v1beta1.StatusRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for StatusResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.StatusResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("earliestStoreHeight", ::alloc::string::ToString::to_string(&self.earliest_store_height).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.timestamp.as_ref() { + struct_ser.serialize_field("timestamp", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("appHash", pbjson::private::base64::encode(&self.app_hash).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("validatorHash", pbjson::private::base64::encode(&self.validator_hash).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for StatusResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "earliest_store_height", + "earliestStoreHeight", + "height", + "timestamp", + "app_hash", + "appHash", + "validator_hash", + "validatorHash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EarliestStoreHeight, + Height, + Timestamp, + AppHash, + ValidatorHash, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "earliestStoreHeight" | "earliest_store_height" => Ok(GeneratedField::EarliestStoreHeight), + "height" => Ok(GeneratedField::Height), + "timestamp" => Ok(GeneratedField::Timestamp), + "appHash" | "app_hash" => Ok(GeneratedField::AppHash), + "validatorHash" | "validator_hash" => Ok(GeneratedField::ValidatorHash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StatusResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.StatusResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut earliest_store_height__ = None; + let mut height__ = None; + let mut timestamp__ = None; + let mut app_hash__ = None; + let mut validator_hash__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EarliestStoreHeight => { + if earliest_store_height__.is_some() { + return Err(serde::de::Error::duplicate_field("earliestStoreHeight")); + } + earliest_store_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = map_.next_value()?; + } + GeneratedField::AppHash => { + if app_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("appHash")); + } + app_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ValidatorHash => { + if validator_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorHash")); + } + validator_hash__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + } + } + Ok(StatusResponse { + earliest_store_height: earliest_store_height__.unwrap_or_default(), + height: height__.unwrap_or_default(), + timestamp: timestamp__, + app_hash: app_hash__.unwrap_or_default(), + validator_hash: validator_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.base.node.v1beta1.StatusResponse", FIELDS, GeneratedVisitor) + } +} diff --git a/src/prost/cosmos.base.snapshots.v1beta1.rs b/src/prost/cosmos.base.snapshots.v1beta1.rs deleted file mode 100644 index 614c936c..00000000 --- a/src/prost/cosmos.base.snapshots.v1beta1.rs +++ /dev/null @@ -1,184 +0,0 @@ -/// Snapshot contains Tendermint state sync snapshot info. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Snapshot { - #[prost(uint64, tag = "1")] - pub height: u64, - #[prost(uint32, tag = "2")] - pub format: u32, - #[prost(uint32, tag = "3")] - pub chunks: u32, - #[prost(bytes = "vec", tag = "4")] - pub hash: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub metadata: ::core::option::Option, -} -impl ::prost::Name for Snapshot { - const NAME: &'static str = "Snapshot"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// Metadata contains SDK-specific snapshot metadata. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - /// SHA-256 chunk hashes - #[prost(bytes = "vec", repeated, tag = "1")] - pub chunk_hashes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for Metadata { - const NAME: &'static str = "Metadata"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotItem is an item contained in a rootmulti.Store snapshot. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotItem { - /// item is the specific type of snapshot item. - #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4, 5, 6")] - pub item: ::core::option::Option, -} -/// Nested message and enum types in `SnapshotItem`. -pub mod snapshot_item { - /// item is the specific type of snapshot item. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Item { - #[prost(message, tag = "1")] - Store(super::SnapshotStoreItem), - #[prost(message, tag = "2")] - Iavl(super::SnapshotIavlItem), - #[prost(message, tag = "3")] - Extension(super::SnapshotExtensionMeta), - #[prost(message, tag = "4")] - ExtensionPayload(super::SnapshotExtensionPayload), - #[prost(message, tag = "5")] - Kv(super::SnapshotKvItem), - #[prost(message, tag = "6")] - Schema(super::SnapshotSchema), - } -} -impl ::prost::Name for SnapshotItem { - const NAME: &'static str = "SnapshotItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotStoreItem contains metadata about a snapshotted store. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotStoreItem { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -impl ::prost::Name for SnapshotStoreItem { - const NAME: &'static str = "SnapshotStoreItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotIAVLItem is an exported IAVL node. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotIavlItem { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - /// version is block height - #[prost(int64, tag = "3")] - pub version: i64, - /// height is depth of the tree. - #[prost(int32, tag = "4")] - pub height: i32, -} -impl ::prost::Name for SnapshotIavlItem { - const NAME: &'static str = "SnapshotIAVLItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotExtensionMeta contains metadata about an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotExtensionMeta { - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, - #[prost(uint32, tag = "2")] - pub format: u32, -} -impl ::prost::Name for SnapshotExtensionMeta { - const NAME: &'static str = "SnapshotExtensionMeta"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotExtensionPayload contains payloads of an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotExtensionPayload { - #[prost(bytes = "vec", tag = "1")] - pub payload: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SnapshotExtensionPayload { - const NAME: &'static str = "SnapshotExtensionPayload"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotKVItem is an exported Key/Value Pair -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotKvItem { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for SnapshotKvItem { - const NAME: &'static str = "SnapshotKVItem"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} -/// SnapshotSchema is an exported schema of smt store -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotSchema { - #[prost(bytes = "vec", repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -impl ::prost::Name for SnapshotSchema { - const NAME: &'static str = "SnapshotSchema"; - const PACKAGE: &'static str = "cosmos.base.snapshots.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.base.snapshots.v1beta1.{}", Self::NAME) - } -} diff --git a/src/prost/cosmos.base.snapshots.v1beta1.serde.rs b/src/prost/cosmos.base.snapshots.v1beta1.serde.rs deleted file mode 100644 index f28fcfed..00000000 --- a/src/prost/cosmos.base.snapshots.v1beta1.serde.rs +++ /dev/null @@ -1,1082 +0,0 @@ -impl serde::Serialize for Metadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Metadata", len)?; - if true { - struct_ser.serialize_field("chunkHashes", &self.chunk_hashes.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Metadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "chunk_hashes", - "chunkHashes", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ChunkHashes, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "chunkHashes" | "chunk_hashes" => Ok(GeneratedField::ChunkHashes), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Metadata; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Metadata") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut chunk_hashes__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ChunkHashes => { - if chunk_hashes__.is_some() { - return Err(serde::de::Error::duplicate_field("chunkHashes")); - } - chunk_hashes__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(Metadata { - chunk_hashes: chunk_hashes__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Metadata", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for Snapshot { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("height", ::alloc::string::ToString::to_string(&self.height).as_str())?; - } - if true { - struct_ser.serialize_field("format", &self.format)?; - } - if true { - struct_ser.serialize_field("chunks", &self.chunks)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - if let Some(v) = self.metadata.as_ref() { - struct_ser.serialize_field("metadata", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for Snapshot { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "height", - "format", - "chunks", - "hash", - "metadata", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Height, - Format, - Chunks, - Hash, - Metadata, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "height" => Ok(GeneratedField::Height), - "format" => Ok(GeneratedField::Format), - "chunks" => Ok(GeneratedField::Chunks), - "hash" => Ok(GeneratedField::Hash), - "metadata" => Ok(GeneratedField::Metadata), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Snapshot; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Snapshot") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut height__ = None; - let mut format__ = None; - let mut chunks__ = None; - let mut hash__ = None; - let mut metadata__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Format => { - if format__.is_some() { - return Err(serde::de::Error::duplicate_field("format")); - } - format__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Chunks => { - if chunks__.is_some() { - return Err(serde::de::Error::duplicate_field("chunks")); - } - chunks__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Metadata => { - if metadata__.is_some() { - return Err(serde::de::Error::duplicate_field("metadata")); - } - metadata__ = map_.next_value()?; - } - } - } - Ok(Snapshot { - height: height__.unwrap_or_default(), - format: format__.unwrap_or_default(), - chunks: chunks__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - metadata: metadata__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotExtensionMeta { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if true { - struct_ser.serialize_field("format", &self.format)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "format", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - Format, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "format" => Ok(GeneratedField::Format), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotExtensionMeta; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut format__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::Format => { - if format__.is_some() { - return Err(serde::de::Error::duplicate_field("format")); - } - format__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotExtensionMeta { - name: name__.unwrap_or_default(), - format: format__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotExtensionPayload { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("payload", pbjson::private::base64::encode(&self.payload).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "payload", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Payload, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "payload" => Ok(GeneratedField::Payload), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotExtensionPayload; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut payload__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Payload => { - if payload__.is_some() { - return Err(serde::de::Error::duplicate_field("payload")); - } - payload__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotExtensionPayload { - payload: payload__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotIavlItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - struct_ser.serialize_field("height", &self.height)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - "version", - "height", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - Version, - Height, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - "version" => Ok(GeneratedField::Version), - "height" => Ok(GeneratedField::Height), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotIavlItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - let mut version__ = None; - let mut height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); - } - height__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotIavlItem { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - version: version__.unwrap_or_default(), - height: height__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.item.is_some() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", len)?; - if let Some(v) = self.item.as_ref() { - match v { - snapshot_item::Item::Store(v) => { - struct_ser.serialize_field("store", v)?; - } - snapshot_item::Item::Iavl(v) => { - struct_ser.serialize_field("iavl", v)?; - } - snapshot_item::Item::Extension(v) => { - struct_ser.serialize_field("extension", v)?; - } - snapshot_item::Item::ExtensionPayload(v) => { - struct_ser.serialize_field("extensionPayload", v)?; - } - snapshot_item::Item::Kv(v) => { - struct_ser.serialize_field("kv", v)?; - } - snapshot_item::Item::Schema(v) => { - struct_ser.serialize_field("schema", v)?; - } - } - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "store", - "iavl", - "extension", - "extension_payload", - "extensionPayload", - "kv", - "schema", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Store, - Iavl, - Extension, - ExtensionPayload, - Kv, - Schema, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "store" => Ok(GeneratedField::Store), - "iavl" => Ok(GeneratedField::Iavl), - "extension" => Ok(GeneratedField::Extension), - "extensionPayload" | "extension_payload" => Ok(GeneratedField::ExtensionPayload), - "kv" => Ok(GeneratedField::Kv), - "schema" => Ok(GeneratedField::Schema), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut item__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Store => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("store")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Store) -; - } - GeneratedField::Iavl => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("iavl")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Iavl) -; - } - GeneratedField::Extension => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("extension")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Extension) -; - } - GeneratedField::ExtensionPayload => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("extensionPayload")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::ExtensionPayload) -; - } - GeneratedField::Kv => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("kv")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Kv) -; - } - GeneratedField::Schema => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("schema")); - } - item__ = map_.next_value::<::core::option::Option<_>>()?.map(snapshot_item::Item::Schema) -; - } - } - } - Ok(SnapshotItem { - item: item__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotKvItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotKvItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotKvItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotKVItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(SnapshotKvItem { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotSchema { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", len)?; - if true { - struct_ser.serialize_field("keys", &self.keys.iter().map(pbjson::private::base64::encode).collect::<::alloc::vec::Vec<_>>())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotSchema { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "keys", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Keys, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "keys" => Ok(GeneratedField::Keys), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotSchema; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotSchema") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut keys__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Keys => { - if keys__.is_some() { - return Err(serde::de::Error::duplicate_field("keys")); - } - keys__ = - Some(map_.next_value::<::alloc::vec::Vec<::pbjson::private::BytesDeserialize<_>>>()? - .into_iter().map(|x| x.0).collect()) - ; - } - } - } - Ok(SnapshotSchema { - keys: keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for SnapshotStoreItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotStoreItem; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotStoreItem") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - } - } - Ok(SnapshotStoreItem { - name: name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.store.v1beta1.serde.rs b/src/prost/cosmos.base.store.v1beta1.serde.rs deleted file mode 100644 index 2916d33c..00000000 --- a/src/prost/cosmos.base.store.v1beta1.serde.rs +++ /dev/null @@ -1,791 +0,0 @@ -impl serde::Serialize for BlockMetadata { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata", len)?; - if let Some(v) = self.request_begin_block.as_ref() { - struct_ser.serialize_field("requestBeginBlock", v)?; - } - if let Some(v) = self.response_begin_block.as_ref() { - struct_ser.serialize_field("responseBeginBlock", v)?; - } - if true { - struct_ser.serialize_field("deliverTxs", &self.deliver_txs)?; - } - if let Some(v) = self.request_end_block.as_ref() { - struct_ser.serialize_field("requestEndBlock", v)?; - } - if let Some(v) = self.response_end_block.as_ref() { - struct_ser.serialize_field("responseEndBlock", v)?; - } - if let Some(v) = self.response_commit.as_ref() { - struct_ser.serialize_field("responseCommit", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for BlockMetadata { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "request_begin_block", - "requestBeginBlock", - "response_begin_block", - "responseBeginBlock", - "deliver_txs", - "deliverTxs", - "request_end_block", - "requestEndBlock", - "response_end_block", - "responseEndBlock", - "response_commit", - "responseCommit", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - RequestBeginBlock, - ResponseBeginBlock, - DeliverTxs, - RequestEndBlock, - ResponseEndBlock, - ResponseCommit, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "requestBeginBlock" | "request_begin_block" => Ok(GeneratedField::RequestBeginBlock), - "responseBeginBlock" | "response_begin_block" => Ok(GeneratedField::ResponseBeginBlock), - "deliverTxs" | "deliver_txs" => Ok(GeneratedField::DeliverTxs), - "requestEndBlock" | "request_end_block" => Ok(GeneratedField::RequestEndBlock), - "responseEndBlock" | "response_end_block" => Ok(GeneratedField::ResponseEndBlock), - "responseCommit" | "response_commit" => Ok(GeneratedField::ResponseCommit), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = BlockMetadata; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut request_begin_block__ = None; - let mut response_begin_block__ = None; - let mut deliver_txs__ = None; - let mut request_end_block__ = None; - let mut response_end_block__ = None; - let mut response_commit__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::RequestBeginBlock => { - if request_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestBeginBlock")); - } - request_begin_block__ = map_.next_value()?; - } - GeneratedField::ResponseBeginBlock => { - if response_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field("responseBeginBlock")); - } - response_begin_block__ = map_.next_value()?; - } - GeneratedField::DeliverTxs => { - if deliver_txs__.is_some() { - return Err(serde::de::Error::duplicate_field("deliverTxs")); - } - deliver_txs__ = Some(map_.next_value()?); - } - GeneratedField::RequestEndBlock => { - if request_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestEndBlock")); - } - request_end_block__ = map_.next_value()?; - } - GeneratedField::ResponseEndBlock => { - if response_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("responseEndBlock")); - } - response_end_block__ = map_.next_value()?; - } - GeneratedField::ResponseCommit => { - if response_commit__.is_some() { - return Err(serde::de::Error::duplicate_field("responseCommit")); - } - response_commit__ = map_.next_value()?; - } - } - } - Ok(BlockMetadata { - request_begin_block: request_begin_block__, - response_begin_block: response_begin_block__, - deliver_txs: deliver_txs__.unwrap_or_default(), - request_end_block: request_end_block__, - response_end_block: response_end_block__, - response_commit: response_commit__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for block_metadata::DeliverTx { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", len)?; - if let Some(v) = self.request.as_ref() { - struct_ser.serialize_field("request", v)?; - } - if let Some(v) = self.response.as_ref() { - struct_ser.serialize_field("response", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for block_metadata::DeliverTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "request", - "response", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Request, - Response, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "request" => Ok(GeneratedField::Request), - "response" => Ok(GeneratedField::Response), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = block_metadata::DeliverTx; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut request__ = None; - let mut response__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Request => { - if request__.is_some() { - return Err(serde::de::Error::duplicate_field("request")); - } - request__ = map_.next_value()?; - } - GeneratedField::Response => { - if response__.is_some() { - return Err(serde::de::Error::duplicate_field("response")); - } - response__ = map_.next_value()?; - } - } - } - Ok(block_metadata::DeliverTx { - request: request__, - response: response__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitId { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitID", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("hash", pbjson::private::base64::encode(&self.hash).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitId { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "hash", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - Hash, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "version" => Ok(GeneratedField::Version), - "hash" => Ok(GeneratedField::Hash), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitId; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitID") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut hash__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::Hash => { - if hash__.is_some() { - return Err(serde::de::Error::duplicate_field("hash")); - } - hash__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(CommitId { - version: version__.unwrap_or_default(), - hash: hash__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitID", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for CommitInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("version", ::alloc::string::ToString::to_string(&self.version).as_str())?; - } - if true { - struct_ser.serialize_field("storeInfos", &self.store_infos)?; - } - if let Some(v) = self.timestamp.as_ref() { - struct_ser.serialize_field("timestamp", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for CommitInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "version", - "store_infos", - "storeInfos", - "timestamp", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Version, - StoreInfos, - Timestamp, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "version" => Ok(GeneratedField::Version), - "storeInfos" | "store_infos" => Ok(GeneratedField::StoreInfos), - "timestamp" => Ok(GeneratedField::Timestamp), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CommitInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut version__ = None; - let mut store_infos__ = None; - let mut timestamp__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Version => { - if version__.is_some() { - return Err(serde::de::Error::duplicate_field("version")); - } - version__ = - Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) - ; - } - GeneratedField::StoreInfos => { - if store_infos__.is_some() { - return Err(serde::de::Error::duplicate_field("storeInfos")); - } - store_infos__ = Some(map_.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = map_.next_value()?; - } - } - } - Ok(CommitInfo { - version: version__.unwrap_or_default(), - store_infos: store_infos__.unwrap_or_default(), - timestamp: timestamp__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.CommitInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StoreInfo { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreInfo", len)?; - if true { - struct_ser.serialize_field("name", &self.name)?; - } - if let Some(v) = self.commit_id.as_ref() { - struct_ser.serialize_field("commitId", v)?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreInfo { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "name", - "commit_id", - "commitId", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Name, - CommitId, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "name" => Ok(GeneratedField::Name), - "commitId" | "commit_id" => Ok(GeneratedField::CommitId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreInfo; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreInfo") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut name__ = None; - let mut commit_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - GeneratedField::CommitId => { - if commit_id__.is_some() { - return Err(serde::de::Error::duplicate_field("commitId")); - } - commit_id__ = map_.next_value()?; - } - } - } - Ok(StoreInfo { - name: name__.unwrap_or_default(), - commit_id: commit_id__, - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreInfo", FIELDS, GeneratedVisitor) - } -} -impl serde::Serialize for StoreKvPair { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - if true { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.store.v1beta1.StoreKVPair", len)?; - if true { - struct_ser.serialize_field("storeKey", &self.store_key)?; - } - if true { - struct_ser.serialize_field("delete", &self.delete)?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if true { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; - } - struct_ser.end() - } -} -impl<'de> serde::Deserialize<'de> for StoreKvPair { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "store_key", - "storeKey", - "delete", - "key", - "value", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - StoreKey, - Delete, - Key, - Value, - } - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "storeKey" | "store_key" => Ok(GeneratedField::StoreKey), - "delete" => Ok(GeneratedField::Delete), - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StoreKvPair; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreKVPair") - } - - fn visit_map(self, mut map_: V) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut store_key__ = None; - let mut delete__ = None; - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::StoreKey => { - if store_key__.is_some() { - return Err(serde::de::Error::duplicate_field("storeKey")); - } - store_key__ = Some(map_.next_value()?); - } - GeneratedField::Delete => { - if delete__.is_some() { - return Err(serde::de::Error::duplicate_field("delete")); - } - delete__ = Some(map_.next_value()?); - } - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = - Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) - ; - } - } - } - Ok(StoreKvPair { - store_key: store_key__.unwrap_or_default(), - delete: delete__.unwrap_or_default(), - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.store.v1beta1.StoreKVPair", FIELDS, GeneratedVisitor) - } -} diff --git a/src/prost/cosmos.base.tendermint.v1beta1.rs b/src/prost/cosmos.base.tendermint.v1beta1.rs index 82dd22d6..24bbd792 100644 --- a/src/prost/cosmos.base.tendermint.v1beta1.rs +++ b/src/prost/cosmos.base.tendermint.v1beta1.rs @@ -6,11 +6,11 @@ pub struct Block { #[prost(message, optional, tag = "1")] pub header: ::core::option::Option
, #[prost(message, optional, tag = "2")] - pub data: ::core::option::Option<::tendermint_proto::types::Data>, + pub data: ::core::option::Option<::cometbft_proto::types::v1::Data>, #[prost(message, optional, tag = "3")] - pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>, + pub evidence: ::core::option::Option<::cometbft_proto::types::v1::EvidenceList>, #[prost(message, optional, tag = "4")] - pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>, + pub last_commit: ::core::option::Option<::cometbft_proto::types::v1::Commit>, } impl ::prost::Name for Block { const NAME: &'static str = "Block"; @@ -25,7 +25,7 @@ impl ::prost::Name for Block { pub struct Header { /// basic block info #[prost(message, optional, tag = "1")] - pub version: ::core::option::Option<::tendermint_proto::version::Consensus>, + pub version: ::core::option::Option<::cometbft_proto::version::v1::Consensus>, #[prost(string, tag = "2")] pub chain_id: ::prost::alloc::string::String, #[prost(int64, tag = "3")] @@ -36,7 +36,7 @@ pub struct Header { >, /// prev block info #[prost(message, optional, tag = "5")] - pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + pub last_block_id: ::core::option::Option<::cometbft_proto::types::v1::BlockId>, /// hashes of block data /// /// commit from validators from the last block @@ -193,10 +193,10 @@ impl ::prost::Name for GetBlockByHeightRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "1")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + pub block_id: ::core::option::Option<::cometbft_proto::types::v1::BlockId>, /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, + pub block: ::core::option::Option<::cometbft_proto::types::v1::Block>, /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, @@ -224,10 +224,10 @@ impl ::prost::Name for GetLatestBlockRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { #[prost(message, optional, tag = "1")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + pub block_id: ::core::option::Option<::cometbft_proto::types::v1::BlockId>, /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, + pub block: ::core::option::Option<::cometbft_proto::types::v1::Block>, /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "3")] pub sdk_block: ::core::option::Option, @@ -281,7 +281,7 @@ impl ::prost::Name for GetNodeInfoRequest { pub struct GetNodeInfoResponse { #[prost(message, optional, tag = "1")] pub default_node_info: ::core::option::Option< - ::tendermint_proto::p2p::DefaultNodeInfo, + ::cometbft_proto::p2p::v1::DefaultNodeInfo, >, #[prost(message, optional, tag = "2")] pub application_version: ::core::option::Option, diff --git a/src/prost/cosmos.base.v1beta1.rs b/src/prost/cosmos.base.v1beta1.rs index e3497310..a1b0c37d 100644 --- a/src/prost/cosmos.base.v1beta1.rs +++ b/src/prost/cosmos.base.v1beta1.rs @@ -37,6 +37,7 @@ impl ::prost::Name for DecCoin { } } /// IntProto defines a Protobuf wrapper around an Int object. +/// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IntProto { @@ -51,6 +52,7 @@ impl ::prost::Name for IntProto { } } /// DecProto defines a Protobuf wrapper around a Dec object. +/// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecProto { diff --git a/src/prost/cosmos.crypto.ed25519.rs b/src/prost/cosmos.crypto.ed25519.rs index 4195c048..895b751f 100644 --- a/src/prost/cosmos.crypto.ed25519.rs +++ b/src/prost/cosmos.crypto.ed25519.rs @@ -16,7 +16,7 @@ impl ::prost::Name for PubKey { ::prost::alloc::format!("cosmos.crypto.ed25519.{}", Self::NAME) } } -/// Deprecated: PrivKey defines a ed25519 private key. +/// PrivKey defines a ed25519 private key. /// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/src/prost/cosmos.gov.v1.rs b/src/prost/cosmos.gov.v1.rs index feb0a17d..4e8b9519 100644 --- a/src/prost/cosmos.gov.v1.rs +++ b/src/prost/cosmos.gov.v1.rs @@ -80,6 +80,8 @@ pub struct Proposal { super::super::super::google::protobuf::Timestamp, >, /// metadata is any arbitrary metadata attached to the proposal. + /// the recommended format of the metadata is to be found here: + /// #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal @@ -92,11 +94,21 @@ pub struct Proposal { /// Since: cosmos-sdk 0.47 #[prost(string, tag = "12")] pub summary: ::prost::alloc::string::String, - /// Proposer is the address of the proposal sumbitter + /// proposer is the address of the proposal sumbitter /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "13")] pub proposer: ::prost::alloc::string::String, + /// expedited defines if the proposal is expedited + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "14")] + pub expedited: bool, + /// failed_reason defines the reason why the proposal failed + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "15")] + pub failed_reason: ::prost::alloc::string::String, } impl ::prost::Name for Proposal { const NAME: &'static str = "Proposal"; @@ -143,7 +155,8 @@ pub struct Vote { /// options is the weighted vote options. #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, - /// metadata is any arbitrary metadata to attached to the vote. + /// metadata is any arbitrary metadata attached to the vote. + /// the recommended format of the metadata is to be found here: #[prost(string, tag = "5")] pub metadata: ::prost::alloc::string::String, } @@ -249,6 +262,34 @@ pub struct Params { /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. #[prost(string, tag = "7")] pub min_initial_deposit_ratio: ::prost::alloc::string::String, + /// The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "8")] + pub proposal_cancel_ratio: ::prost::alloc::string::String, + /// The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + /// If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "9")] + pub proposal_cancel_dest: ::prost::alloc::string::String, + /// Duration of the voting period of an expedited proposal. + /// + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "10")] + pub expedited_voting_period: ::core::option::Option< + super::super::super::google::protobuf::Duration, + >, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "11")] + pub expedited_threshold: ::prost::alloc::string::String, + /// Minimum expedited deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "12")] + pub expedited_min_deposit: ::prost::alloc::vec::Vec< + super::super::base::v1beta1::Coin, + >, /// burn deposits if a proposal does not meet quorum #[prost(bool, tag = "13")] pub burn_vote_quorum: bool, @@ -258,6 +299,13 @@ pub struct Params { /// burn deposits if quorum with vote type no_veto is met #[prost(bool, tag = "15")] pub burn_vote_veto: bool, + /// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + /// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + /// required. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "16")] + pub min_deposit_ratio: ::prost::alloc::string::String, } impl ::prost::Name for Params { const NAME: &'static str = "Params"; @@ -357,236 +405,396 @@ impl ProposalStatus { } } } -/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -/// proposal Content. +/// GenesisState defines the gov module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposal { - /// messages are the arbitrary messages to be executed if proposal passes. - #[prost(message, repeated, tag = "1")] - pub messages: ::prost::alloc::vec::Vec, - /// initial_deposit is the deposit value that must be paid at proposal submission. +pub struct GenesisState { + /// starting_proposal_id is the ID of the starting proposal. + #[prost(uint64, tag = "1")] + pub starting_proposal_id: u64, + /// deposits defines all the deposits present at genesis. #[prost(message, repeated, tag = "2")] - pub initial_deposit: ::prost::alloc::vec::Vec, - /// proposer is the account address of the proposer. - #[prost(string, tag = "3")] - pub proposer: ::prost::alloc::string::String, - /// metadata is any arbitrary metadata attached to the proposal. - #[prost(string, tag = "4")] - pub metadata: ::prost::alloc::string::String, - /// title is the title of the proposal. + pub deposits: ::prost::alloc::vec::Vec, + /// votes defines all the votes present at genesis. + #[prost(message, repeated, tag = "3")] + pub votes: ::prost::alloc::vec::Vec, + /// proposals defines all the proposals present at genesis. + #[prost(message, repeated, tag = "4")] + pub proposals: ::prost::alloc::vec::Vec, + /// Deprecated: Prefer to use `params` instead. + /// deposit_params defines all the paramaters of related to deposit. + #[deprecated] + #[prost(message, optional, tag = "5")] + pub deposit_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// voting_params defines all the paramaters of related to voting. + #[deprecated] + #[prost(message, optional, tag = "6")] + pub voting_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// tally_params defines all the paramaters of related to tally. + #[deprecated] + #[prost(message, optional, tag = "7")] + pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. /// /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "5")] - pub title: ::prost::alloc::string::String, - /// summary is the summary of the proposal + #[prost(message, optional, tag = "8")] + pub params: ::core::option::Option, + /// The constitution allows builders to lay a foundation and define purpose. + /// This is an immutable string set in genesis. + /// There are no amendments, to go outside of scope, just fork. + /// constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. /// - /// Since: cosmos-sdk 0.47 - #[prost(string, tag = "6")] - pub summary: ::prost::alloc::string::String, + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "9")] + pub constitution: ::prost::alloc::string::String, } -impl ::prost::Name for MsgSubmitProposal { - const NAME: &'static str = "MsgSubmitProposal"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +/// QueryConstitutionRequest is the request type for the Query/Constitution RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposalResponse { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, +pub struct QueryConstitutionRequest {} +impl ::prost::Name for QueryConstitutionRequest { + const NAME: &'static str = "QueryConstitutionRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } } -impl ::prost::Name for MsgSubmitProposalResponse { - const NAME: &'static str = "MsgSubmitProposalResponse"; +/// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConstitutionResponse { + #[prost(string, tag = "1")] + pub constitution: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryConstitutionResponse { + const NAME: &'static str = "QueryConstitutionResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgExecLegacyContent is used to wrap the legacy content field into a message. -/// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +/// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExecLegacyContent { - /// content is the proposal's content. - #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option, - /// authority must be the gov module address. - #[prost(string, tag = "2")] - pub authority: ::prost::alloc::string::String, +pub struct QueryProposalRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, } -impl ::prost::Name for MsgExecLegacyContent { - const NAME: &'static str = "MsgExecLegacyContent"; +impl ::prost::Name for QueryProposalRequest { + const NAME: &'static str = "QueryProposalRequest"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +/// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExecLegacyContentResponse {} -impl ::prost::Name for MsgExecLegacyContentResponse { - const NAME: &'static str = "MsgExecLegacyContentResponse"; +pub struct QueryProposalResponse { + /// proposal is the requested governance proposal. + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +impl ::prost::Name for QueryProposalResponse { + const NAME: &'static str = "QueryProposalResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgVote defines a message to cast a vote. +/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVote { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// voter is the voter address for the proposal. +pub struct QueryProposalsRequest { + /// proposal_status defines the status of the proposals. + #[prost(enumeration = "ProposalStatus", tag = "1")] + pub proposal_status: i32, + /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// option defines the vote option. - #[prost(enumeration = "VoteOption", tag = "3")] - pub option: i32, - /// metadata is any arbitrary metadata attached to the Vote. - #[prost(string, tag = "4")] - pub metadata: ::prost::alloc::string::String, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "3")] + pub depositor: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgVote { - const NAME: &'static str = "MsgVote"; +impl ::prost::Name for QueryProposalsRequest { + const NAME: &'static str = "QueryProposalsRequest"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgVoteResponse defines the Msg/Vote response type. +/// QueryProposalsResponse is the response type for the Query/Proposals RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteResponse {} -impl ::prost::Name for MsgVoteResponse { - const NAME: &'static str = "MsgVoteResponse"; +pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. + #[prost(message, repeated, tag = "1")] + pub proposals: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryProposalsResponse { + const NAME: &'static str = "QueryProposalsResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgVoteWeighted defines a message to cast a vote. +/// QueryVoteRequest is the request type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeighted { +pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// voter is the voter address for the proposal. + /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// options defines the weighted vote options. - #[prost(message, repeated, tag = "3")] - pub options: ::prost::alloc::vec::Vec, - /// metadata is any arbitrary metadata attached to the VoteWeighted. - #[prost(string, tag = "4")] - pub metadata: ::prost::alloc::string::String, } -impl ::prost::Name for MsgVoteWeighted { - const NAME: &'static str = "MsgVoteWeighted"; +impl ::prost::Name for QueryVoteRequest { + const NAME: &'static str = "QueryVoteRequest"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +/// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeightedResponse {} -impl ::prost::Name for MsgVoteWeightedResponse { - const NAME: &'static str = "MsgVoteWeightedResponse"; +pub struct QueryVoteResponse { + /// vote defines the queried vote. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +impl ::prost::Name for QueryVoteResponse { + const NAME: &'static str = "QueryVoteResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgDeposit defines a message to submit a deposit to an existing proposal. +/// QueryVotesRequest is the request type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeposit { +pub struct QueryVotesRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "2")] - pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. - #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgDeposit { - const NAME: &'static str = "MsgDeposit"; +impl ::prost::Name for QueryVotesRequest { + const NAME: &'static str = "QueryVotesRequest"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgDepositResponse defines the Msg/Deposit response type. +/// QueryVotesResponse is the response type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDepositResponse {} -impl ::prost::Name for MsgDepositResponse { - const NAME: &'static str = "MsgDepositResponse"; +pub struct QueryVotesResponse { + /// votes defines the queried votes. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryVotesResponse { + const NAME: &'static str = "QueryVotesResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). +pub struct QueryParamsRequest { + /// params_type defines which parameters to query for, can be one of "voting", + /// "tallying" or "deposit". #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/gov parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub params_type: ::prost::alloc::string::String, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[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 = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) +pub struct QueryParamsResponse { + /// Deprecated: Prefer to use `params` instead. + /// voting_params defines the parameters related to voting. + #[deprecated] + #[prost(message, optional, tag = "1")] + pub voting_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// deposit_params defines the parameters related to deposit. + #[deprecated] + #[prost(message, optional, tag = "2")] + pub deposit_params: ::core::option::Option, + /// Deprecated: Prefer to use `params` instead. + /// tally_params defines the parameters related to tally. + #[deprecated] + #[prost(message, optional, tag = "3")] + pub tally_params: ::core::option::Option, + /// params defines all the paramaters of x/gov module. + /// + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "4")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryDepositRequest { + const NAME: &'static str = "QueryDepositRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositResponse { + /// deposit defines the requested deposit. + #[prost(message, optional, tag = "1")] + pub deposit: ::core::option::Option, +} +impl ::prost::Name for QueryDepositResponse { + const NAME: &'static str = "QueryDepositResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositsRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDepositsRequest { + const NAME: &'static str = "QueryDepositsRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. + #[prost(message, repeated, tag = "1")] + pub deposits: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDepositsResponse { + const NAME: &'static str = "QueryDepositsResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +impl ::prost::Name for QueryTallyResultRequest { + const NAME: &'static str = "QueryTallyResultRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +impl ::prost::Name for QueryTallyResultResponse { + const NAME: &'static str = "QueryTallyResultResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the gov Msg service. + /// Query defines the gRPC querier service for gov module #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -597,7 +805,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -615,7 +823,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -629,7 +837,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -662,12 +870,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// SubmitProposal defines a method to create new proposal given the messages. - pub async fn submit_proposal( + /// Constitution queries the chain's constitution. + pub async fn constitution( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -681,20 +889,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Msg/SubmitProposal", + "/cosmos.gov.v1.Query/Constitution", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "SubmitProposal")); + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Constitution")); self.inner.unary(req, path, codec).await } - /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - /// to execute a legacy content-based proposal. - pub async fn exec_legacy_content( + /// Proposal queries proposal details based on ProposalID. + pub async fn proposal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -708,19 +915,45 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Msg/ExecLegacyContent", + "/cosmos.gov.v1.Query/Proposal", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "ExecLegacyContent")); + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposal")); self.inner.unary(req, path, codec).await } - /// Vote defines a method to add a vote on a specific proposal. + /// Proposals queries all proposals based on given status. + pub async fn proposals( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1.Query/Proposals", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposals")); + self.inner.unary(req, path, codec).await + } + /// Vote queries voted information based on proposalID, voterAddr. pub async fn vote( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -733,17 +966,17 @@ pub mod msg_client { ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Vote"); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Vote"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Vote")); + req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Vote")); self.inner.unary(req, path, codec).await } - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - pub async fn vote_weighted( + /// Votes queries votes of a given proposal. + pub async fn votes( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -757,19 +990,44 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Msg/VoteWeighted", + "/cosmos.gov.v1.Query/Votes", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Votes")); + self.inner.unary(req, path, codec).await + } + /// Params queries all parameters of the gov module. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1.Query/Params", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "VoteWeighted")); + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Params")); self.inner.unary(req, path, codec).await } - /// Deposit defines a method to add deposit on a specific proposal. + /// Deposit queries single deposit information based on proposalID, depositAddr. pub async fn deposit( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -783,21 +1041,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Msg/Deposit", + "/cosmos.gov.v1.Query/Deposit", ); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Deposit")); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposit")); self.inner.unary(req, path, codec).await } - /// UpdateParams defines a governance operation for updating the x/gov module - /// parameters. The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - pub async fn update_params( + /// Deposits queries all deposits of a single proposal. + pub async fn deposits( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -811,76 +1067,125 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Msg/UpdateParams", + "/cosmos.gov.v1.Query/Deposits", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "UpdateParams")); + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposits")); + self.inner.unary(req, path, codec).await + } + /// TallyResult queries the tally of a proposal vote. + pub async fn tally_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1.Query/TallyResult", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "TallyResult")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// SubmitProposal defines a method to create new proposal given the messages. - async fn submit_proposal( + pub trait Query: Send + Sync + 'static { + /// Constitution queries the chain's constitution. + async fn constitution( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Proposal queries proposal details based on ProposalID. + async fn proposal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal - /// to execute a legacy content-based proposal. - async fn exec_legacy_content( + /// Proposals queries all proposals based on given status. + async fn proposals( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Vote defines a method to add a vote on a specific proposal. + /// Vote queries voted information based on proposalID, voterAddr. async fn vote( &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - async fn vote_weighted( + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Votes queries votes of a given proposal. + async fn votes( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Deposit defines a method to add deposit on a specific proposal. + /// Params queries all parameters of the gov module. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Deposit queries single deposit information based on proposalID, depositAddr. async fn deposit( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateParams defines a governance operation for updating the x/gov module - /// parameters. The authority is defined in the keeper. - /// - /// Since: cosmos-sdk 0.47 - async fn update_params( + /// Deposits queries all deposits of a single proposal. + async fn deposits( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// TallyResult queries the tally of a proposal vote. + async fn tally_result( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the gov Msg service. + /// Query defines the gRPC querier service for gov module #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -888,7 +1193,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -940,9 +1245,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -958,23 +1263,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.gov.v1.Msg/SubmitProposal" => { + "/cosmos.gov.v1.Query/Constitution" => { #[allow(non_camel_case_types)] - struct SubmitProposalSvc(pub Arc); - impl tonic::server::UnaryService - for SubmitProposalSvc { - type Response = super::MsgSubmitProposalResponse; + struct ConstitutionSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConstitutionSvc { + type Response = super::QueryConstitutionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::submit_proposal(&inner, request).await + ::constitution(&inner, request).await }; Box::pin(fut) } @@ -986,7 +1293,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SubmitProposalSvc(inner); + let method = ConstitutionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1002,23 +1309,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Msg/ExecLegacyContent" => { + "/cosmos.gov.v1.Query/Proposal" => { #[allow(non_camel_case_types)] - struct ExecLegacyContentSvc(pub Arc); - impl tonic::server::UnaryService - for ExecLegacyContentSvc { - type Response = super::MsgExecLegacyContentResponse; + struct ProposalSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalSvc { + type Response = super::QueryProposalResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::exec_legacy_content(&inner, request).await + ::proposal(&inner, request).await }; Box::pin(fut) } @@ -1030,7 +1339,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ExecLegacyContentSvc(inner); + let method = ProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1046,23 +1355,69 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Msg/Vote" => { + "/cosmos.gov.v1.Query/Proposals" => { #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService + struct ProposalsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalsSvc { + type Response = super::QueryProposalsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::proposals(&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 = ProposalsSvc(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) + } + "/cosmos.gov.v1.Query/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService for VoteSvc { - type Response = super::MsgVoteResponse; + type Response = super::QueryVoteResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote(&inner, request).await + ::vote(&inner, request).await }; Box::pin(fut) } @@ -1090,23 +1445,113 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Msg/VoteWeighted" => { + "/cosmos.gov.v1.Query/Votes" => { #[allow(non_camel_case_types)] - struct VoteWeightedSvc(pub Arc); - impl tonic::server::UnaryService - for VoteWeightedSvc { - type Response = super::MsgVoteWeightedResponse; + struct VotesSvc(pub Arc); + impl tonic::server::UnaryService + for VotesSvc { + type Response = super::QueryVotesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::votes(&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 = VotesSvc(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) + } + "/cosmos.gov.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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) + } + "/cosmos.gov.v1.Query/Deposit" => { + #[allow(non_camel_case_types)] + struct DepositSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositSvc { + type Response = super::QueryDepositResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote_weighted(&inner, request).await + ::deposit(&inner, request).await }; Box::pin(fut) } @@ -1118,7 +1563,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = VoteWeightedSvc(inner); + let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1134,23 +1579,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Msg/Deposit" => { + "/cosmos.gov.v1.Query/Deposits" => { #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl tonic::server::UnaryService - for DepositSvc { - type Response = super::MsgDepositResponse; + struct DepositsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositsSvc { + type Response = super::QueryDepositsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposit(&inner, request).await + ::deposits(&inner, request).await }; Box::pin(fut) } @@ -1162,7 +1609,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DepositSvc(inner); + let method = DepositsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1178,23 +1625,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Msg/UpdateParams" => { + "/cosmos.gov.v1.Query/TallyResult" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct TallyResultSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for TallyResultSvc { + type Response = super::QueryTallyResultResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::tally_result(&inner, request).await }; Box::pin(fut) } @@ -1206,7 +1655,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1237,7 +1686,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1249,7 +1698,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1259,306 +1708,274 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.gov.v1.Msg"; + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.gov.v1.Query"; } } -/// QueryProposalRequest is the request type for the Query/Proposal RPC method. +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, +pub struct MsgSubmitProposal { + /// messages are the arbitrary messages to be executed if proposal passes. + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec, + /// initial_deposit is the deposit value that must be paid at proposal submission. + #[prost(message, repeated, tag = "2")] + pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. + #[prost(string, tag = "3")] + pub proposer: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the proposal. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// title is the title of the proposal. + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "5")] + pub title: ::prost::alloc::string::String, + /// summary is the summary of the proposal + /// + /// Since: cosmos-sdk 0.47 + #[prost(string, tag = "6")] + pub summary: ::prost::alloc::string::String, + /// expedited defines if the proposal is expedited or not + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "7")] + pub expedited: bool, } -impl ::prost::Name for QueryProposalRequest { - const NAME: &'static str = "QueryProposalRequest"; +impl ::prost::Name for MsgSubmitProposal { + const NAME: &'static str = "MsgSubmitProposal"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryProposalResponse is the response type for the Query/Proposal RPC method. +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalResponse { - /// proposal is the requested governance proposal. - #[prost(message, optional, tag = "1")] - pub proposal: ::core::option::Option, +pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, } -impl ::prost::Name for QueryProposalResponse { - const NAME: &'static str = "QueryProposalResponse"; +impl ::prost::Name for MsgSubmitProposalResponse { + const NAME: &'static str = "MsgSubmitProposalResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +/// MsgExecLegacyContent is used to wrap the legacy content field into a message. +/// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsRequest { - /// proposal_status defines the status of the proposals. - #[prost(enumeration = "ProposalStatus", tag = "1")] - pub proposal_status: i32, - /// voter defines the voter address for the proposals. +pub struct MsgExecLegacyContent { + /// content is the proposal's content. + #[prost(message, optional, tag = "1")] + pub content: ::core::option::Option, + /// authority must be the gov module address. #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "3")] - pub depositor: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, + pub authority: ::prost::alloc::string::String, } -impl ::prost::Name for QueryProposalsRequest { - const NAME: &'static str = "QueryProposalsRequest"; +impl ::prost::Name for MsgExecLegacyContent { + const NAME: &'static str = "MsgExecLegacyContent"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryProposalsResponse is the response type for the Query/Proposals RPC -/// method. +/// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsResponse { - /// proposals defines all the requested governance proposals. - #[prost(message, repeated, tag = "1")] - pub proposals: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryProposalsResponse { - const NAME: &'static str = "QueryProposalsResponse"; +pub struct MsgExecLegacyContentResponse {} +impl ::prost::Name for MsgExecLegacyContentResponse { + const NAME: &'static str = "MsgExecLegacyContentResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryVoteRequest is the request type for the Query/Vote RPC method. +/// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteRequest { +pub struct MsgVote { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// voter defines the voter address for the proposals. + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, + /// option defines the vote option. + #[prost(enumeration = "VoteOption", tag = "3")] + pub option: i32, + /// metadata is any arbitrary metadata attached to the Vote. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, } -impl ::prost::Name for QueryVoteRequest { - const NAME: &'static str = "QueryVoteRequest"; +impl ::prost::Name for MsgVote { + const NAME: &'static str = "MsgVote"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryVoteResponse is the response type for the Query/Vote RPC method. +/// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteResponse { - /// vote defines the queried vote. - #[prost(message, optional, tag = "1")] - pub vote: ::core::option::Option, -} -impl ::prost::Name for QueryVoteResponse { - const NAME: &'static str = "QueryVoteResponse"; +pub struct MsgVoteResponse {} +impl ::prost::Name for MsgVoteResponse { + const NAME: &'static str = "MsgVoteResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryVotesRequest is the request type for the Query/Votes RPC method. +/// MsgVoteWeighted defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesRequest { +pub struct MsgVoteWeighted { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryVotesRequest { - const NAME: &'static str = "QueryVotesRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) - } -} -/// QueryVotesResponse is the response type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesResponse { - /// votes defines the queried votes. - #[prost(message, repeated, tag = "1")] - pub votes: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryVotesResponse { - const NAME: &'static str = "QueryVotesResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) - } -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest { - /// params_type defines which parameters to query for, can be one of "voting", - /// "tallying" or "deposit". - #[prost(string, tag = "1")] - pub params_type: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) - } -} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// Deprecated: Prefer to use `params` instead. - /// voting_params defines the parameters related to voting. - #[deprecated] - #[prost(message, optional, tag = "1")] - pub voting_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// deposit_params defines the parameters related to deposit. - #[deprecated] - #[prost(message, optional, tag = "2")] - pub deposit_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// tally_params defines the parameters related to tally. - #[deprecated] - #[prost(message, optional, tag = "3")] - pub tally_params: ::core::option::Option, - /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "4")] - pub params: ::core::option::Option, + /// voter is the voter address for the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. + #[prost(message, repeated, tag = "3")] + pub options: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata attached to the VoteWeighted. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, } -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; +impl ::prost::Name for MsgVoteWeighted { + const NAME: &'static str = "MsgVoteWeighted"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryDepositRequest is the request type for the Query/Deposit RPC method. +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositRequest { +pub struct MsgVoteWeightedResponse {} +impl ::prost::Name for MsgVoteWeightedResponse { + const NAME: &'static str = "MsgVoteWeightedResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + } +} +/// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeposit { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, } -impl ::prost::Name for QueryDepositRequest { - const NAME: &'static str = "QueryDepositRequest"; +impl ::prost::Name for MsgDeposit { + const NAME: &'static str = "MsgDeposit"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryDepositResponse is the response type for the Query/Deposit RPC method. +/// MsgDepositResponse defines the Msg/Deposit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositResponse { - /// deposit defines the requested deposit. - #[prost(message, optional, tag = "1")] - pub deposit: ::core::option::Option, -} -impl ::prost::Name for QueryDepositResponse { - const NAME: &'static str = "QueryDepositResponse"; +pub struct MsgDepositResponse {} +impl ::prost::Name for MsgDepositResponse { + const NAME: &'static str = "MsgDepositResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/gov parameters to update. + /// + /// NOTE: All parameters must be supplied. #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, + pub params: ::core::option::Option, } -impl ::prost::Name for QueryDepositsRequest { - const NAME: &'static str = "QueryDepositsRequest"; +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsResponse { - /// deposits defines the requested deposits. - #[prost(message, repeated, tag = "1")] - pub deposits: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDepositsResponse { - const NAME: &'static str = "QueryDepositsResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +/// MsgCancelProposal is the Msg/CancelProposal request type. +/// +/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultRequest { +pub struct MsgCancelProposal { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// proposer is the account address of the proposer. + #[prost(string, tag = "2")] + pub proposer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryTallyResultRequest { - const NAME: &'static str = "QueryTallyResultRequest"; +impl ::prost::Name for MsgCancelProposal { + const NAME: &'static str = "MsgCancelProposal"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) } } -/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +/// MsgCancelProposalResponse defines the response structure for executing a +/// MsgCancelProposal message. +/// +/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultResponse { - /// tally defines the requested tally. - #[prost(message, optional, tag = "1")] - pub tally: ::core::option::Option, +pub struct MsgCancelProposalResponse { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// canceled_time is the time when proposal is canceled. + #[prost(message, optional, tag = "2")] + pub canceled_time: ::core::option::Option< + super::super::super::google::protobuf::Timestamp, + >, + /// canceled_height defines the block height at which the proposal is canceled. + #[prost(uint64, tag = "3")] + pub canceled_height: u64, } -impl ::prost::Name for QueryTallyResultResponse { - const NAME: &'static str = "QueryTallyResultResponse"; +impl ::prost::Name for MsgCancelProposalResponse { + const NAME: &'static str = "MsgCancelProposalResponse"; const PACKAGE: &'static str = "cosmos.gov.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) @@ -1566,16 +1983,16 @@ impl ::prost::Name for QueryTallyResultResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service for gov module + /// Msg defines the gov Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1586,7 +2003,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1604,7 +2021,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1618,7 +2035,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1651,12 +2068,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Proposal queries proposal details based on ProposalID. - pub async fn proposal( + /// SubmitProposal defines a method to create new proposal given the messages. + pub async fn submit_proposal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1670,19 +2087,20 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Proposal", + "/cosmos.gov.v1.Msg/SubmitProposal", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposal")); + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "SubmitProposal")); self.inner.unary(req, path, codec).await } - /// Proposals queries all proposals based on given status. - pub async fn proposals( + /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + /// to execute a legacy content-based proposal. + pub async fn exec_legacy_content( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1696,42 +2114,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Proposals", + "/cosmos.gov.v1.Msg/ExecLegacyContent", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Proposals")); + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "ExecLegacyContent")); self.inner.unary(req, path, codec).await } - /// Vote queries voted information based on proposalID, voterAddr. + /// Vote defines a method to add a vote on a specific proposal. pub async fn vote( &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Vote"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Vote")); - self.inner.unary(req, path, codec).await - } - /// Votes queries votes of a given proposal. - pub async fn votes( - &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1744,19 +2139,17 @@ pub mod query_client { ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Votes", - ); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Vote"); let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Query", "Votes")); + req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Vote")); self.inner.unary(req, path, codec).await } - /// Params queries all parameters of the gov module. - pub async fn params( + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + pub async fn vote_weighted( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1770,19 +2163,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Params", + "/cosmos.gov.v1.Msg/VoteWeighted", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Params")); + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "VoteWeighted")); self.inner.unary(req, path, codec).await } - /// Deposit queries single deposit information based proposalID, depositAddr. + /// Deposit defines a method to add deposit on a specific proposal. pub async fn deposit( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1796,19 +2189,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Deposit", + "/cosmos.gov.v1.Msg/Deposit", ); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposit")); + req.extensions_mut().insert(GrpcMethod::new("cosmos.gov.v1.Msg", "Deposit")); self.inner.unary(req, path, codec).await } - /// Deposits queries all deposits of a single proposal. - pub async fn deposits( + /// UpdateParams defines a governance operation for updating the x/gov module + /// parameters. The authority is defined in the keeper. + /// + /// Since: cosmos-sdk 0.47 + pub async fn update_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1822,19 +2217,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/Deposits", + "/cosmos.gov.v1.Msg/UpdateParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Deposits")); + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "UpdateParams")); self.inner.unary(req, path, codec).await } - /// TallyResult queries the tally of a proposal vote. - pub async fn tally_result( + /// CancelProposal defines a method to cancel governance proposal + /// + /// Since: cosmos-sdk 0.50 + pub async fn cancel_proposal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1848,91 +2245,86 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1.Query/TallyResult", + "/cosmos.gov.v1.Msg/CancelProposal", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1.Query", "TallyResult")); + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "CancelProposal")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Proposal queries proposal details based on ProposalID. - async fn proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Proposals queries all proposals based on given status. - async fn proposals( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Vote queries voted information based on proposalID, voterAddr. - async fn vote( + pub trait Msg: Send + Sync + 'static { + /// SubmitProposal defines a method to create new proposal given the messages. + async fn submit_proposal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Votes queries votes of a given proposal. - async fn votes( + /// ExecLegacyContent defines a Msg to be in included in a MsgSubmitProposal + /// to execute a legacy content-based proposal. + async fn exec_legacy_content( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Params queries all parameters of the gov module. - async fn params( + /// Vote defines a method to add a vote on a specific proposal. + async fn vote( &self, - request: tonic::Request, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + async fn vote_weighted( + &self, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Deposit queries single deposit information based proposalID, depositAddr. + /// Deposit defines a method to add deposit on a specific proposal. async fn deposit( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Deposits queries all deposits of a single proposal. - async fn deposits( + /// UpdateParams defines a governance operation for updating the x/gov module + /// parameters. The authority is defined in the keeper. + /// + /// Since: cosmos-sdk 0.47 + async fn update_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// TallyResult queries the tally of a proposal vote. - async fn tally_result( + /// CancelProposal defines a method to cancel governance proposal + /// + /// Since: cosmos-sdk 0.50 + async fn cancel_proposal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query defines the gRPC querier service for gov module + /// Msg defines the gov Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1940,7 +2332,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1992,9 +2384,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -2010,25 +2402,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.gov.v1.Query/Proposal" => { + "/cosmos.gov.v1.Msg/SubmitProposal" => { #[allow(non_camel_case_types)] - struct ProposalSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalSvc { - type Response = super::QueryProposalResponse; + struct SubmitProposalSvc(pub Arc); + impl tonic::server::UnaryService + for SubmitProposalSvc { + type Response = super::MsgSubmitProposalResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::proposal(&inner, request).await + ::submit_proposal(&inner, request).await }; Box::pin(fut) } @@ -2040,7 +2430,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ProposalSvc(inner); + let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2056,25 +2446,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/Proposals" => { + "/cosmos.gov.v1.Msg/ExecLegacyContent" => { #[allow(non_camel_case_types)] - struct ProposalsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalsSvc { - type Response = super::QueryProposalsResponse; + struct ExecLegacyContentSvc(pub Arc); + impl tonic::server::UnaryService + for ExecLegacyContentSvc { + type Response = super::MsgExecLegacyContentResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::proposals(&inner, request).await + ::exec_legacy_content(&inner, request).await }; Box::pin(fut) } @@ -2086,7 +2474,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ProposalsSvc(inner); + let method = ExecLegacyContentSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2102,23 +2490,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/Vote" => { + "/cosmos.gov.v1.Msg/Vote" => { #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService for VoteSvc { - type Response = super::QueryVoteResponse; + type Response = super::MsgVoteResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote(&inner, request).await + ::vote(&inner, request).await }; Box::pin(fut) } @@ -2146,67 +2534,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/Votes" => { - #[allow(non_camel_case_types)] - struct VotesSvc(pub Arc); - impl tonic::server::UnaryService - for VotesSvc { - type Response = super::QueryVotesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::votes(&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 = VotesSvc(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) - } - "/cosmos.gov.v1.Query/Params" => { + "/cosmos.gov.v1.Msg/VoteWeighted" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct VoteWeightedSvc(pub Arc); + impl tonic::server::UnaryService + for VoteWeightedSvc { + type Response = super::MsgVoteWeightedResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::vote_weighted(&inner, request).await }; Box::pin(fut) } @@ -2218,7 +2562,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = VoteWeightedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2234,25 +2578,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/Deposit" => { + "/cosmos.gov.v1.Msg/Deposit" => { #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService + struct DepositSvc(pub Arc); + impl tonic::server::UnaryService for DepositSvc { - type Response = super::QueryDepositResponse; + type Response = super::MsgDepositResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposit(&inner, request).await + ::deposit(&inner, request).await }; Box::pin(fut) } @@ -2280,25 +2622,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/Deposits" => { + "/cosmos.gov.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct DepositsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositsSvc { - type Response = super::QueryDepositsResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposits(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -2310,7 +2650,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DepositsSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2326,25 +2666,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1.Query/TallyResult" => { + "/cosmos.gov.v1.Msg/CancelProposal" => { #[allow(non_camel_case_types)] - struct TallyResultSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TallyResultSvc { - type Response = super::QueryTallyResultResponse; + struct CancelProposalSvc(pub Arc); + impl tonic::server::UnaryService + for CancelProposalSvc { + type Response = super::MsgCancelProposalResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::tally_result(&inner, request).await + ::cancel_proposal(&inner, request).await }; Box::pin(fut) } @@ -2356,7 +2694,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TallyResultSvc(inner); + let method = CancelProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2387,7 +2725,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2399,7 +2737,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2409,51 +2747,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.gov.v1.Query"; - } -} -/// GenesisState defines the gov module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// starting_proposal_id is the ID of the starting proposal. - #[prost(uint64, tag = "1")] - pub starting_proposal_id: u64, - /// deposits defines all the deposits present at genesis. - #[prost(message, repeated, tag = "2")] - pub deposits: ::prost::alloc::vec::Vec, - /// votes defines all the votes present at genesis. - #[prost(message, repeated, tag = "3")] - pub votes: ::prost::alloc::vec::Vec, - /// proposals defines all the proposals present at genesis. - #[prost(message, repeated, tag = "4")] - pub proposals: ::prost::alloc::vec::Vec, - /// Deprecated: Prefer to use `params` instead. - /// deposit_params defines all the paramaters of related to deposit. - #[deprecated] - #[prost(message, optional, tag = "5")] - pub deposit_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// voting_params defines all the paramaters of related to voting. - #[deprecated] - #[prost(message, optional, tag = "6")] - pub voting_params: ::core::option::Option, - /// Deprecated: Prefer to use `params` instead. - /// tally_params defines all the paramaters of related to tally. - #[deprecated] - #[prost(message, optional, tag = "7")] - pub tally_params: ::core::option::Option, - /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 - #[prost(message, optional, tag = "8")] - pub params: ::core::option::Option, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.gov.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.gov.v1.Msg"; } } diff --git a/src/prost/cosmos.gov.v1.serde.rs b/src/prost/cosmos.gov.v1.serde.rs index 82932543..4538cd9f 100644 --- a/src/prost/cosmos.gov.v1.serde.rs +++ b/src/prost/cosmos.gov.v1.serde.rs @@ -269,6 +269,9 @@ impl serde::Serialize for GenesisState { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; if true { #[allow(clippy::needless_borrow)] @@ -295,6 +298,9 @@ impl serde::Serialize for GenesisState { if let Some(v) = self.params.as_ref() { struct_ser.serialize_field("params", v)?; } + if true { + struct_ser.serialize_field("constitution", &self.constitution)?; + } struct_ser.end() } } @@ -317,6 +323,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "tally_params", "tallyParams", "params", + "constitution", ]; #[allow(clippy::enum_variant_names)] @@ -329,6 +336,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { VotingParams, TallyParams, Params, + Constitution, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -358,6 +366,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), "params" => Ok(GeneratedField::Params), + "constitution" => Ok(GeneratedField::Constitution), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -385,6 +394,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { let mut voting_params__ = None; let mut tally_params__ = None; let mut params__ = None; + let mut constitution__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::StartingProposalId => { @@ -437,6 +447,12 @@ impl<'de> serde::Deserialize<'de> for GenesisState { } params__ = map_.next_value()?; } + GeneratedField::Constitution => { + if constitution__.is_some() { + return Err(serde::de::Error::duplicate_field("constitution")); + } + constitution__ = Some(map_.next_value()?); + } } } Ok(GenesisState { @@ -448,12 +464,259 @@ impl<'de> serde::Deserialize<'de> for GenesisState { voting_params: voting_params__, tally_params: tally_params__, params: params__, + constitution: constitution__.unwrap_or_default(), }) } } deserializer.deserialize_struct("cosmos.gov.v1.GenesisState", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MsgCancelProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgCancelProposal", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if true { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "proposer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Proposer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "proposer" => Ok(GeneratedField::Proposer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelProposal; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgCancelProposal") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut proposer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::Proposer => { + if proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("proposer")); + } + proposer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCancelProposal { + proposal_id: proposal_id__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgCancelProposal", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgCancelProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgCancelProposalResponse", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proposalId", ::alloc::string::ToString::to_string(&self.proposal_id).as_str())?; + } + if let Some(v) = self.canceled_time.as_ref() { + struct_ser.serialize_field("canceledTime", v)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("canceledHeight", ::alloc::string::ToString::to_string(&self.canceled_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgCancelProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "canceled_time", + "canceledTime", + "canceled_height", + "canceledHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + CanceledTime, + CanceledHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "canceledTime" | "canceled_time" => Ok(GeneratedField::CanceledTime), + "canceledHeight" | "canceled_height" => Ok(GeneratedField::CanceledHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelProposalResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgCancelProposalResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut canceled_time__ = None; + let mut canceled_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + GeneratedField::CanceledTime => { + if canceled_time__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledTime")); + } + canceled_time__ = map_.next_value()?; + } + GeneratedField::CanceledHeight => { + if canceled_height__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledHeight")); + } + canceled_height__ = + Some(map_.next_value::<::pbjson::private::NumberDeserialize<_>>()?.0) + ; + } + } + } + Ok(MsgCancelProposalResponse { + proposal_id: proposal_id__.unwrap_or_default(), + canceled_time: canceled_time__, + canceled_height: canceled_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgCancelProposalResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for MsgDeposit { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -859,6 +1122,9 @@ impl serde::Serialize for MsgSubmitProposal { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposal", len)?; if true { struct_ser.serialize_field("messages", &self.messages)?; @@ -878,6 +1144,9 @@ impl serde::Serialize for MsgSubmitProposal { if true { struct_ser.serialize_field("summary", &self.summary)?; } + if true { + struct_ser.serialize_field("expedited", &self.expedited)?; + } struct_ser.end() } } @@ -895,6 +1164,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { "metadata", "title", "summary", + "expedited", ]; #[allow(clippy::enum_variant_names)] @@ -905,6 +1175,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { Metadata, Title, Summary, + Expedited, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -932,6 +1203,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { "metadata" => Ok(GeneratedField::Metadata), "title" => Ok(GeneratedField::Title), "summary" => Ok(GeneratedField::Summary), + "expedited" => Ok(GeneratedField::Expedited), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -957,6 +1229,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { let mut metadata__ = None; let mut title__ = None; let mut summary__ = None; + let mut expedited__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Messages => { @@ -995,6 +1268,12 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { } summary__ = Some(map_.next_value()?); } + GeneratedField::Expedited => { + if expedited__.is_some() { + return Err(serde::de::Error::duplicate_field("expedited")); + } + expedited__ = Some(map_.next_value()?); + } } } Ok(MsgSubmitProposal { @@ -1004,6 +1283,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { metadata: metadata__.unwrap_or_default(), title: title__.unwrap_or_default(), summary: summary__.unwrap_or_default(), + expedited: expedited__.unwrap_or_default(), }) } } @@ -1758,6 +2038,24 @@ impl serde::Serialize for Params { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Params", len)?; if true { struct_ser.serialize_field("minDeposit", &self.min_deposit)?; @@ -1780,6 +2078,21 @@ impl serde::Serialize for Params { if true { struct_ser.serialize_field("minInitialDepositRatio", &self.min_initial_deposit_ratio)?; } + if true { + struct_ser.serialize_field("proposalCancelRatio", &self.proposal_cancel_ratio)?; + } + if true { + struct_ser.serialize_field("proposalCancelDest", &self.proposal_cancel_dest)?; + } + if let Some(v) = self.expedited_voting_period.as_ref() { + struct_ser.serialize_field("expeditedVotingPeriod", v)?; + } + if true { + struct_ser.serialize_field("expeditedThreshold", &self.expedited_threshold)?; + } + if true { + struct_ser.serialize_field("expeditedMinDeposit", &self.expedited_min_deposit)?; + } if true { struct_ser.serialize_field("burnVoteQuorum", &self.burn_vote_quorum)?; } @@ -1789,6 +2102,9 @@ impl serde::Serialize for Params { if true { struct_ser.serialize_field("burnVoteVeto", &self.burn_vote_veto)?; } + if true { + struct_ser.serialize_field("minDepositRatio", &self.min_deposit_ratio)?; + } struct_ser.end() } } @@ -1811,12 +2127,24 @@ impl<'de> serde::Deserialize<'de> for Params { "vetoThreshold", "min_initial_deposit_ratio", "minInitialDepositRatio", + "proposal_cancel_ratio", + "proposalCancelRatio", + "proposal_cancel_dest", + "proposalCancelDest", + "expedited_voting_period", + "expeditedVotingPeriod", + "expedited_threshold", + "expeditedThreshold", + "expedited_min_deposit", + "expeditedMinDeposit", "burn_vote_quorum", "burnVoteQuorum", "burn_proposal_deposit_prevote", "burnProposalDepositPrevote", "burn_vote_veto", "burnVoteVeto", + "min_deposit_ratio", + "minDepositRatio", ]; #[allow(clippy::enum_variant_names)] @@ -1828,9 +2156,15 @@ impl<'de> serde::Deserialize<'de> for Params { Threshold, VetoThreshold, MinInitialDepositRatio, + ProposalCancelRatio, + ProposalCancelDest, + ExpeditedVotingPeriod, + ExpeditedThreshold, + ExpeditedMinDeposit, BurnVoteQuorum, BurnProposalDepositPrevote, BurnVoteVeto, + MinDepositRatio, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -1859,9 +2193,15 @@ impl<'de> serde::Deserialize<'de> for Params { "threshold" => Ok(GeneratedField::Threshold), "vetoThreshold" | "veto_threshold" => Ok(GeneratedField::VetoThreshold), "minInitialDepositRatio" | "min_initial_deposit_ratio" => Ok(GeneratedField::MinInitialDepositRatio), + "proposalCancelRatio" | "proposal_cancel_ratio" => Ok(GeneratedField::ProposalCancelRatio), + "proposalCancelDest" | "proposal_cancel_dest" => Ok(GeneratedField::ProposalCancelDest), + "expeditedVotingPeriod" | "expedited_voting_period" => Ok(GeneratedField::ExpeditedVotingPeriod), + "expeditedThreshold" | "expedited_threshold" => Ok(GeneratedField::ExpeditedThreshold), + "expeditedMinDeposit" | "expedited_min_deposit" => Ok(GeneratedField::ExpeditedMinDeposit), "burnVoteQuorum" | "burn_vote_quorum" => Ok(GeneratedField::BurnVoteQuorum), "burnProposalDepositPrevote" | "burn_proposal_deposit_prevote" => Ok(GeneratedField::BurnProposalDepositPrevote), "burnVoteVeto" | "burn_vote_veto" => Ok(GeneratedField::BurnVoteVeto), + "minDepositRatio" | "min_deposit_ratio" => Ok(GeneratedField::MinDepositRatio), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1888,9 +2228,15 @@ impl<'de> serde::Deserialize<'de> for Params { let mut threshold__ = None; let mut veto_threshold__ = None; let mut min_initial_deposit_ratio__ = None; + let mut proposal_cancel_ratio__ = None; + let mut proposal_cancel_dest__ = None; + let mut expedited_voting_period__ = None; + let mut expedited_threshold__ = None; + let mut expedited_min_deposit__ = None; let mut burn_vote_quorum__ = None; let mut burn_proposal_deposit_prevote__ = None; let mut burn_vote_veto__ = None; + let mut min_deposit_ratio__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::MinDeposit => { @@ -1935,6 +2281,36 @@ impl<'de> serde::Deserialize<'de> for Params { } min_initial_deposit_ratio__ = Some(map_.next_value()?); } + GeneratedField::ProposalCancelRatio => { + if proposal_cancel_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalCancelRatio")); + } + proposal_cancel_ratio__ = Some(map_.next_value()?); + } + GeneratedField::ProposalCancelDest => { + if proposal_cancel_dest__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalCancelDest")); + } + proposal_cancel_dest__ = Some(map_.next_value()?); + } + GeneratedField::ExpeditedVotingPeriod => { + if expedited_voting_period__.is_some() { + return Err(serde::de::Error::duplicate_field("expeditedVotingPeriod")); + } + expedited_voting_period__ = map_.next_value()?; + } + GeneratedField::ExpeditedThreshold => { + if expedited_threshold__.is_some() { + return Err(serde::de::Error::duplicate_field("expeditedThreshold")); + } + expedited_threshold__ = Some(map_.next_value()?); + } + GeneratedField::ExpeditedMinDeposit => { + if expedited_min_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field("expeditedMinDeposit")); + } + expedited_min_deposit__ = Some(map_.next_value()?); + } GeneratedField::BurnVoteQuorum => { if burn_vote_quorum__.is_some() { return Err(serde::de::Error::duplicate_field("burnVoteQuorum")); @@ -1953,6 +2329,12 @@ impl<'de> serde::Deserialize<'de> for Params { } burn_vote_veto__ = Some(map_.next_value()?); } + GeneratedField::MinDepositRatio => { + if min_deposit_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("minDepositRatio")); + } + min_deposit_ratio__ = Some(map_.next_value()?); + } } } Ok(Params { @@ -1963,9 +2345,15 @@ impl<'de> serde::Deserialize<'de> for Params { threshold: threshold__.unwrap_or_default(), veto_threshold: veto_threshold__.unwrap_or_default(), min_initial_deposit_ratio: min_initial_deposit_ratio__.unwrap_or_default(), + proposal_cancel_ratio: proposal_cancel_ratio__.unwrap_or_default(), + proposal_cancel_dest: proposal_cancel_dest__.unwrap_or_default(), + expedited_voting_period: expedited_voting_period__, + expedited_threshold: expedited_threshold__.unwrap_or_default(), + expedited_min_deposit: expedited_min_deposit__.unwrap_or_default(), burn_vote_quorum: burn_vote_quorum__.unwrap_or_default(), burn_proposal_deposit_prevote: burn_proposal_deposit_prevote__.unwrap_or_default(), burn_vote_veto: burn_vote_veto__.unwrap_or_default(), + min_deposit_ratio: min_deposit_ratio__.unwrap_or_default(), }) } } @@ -2019,6 +2407,12 @@ impl serde::Serialize for Proposal { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; if true { #[allow(clippy::needless_borrow)] @@ -2062,6 +2456,12 @@ impl serde::Serialize for Proposal { if true { struct_ser.serialize_field("proposer", &self.proposer)?; } + if true { + struct_ser.serialize_field("expedited", &self.expedited)?; + } + if true { + struct_ser.serialize_field("failedReason", &self.failed_reason)?; + } struct_ser.end() } } @@ -2091,6 +2491,9 @@ impl<'de> serde::Deserialize<'de> for Proposal { "title", "summary", "proposer", + "expedited", + "failed_reason", + "failedReason", ]; #[allow(clippy::enum_variant_names)] @@ -2108,6 +2511,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { Title, Summary, Proposer, + Expedited, + FailedReason, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -2142,6 +2547,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { "title" => Ok(GeneratedField::Title), "summary" => Ok(GeneratedField::Summary), "proposer" => Ok(GeneratedField::Proposer), + "expedited" => Ok(GeneratedField::Expedited), + "failedReason" | "failed_reason" => Ok(GeneratedField::FailedReason), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2174,6 +2581,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { let mut title__ = None; let mut summary__ = None; let mut proposer__ = None; + let mut expedited__ = None; + let mut failed_reason__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Id => { @@ -2256,6 +2665,18 @@ impl<'de> serde::Deserialize<'de> for Proposal { } proposer__ = Some(map_.next_value()?); } + GeneratedField::Expedited => { + if expedited__.is_some() { + return Err(serde::de::Error::duplicate_field("expedited")); + } + expedited__ = Some(map_.next_value()?); + } + GeneratedField::FailedReason => { + if failed_reason__.is_some() { + return Err(serde::de::Error::duplicate_field("failedReason")); + } + failed_reason__ = Some(map_.next_value()?); + } } } Ok(Proposal { @@ -2272,6 +2693,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { title: title__.unwrap_or_default(), summary: summary__.unwrap_or_default(), proposer: proposer__.unwrap_or_default(), + expedited: expedited__.unwrap_or_default(), + failed_reason: failed_reason__.unwrap_or_default(), }) } } @@ -2361,6 +2784,168 @@ impl<'de> serde::Deserialize<'de> for ProposalStatus { deserializer.deserialize_any(GeneratedVisitor) } } +impl serde::Serialize for QueryConstitutionRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryConstitutionRequest", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConstitutionRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConstitutionRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryConstitutionRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryConstitutionRequest { + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryConstitutionRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryConstitutionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.QueryConstitutionResponse", len)?; + if true { + struct_ser.serialize_field("constitution", &self.constitution)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryConstitutionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "constitution", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Constitution, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "constitution" => Ok(GeneratedField::Constitution), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConstitutionResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryConstitutionResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut constitution__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Constitution => { + if constitution__.is_some() { + return Err(serde::de::Error::duplicate_field("constitution")); + } + constitution__ = Some(map_.next_value()?); + } + } + } + Ok(QueryConstitutionResponse { + constitution: constitution__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.QueryConstitutionResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for QueryDepositRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result diff --git a/src/prost/cosmos.gov.v1beta1.rs b/src/prost/cosmos.gov.v1beta1.rs index d421555b..3af4a744 100644 --- a/src/prost/cosmos.gov.v1beta1.rs +++ b/src/prost/cosmos.gov.v1beta1.rs @@ -314,138 +314,323 @@ impl ProposalStatus { } } } -/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary -/// proposal Content. +/// GenesisState defines the gov module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposal { - /// content is the proposal's content. - #[prost(message, optional, tag = "1")] - pub content: ::core::option::Option, - /// initial_deposit is the deposit value that must be paid at proposal submission. +pub struct GenesisState { + /// starting_proposal_id is the ID of the starting proposal. + #[prost(uint64, tag = "1")] + pub starting_proposal_id: u64, + /// deposits defines all the deposits present at genesis. #[prost(message, repeated, tag = "2")] - pub initial_deposit: ::prost::alloc::vec::Vec, - /// proposer is the account address of the proposer. - #[prost(string, tag = "3")] - pub proposer: ::prost::alloc::string::String, + pub deposits: ::prost::alloc::vec::Vec, + /// votes defines all the votes present at genesis. + #[prost(message, repeated, tag = "3")] + pub votes: ::prost::alloc::vec::Vec, + /// proposals defines all the proposals present at genesis. + #[prost(message, repeated, tag = "4")] + pub proposals: ::prost::alloc::vec::Vec, + /// deposit_params defines all the parameters related to deposit. + #[prost(message, optional, tag = "5")] + pub deposit_params: ::core::option::Option, + /// voting_params defines all the parameters related to voting. + #[prost(message, optional, tag = "6")] + pub voting_params: ::core::option::Option, + /// tally_params defines all the parameters related to tally. + #[prost(message, optional, tag = "7")] + pub tally_params: ::core::option::Option, } -impl ::prost::Name for MsgSubmitProposal { - const NAME: &'static str = "MsgSubmitProposal"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +/// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitProposalResponse { +pub struct QueryProposalRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, } -impl ::prost::Name for MsgSubmitProposalResponse { - const NAME: &'static str = "MsgSubmitProposalResponse"; +impl ::prost::Name for QueryProposalRequest { + const NAME: &'static str = "QueryProposalRequest"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgVote defines a message to cast a vote. +/// QueryProposalResponse is the response type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVote { +pub struct QueryProposalResponse { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +impl ::prost::Name for QueryProposalResponse { + const NAME: &'static str = "QueryProposalResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalsRequest { + /// proposal_status defines the status of the proposals. + #[prost(enumeration = "ProposalStatus", tag = "1")] + pub proposal_status: i32, + /// voter defines the voter address for the proposals. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "3")] + pub depositor: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryProposalsRequest { + const NAME: &'static str = "QueryProposalsRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryProposalsResponse is the response type for the Query/Proposals RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalsResponse { + /// proposals defines all the requested governance proposals. + #[prost(message, repeated, tag = "1")] + pub proposals: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryProposalsResponse { + const NAME: &'static str = "QueryProposalsResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// voter is the voter address for the proposal. + /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, - /// option defines the vote option. - #[prost(enumeration = "VoteOption", tag = "3")] - pub option: i32, } -impl ::prost::Name for MsgVote { - const NAME: &'static str = "MsgVote"; +impl ::prost::Name for QueryVoteRequest { + const NAME: &'static str = "QueryVoteRequest"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgVoteResponse defines the Msg/Vote response type. +/// QueryVoteResponse is the response type for the Query/Vote RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteResponse {} -impl ::prost::Name for MsgVoteResponse { - const NAME: &'static str = "MsgVoteResponse"; +pub struct QueryVoteResponse { + /// vote defines the queried vote. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +impl ::prost::Name for QueryVoteResponse { + const NAME: &'static str = "QueryVoteResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgVoteWeighted defines a message to cast a vote. -/// -/// Since: cosmos-sdk 0.43 +/// QueryVotesRequest is the request type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeighted { +pub struct QueryVotesRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// voter is the voter address for the proposal. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, - /// options defines the weighted vote options. - #[prost(message, repeated, tag = "3")] - pub options: ::prost::alloc::vec::Vec, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgVoteWeighted { - const NAME: &'static str = "MsgVoteWeighted"; +impl ::prost::Name for QueryVotesRequest { + const NAME: &'static str = "QueryVotesRequest"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -/// -/// Since: cosmos-sdk 0.43 +/// QueryVotesResponse is the response type for the Query/Votes RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgVoteWeightedResponse {} -impl ::prost::Name for MsgVoteWeightedResponse { - const NAME: &'static str = "MsgVoteWeightedResponse"; +pub struct QueryVotesResponse { + /// votes defines the queried votes. + #[prost(message, repeated, tag = "1")] + pub votes: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryVotesResponse { + const NAME: &'static str = "QueryVotesResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgDeposit defines a message to submit a deposit to an existing proposal. +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDeposit { +pub struct QueryParamsRequest { + /// params_type defines which parameters to query for, can be one of "voting", + /// "tallying" or "deposit". + #[prost(string, tag = "1")] + pub params_type: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// voting_params defines the parameters related to voting. + #[prost(message, optional, tag = "1")] + pub voting_params: ::core::option::Option, + /// deposit_params defines the parameters related to deposit. + #[prost(message, optional, tag = "2")] + pub deposit_params: ::core::option::Option, + /// tally_params defines the parameters related to tally. + #[prost(message, optional, tag = "3")] + pub tally_params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, /// depositor defines the deposit addresses from the proposals. #[prost(string, tag = "2")] pub depositor: ::prost::alloc::string::String, - /// amount to be deposited by depositor. - #[prost(message, repeated, tag = "3")] - pub amount: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgDeposit { - const NAME: &'static str = "MsgDeposit"; +impl ::prost::Name for QueryDepositRequest { + const NAME: &'static str = "QueryDepositRequest"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// MsgDepositResponse defines the Msg/Deposit response type. +/// QueryDepositResponse is the response type for the Query/Deposit RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDepositResponse {} -impl ::prost::Name for MsgDepositResponse { - const NAME: &'static str = "MsgDepositResponse"; +pub struct QueryDepositResponse { + /// deposit defines the requested deposit. + #[prost(message, optional, tag = "1")] + pub deposit: ::core::option::Option, +} +impl ::prost::Name for QueryDepositResponse { + const NAME: &'static str = "QueryDepositResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositsRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDepositsRequest { + const NAME: &'static str = "QueryDepositsRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositsResponse { + /// deposits defines the requested deposits. + #[prost(message, repeated, tag = "1")] + pub deposits: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDepositsResponse { + const NAME: &'static str = "QueryDepositsResponse"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultRequest { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +impl ::prost::Name for QueryTallyResultRequest { + const NAME: &'static str = "QueryTallyResultRequest"; + const PACKAGE: &'static str = "cosmos.gov.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + } +} +/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +impl ::prost::Name for QueryTallyResultResponse { + const NAME: &'static str = "QueryTallyResultResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) @@ -453,16 +638,16 @@ impl ::prost::Name for MsgDepositResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the bank Msg service. + /// Query defines the gRPC querier service for gov module #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -473,7 +658,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -491,7 +676,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -505,7 +690,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -538,12 +723,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// SubmitProposal defines a method to create new proposal given a content. - pub async fn submit_proposal( + /// Proposal queries proposal details based on ProposalID. + pub async fn proposal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -557,19 +742,45 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/SubmitProposal", + "/cosmos.gov.v1beta1.Query/Proposal", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "SubmitProposal")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposal")); self.inner.unary(req, path, codec).await } - /// Vote defines a method to add a vote on a specific proposal. + /// Proposals queries all proposals based on given status. + pub async fn proposals( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Query/Proposals", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposals")); + self.inner.unary(req, path, codec).await + } + /// Vote queries voted information based on proposalID, voterAddr. pub async fn vote( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -583,21 +794,97 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/Vote", + "/cosmos.gov.v1beta1.Query/Vote", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Vote")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Vote")); self.inner.unary(req, path, codec).await } - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - /// - /// Since: cosmos-sdk 0.43 - pub async fn vote_weighted( + /// Votes queries votes of a given proposal. + pub async fn votes( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Query/Votes", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Votes")); + self.inner.unary(req, path, codec).await + } + /// Params queries all parameters of the gov module. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /// Deposit queries single deposit information based on proposalID, depositor address. + pub async fn deposit( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.gov.v1beta1.Query/Deposit", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposit")); + self.inner.unary(req, path, codec).await + } + /// Deposits queries all deposits of a single proposal. + pub async fn deposits( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, tonic::Status, > { self.inner @@ -611,19 +898,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/VoteWeighted", + "/cosmos.gov.v1beta1.Query/Deposits", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "VoteWeighted")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposits")); self.inner.unary(req, path, codec).await } - /// Deposit defines a method to add deposit on a specific proposal. - pub async fn deposit( + /// TallyResult queries the tally of a proposal vote. + pub async fn tally_result( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -637,58 +924,91 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Msg/Deposit", + "/cosmos.gov.v1beta1.Query/TallyResult", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Deposit")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "TallyResult")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// SubmitProposal defines a method to create new proposal given a content. - async fn submit_proposal( + pub trait Query: Send + Sync + 'static { + /// Proposal queries proposal details based on ProposalID. + async fn proposal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Vote defines a method to add a vote on a specific proposal. + /// Proposals queries all proposals based on given status. + async fn proposals( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Vote queries voted information based on proposalID, voterAddr. async fn vote( &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - /// VoteWeighted defines a method to add a weighted vote on a specific proposal. - /// - /// Since: cosmos-sdk 0.43 - async fn vote_weighted( + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Votes queries votes of a given proposal. + async fn votes( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Deposit defines a method to add deposit on a specific proposal. + /// Params queries all parameters of the gov module. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Deposit queries single deposit information based on proposalID, depositor address. async fn deposit( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// Deposits queries all deposits of a single proposal. + async fn deposits( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// TallyResult queries the tally of a proposal vote. + async fn tally_result( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the bank Msg service. + /// Query defines the gRPC querier service for gov module #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -696,7 +1016,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -748,9 +1068,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -766,23 +1086,203 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.gov.v1beta1.Msg/SubmitProposal" => { + "/cosmos.gov.v1beta1.Query/Proposal" => { + #[allow(non_camel_case_types)] + struct ProposalSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalSvc { + type Response = super::QueryProposalResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::proposal(&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 = ProposalSvc(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) + } + "/cosmos.gov.v1beta1.Query/Proposals" => { + #[allow(non_camel_case_types)] + struct ProposalsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ProposalsSvc { + type Response = super::QueryProposalsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::proposals(&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 = ProposalsSvc(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) + } + "/cosmos.gov.v1beta1.Query/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService + for VoteSvc { + type Response = super::QueryVoteResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::vote(&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 = VoteSvc(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) + } + "/cosmos.gov.v1beta1.Query/Votes" => { + #[allow(non_camel_case_types)] + struct VotesSvc(pub Arc); + impl tonic::server::UnaryService + for VotesSvc { + type Response = super::QueryVotesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::votes(&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 = VotesSvc(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) + } + "/cosmos.gov.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] - struct SubmitProposalSvc(pub Arc); - impl tonic::server::UnaryService - for SubmitProposalSvc { - type Response = super::MsgSubmitProposalResponse; + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::submit_proposal(&inner, request).await + ::params(&inner, request).await }; Box::pin(fut) } @@ -794,7 +1294,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SubmitProposalSvc(inner); + let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -810,23 +1310,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Msg/Vote" => { + "/cosmos.gov.v1beta1.Query/Deposit" => { #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService - for VoteSvc { - type Response = super::MsgVoteResponse; + struct DepositSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositSvc { + type Response = super::QueryDepositResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote(&inner, request).await + ::deposit(&inner, request).await }; Box::pin(fut) } @@ -838,7 +1340,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = VoteSvc(inner); + let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -854,23 +1356,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Msg/VoteWeighted" => { + "/cosmos.gov.v1beta1.Query/Deposits" => { #[allow(non_camel_case_types)] - struct VoteWeightedSvc(pub Arc); - impl tonic::server::UnaryService - for VoteWeightedSvc { - type Response = super::MsgVoteWeightedResponse; + struct DepositsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DepositsSvc { + type Response = super::QueryDepositsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote_weighted(&inner, request).await + ::deposits(&inner, request).await }; Box::pin(fut) } @@ -882,7 +1386,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = VoteWeightedSvc(inner); + let method = DepositsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -898,23 +1402,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Msg/Deposit" => { + "/cosmos.gov.v1beta1.Query/TallyResult" => { #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl tonic::server::UnaryService - for DepositSvc { - type Response = super::MsgDepositResponse; + struct TallyResultSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for TallyResultSvc { + type Response = super::QueryTallyResultResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposit(&inner, request).await + ::tally_result(&inner, request).await }; Box::pin(fut) } @@ -926,7 +1432,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DepositSvc(inner); + let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -957,7 +1463,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -969,7 +1475,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -979,294 +1485,142 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "cosmos.gov.v1beta1.Msg"; - } -} -/// QueryProposalRequest is the request type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, -} -impl ::prost::Name for QueryProposalRequest { - const NAME: &'static str = "QueryProposalRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryProposalResponse is the response type for the Query/Proposal RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalResponse { - #[prost(message, optional, tag = "1")] - pub proposal: ::core::option::Option, -} -impl ::prost::Name for QueryProposalResponse { - const NAME: &'static str = "QueryProposalResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsRequest { - /// proposal_status defines the status of the proposals. - #[prost(enumeration = "ProposalStatus", tag = "1")] - pub proposal_status: i32, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, - /// depositor defines the deposit addresses from the proposals. - #[prost(string, tag = "3")] - pub depositor: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryProposalsRequest { - const NAME: &'static str = "QueryProposalsRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryProposalsResponse is the response type for the Query/Proposals RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryProposalsResponse { - /// proposals defines all the requested governance proposals. - #[prost(message, repeated, tag = "1")] - pub proposals: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryProposalsResponse { - const NAME: &'static str = "QueryProposalsResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryVoteRequest is the request type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// voter defines the voter address for the proposals. - #[prost(string, tag = "2")] - pub voter: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryVoteRequest { - const NAME: &'static str = "QueryVoteRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryVoteResponse is the response type for the Query/Vote RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVoteResponse { - /// vote defines the queried vote. - #[prost(message, optional, tag = "1")] - pub vote: ::core::option::Option, -} -impl ::prost::Name for QueryVoteResponse { - const NAME: &'static str = "QueryVoteResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryVotesRequest is the request type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesRequest { - /// proposal_id defines the unique id of the proposal. - #[prost(uint64, tag = "1")] - pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryVotesRequest { - const NAME: &'static str = "QueryVotesRequest"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) - } -} -/// QueryVotesResponse is the response type for the Query/Votes RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryVotesResponse { - /// votes defines the queried votes. - #[prost(message, repeated, tag = "1")] - pub votes: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryVotesResponse { - const NAME: &'static str = "QueryVotesResponse"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Query"; } } -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsRequest { - /// params_type defines which parameters to query for, can be one of "voting", - /// "tallying" or "deposit". - #[prost(string, tag = "1")] - pub params_type: ::prost::alloc::string::String, +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposal { + /// content is the proposal's content. + #[prost(message, optional, tag = "1")] + pub content: ::core::option::Option, + /// initial_deposit is the deposit value that must be paid at proposal submission. + #[prost(message, repeated, tag = "2")] + pub initial_deposit: ::prost::alloc::vec::Vec, + /// proposer is the account address of the proposer. + #[prost(string, tag = "3")] + pub proposer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryParamsRequest { - const NAME: &'static str = "QueryParamsRequest"; +impl ::prost::Name for MsgSubmitProposal { + const NAME: &'static str = "MsgSubmitProposal"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryParamsResponse is the response type for the Query/Params RPC method. +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// voting_params defines the parameters related to voting. - #[prost(message, optional, tag = "1")] - pub voting_params: ::core::option::Option, - /// deposit_params defines the parameters related to deposit. - #[prost(message, optional, tag = "2")] - pub deposit_params: ::core::option::Option, - /// tally_params defines the parameters related to tally. - #[prost(message, optional, tag = "3")] - pub tally_params: ::core::option::Option, +pub struct MsgSubmitProposalResponse { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, } -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; +impl ::prost::Name for MsgSubmitProposalResponse { + const NAME: &'static str = "MsgSubmitProposalResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryDepositRequest is the request type for the Query/Deposit RPC method. +/// MsgVote defines a message to cast a vote. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositRequest { +pub struct MsgVote { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// depositor defines the deposit addresses from the proposals. + /// voter is the voter address for the proposal. #[prost(string, tag = "2")] - pub depositor: ::prost::alloc::string::String, + pub voter: ::prost::alloc::string::String, + /// option defines the vote option. + #[prost(enumeration = "VoteOption", tag = "3")] + pub option: i32, } -impl ::prost::Name for QueryDepositRequest { - const NAME: &'static str = "QueryDepositRequest"; +impl ::prost::Name for MsgVote { + const NAME: &'static str = "MsgVote"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryDepositResponse is the response type for the Query/Deposit RPC method. +/// MsgVoteResponse defines the Msg/Vote response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositResponse { - /// deposit defines the requested deposit. - #[prost(message, optional, tag = "1")] - pub deposit: ::core::option::Option, -} -impl ::prost::Name for QueryDepositResponse { - const NAME: &'static str = "QueryDepositResponse"; +pub struct MsgVoteResponse {} +impl ::prost::Name for MsgVoteResponse { + const NAME: &'static str = "MsgVoteResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +/// MsgVoteWeighted defines a message to cast a vote. +/// +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsRequest { +pub struct MsgVoteWeighted { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, + /// voter is the voter address for the proposal. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// options defines the weighted vote options. + #[prost(message, repeated, tag = "3")] + pub options: ::prost::alloc::vec::Vec, } -impl ::prost::Name for QueryDepositsRequest { - const NAME: &'static str = "QueryDepositsRequest"; +impl ::prost::Name for MsgVoteWeighted { + const NAME: &'static str = "MsgVoteWeighted"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +/// +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDepositsResponse { - /// deposits defines the requested deposits. - #[prost(message, repeated, tag = "1")] - pub deposits: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDepositsResponse { - const NAME: &'static str = "QueryDepositsResponse"; +pub struct MsgVoteWeightedResponse {} +impl ::prost::Name for MsgVoteWeightedResponse { + const NAME: &'static str = "MsgVoteWeightedResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +/// MsgDeposit defines a message to submit a deposit to an existing proposal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultRequest { +pub struct MsgDeposit { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, + /// depositor defines the deposit addresses from the proposals. + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + /// amount to be deposited by depositor. + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, } -impl ::prost::Name for QueryTallyResultRequest { - const NAME: &'static str = "QueryTallyResultRequest"; +impl ::prost::Name for MsgDeposit { + const NAME: &'static str = "MsgDeposit"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) } } -/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +/// MsgDepositResponse defines the Msg/Deposit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTallyResultResponse { - /// tally defines the requested tally. - #[prost(message, optional, tag = "1")] - pub tally: ::core::option::Option, -} -impl ::prost::Name for QueryTallyResultResponse { - const NAME: &'static str = "QueryTallyResultResponse"; +pub struct MsgDepositResponse {} +impl ::prost::Name for MsgDepositResponse { + const NAME: &'static str = "MsgDepositResponse"; const PACKAGE: &'static str = "cosmos.gov.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) @@ -1274,16 +1628,16 @@ impl ::prost::Name for QueryTallyResultResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query defines the gRPC querier service for gov module + /// Msg defines the gov Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1294,7 +1648,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1312,7 +1666,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1320,155 +1674,51 @@ pub mod query_client { 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Proposal queries proposal details based on ProposalID. - pub async fn proposal( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Proposal", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposal")); - self.inner.unary(req, path, codec).await - } - /// Proposals queries all proposals based on given status. - pub async fn proposals( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Proposals", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Proposals")); - self.inner.unary(req, path, codec).await - } - /// Vote queries voted information based on proposalID, voterAddr. - pub async fn vote( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Vote", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Vote")); - self.inner.unary(req, path, codec).await + >, + >, + , + >>::Error: Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) } - /// Votes queries votes of a given proposal. - pub async fn votes( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Votes", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Votes")); - self.inner.unary(req, path, codec).await + /// 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 } - /// Params queries all parameters of the gov module. - pub async fn params( + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// SubmitProposal defines a method to create new proposal given a content. + pub async fn submit_proposal( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1482,19 +1732,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Params", + "/cosmos.gov.v1beta1.Msg/SubmitProposal", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Params")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "SubmitProposal")); self.inner.unary(req, path, codec).await } - /// Deposit queries single deposit information based proposalID, depositAddr. - pub async fn deposit( + /// Vote defines a method to add a vote on a specific proposal. + pub async fn vote( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1508,19 +1758,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Deposit", + "/cosmos.gov.v1beta1.Msg/Vote", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposit")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Vote")); self.inner.unary(req, path, codec).await } - /// Deposits queries all deposits of a single proposal. - pub async fn deposits( + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + /// + /// Since: cosmos-sdk 0.43 + pub async fn vote_weighted( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1534,19 +1786,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/Deposits", + "/cosmos.gov.v1beta1.Msg/VoteWeighted", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "Deposits")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "VoteWeighted")); self.inner.unary(req, path, codec).await } - /// TallyResult queries the tally of a proposal vote. - pub async fn tally_result( + /// Deposit defines a method to add deposit on a specific proposal. + pub async fn deposit( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1560,91 +1812,58 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.gov.v1beta1.Query/TallyResult", + "/cosmos.gov.v1beta1.Msg/Deposit", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.gov.v1beta1.Query", "TallyResult")); + .insert(GrpcMethod::new("cosmos.gov.v1beta1.Msg", "Deposit")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Proposal queries proposal details based on ProposalID. - async fn proposal( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Proposals queries all proposals based on given status. - async fn proposals( + pub trait Msg: Send + Sync + 'static { + /// SubmitProposal defines a method to create new proposal given a content. + async fn submit_proposal( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Vote queries voted information based on proposalID, voterAddr. + /// Vote defines a method to add a vote on a specific proposal. async fn vote( &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Votes queries votes of a given proposal. - async fn votes( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries all parameters of the gov module. - async fn params( + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /// VoteWeighted defines a method to add a weighted vote on a specific proposal. + /// + /// Since: cosmos-sdk 0.43 + async fn vote_weighted( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Deposit queries single deposit information based proposalID, depositAddr. + /// Deposit defines a method to add deposit on a specific proposal. async fn deposit( &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Deposits queries all deposits of a single proposal. - async fn deposits( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TallyResult queries the tally of a proposal vote. - async fn tally_result( - &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query defines the gRPC querier service for gov module + /// Msg defines the gov Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1652,7 +1871,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1699,94 +1918,46 @@ pub mod query_server { /// /// Default: `usize::MAX` #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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() { - "/cosmos.gov.v1beta1.Query/Proposal" => { - #[allow(non_camel_case_types)] - struct ProposalSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalSvc { - type Response = super::QueryProposalResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::proposal(&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 = ProposalSvc(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) - } - "/cosmos.gov.v1beta1.Query/Proposals" => { + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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() { + "/cosmos.gov.v1beta1.Msg/SubmitProposal" => { #[allow(non_camel_case_types)] - struct ProposalsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ProposalsSvc { - type Response = super::QueryProposalsResponse; + struct SubmitProposalSvc(pub Arc); + impl tonic::server::UnaryService + for SubmitProposalSvc { + type Response = super::MsgSubmitProposalResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::proposals(&inner, request).await + ::submit_proposal(&inner, request).await }; Box::pin(fut) } @@ -1798,7 +1969,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ProposalsSvc(inner); + let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1814,23 +1985,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Query/Vote" => { + "/cosmos.gov.v1beta1.Msg/Vote" => { #[allow(non_camel_case_types)] - struct VoteSvc(pub Arc); - impl tonic::server::UnaryService + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService for VoteSvc { - type Response = super::QueryVoteResponse; + type Response = super::MsgVoteResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::vote(&inner, request).await + ::vote(&inner, request).await }; Box::pin(fut) } @@ -1858,67 +2029,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Query/Votes" => { - #[allow(non_camel_case_types)] - struct VotesSvc(pub Arc); - impl tonic::server::UnaryService - for VotesSvc { - type Response = super::QueryVotesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::votes(&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 = VotesSvc(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) - } - "/cosmos.gov.v1beta1.Query/Params" => { + "/cosmos.gov.v1beta1.Msg/VoteWeighted" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct VoteWeightedSvc(pub Arc); + impl tonic::server::UnaryService + for VoteWeightedSvc { + type Response = super::MsgVoteWeightedResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::vote_weighted(&inner, request).await }; Box::pin(fut) } @@ -1930,7 +2057,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = VoteWeightedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1946,25 +2073,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Query/Deposit" => { + "/cosmos.gov.v1beta1.Msg/Deposit" => { #[allow(non_camel_case_types)] - struct DepositSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService + struct DepositSvc(pub Arc); + impl tonic::server::UnaryService for DepositSvc { - type Response = super::QueryDepositResponse; + type Response = super::MsgDepositResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposit(&inner, request).await + ::deposit(&inner, request).await }; Box::pin(fut) } @@ -1992,98 +2117,6 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.gov.v1beta1.Query/Deposits" => { - #[allow(non_camel_case_types)] - struct DepositsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DepositsSvc { - type Response = super::QueryDepositsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::deposits(&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 = DepositsSvc(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) - } - "/cosmos.gov.v1beta1.Query/TallyResult" => { - #[allow(non_camel_case_types)] - struct TallyResultSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TallyResultSvc { - type Response = super::QueryTallyResultResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::tally_result(&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 = TallyResultSvc(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( @@ -2099,7 +2132,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2111,7 +2144,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2121,40 +2154,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.gov.v1beta1.Query"; - } -} -/// GenesisState defines the gov module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// starting_proposal_id is the ID of the starting proposal. - #[prost(uint64, tag = "1")] - pub starting_proposal_id: u64, - /// deposits defines all the deposits present at genesis. - #[prost(message, repeated, tag = "2")] - pub deposits: ::prost::alloc::vec::Vec, - /// votes defines all the votes present at genesis. - #[prost(message, repeated, tag = "3")] - pub votes: ::prost::alloc::vec::Vec, - /// proposals defines all the proposals present at genesis. - #[prost(message, repeated, tag = "4")] - pub proposals: ::prost::alloc::vec::Vec, - /// params defines all the parameters of related to deposit. - #[prost(message, optional, tag = "5")] - pub deposit_params: ::core::option::Option, - /// params defines all the parameters of related to voting. - #[prost(message, optional, tag = "6")] - pub voting_params: ::core::option::Option, - /// params defines all the parameters of related to tally. - #[prost(message, optional, tag = "7")] - pub tally_params: ::core::option::Option, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.gov.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.gov.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Msg"; } } diff --git a/src/prost/cosmos.staking.module.v1.rs b/src/prost/cosmos.staking.module.v1.rs index 2a8d086b..659a269d 100644 --- a/src/prost/cosmos.staking.module.v1.rs +++ b/src/prost/cosmos.staking.module.v1.rs @@ -10,6 +10,12 @@ pub struct Module { /// authority defines the custom module authority. If not set, defaults to the governance module. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, + /// bech32_prefix_validator is the bech32 validator prefix for the app. + #[prost(string, tag = "3")] + pub bech32_prefix_validator: ::prost::alloc::string::String, + /// bech32_prefix_consensus is the bech32 consensus node prefix for the app. + #[prost(string, tag = "4")] + pub bech32_prefix_consensus: ::prost::alloc::string::String, } impl ::prost::Name for Module { const NAME: &'static str = "Module"; diff --git a/src/prost/cosmos.staking.module.v1.serde.rs b/src/prost/cosmos.staking.module.v1.serde.rs index f9224074..9b0e85d3 100644 --- a/src/prost/cosmos.staking.module.v1.serde.rs +++ b/src/prost/cosmos.staking.module.v1.serde.rs @@ -12,6 +12,12 @@ impl serde::Serialize for Module { if true { len += 1; } + if true { + len += 1; + } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.staking.module.v1.Module", len)?; if true { struct_ser.serialize_field("hooksOrder", &self.hooks_order)?; @@ -19,6 +25,12 @@ impl serde::Serialize for Module { if true { struct_ser.serialize_field("authority", &self.authority)?; } + if true { + struct_ser.serialize_field("bech32PrefixValidator", &self.bech32_prefix_validator)?; + } + if true { + struct_ser.serialize_field("bech32PrefixConsensus", &self.bech32_prefix_consensus)?; + } struct_ser.end() } } @@ -32,12 +44,18 @@ impl<'de> serde::Deserialize<'de> for Module { "hooks_order", "hooksOrder", "authority", + "bech32_prefix_validator", + "bech32PrefixValidator", + "bech32_prefix_consensus", + "bech32PrefixConsensus", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { HooksOrder, Authority, + Bech32PrefixValidator, + Bech32PrefixConsensus, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -61,6 +79,8 @@ impl<'de> serde::Deserialize<'de> for Module { match value { "hooksOrder" | "hooks_order" => Ok(GeneratedField::HooksOrder), "authority" => Ok(GeneratedField::Authority), + "bech32PrefixValidator" | "bech32_prefix_validator" => Ok(GeneratedField::Bech32PrefixValidator), + "bech32PrefixConsensus" | "bech32_prefix_consensus" => Ok(GeneratedField::Bech32PrefixConsensus), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -82,6 +102,8 @@ impl<'de> serde::Deserialize<'de> for Module { { let mut hooks_order__ = None; let mut authority__ = None; + let mut bech32_prefix_validator__ = None; + let mut bech32_prefix_consensus__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::HooksOrder => { @@ -96,11 +118,25 @@ impl<'de> serde::Deserialize<'de> for Module { } authority__ = Some(map_.next_value()?); } + GeneratedField::Bech32PrefixValidator => { + if bech32_prefix_validator__.is_some() { + return Err(serde::de::Error::duplicate_field("bech32PrefixValidator")); + } + bech32_prefix_validator__ = Some(map_.next_value()?); + } + GeneratedField::Bech32PrefixConsensus => { + if bech32_prefix_consensus__.is_some() { + return Err(serde::de::Error::duplicate_field("bech32PrefixConsensus")); + } + bech32_prefix_consensus__ = Some(map_.next_value()?); + } } } Ok(Module { hooks_order: hooks_order__.unwrap_or_default(), authority: authority__.unwrap_or_default(), + bech32_prefix_validator: bech32_prefix_validator__.unwrap_or_default(), + bech32_prefix_consensus: bech32_prefix_consensus__.unwrap_or_default(), }) } } diff --git a/src/prost/cosmos.staking.v1beta1.rs b/src/prost/cosmos.staking.v1beta1.rs index 2c2c1b8d..b5de8490 100644 --- a/src/prost/cosmos.staking.v1beta1.rs +++ b/src/prost/cosmos.staking.v1beta1.rs @@ -1,3 +1,105 @@ +/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. +/// +/// Since: cosmos-sdk 0.43 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StakeAuthorization { + /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is + /// empty, there is no spend limit and any amount of coins can be delegated. + #[prost(message, optional, tag = "1")] + pub max_tokens: ::core::option::Option, + /// authorization_type defines one of AuthorizationType. + #[prost(enumeration = "AuthorizationType", tag = "4")] + pub authorization_type: i32, + /// validators is the oneof that represents either allow_list or deny_list + #[prost(oneof = "stake_authorization::Validators", tags = "2, 3")] + pub validators: ::core::option::Option, +} +/// Nested message and enum types in `StakeAuthorization`. +pub mod stake_authorization { + /// Validators defines list of validator addresses. + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct ValidatorsVec { + #[prost(string, repeated, tag = "1")] + pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + } + impl ::prost::Name for ValidatorsVec { + const NAME: &'static str = "Validators"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "cosmos.staking.v1beta1.StakeAuthorization.{}", Self::NAME + ) + } + } + /// validators is the oneof that represents either allow_list or deny_list + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Validators { + /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's + /// account. + #[prost(message, tag = "2")] + AllowList(ValidatorsVec), + /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. + #[prost(message, tag = "3")] + DenyList(ValidatorsVec), + } +} +impl ::prost::Name for StakeAuthorization { + const NAME: &'static str = "StakeAuthorization"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// AuthorizationType defines the type of staking module authorization type +/// +/// Since: cosmos-sdk 0.43 +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum AuthorizationType { + /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type + Unspecified = 0, + /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate + Delegate = 1, + /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate + Undelegate = 2, + /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate + Redelegate = 3, + /// AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation + CancelUnbondingDelegation = 4, +} +impl AuthorizationType { + /// 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 { + AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", + AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", + AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", + AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + AuthorizationType::CancelUnbondingDelegation => { + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" + } + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), + "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), + "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => { + Some(Self::CancelUnbondingDelegation) + } + _ => None, + } + } +} /// HistoricalInfo contains header and validator information for a given block. /// It is stored as part of staking module's state, which persists the `n` most /// recent HistoricalInfo @@ -6,7 +108,7 @@ #[derive(Clone, PartialEq, ::prost::Message)] pub struct HistoricalInfo { #[prost(message, optional, tag = "1")] - pub header: ::core::option::Option<::tendermint_proto::types::Header>, + pub header: ::core::option::Option<::cometbft_proto::types::v1::Header>, #[prost(message, repeated, tag = "2")] pub valset: ::prost::alloc::vec::Vec, } @@ -237,10 +339,10 @@ impl ::prost::Name for DvvTriplets { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delegation { - /// delegator_address is the bech32-encoded address of the delegator. + /// delegator_address is the encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the bech32-encoded address of the validator. + /// validator_address is the encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// shares define the delegation shares received. @@ -259,10 +361,10 @@ impl ::prost::Name for Delegation { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegation { - /// delegator_address is the bech32-encoded address of the delegator. + /// delegator_address is the encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the bech32-encoded address of the validator. + /// validator_address is the encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// entries are the unbonding delegation entries. @@ -477,7 +579,9 @@ impl ::prost::Name for Pool { #[derive(Clone, PartialEq, ::prost::Message)] pub struct ValidatorUpdates { #[prost(message, repeated, tag = "1")] - pub updates: ::prost::alloc::vec::Vec<::tendermint_proto::abci::ValidatorUpdate>, + pub updates: ::prost::alloc::vec::Vec< + ::cometbft_proto::abci::v1beta1::ValidatorUpdate, + >, } impl ::prost::Name for ValidatorUpdates { const NAME: &'static str = "ValidatorUpdates"; @@ -589,323 +693,643 @@ impl InfractionType { } } } -/// MsgCreateValidator defines a SDK message for creating a new validator. +/// GenesisState defines the staking module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateValidator { +pub struct GenesisState { + /// params defines all the parameters of related to deposit. #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub commission: ::core::option::Option, - #[prost(string, tag = "3")] - pub min_self_delegation: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "5")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "6")] - pub pubkey: ::core::option::Option, - #[prost(message, optional, tag = "7")] - pub value: ::core::option::Option, + pub params: ::core::option::Option, + /// last_total_power tracks the total amounts of bonded tokens recorded during + /// the previous end block. + #[prost(bytes = "vec", tag = "2")] + pub last_total_power: ::prost::alloc::vec::Vec, + /// last_validator_powers is a special index that provides a historical list + /// of the last-block's bonded validators. + #[prost(message, repeated, tag = "3")] + pub last_validator_powers: ::prost::alloc::vec::Vec, + /// validators defines the validator set at genesis. + #[prost(message, repeated, tag = "4")] + pub validators: ::prost::alloc::vec::Vec, + /// delegations defines the delegations active at genesis. + #[prost(message, repeated, tag = "5")] + pub delegations: ::prost::alloc::vec::Vec, + /// unbonding_delegations defines the unbonding delegations active at genesis. + #[prost(message, repeated, tag = "6")] + pub unbonding_delegations: ::prost::alloc::vec::Vec, + /// redelegations defines the redelegations active at genesis. + #[prost(message, repeated, tag = "7")] + pub redelegations: ::prost::alloc::vec::Vec, + /// exported defines a bool to identify whether the chain dealing with exported or initialized genesis. + #[prost(bool, tag = "8")] + pub exported: bool, } -impl ::prost::Name for MsgCreateValidator { - const NAME: &'static str = "MsgCreateValidator"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +/// LastValidatorPower required for validator set update logic. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateValidatorResponse {} -impl ::prost::Name for MsgCreateValidatorResponse { - const NAME: &'static str = "MsgCreateValidatorResponse"; +pub struct LastValidatorPower { + /// address is the address of the validator. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// power defines the power of the validator. + #[prost(int64, tag = "2")] + pub power: i64, +} +impl ::prost::Name for LastValidatorPower { + const NAME: &'static str = "LastValidatorPower"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgEditValidator defines a SDK message for editing an existing validator. +/// QueryValidatorsRequest is request type for Query/Validators RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEditValidator { - #[prost(message, optional, tag = "1")] - pub description: ::core::option::Option, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// We pass a reference to the new commission rate and min self delegation as - /// it's not mandatory to update. If not updated, the deserialized rate will be - /// zero with no way to distinguish if an update was intended. - /// REF: #2373 - #[prost(string, tag = "3")] - pub commission_rate: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub min_self_delegation: ::prost::alloc::string::String, +pub struct QueryValidatorsRequest { + /// status enables to query for validators matching a given status. + #[prost(string, tag = "1")] + pub status: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgEditValidator { - const NAME: &'static str = "MsgEditValidator"; +impl ::prost::Name for QueryValidatorsRequest { + const NAME: &'static str = "QueryValidatorsRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgEditValidatorResponse defines the Msg/EditValidator response type. +/// QueryValidatorsResponse is response type for the Query/Validators RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgEditValidatorResponse {} -impl ::prost::Name for MsgEditValidatorResponse { - const NAME: &'static str = "MsgEditValidatorResponse"; +pub struct QueryValidatorsResponse { + /// validators contains all the queried validators. + #[prost(message, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryValidatorsResponse { + const NAME: &'static str = "QueryValidatorsResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgDelegate defines a SDK message for performing a delegation of coins -/// from a delegator to a validator. +/// QueryValidatorRequest is response type for the Query/Validator RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDelegate { +pub struct QueryValidatorRequest { + /// validator_addr defines the validator address to query for. #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, + pub validator_addr: ::prost::alloc::string::String, } -impl ::prost::Name for MsgDelegate { - const NAME: &'static str = "MsgDelegate"; +impl ::prost::Name for QueryValidatorRequest { + const NAME: &'static str = "QueryValidatorRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgDelegateResponse defines the Msg/Delegate response type. +/// QueryValidatorResponse is response type for the Query/Validator RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgDelegateResponse {} -impl ::prost::Name for MsgDelegateResponse { - const NAME: &'static str = "MsgDelegateResponse"; +pub struct QueryValidatorResponse { + /// validator defines the validator info. + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, +} +impl ::prost::Name for QueryValidatorResponse { + const NAME: &'static str = "QueryValidatorResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgBeginRedelegate defines a SDK message for performing a redelegation -/// of coins from a delegator and source validator to a destination validator. +/// QueryValidatorDelegationsRequest is request type for the +/// Query/ValidatorDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgBeginRedelegate { +pub struct QueryValidatorDelegationsRequest { + /// validator_addr defines the validator address to query for. #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub validator_src_address: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub validator_dst_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "4")] - pub amount: ::core::option::Option, + pub validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgBeginRedelegate { - const NAME: &'static str = "MsgBeginRedelegate"; +impl ::prost::Name for QueryValidatorDelegationsRequest { + const NAME: &'static str = "QueryValidatorDelegationsRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +/// QueryValidatorDelegationsResponse is response type for the +/// Query/ValidatorDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgBeginRedelegateResponse { - #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option< - super::super::super::google::protobuf::Timestamp, +pub struct QueryValidatorDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub delegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, >, } -impl ::prost::Name for MsgBeginRedelegateResponse { - const NAME: &'static str = "MsgBeginRedelegateResponse"; +impl ::prost::Name for QueryValidatorDelegationsResponse { + const NAME: &'static str = "QueryValidatorDelegationsResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgUndelegate defines a SDK message for performing an undelegation from a -/// delegate and a validator. +/// QueryValidatorUnbondingDelegationsRequest is required type for the +/// Query/ValidatorUnbondingDelegations RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUndelegate { +pub struct QueryValidatorUnbondingDelegationsRequest { + /// validator_addr defines the validator address to query for. #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, + pub validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryValidatorUnbondingDelegationsRequest { + const NAME: &'static str = "QueryValidatorUnbondingDelegationsRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryValidatorUnbondingDelegationsResponse is response type for the +/// Query/ValidatorUnbondingDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryValidatorUnbondingDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub unbonding_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryValidatorUnbondingDelegationsResponse { + const NAME: &'static str = "QueryValidatorUnbondingDelegationsResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryDelegationRequest is request type for the Query/Delegation RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegationRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, + pub validator_addr: ::prost::alloc::string::String, } -impl ::prost::Name for MsgUndelegate { - const NAME: &'static str = "MsgUndelegate"; +impl ::prost::Name for QueryDelegationRequest { + const NAME: &'static str = "QueryDelegationRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgUndelegateResponse defines the Msg/Undelegate response type. +/// QueryDelegationResponse is response type for the Query/Delegation RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUndelegateResponse { +pub struct QueryDelegationResponse { + /// delegation_responses defines the delegation info of a delegation. #[prost(message, optional, tag = "1")] - pub completion_time: ::core::option::Option< - super::super::super::google::protobuf::Timestamp, - >, + pub delegation_response: ::core::option::Option, } -impl ::prost::Name for MsgUndelegateResponse { - const NAME: &'static str = "MsgUndelegateResponse"; +impl ::prost::Name for QueryDelegationResponse { + const NAME: &'static str = "QueryDelegationResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator -/// -/// Since: cosmos-sdk 0.46 +/// QueryUnbondingDelegationRequest is request type for the +/// Query/UnbondingDelegation RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUnbondingDelegation { +pub struct QueryUnbondingDelegationRequest { + /// delegator_addr defines the delegator address to query for. #[prost(string, tag = "1")] - pub delegator_address: ::prost::alloc::string::String, + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. #[prost(string, tag = "2")] - pub validator_address: ::prost::alloc::string::String, - /// amount is always less than or equal to unbonding delegation entry balance - #[prost(message, optional, tag = "3")] - pub amount: ::core::option::Option, - /// creation_height is the height which the unbonding took place. - #[prost(int64, tag = "4")] - pub creation_height: i64, + pub validator_addr: ::prost::alloc::string::String, } -impl ::prost::Name for MsgCancelUnbondingDelegation { - const NAME: &'static str = "MsgCancelUnbondingDelegation"; +impl ::prost::Name for QueryUnbondingDelegationRequest { + const NAME: &'static str = "QueryUnbondingDelegationRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgCancelUnbondingDelegationResponse -/// -/// Since: cosmos-sdk 0.46 +/// QueryDelegationResponse is response type for the Query/UnbondingDelegation +/// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUnbondingDelegationResponse {} -impl ::prost::Name for MsgCancelUnbondingDelegationResponse { - const NAME: &'static str = "MsgCancelUnbondingDelegationResponse"; +pub struct QueryUnbondingDelegationResponse { + /// unbond defines the unbonding information of a delegation. + #[prost(message, optional, tag = "1")] + pub unbond: ::core::option::Option, +} +impl ::prost::Name for QueryUnbondingDelegationResponse { + const NAME: &'static str = "QueryUnbondingDelegationResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 +/// QueryDelegatorDelegationsRequest is request type for the +/// Query/DelegatorDelegations RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). +pub struct QueryDelegatorDelegationsRequest { + /// delegator_addr defines the delegator address to query for. #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the x/staking parameters to update. - /// - /// NOTE: All parameters must be supplied. + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryDelegatorDelegationsRequest { + const NAME: &'static str = "QueryDelegatorDelegationsRequest"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 +/// QueryDelegatorDelegationsResponse is response type for the +/// Query/DelegatorDelegations RPC method. #[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"; +pub struct QueryDelegatorDelegationsResponse { + /// delegation_responses defines all the delegations' info of a delegator. + #[prost(message, repeated, tag = "1")] + pub delegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDelegatorDelegationsResponse { + const NAME: &'static str = "QueryDelegatorDelegationsResponse"; const PACKAGE: &'static str = "cosmos.staking.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the staking Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, +/// QueryDelegatorUnbondingDelegationsRequest is request type for the +/// Query/DelegatorUnbondingDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorUnbondingDelegationsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDelegatorUnbondingDelegationsRequest { + const NAME: &'static str = "QueryDelegatorUnbondingDelegationsRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +} +/// QueryUnbondingDelegatorDelegationsResponse is response type for the +/// Query/UnbondingDelegatorDelegations RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorUnbondingDelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub unbonding_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDelegatorUnbondingDelegationsResponse { + const NAME: &'static str = "QueryDelegatorUnbondingDelegationsResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) } - 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, +} +/// QueryRedelegationsRequest is request type for the Query/Redelegations RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRedelegationsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// src_validator_addr defines the validator address to redelegate from. + #[prost(string, tag = "2")] + pub src_validator_addr: ::prost::alloc::string::String, + /// dst_validator_addr defines the validator address to redelegate to. + #[prost(string, tag = "3")] + pub dst_validator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "4")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryRedelegationsRequest { + const NAME: &'static str = "QueryRedelegationsRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryRedelegationsResponse is response type for the Query/Redelegations RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRedelegationsResponse { + #[prost(message, repeated, tag = "1")] + pub redelegation_responses: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryRedelegationsResponse { + const NAME: &'static str = "QueryRedelegationsResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryDelegatorValidatorsRequest is request type for the +/// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorValidatorsRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDelegatorValidatorsRequest { + const NAME: &'static str = "QueryDelegatorValidatorsRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryDelegatorValidatorsResponse is response type for the +/// Query/DelegatorValidators RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorValidatorsResponse { + /// validators defines the validators' info of a delegator. + #[prost(message, repeated, tag = "1")] + pub validators: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDelegatorValidatorsResponse { + const NAME: &'static str = "QueryDelegatorValidatorsResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryDelegatorValidatorRequest is request type for the +/// Query/DelegatorValidator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorValidatorRequest { + /// delegator_addr defines the delegator address to query for. + #[prost(string, tag = "1")] + pub delegator_addr: ::prost::alloc::string::String, + /// validator_addr defines the validator address to query for. + #[prost(string, tag = "2")] + pub validator_addr: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryDelegatorValidatorRequest { + const NAME: &'static str = "QueryDelegatorValidatorRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryDelegatorValidatorResponse response type for the +/// Query/DelegatorValidator RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDelegatorValidatorResponse { + /// validator defines the validator info. + #[prost(message, optional, tag = "1")] + pub validator: ::core::option::Option, +} +impl ::prost::Name for QueryDelegatorValidatorResponse { + const NAME: &'static str = "QueryDelegatorValidatorResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryHistoricalInfoRequest { + /// height defines at which height to query the historical info. + #[prost(int64, tag = "1")] + pub height: i64, +} +impl ::prost::Name for QueryHistoricalInfoRequest { + const NAME: &'static str = "QueryHistoricalInfoRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryHistoricalInfoResponse { + /// hist defines the historical info at the given height. + #[prost(message, optional, tag = "1")] + pub hist: ::core::option::Option, +} +impl ::prost::Name for QueryHistoricalInfoResponse { + const NAME: &'static str = "QueryHistoricalInfoResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryPoolRequest is request type for the Query/Pool RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPoolRequest {} +impl ::prost::Name for QueryPoolRequest { + const NAME: &'static str = "QueryPoolRequest"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryPoolResponse is response type for the Query/Pool RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryPoolResponse { + /// pool defines the pool info. + #[prost(message, optional, tag = "1")] + pub pool: ::core::option::Option, +} +impl ::prost::Name for QueryPoolResponse { + const NAME: &'static str = "QueryPoolResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[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 = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Query defines the gRPC querier service. + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) } - /// 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 + } + 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 } } - /// Enable decompressing responses. - #[must_use] - pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { - self.inner = self.inner.accept_compressed(encoding); - self + 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 } /// Limits the maximum size of a decoded message. /// @@ -923,12 +1347,15 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateValidator defines a method for creating a new validator. - pub async fn create_validator( + /// Validators queries all validators that match the given status. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn validators( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -942,21 +1369,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/CreateValidator", + "/cosmos.staking.v1beta1.Query/Validators", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Msg", "CreateValidator"), - ); + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validators")); self.inner.unary(req, path, codec).await } - /// EditValidator defines a method for editing an existing validator. - pub async fn edit_validator( + /// Validator queries validator info for given validator address. + pub async fn validator( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -970,20 +1395,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/EditValidator", + "/cosmos.staking.v1beta1.Query/Validator", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "EditValidator")); + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validator")); self.inner.unary(req, path, codec).await } - /// Delegate defines a method for performing a delegation of coins - /// from a delegator to a validator. - pub async fn delegate( + /// ValidatorDelegations queries delegate info for given validator. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn validator_delegations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -997,20 +1424,29 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/Delegate", + "/cosmos.staking.v1beta1.Query/ValidatorDelegations", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Delegate")); + .insert( + GrpcMethod::new( + "cosmos.staking.v1beta1.Query", + "ValidatorDelegations", + ), + ); self.inner.unary(req, path, codec).await } - /// BeginRedelegate defines a method for performing a redelegation - /// of coins from a delegator and source validator to a destination validator. - pub async fn begin_redelegate( + /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn validator_unbonding_delegations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::QueryValidatorUnbondingDelegationsRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1024,22 +1460,24 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Msg", "BeginRedelegate"), + GrpcMethod::new( + "cosmos.staking.v1beta1.Query", + "ValidatorUnbondingDelegations", + ), ); self.inner.unary(req, path, codec).await } - /// Undelegate defines a method for performing an undelegation from a - /// delegate and a validator. - pub async fn undelegate( + /// Delegation queries delegate info for given validator delegator pair. + pub async fn delegation( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1053,22 +1491,54 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/Undelegate", + "/cosmos.staking.v1beta1.Query/Delegation", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Undelegate")); + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Delegation")); self.inner.unary(req, path, codec).await } - /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - /// and delegate back to previous validator. + /// UnbondingDelegation queries unbonding info for given validator delegator + /// pair. + pub async fn unbonding_delegation( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/UnbondingDelegation", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "cosmos.staking.v1beta1.Query", + "UnbondingDelegation", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DelegatorDelegations queries all delegations of a given delegator address. /// - /// Since: cosmos-sdk 0.46 - pub async fn cancel_unbonding_delegation( + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn delegator_delegations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1082,26 +1552,30 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", + "/cosmos.staking.v1beta1.Query/DelegatorDelegations", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "cosmos.staking.v1beta1.Msg", - "CancelUnbondingDelegation", + "cosmos.staking.v1beta1.Query", + "DelegatorDelegations", ), ); self.inner.unary(req, path, codec).await } - /// UpdateParams defines an operation for updating the x/staking module - /// parameters. - /// Since: cosmos-sdk 0.47 - pub async fn update_params( + /// DelegatorUnbondingDelegations queries all unbonding delegations of a given + /// delegator address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn delegator_unbonding_delegations( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest< + super::QueryDelegatorUnbondingDelegationsRequest, + >, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1115,136 +1589,389 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Msg/UpdateParams", + "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "UpdateParams")); + .insert( + GrpcMethod::new( + "cosmos.staking.v1beta1.Query", + "DelegatorUnbondingDelegations", + ), + ); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// CreateValidator defines a method for creating a new validator. - async fn create_validator( - &self, - request: tonic::Request, + /// Redelegations queries redelegations of given address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn redelegations( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// EditValidator defines a method for editing an existing validator. - async fn edit_validator( - &self, - request: tonic::Request, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Redelegations", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.staking.v1beta1.Query", "Redelegations"), + ); + self.inner.unary(req, path, codec).await + } + /// DelegatorValidators queries all validators info for given delegator + /// address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + pub async fn delegator_validators( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// Delegate defines a method for performing a delegation of coins - /// from a delegator to a validator. - async fn delegate( + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/DelegatorValidators", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "cosmos.staking.v1beta1.Query", + "DelegatorValidators", + ), + ); + self.inner.unary(req, path, codec).await + } + /// DelegatorValidator queries validator info for given delegator validator + /// pair. + pub async fn delegator_validator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/DelegatorValidator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.staking.v1beta1.Query", "DelegatorValidator"), + ); + self.inner.unary(req, path, codec).await + } + /// HistoricalInfo queries the historical info for given height. + pub async fn historical_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/HistoricalInfo", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.staking.v1beta1.Query", "HistoricalInfo"), + ); + self.inner.unary(req, path, codec).await + } + /// Pool queries the pool info. + pub async fn pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Pool", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Pool")); + self.inner.unary(req, path, codec).await + } + /// Parameters queries the staking parameters. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// Validators queries all validators that match the given status. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn validators( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// BeginRedelegate defines a method for performing a redelegation - /// of coins from a delegator and source validator to a destination validator. - async fn begin_redelegate( + /// Validator queries validator info for given validator address. + async fn validator( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Undelegate defines a method for performing an undelegation from a - /// delegate and a validator. - async fn undelegate( + /// ValidatorDelegations queries delegate info for given validator. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn validator_delegations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation - /// and delegate back to previous validator. + /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. /// - /// Since: cosmos-sdk 0.46 - async fn cancel_unbonding_delegation( + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn validator_unbonding_delegations( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateParams defines an operation for updating the x/staking module - /// parameters. - /// Since: cosmos-sdk 0.47 - async fn update_params( + /// Delegation queries delegate info for given validator delegator pair. + async fn delegation( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - } - /// Msg defines the staking Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. + /// UnbondingDelegation queries unbonding info for given validator delegator + /// pair. + async fn unbonding_delegation( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorDelegations queries all delegations of a given delegator address. /// - /// Default: `4MB` + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn delegator_delegations( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorUnbondingDelegations queries all unbonding delegations of a given + /// delegator address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn delegator_unbonding_delegations( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Redelegations queries redelegations of given address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn redelegations( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorValidators queries all validators info for given delegator + /// address. + /// + /// When called from another module, this query might consume a high amount of + /// gas if the pagination field is incorrectly set. + async fn delegator_validators( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DelegatorValidator queries validator info for given delegator validator + /// pair. + async fn delegator_validator( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// HistoricalInfo queries the historical info for given height. + async fn historical_info( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Pool queries the pool info. + async fn pool( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Parameters queries the staking parameters. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Query defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` #[must_use] pub fn max_decoding_message_size(mut self, limit: usize) -> Self { self.max_decoding_message_size = Some(limit); @@ -1259,9 +1986,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1277,23 +2004,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.staking.v1beta1.Msg/CreateValidator" => { + "/cosmos.staking.v1beta1.Query/Validators" => { #[allow(non_camel_case_types)] - struct CreateValidatorSvc(pub Arc); - impl tonic::server::UnaryService - for CreateValidatorSvc { - type Response = super::MsgCreateValidatorResponse; + struct ValidatorsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorsSvc { + type Response = super::QueryValidatorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_validator(&inner, request).await + ::validators(&inner, request).await }; Box::pin(fut) } @@ -1305,7 +2034,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateValidatorSvc(inner); + let method = ValidatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1321,23 +2050,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/EditValidator" => { + "/cosmos.staking.v1beta1.Query/Validator" => { #[allow(non_camel_case_types)] - struct EditValidatorSvc(pub Arc); - impl tonic::server::UnaryService - for EditValidatorSvc { - type Response = super::MsgEditValidatorResponse; + struct ValidatorSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ValidatorSvc { + type Response = super::QueryValidatorResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::edit_validator(&inner, request).await + ::validator(&inner, request).await }; Box::pin(fut) } @@ -1349,7 +2080,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = EditValidatorSvc(inner); + let method = ValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1365,23 +2096,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/Delegate" => { + "/cosmos.staking.v1beta1.Query/ValidatorDelegations" => { #[allow(non_camel_case_types)] - struct DelegateSvc(pub Arc); - impl tonic::server::UnaryService - for DelegateSvc { - type Response = super::MsgDelegateResponse; + struct ValidatorDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryValidatorDelegationsRequest, + > for ValidatorDelegationsSvc { + type Response = super::QueryValidatorDelegationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryValidatorDelegationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegate(&inner, request).await + ::validator_delegations(&inner, request).await }; Box::pin(fut) } @@ -1393,7 +2129,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegateSvc(inner); + let method = ValidatorDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1409,23 +2145,32 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/BeginRedelegate" => { + "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => { #[allow(non_camel_case_types)] - struct BeginRedelegateSvc(pub Arc); - impl tonic::server::UnaryService - for BeginRedelegateSvc { - type Response = super::MsgBeginRedelegateResponse; + struct ValidatorUnbondingDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryValidatorUnbondingDelegationsRequest, + > for ValidatorUnbondingDelegationsSvc { + type Response = super::QueryValidatorUnbondingDelegationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryValidatorUnbondingDelegationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::begin_redelegate(&inner, request).await + ::validator_unbonding_delegations( + &inner, + request, + ) + .await }; Box::pin(fut) } @@ -1437,7 +2182,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = BeginRedelegateSvc(inner); + let method = ValidatorUnbondingDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1453,23 +2198,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/Undelegate" => { + "/cosmos.staking.v1beta1.Query/Delegation" => { #[allow(non_camel_case_types)] - struct UndelegateSvc(pub Arc); - impl tonic::server::UnaryService - for UndelegateSvc { - type Response = super::MsgUndelegateResponse; + struct DelegationSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DelegationSvc { + type Response = super::QueryDelegationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::undelegate(&inner, request).await + ::delegation(&inner, request).await }; Box::pin(fut) } @@ -1481,7 +2228,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UndelegateSvc(inner); + let method = DelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1497,26 +2244,27 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation" => { + "/cosmos.staking.v1beta1.Query/UnbondingDelegation" => { #[allow(non_camel_case_types)] - struct CancelUnbondingDelegationSvc(pub Arc); + struct UnbondingDelegationSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for CancelUnbondingDelegationSvc { - type Response = super::MsgCancelUnbondingDelegationResponse; + T: Query, + > tonic::server::UnaryService + for UnbondingDelegationSvc { + type Response = super::QueryUnbondingDelegationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryUnbondingDelegationRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::cancel_unbonding_delegation(&inner, request) - .await + ::unbonding_delegation(&inner, request).await }; Box::pin(fut) } @@ -1528,7 +2276,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CancelUnbondingDelegationSvc(inner); + let method = UnbondingDelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1544,23 +2292,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Msg/UpdateParams" => { + "/cosmos.staking.v1beta1.Query/DelegatorDelegations" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct DelegatorDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegatorDelegationsRequest, + > for DelegatorDelegationsSvc { + type Response = super::QueryDelegatorDelegationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryDelegatorDelegationsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::delegator_delegations(&inner, request).await }; Box::pin(fut) } @@ -1572,7 +2325,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + let method = DelegatorDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1588,1367 +2341,78 @@ pub mod msg_server { }; 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(), - ) - }) + "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => { + #[allow(non_camel_case_types)] + struct DelegatorUnbondingDelegationsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryDelegatorUnbondingDelegationsRequest, + > for DelegatorUnbondingDelegationsSvc { + type Response = super::QueryDelegatorUnbondingDelegationsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryDelegatorUnbondingDelegationsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::delegator_unbonding_delegations( + &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 = DelegatorUnbondingDelegationsSvc(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) } - } - } - } - 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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 = "cosmos.staking.v1beta1.Msg"; - } -} -/// QueryValidatorsRequest is request type for Query/Validators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorsRequest { - /// status enables to query for validators matching a given status. - #[prost(string, tag = "1")] - pub status: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorsRequest { - const NAME: &'static str = "QueryValidatorsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorsResponse is response type for the Query/Validators RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorsResponse { - /// validators contains all the queried validators. - #[prost(message, repeated, tag = "1")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorsResponse { - const NAME: &'static str = "QueryValidatorsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorRequest is response type for the Query/Validator RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryValidatorRequest { - const NAME: &'static str = "QueryValidatorRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorResponse is response type for the Query/Validator RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorResponse { - /// validator defines the validator info. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, -} -impl ::prost::Name for QueryValidatorResponse { - const NAME: &'static str = "QueryValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorDelegationsRequest is request type for the -/// Query/ValidatorDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorDelegationsRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorDelegationsRequest { - const NAME: &'static str = "QueryValidatorDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorDelegationsResponse is response type for the -/// Query/ValidatorDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub delegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorDelegationsResponse { - const NAME: &'static str = "QueryValidatorDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorUnbondingDelegationsRequest is required type for the -/// Query/ValidatorUnbondingDelegations RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorUnbondingDelegationsRequest { - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "1")] - pub validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryValidatorUnbondingDelegationsRequest { - const NAME: &'static str = "QueryValidatorUnbondingDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryValidatorUnbondingDelegationsResponse is response type for the -/// Query/ValidatorUnbondingDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryValidatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub unbonding_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryValidatorUnbondingDelegationsResponse { - const NAME: &'static str = "QueryValidatorUnbondingDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegationRequest is request type for the Query/Delegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegationRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDelegationRequest { - const NAME: &'static str = "QueryDelegationRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegationResponse is response type for the Query/Delegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegationResponse { - /// delegation_responses defines the delegation info of a delegation. - #[prost(message, optional, tag = "1")] - pub delegation_response: ::core::option::Option, -} -impl ::prost::Name for QueryDelegationResponse { - const NAME: &'static str = "QueryDelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryUnbondingDelegationRequest is request type for the -/// Query/UnbondingDelegation RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnbondingDelegationRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryUnbondingDelegationRequest { - const NAME: &'static str = "QueryUnbondingDelegationRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegationResponse is response type for the Query/UnbondingDelegation -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnbondingDelegationResponse { - /// unbond defines the unbonding information of a delegation. - #[prost(message, optional, tag = "1")] - pub unbond: ::core::option::Option, -} -impl ::prost::Name for QueryUnbondingDelegationResponse { - const NAME: &'static str = "QueryUnbondingDelegationResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorDelegationsRequest is request type for the -/// Query/DelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorDelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorDelegationsRequest { - const NAME: &'static str = "QueryDelegatorDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorDelegationsResponse is response type for the -/// Query/DelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorDelegationsResponse { - /// delegation_responses defines all the delegations' info of a delegator. - #[prost(message, repeated, tag = "1")] - pub delegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorDelegationsResponse { - const NAME: &'static str = "QueryDelegatorDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorUnbondingDelegationsRequest is request type for the -/// Query/DelegatorUnbondingDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorUnbondingDelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorUnbondingDelegationsRequest { - const NAME: &'static str = "QueryDelegatorUnbondingDelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryUnbondingDelegatorDelegationsResponse is response type for the -/// Query/UnbondingDelegatorDelegations RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorUnbondingDelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub unbonding_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorUnbondingDelegationsResponse { - const NAME: &'static str = "QueryDelegatorUnbondingDelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryRedelegationsRequest is request type for the Query/Redelegations RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRedelegationsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// src_validator_addr defines the validator address to redelegate from. - #[prost(string, tag = "2")] - pub src_validator_addr: ::prost::alloc::string::String, - /// dst_validator_addr defines the validator address to redelegate to. - #[prost(string, tag = "3")] - pub dst_validator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "4")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryRedelegationsRequest { - const NAME: &'static str = "QueryRedelegationsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryRedelegationsResponse is response type for the Query/Redelegations RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryRedelegationsResponse { - #[prost(message, repeated, tag = "1")] - pub redelegation_responses: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryRedelegationsResponse { - const NAME: &'static str = "QueryRedelegationsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorValidatorsRequest is request type for the -/// Query/DelegatorValidators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorsRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDelegatorValidatorsRequest { - const NAME: &'static str = "QueryDelegatorValidatorsRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorValidatorsResponse is response type for the -/// Query/DelegatorValidators RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorsResponse { - /// validators defines the validators' info of a delegator. - #[prost(message, repeated, tag = "1")] - pub validators: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDelegatorValidatorsResponse { - const NAME: &'static str = "QueryDelegatorValidatorsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorValidatorRequest is request type for the -/// Query/DelegatorValidator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorRequest { - /// delegator_addr defines the delegator address to query for. - #[prost(string, tag = "1")] - pub delegator_addr: ::prost::alloc::string::String, - /// validator_addr defines the validator address to query for. - #[prost(string, tag = "2")] - pub validator_addr: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDelegatorValidatorRequest { - const NAME: &'static str = "QueryDelegatorValidatorRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryDelegatorValidatorResponse response type for the -/// Query/DelegatorValidator RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDelegatorValidatorResponse { - /// validator defines the validator info. - #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option, -} -impl ::prost::Name for QueryDelegatorValidatorResponse { - const NAME: &'static str = "QueryDelegatorValidatorResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryHistoricalInfoRequest is request type for the Query/HistoricalInfo RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryHistoricalInfoRequest { - /// height defines at which height to query the historical info. - #[prost(int64, tag = "1")] - pub height: i64, -} -impl ::prost::Name for QueryHistoricalInfoRequest { - const NAME: &'static str = "QueryHistoricalInfoRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryHistoricalInfoResponse is response type for the Query/HistoricalInfo RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryHistoricalInfoResponse { - /// hist defines the historical info at the given height. - #[prost(message, optional, tag = "1")] - pub hist: ::core::option::Option, -} -impl ::prost::Name for QueryHistoricalInfoResponse { - const NAME: &'static str = "QueryHistoricalInfoResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryPoolRequest is request type for the Query/Pool RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPoolRequest {} -impl ::prost::Name for QueryPoolRequest { - const NAME: &'static str = "QueryPoolRequest"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryPoolResponse is response type for the Query/Pool RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPoolResponse { - /// pool defines the pool info. - #[prost(message, optional, tag = "1")] - pub pool: ::core::option::Option, -} -impl ::prost::Name for QueryPoolResponse { - const NAME: &'static str = "QueryPoolResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryParamsRequest is request type for the Query/Params RPC method. -#[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 = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// QueryParamsResponse is response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params holds all the parameters of this module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// Generated client implementations. -#[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; - /// Query defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// Validators queries all validators that match the given status. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validators( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Validators", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validators")); - self.inner.unary(req, path, codec).await - } - /// Validator queries validator info for given validator address. - pub async fn validator( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Validator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Validator")); - self.inner.unary(req, path, codec).await - } - /// ValidatorDelegations queries delegate info for given validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validator_delegations( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/ValidatorDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "ValidatorDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn validator_unbonding_delegations( - &mut self, - request: impl tonic::IntoRequest< - super::QueryValidatorUnbondingDelegationsRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "ValidatorUnbondingDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// Delegation queries delegate info for given validator delegator pair. - pub async fn delegation( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Delegation", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Delegation")); - self.inner.unary(req, path, codec).await - } - /// UnbondingDelegation queries unbonding info for given validator delegator - /// pair. - pub async fn unbonding_delegation( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/UnbondingDelegation", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "UnbondingDelegation", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorDelegations queries all delegations of a given delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_delegations( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/DelegatorDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorUnbondingDelegations queries all unbonding delegations of a given - /// delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_unbonding_delegations( - &mut self, - request: impl tonic::IntoRequest< - super::QueryDelegatorUnbondingDelegationsRequest, - >, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorUnbondingDelegations", - ), - ); - self.inner.unary(req, path, codec).await - } - /// Redelegations queries redelegations of given address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn redelegations( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Redelegations", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "Redelegations"), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorValidators queries all validators info for given delegator - /// address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - pub async fn delegator_validators( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/DelegatorValidators", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.staking.v1beta1.Query", - "DelegatorValidators", - ), - ); - self.inner.unary(req, path, codec).await - } - /// DelegatorValidator queries validator info for given delegator validator - /// pair. - pub async fn delegator_validator( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/DelegatorValidator", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "DelegatorValidator"), - ); - self.inner.unary(req, path, codec).await - } - /// HistoricalInfo queries the historical info for given height. - pub async fn historical_info( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/HistoricalInfo", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.staking.v1beta1.Query", "HistoricalInfo"), - ); - self.inner.unary(req, path, codec).await - } - /// Pool queries the pool info. - pub async fn pool( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Pool", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Pool")); - self.inner.unary(req, path, codec).await - } - /// Parameters queries the staking parameters. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.staking.v1beta1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.staking.v1beta1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// Validators queries all validators that match the given status. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validators( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Validator queries validator info for given validator address. - async fn validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ValidatorDelegations queries delegate info for given validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validator_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ValidatorUnbondingDelegations queries unbonding delegations of a validator. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn validator_unbonding_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Delegation queries delegate info for given validator delegator pair. - async fn delegation( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UnbondingDelegation queries unbonding info for given validator delegator - /// pair. - async fn unbonding_delegation( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorDelegations queries all delegations of a given delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorUnbondingDelegations queries all unbonding delegations of a given - /// delegator address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_unbonding_delegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Redelegations queries redelegations of given address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn redelegations( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorValidators queries all validators info for given delegator - /// address. - /// - /// When called from another module, this query might consume a high amount of - /// gas if the pagination field is incorrectly set. - async fn delegator_validators( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DelegatorValidator queries validator info for given delegator validator - /// pair. - async fn delegator_validator( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// HistoricalInfo queries the historical info for given height. - async fn historical_info( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Pool queries the pool info. - async fn pool( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Parameters queries the staking parameters. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query defines the gRPC querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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() { - "/cosmos.staking.v1beta1.Query/Validators" => { - #[allow(non_camel_case_types)] - struct ValidatorsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ValidatorsSvc { - type Response = super::QueryValidatorsResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::validators(&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 = ValidatorsSvc(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) - } - "/cosmos.staking.v1beta1.Query/Validator" => { + "/cosmos.staking.v1beta1.Query/Redelegations" => { #[allow(non_camel_case_types)] - struct ValidatorSvc(pub Arc); + struct RedelegationsSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService - for ValidatorSvc { - type Response = super::QueryValidatorResponse; + > tonic::server::UnaryService + for RedelegationsSvc { + type Response = super::QueryRedelegationsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::validator(&inner, request).await + ::redelegations(&inner, request).await }; Box::pin(fut) } @@ -2960,7 +2424,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ValidatorSvc(inner); + let method = RedelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2976,15 +2440,14 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/ValidatorDelegations" => { + "/cosmos.staking.v1beta1.Query/DelegatorValidators" => { #[allow(non_camel_case_types)] - struct ValidatorDelegationsSvc(pub Arc); + struct DelegatorValidatorsSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService< - super::QueryValidatorDelegationsRequest, - > for ValidatorDelegationsSvc { - type Response = super::QueryValidatorDelegationsResponse; + > tonic::server::UnaryService + for DelegatorValidatorsSvc { + type Response = super::QueryDelegatorValidatorsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -2992,12 +2455,12 @@ pub mod query_server { fn call( &mut self, request: tonic::Request< - super::QueryValidatorDelegationsRequest, + super::QueryDelegatorValidatorsRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::validator_delegations(&inner, request).await + ::delegator_validators(&inner, request).await }; Box::pin(fut) } @@ -3009,7 +2472,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ValidatorDelegationsSvc(inner); + let method = DelegatorValidatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3025,15 +2488,14 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/ValidatorUnbondingDelegations" => { + "/cosmos.staking.v1beta1.Query/DelegatorValidator" => { #[allow(non_camel_case_types)] - struct ValidatorUnbondingDelegationsSvc(pub Arc); + struct DelegatorValidatorSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService< - super::QueryValidatorUnbondingDelegationsRequest, - > for ValidatorUnbondingDelegationsSvc { - type Response = super::QueryValidatorUnbondingDelegationsResponse; + > tonic::server::UnaryService + for DelegatorValidatorSvc { + type Response = super::QueryDelegatorValidatorResponse; type Future = BoxFuture< tonic::Response, tonic::Status, @@ -3041,16 +2503,12 @@ pub mod query_server { fn call( &mut self, request: tonic::Request< - super::QueryValidatorUnbondingDelegationsRequest, + super::QueryDelegatorValidatorRequest, >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::validator_unbonding_delegations( - &inner, - request, - ) - .await + ::delegator_validator(&inner, request).await }; Box::pin(fut) } @@ -3062,7 +2520,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ValidatorUnbondingDelegationsSvc(inner); + let method = DelegatorValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3078,25 +2536,25 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/Delegation" => { + "/cosmos.staking.v1beta1.Query/HistoricalInfo" => { #[allow(non_camel_case_types)] - struct DelegationSvc(pub Arc); + struct HistoricalInfoSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService - for DelegationSvc { - type Response = super::QueryDelegationResponse; + > tonic::server::UnaryService + for HistoricalInfoSvc { + type Response = super::QueryHistoricalInfoResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegation(&inner, request).await + ::historical_info(&inner, request).await }; Box::pin(fut) } @@ -3108,7 +2566,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegationSvc(inner); + let method = HistoricalInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3124,27 +2582,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/UnbondingDelegation" => { + "/cosmos.staking.v1beta1.Query/Pool" => { #[allow(non_camel_case_types)] - struct UnbondingDelegationSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for UnbondingDelegationSvc { - type Response = super::QueryUnbondingDelegationResponse; + struct PoolSvc(pub Arc); + impl tonic::server::UnaryService + for PoolSvc { + type Response = super::QueryPoolResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryUnbondingDelegationRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::unbonding_delegation(&inner, request).await + ::pool(&inner, request).await }; Box::pin(fut) } @@ -3156,7 +2610,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UnbondingDelegationSvc(inner); + let method = PoolSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3172,28 +2626,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/DelegatorDelegations" => { + "/cosmos.staking.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] - struct DelegatorDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryDelegatorDelegationsRequest, - > for DelegatorDelegationsSvc { - type Response = super::QueryDelegatorDelegationsResponse; + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryDelegatorDelegationsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegator_delegations(&inner, request).await + ::params(&inner, request).await }; Box::pin(fut) } @@ -3205,7 +2654,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegatorDelegationsSvc(inner); + let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3221,32 +2670,761 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/DelegatorUnbondingDelegations" => { + _ => { + 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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 = "cosmos.staking.v1beta1.Query"; + } +} +/// MsgCreateValidator defines a SDK message for creating a new validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateValidator { + #[prost(message, optional, tag = "1")] + pub description: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub commission: ::core::option::Option, + #[prost(string, tag = "3")] + pub min_self_delegation: ::prost::alloc::string::String, + /// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + /// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + /// only in bech32 notation). + #[deprecated] + #[prost(string, tag = "4")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "5")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "6")] + pub pubkey: ::core::option::Option, + #[prost(message, optional, tag = "7")] + pub value: ::core::option::Option, +} +impl ::prost::Name for MsgCreateValidator { + const NAME: &'static str = "MsgCreateValidator"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgCreateValidatorResponse defines the Msg/CreateValidator response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateValidatorResponse {} +impl ::prost::Name for MsgCreateValidatorResponse { + const NAME: &'static str = "MsgCreateValidatorResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgEditValidator defines a SDK message for editing an existing validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgEditValidator { + #[prost(message, optional, tag = "1")] + pub description: ::core::option::Option, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// We pass a reference to the new commission rate and min self delegation as + /// it's not mandatory to update. If not updated, the deserialized rate will be + /// zero with no way to distinguish if an update was intended. + /// REF: #2373 + #[prost(string, tag = "3")] + pub commission_rate: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub min_self_delegation: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgEditValidator { + const NAME: &'static str = "MsgEditValidator"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgEditValidatorResponse defines the Msg/EditValidator response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgEditValidatorResponse {} +impl ::prost::Name for MsgEditValidatorResponse { + const NAME: &'static str = "MsgEditValidatorResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgDelegate defines a SDK message for performing a delegation of coins +/// from a delegator to a validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, +} +impl ::prost::Name for MsgDelegate { + const NAME: &'static str = "MsgDelegate"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgDelegateResponse defines the Msg/Delegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDelegateResponse {} +impl ::prost::Name for MsgDelegateResponse { + const NAME: &'static str = "MsgDelegateResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgBeginRedelegate defines a SDK message for performing a redelegation +/// of coins from a delegator and source validator to a destination validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBeginRedelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_src_address: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub validator_dst_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "4")] + pub amount: ::core::option::Option, +} +impl ::prost::Name for MsgBeginRedelegate { + const NAME: &'static str = "MsgBeginRedelegate"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgBeginRedelegateResponse { + #[prost(message, optional, tag = "1")] + pub completion_time: ::core::option::Option< + super::super::super::google::protobuf::Timestamp, + >, +} +impl ::prost::Name for MsgBeginRedelegateResponse { + const NAME: &'static str = "MsgBeginRedelegateResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgUndelegate defines a SDK message for performing an undelegation from a +/// delegate and a validator. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUndelegate { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, +} +impl ::prost::Name for MsgUndelegate { + const NAME: &'static str = "MsgUndelegate"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgUndelegateResponse defines the Msg/Undelegate response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUndelegateResponse { + #[prost(message, optional, tag = "1")] + pub completion_time: ::core::option::Option< + super::super::super::google::protobuf::Timestamp, + >, + /// amount returns the amount of undelegated coins + /// + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "2")] + pub amount: ::core::option::Option, +} +impl ::prost::Name for MsgUndelegateResponse { + const NAME: &'static str = "MsgUndelegateResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +/// +/// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelUnbondingDelegation { + #[prost(string, tag = "1")] + pub delegator_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + /// amount is always less than or equal to unbonding delegation entry balance + #[prost(message, optional, tag = "3")] + pub amount: ::core::option::Option, + /// creation_height is the height which the unbonding took place. + #[prost(int64, tag = "4")] + pub creation_height: i64, +} +impl ::prost::Name for MsgCancelUnbondingDelegation { + const NAME: &'static str = "MsgCancelUnbondingDelegation"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgCancelUnbondingDelegationResponse +/// +/// Since: cosmos-sdk 0.46 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelUnbondingDelegationResponse {} +impl ::prost::Name for MsgCancelUnbondingDelegationResponse { + const NAME: &'static str = "MsgCancelUnbondingDelegationResponse"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/staking parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// +/// Since: cosmos-sdk 0.47 +#[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 = "cosmos.staking.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the staking Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// CreateValidator defines a method for creating a new validator. + pub async fn create_validator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/CreateValidator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.staking.v1beta1.Msg", "CreateValidator"), + ); + self.inner.unary(req, path, codec).await + } + /// EditValidator defines a method for editing an existing validator. + pub async fn edit_validator( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/EditValidator", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "EditValidator")); + self.inner.unary(req, path, codec).await + } + /// Delegate defines a method for performing a delegation of coins + /// from a delegator to a validator. + pub async fn delegate( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/Delegate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Delegate")); + self.inner.unary(req, path, codec).await + } + /// BeginRedelegate defines a method for performing a redelegation + /// of coins from a delegator and source validator to a destination validator. + pub async fn begin_redelegate( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/BeginRedelegate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.staking.v1beta1.Msg", "BeginRedelegate"), + ); + self.inner.unary(req, path, codec).await + } + /// Undelegate defines a method for performing an undelegation from a + /// delegate and a validator. + pub async fn undelegate( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/Undelegate", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "Undelegate")); + self.inner.unary(req, path, codec).await + } + /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + /// and delegate back to previous validator. + /// + /// Since: cosmos-sdk 0.46 + pub async fn cancel_unbonding_delegation( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "cosmos.staking.v1beta1.Msg", + "CancelUnbondingDelegation", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateParams defines an operation for updating the x/staking module + /// parameters. + /// Since: cosmos-sdk 0.47 + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.staking.v1beta1.Msg", "UpdateParams")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// CreateValidator defines a method for creating a new validator. + async fn create_validator( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// EditValidator defines a method for editing an existing validator. + async fn edit_validator( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Delegate defines a method for performing a delegation of coins + /// from a delegator to a validator. + async fn delegate( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// BeginRedelegate defines a method for performing a redelegation + /// of coins from a delegator and source validator to a destination validator. + async fn begin_redelegate( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Undelegate defines a method for performing an undelegation from a + /// delegate and a validator. + async fn undelegate( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// CancelUnbondingDelegation defines a method for performing canceling the unbonding delegation + /// and delegate back to previous validator. + /// + /// Since: cosmos-sdk 0.46 + async fn cancel_unbonding_delegation( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateParams defines an operation for updating the x/staking module + /// parameters. + /// Since: cosmos-sdk 0.47 + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the staking Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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() { + "/cosmos.staking.v1beta1.Msg/CreateValidator" => { #[allow(non_camel_case_types)] - struct DelegatorUnbondingDelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryDelegatorUnbondingDelegationsRequest, - > for DelegatorUnbondingDelegationsSvc { - type Response = super::QueryDelegatorUnbondingDelegationsResponse; + struct CreateValidatorSvc(pub Arc); + impl tonic::server::UnaryService + for CreateValidatorSvc { + type Response = super::MsgCreateValidatorResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryDelegatorUnbondingDelegationsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegator_unbonding_delegations( - &inner, - request, - ) - .await + ::create_validator(&inner, request).await }; Box::pin(fut) } @@ -3258,7 +3436,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegatorUnbondingDelegationsSvc(inner); + let method = CreateValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3274,25 +3452,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/Redelegations" => { + "/cosmos.staking.v1beta1.Msg/EditValidator" => { #[allow(non_camel_case_types)] - struct RedelegationsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for RedelegationsSvc { - type Response = super::QueryRedelegationsResponse; + struct EditValidatorSvc(pub Arc); + impl tonic::server::UnaryService + for EditValidatorSvc { + type Response = super::MsgEditValidatorResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::redelegations(&inner, request).await + ::edit_validator(&inner, request).await }; Box::pin(fut) } @@ -3304,7 +3480,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RedelegationsSvc(inner); + let method = EditValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3320,27 +3496,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/DelegatorValidators" => { + "/cosmos.staking.v1beta1.Msg/Delegate" => { #[allow(non_camel_case_types)] - struct DelegatorValidatorsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DelegatorValidatorsSvc { - type Response = super::QueryDelegatorValidatorsResponse; + struct DelegateSvc(pub Arc); + impl tonic::server::UnaryService + for DelegateSvc { + type Response = super::MsgDelegateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryDelegatorValidatorsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegator_validators(&inner, request).await + ::delegate(&inner, request).await }; Box::pin(fut) } @@ -3352,7 +3524,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegatorValidatorsSvc(inner); + let method = DelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3368,27 +3540,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/DelegatorValidator" => { + "/cosmos.staking.v1beta1.Msg/BeginRedelegate" => { #[allow(non_camel_case_types)] - struct DelegatorValidatorSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for DelegatorValidatorSvc { - type Response = super::QueryDelegatorValidatorResponse; + struct BeginRedelegateSvc(pub Arc); + impl tonic::server::UnaryService + for BeginRedelegateSvc { + type Response = super::MsgBeginRedelegateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryDelegatorValidatorRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegator_validator(&inner, request).await + ::begin_redelegate(&inner, request).await }; Box::pin(fut) } @@ -3400,7 +3568,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DelegatorValidatorSvc(inner); + let method = BeginRedelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3416,25 +3584,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/HistoricalInfo" => { + "/cosmos.staking.v1beta1.Msg/Undelegate" => { #[allow(non_camel_case_types)] - struct HistoricalInfoSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for HistoricalInfoSvc { - type Response = super::QueryHistoricalInfoResponse; + struct UndelegateSvc(pub Arc); + impl tonic::server::UnaryService + for UndelegateSvc { + type Response = super::MsgUndelegateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::historical_info(&inner, request).await + ::undelegate(&inner, request).await }; Box::pin(fut) } @@ -3446,7 +3612,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = HistoricalInfoSvc(inner); + let method = UndelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3462,23 +3628,26 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/Pool" => { + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation" => { #[allow(non_camel_case_types)] - struct PoolSvc(pub Arc); - impl tonic::server::UnaryService - for PoolSvc { - type Response = super::QueryPoolResponse; + struct CancelUnbondingDelegationSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for CancelUnbondingDelegationSvc { + type Response = super::MsgCancelUnbondingDelegationResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::pool(&inner, request).await + ::cancel_unbonding_delegation(&inner, request) + .await }; Box::pin(fut) } @@ -3490,7 +3659,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PoolSvc(inner); + let method = CancelUnbondingDelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3506,23 +3675,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.staking.v1beta1.Query/Params" => { + "/cosmos.staking.v1beta1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -3534,7 +3703,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -3565,7 +3734,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -3577,7 +3746,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -3587,156 +3756,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.staking.v1beta1.Query"; - } -} -/// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -/// -/// Since: cosmos-sdk 0.43 -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct StakeAuthorization { - /// max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is - /// empty, there is no spend limit and any amount of coins can be delegated. - #[prost(message, optional, tag = "1")] - pub max_tokens: ::core::option::Option, - /// authorization_type defines one of AuthorizationType. - #[prost(enumeration = "AuthorizationType", tag = "4")] - pub authorization_type: i32, - /// validators is the oneof that represents either allow_list or deny_list - #[prost(oneof = "stake_authorization::Validators", tags = "2, 3")] - pub validators: ::core::option::Option, -} -/// Nested message and enum types in `StakeAuthorization`. -pub mod stake_authorization { - /// Validators defines list of validator addresses. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct ValidatorsVec { - #[prost(string, repeated, tag = "1")] - pub address: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - } - impl ::prost::Name for ValidatorsVec { - const NAME: &'static str = "Validators"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "cosmos.staking.v1beta1.StakeAuthorization.{}", Self::NAME - ) - } - } - /// validators is the oneof that represents either allow_list or deny_list - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Validators { - /// allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's - /// account. - #[prost(message, tag = "2")] - AllowList(ValidatorsVec), - /// deny_list specifies list of validator addresses to whom grantee can not delegate tokens. - #[prost(message, tag = "3")] - DenyList(ValidatorsVec), - } -} -impl ::prost::Name for StakeAuthorization { - const NAME: &'static str = "StakeAuthorization"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// AuthorizationType defines the type of staking module authorization type -/// -/// Since: cosmos-sdk 0.43 -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum AuthorizationType { - /// AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type - Unspecified = 0, - /// AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate - Delegate = 1, - /// AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate - Undelegate = 2, - /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate - Redelegate = 3, -} -impl AuthorizationType { - /// 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 { - AuthorizationType::Unspecified => "AUTHORIZATION_TYPE_UNSPECIFIED", - AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", - AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", - AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "AUTHORIZATION_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), - "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), - "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), - _ => None, - } - } -} -/// GenesisState defines the staking module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// params defines all the parameters of related to deposit. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, - /// last_total_power tracks the total amounts of bonded tokens recorded during - /// the previous end block. - #[prost(bytes = "vec", tag = "2")] - pub last_total_power: ::prost::alloc::vec::Vec, - /// last_validator_powers is a special index that provides a historical list - /// of the last-block's bonded validators. - #[prost(message, repeated, tag = "3")] - pub last_validator_powers: ::prost::alloc::vec::Vec, - /// delegations defines the validator set at genesis. - #[prost(message, repeated, tag = "4")] - pub validators: ::prost::alloc::vec::Vec, - /// delegations defines the delegations active at genesis. - #[prost(message, repeated, tag = "5")] - pub delegations: ::prost::alloc::vec::Vec, - /// unbonding_delegations defines the unbonding delegations active at genesis. - #[prost(message, repeated, tag = "6")] - pub unbonding_delegations: ::prost::alloc::vec::Vec, - /// redelegations defines the redelegations active at genesis. - #[prost(message, repeated, tag = "7")] - pub redelegations: ::prost::alloc::vec::Vec, - #[prost(bool, tag = "8")] - pub exported: bool, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) - } -} -/// LastValidatorPower required for validator set update logic. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LastValidatorPower { - /// address is the address of the validator. - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// power defines the power of the validator. - #[prost(int64, tag = "2")] - pub power: i64, -} -impl ::prost::Name for LastValidatorPower { - const NAME: &'static str = "LastValidatorPower"; - const PACKAGE: &'static str = "cosmos.staking.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.staking.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.staking.v1beta1.Msg"; } } diff --git a/src/prost/cosmos.staking.v1beta1.serde.rs b/src/prost/cosmos.staking.v1beta1.serde.rs index 38ca4a23..8195e71b 100644 --- a/src/prost/cosmos.staking.v1beta1.serde.rs +++ b/src/prost/cosmos.staking.v1beta1.serde.rs @@ -9,6 +9,7 @@ impl serde::Serialize for AuthorizationType { Self::Delegate => "AUTHORIZATION_TYPE_DELEGATE", Self::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", Self::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + Self::CancelUnbondingDelegation => "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION", }; serializer.serialize_str(variant) } @@ -24,6 +25,7 @@ impl<'de> serde::Deserialize<'de> for AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE", "AUTHORIZATION_TYPE_UNDELEGATE", "AUTHORIZATION_TYPE_REDELEGATE", + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION", ]; struct GeneratedVisitor; @@ -68,6 +70,7 @@ impl<'de> serde::Deserialize<'de> for AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE" => Ok(AuthorizationType::Delegate), "AUTHORIZATION_TYPE_UNDELEGATE" => Ok(AuthorizationType::Undelegate), "AUTHORIZATION_TYPE_REDELEGATE" => Ok(AuthorizationType::Redelegate), + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => Ok(AuthorizationType::CancelUnbondingDelegation), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -3062,10 +3065,16 @@ impl serde::Serialize for MsgUndelegateResponse { if true { len += 1; } + if true { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", len)?; if let Some(v) = self.completion_time.as_ref() { struct_ser.serialize_field("completionTime", v)?; } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } struct_ser.end() } } @@ -3078,11 +3087,13 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { const FIELDS: &[&str] = &[ "completion_time", "completionTime", + "amount", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { CompletionTime, + Amount, } impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -3105,6 +3116,7 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { { match value { "completionTime" | "completion_time" => Ok(GeneratedField::CompletionTime), + "amount" => Ok(GeneratedField::Amount), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3125,6 +3137,7 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { V: serde::de::MapAccess<'de>, { let mut completion_time__ = None; + let mut amount__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::CompletionTime => { @@ -3133,10 +3146,17 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { } completion_time__ = map_.next_value()?; } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } } } Ok(MsgUndelegateResponse { completion_time: completion_time__, + amount: amount__, }) } } diff --git a/src/prost/cosmos.tx.signing.v1beta1.rs b/src/prost/cosmos.tx.signing.v1beta1.rs index 4685364f..48f7ca1a 100644 --- a/src/prost/cosmos.tx.signing.v1beta1.rs +++ b/src/prost/cosmos.tx.signing.v1beta1.rs @@ -135,12 +135,13 @@ pub enum SignMode { Direct = 1, /// SIGN_MODE_TEXTUAL is a future signing mode that will verify some /// human-readable textual representation on top of the binary representation - /// from SIGN_MODE_DIRECT. It is currently not supported. + /// from SIGN_MODE_DIRECT. + /// + /// Since: cosmos-sdk 0.50 Textual = 2, /// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses /// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - /// require signers signing over other signers' `signer_info`. It also allows - /// for adding Tips in transactions. + /// require signers signing over other signers' `signer_info`. /// /// Since: cosmos-sdk 0.46 DirectAux = 3, diff --git a/src/prost/cosmos.tx.v1beta1.rs b/src/prost/cosmos.tx.v1beta1.rs index 403722eb..87a35d3a 100644 --- a/src/prost/cosmos.tx.v1beta1.rs +++ b/src/prost/cosmos.tx.v1beta1.rs @@ -104,12 +104,8 @@ pub struct SignDocDirectAux { /// sequence is the sequence number of the signing account. #[prost(uint64, tag = "5")] pub sequence: u64, - /// Tip is the optional tip used for transactions fees paid in another denom. - /// It should be left empty if the signer is not the tipper for this - /// transaction. - /// - /// This field is ignored if the chain didn't enable tips, i.e. didn't add the - /// `TipDecorator` in its posthandler. + /// tips have been depreacted and should not be used + #[deprecated] #[prost(message, optional, tag = "6")] pub tip: ::core::option::Option, } @@ -187,6 +183,7 @@ pub struct AuthInfo { /// `TipDecorator` in its posthandler. /// /// Since: cosmos-sdk 0.46 + #[deprecated] #[prost(message, optional, tag = "3")] pub tip: ::core::option::Option, } @@ -383,6 +380,9 @@ impl ::prost::Name for AuxSignerData { #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventRequest { /// events is the list of transaction event type. + /// Deprecated post v0.47.x: use query instead, which should contain a valid + /// events query. + #[deprecated] #[prost(string, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// pagination defines a pagination for the request. @@ -394,13 +394,20 @@ pub struct GetTxsEventRequest { >, #[prost(enumeration = "OrderBy", tag = "3")] pub order_by: i32, - /// page is the page number to query, starts at 1. If not provided, will default to first page. + /// page is the page number to query, starts at 1. If not provided, will + /// default to first page. #[prost(uint64, tag = "4")] pub page: u64, /// limit is the total number of results to be returned in the result page. /// If left empty it will default to a value to be set by each app. #[prost(uint64, tag = "5")] pub limit: u64, + /// query defines the transaction event query that is proxied to Tendermint's + /// TxSearch RPC method. The query must be valid. + /// + /// Since cosmos-sdk 0.50 + #[prost(string, tag = "6")] + pub query: ::prost::alloc::string::String, } impl ::prost::Name for GetTxsEventRequest { const NAME: &'static str = "GetTxsEventRequest"; @@ -577,7 +584,8 @@ impl ::prost::Name for GetBlockWithTxsRequest { ::prost::alloc::format!("cosmos.tx.v1beta1.{}", Self::NAME) } } -/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +/// method. /// /// Since: cosmos-sdk 0.45.2 #[allow(clippy::derive_partial_eq_without_eq)] @@ -587,9 +595,9 @@ pub struct GetBlockWithTxsResponse { #[prost(message, repeated, tag = "1")] pub txs: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "2")] - pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + pub block_id: ::core::option::Option<::cometbft_proto::types::v1::BlockId>, #[prost(message, optional, tag = "3")] - pub block: ::core::option::Option<::tendermint_proto::types::Block>, + pub block: ::core::option::Option<::cometbft_proto::types::v1::Block>, /// pagination defines a pagination for the response. #[prost(message, optional, tag = "4")] pub pagination: ::core::option::Option< @@ -747,7 +755,8 @@ impl ::prost::Name for TxDecodeAminoResponse { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderBy { - /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + /// to ASC in this case. Unspecified = 0, /// ORDER_BY_ASC defines ascending order Asc = 1, @@ -776,7 +785,8 @@ impl OrderBy { } } } -/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +/// method. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BroadcastMode { @@ -785,11 +795,11 @@ pub enum BroadcastMode { /// DEPRECATED: use BROADCAST_MODE_SYNC instead, /// BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. Block = 1, - /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - /// a CheckTx execution response only. + /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + /// for a CheckTx execution response only. Sync = 2, - /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - /// immediately. + /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + /// returns immediately. Async = 3, } impl BroadcastMode { diff --git a/src/prost/cosmos.upgrade.v1beta1.rs b/src/prost/cosmos.upgrade.v1beta1.rs index 2bb5cab7..3fe838d6 100644 --- a/src/prost/cosmos.upgrade.v1beta1.rs +++ b/src/prost/cosmos.upgrade.v1beta1.rs @@ -105,64 +105,161 @@ impl ::prost::Name for ModuleVersion { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +/// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentPlanRequest {} +impl ::prost::Name for QueryCurrentPlanRequest { + const NAME: &'static str = "QueryCurrentPlanRequest"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentPlanResponse { + /// plan is the current upgrade plan. + #[prost(message, optional, tag = "1")] + pub plan: ::core::option::Option, +} +impl ::prost::Name for QueryCurrentPlanResponse { + const NAME: &'static str = "QueryCurrentPlanResponse"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAppliedPlanRequest { + /// name is the name of the applied plan to query for. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryAppliedPlanRequest { + const NAME: &'static str = "QueryAppliedPlanRequest"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAppliedPlanResponse { + /// height is the block height at which the plan was applied. + #[prost(int64, tag = "1")] + pub height: i64, +} +impl ::prost::Name for QueryAppliedPlanResponse { + const NAME: &'static str = "QueryAppliedPlanResponse"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradedConsensusStateRequest { + /// last height of the current chain must be sent in request + /// as this is the height under which next consensus state is stored + #[prost(int64, tag = "1")] + pub last_height: i64, +} +impl ::prost::Name for QueryUpgradedConsensusStateRequest { + const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradedConsensusStateResponse { + /// Since: cosmos-sdk 0.43 + #[prost(bytes = "vec", tag = "2")] + pub upgraded_consensus_state: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryUpgradedConsensusStateResponse { + const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; + const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + } +} +/// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions +/// RPC method. /// -/// Since: cosmos-sdk 0.46 +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSoftwareUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). +pub struct QueryModuleVersionsRequest { + /// module_name is a field to query a specific module + /// consensus version from state. Leaving this empty will + /// fetch the full list of module versions from state #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// plan is the upgrade plan. - #[prost(message, optional, tag = "2")] - pub plan: ::core::option::Option, + pub module_name: ::prost::alloc::string::String, } -impl ::prost::Name for MsgSoftwareUpgrade { - const NAME: &'static str = "MsgSoftwareUpgrade"; +impl ::prost::Name for QueryModuleVersionsRequest { + const NAME: &'static str = "QueryModuleVersionsRequest"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +/// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions +/// RPC method. /// -/// Since: cosmos-sdk 0.46 +/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSoftwareUpgradeResponse {} -impl ::prost::Name for MsgSoftwareUpgradeResponse { - const NAME: &'static str = "MsgSoftwareUpgradeResponse"; +pub struct QueryModuleVersionsResponse { + /// module_versions is a list of module names with their consensus versions. + #[prost(message, repeated, tag = "1")] + pub module_versions: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryModuleVersionsResponse { + const NAME: &'static str = "QueryModuleVersionsResponse"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +/// QueryAuthorityRequest is the request type for Query/Authority /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUpgrade { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgCancelUpgrade { - const NAME: &'static str = "MsgCancelUpgrade"; +pub struct QueryAuthorityRequest {} +impl ::prost::Name for QueryAuthorityRequest { + const NAME: &'static str = "QueryAuthorityRequest"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +/// QueryAuthorityResponse is the response type for Query/Authority /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCancelUpgradeResponse {} -impl ::prost::Name for MsgCancelUpgradeResponse { - const NAME: &'static str = "MsgCancelUpgradeResponse"; +pub struct QueryAuthorityResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryAuthorityResponse { + const NAME: &'static str = "QueryAuthorityResponse"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) @@ -170,16 +267,16 @@ impl ::prost::Name for MsgCancelUpgradeResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the upgrade Msg service. + /// Query defines the gRPC upgrade querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -190,7 +287,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -208,7 +305,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -222,7 +319,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -255,14 +352,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// SoftwareUpgrade is a governance operation for initiating a software upgrade. - /// - /// Since: cosmos-sdk 0.46 - pub async fn software_upgrade( + /// CurrentPlan queries the current upgrade plan. + pub async fn current_plan( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -276,24 +371,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade", + "/cosmos.upgrade.v1beta1.Query/CurrentPlan", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade"), - ); + .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "CurrentPlan")); self.inner.unary(req, path, codec).await } - /// CancelUpgrade is a governance operation for cancelling a previously - /// approved software upgrade. - /// - /// Since: cosmos-sdk 0.46 - pub async fn cancel_upgrade( + /// AppliedPlan queries a previously applied upgrade plan by its name. + pub async fn applied_plan( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -307,48 +397,170 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade", + "/cosmos.upgrade.v1beta1.Query/AppliedPlan", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade")); + .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "AppliedPlan")); self.inner.unary(req, path, codec).await } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// SoftwareUpgrade is a governance operation for initiating a software upgrade. - /// - /// Since: cosmos-sdk 0.46 - async fn software_upgrade( - &self, - request: tonic::Request, + /// UpgradedConsensusState queries the consensus state that will serve + /// as a trusted kernel for the next version of this chain. It will only be + /// stored at the last height of this chain. + /// UpgradedConsensusState RPC not supported with legacy querier + /// This rpc is deprecated now that IBC has its own replacement + /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + pub async fn upgraded_consensus_state( + &mut self, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, - >; - /// CancelUpgrade is a governance operation for cancelling a previously - /// approved software upgrade. + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "cosmos.upgrade.v1beta1.Query", + "UpgradedConsensusState", + ), + ); + self.inner.unary(req, path, codec).await + } + /// ModuleVersions queries the list of module versions from state. /// - /// Since: cosmos-sdk 0.46 - async fn cancel_upgrade( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, + /// Since: cosmos-sdk 0.43 + pub async fn module_versions( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/ModuleVersions", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "ModuleVersions"), + ); + self.inner.unary(req, path, codec).await + } + /// Returns the account with authority to conduct upgrades + /// + /// Since: cosmos-sdk 0.46 + pub async fn authority( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.upgrade.v1beta1.Query/Authority", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "Authority")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// CurrentPlan queries the current upgrade plan. + async fn current_plan( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// AppliedPlan queries a previously applied upgrade plan by its name. + async fn applied_plan( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpgradedConsensusState queries the consensus state that will serve + /// as a trusted kernel for the next version of this chain. It will only be + /// stored at the last height of this chain. + /// UpgradedConsensusState RPC not supported with legacy querier + /// This rpc is deprecated now that IBC has its own replacement + /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) + async fn upgraded_consensus_state( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// ModuleVersions queries the list of module versions from state. + /// + /// Since: cosmos-sdk 0.43 + async fn module_versions( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Returns the account with authority to conduct upgrades + /// + /// Since: cosmos-sdk 0.46 + async fn authority( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the upgrade Msg service. + /// Query defines the gRPC upgrade querier service. #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -356,7 +568,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -408,9 +620,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -426,23 +638,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade" => { + "/cosmos.upgrade.v1beta1.Query/CurrentPlan" => { #[allow(non_camel_case_types)] - struct SoftwareUpgradeSvc(pub Arc); - impl tonic::server::UnaryService - for SoftwareUpgradeSvc { - type Response = super::MsgSoftwareUpgradeResponse; + struct CurrentPlanSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for CurrentPlanSvc { + type Response = super::QueryCurrentPlanResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::software_upgrade(&inner, request).await + ::current_plan(&inner, request).await }; Box::pin(fut) } @@ -454,7 +668,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SoftwareUpgradeSvc(inner); + let method = CurrentPlanSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -470,23 +684,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade" => { + "/cosmos.upgrade.v1beta1.Query/AppliedPlan" => { #[allow(non_camel_case_types)] - struct CancelUpgradeSvc(pub Arc); - impl tonic::server::UnaryService - for CancelUpgradeSvc { - type Response = super::MsgCancelUpgradeResponse; + struct AppliedPlanSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AppliedPlanSvc { + type Response = super::QueryAppliedPlanResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::cancel_upgrade(&inner, request).await + ::applied_plan(&inner, request).await }; Box::pin(fut) } @@ -498,7 +714,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CancelUpgradeSvc(inner); + let method = AppliedPlanSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -514,202 +730,247 @@ pub mod msg_server { }; 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(), - ) - }) + "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState" => { + #[allow(non_camel_case_types)] + struct UpgradedConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryUpgradedConsensusStateRequest, + > for UpgradedConsensusStateSvc { + type Response = super::QueryUpgradedConsensusStateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryUpgradedConsensusStateRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::upgraded_consensus_state(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpgradedConsensusStateSvc(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) } - } - } - } - 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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 = "cosmos.upgrade.v1beta1.Msg"; - } -} -/// QueryCurrentPlanRequest is the request type for the Query/CurrentPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryCurrentPlanRequest {} -impl ::prost::Name for QueryCurrentPlanRequest { - const NAME: &'static str = "QueryCurrentPlanRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) - } -} -/// QueryCurrentPlanResponse is the response type for the Query/CurrentPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryCurrentPlanResponse { - /// plan is the current upgrade plan. - #[prost(message, optional, tag = "1")] - pub plan: ::core::option::Option, -} -impl ::prost::Name for QueryCurrentPlanResponse { - const NAME: &'static str = "QueryCurrentPlanResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + "/cosmos.upgrade.v1beta1.Query/ModuleVersions" => { + #[allow(non_camel_case_types)] + struct ModuleVersionsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ModuleVersionsSvc { + type Response = super::QueryModuleVersionsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::module_versions(&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 = ModuleVersionsSvc(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) + } + "/cosmos.upgrade.v1beta1.Query/Authority" => { + #[allow(non_camel_case_types)] + struct AuthoritySvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for AuthoritySvc { + type Response = super::QueryAuthorityResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::authority(&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 = AuthoritySvc(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(), + ) + }) + } + } + } } -} -/// QueryCurrentPlanRequest is the request type for the Query/AppliedPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAppliedPlanRequest { - /// name is the name of the applied plan to query for. - #[prost(string, tag = "1")] - pub name: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAppliedPlanRequest { - const NAME: &'static str = "QueryAppliedPlanRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } } -} -/// QueryAppliedPlanResponse is the response type for the Query/AppliedPlan RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAppliedPlanResponse { - /// height is the block height at which the plan was applied. - #[prost(int64, tag = "1")] - pub height: i64, -} -impl ::prost::Name for QueryAppliedPlanResponse { - const NAME: &'static str = "QueryAppliedPlanResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } } -} -/// QueryUpgradedConsensusStateRequest is the request type for the Query/UpgradedConsensusState -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateRequest { - /// last height of the current chain must be sent in request - /// as this is the height under which next consensus state is stored - #[prost(int64, tag = "1")] - pub last_height: i64, -} -impl ::prost::Name for QueryUpgradedConsensusStateRequest { - const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } } -} -/// QueryUpgradedConsensusStateResponse is the response type for the Query/UpgradedConsensusState -/// RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateResponse { - /// Since: cosmos-sdk 0.43 - #[prost(bytes = "vec", tag = "2")] - pub upgraded_consensus_state: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryUpgradedConsensusStateResponse { - const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; - const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; } } -/// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions -/// RPC method. +/// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. /// -/// Since: cosmos-sdk 0.43 +/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleVersionsRequest { - /// module_name is a field to query a specific module - /// consensus version from state. Leaving this empty will - /// fetch the full list of module versions from state +pub struct MsgSoftwareUpgrade { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] - pub module_name: ::prost::alloc::string::String, + pub authority: ::prost::alloc::string::String, + /// plan is the upgrade plan. + #[prost(message, optional, tag = "2")] + pub plan: ::core::option::Option, } -impl ::prost::Name for QueryModuleVersionsRequest { - const NAME: &'static str = "QueryModuleVersionsRequest"; +impl ::prost::Name for MsgSoftwareUpgrade { + const NAME: &'static str = "MsgSoftwareUpgrade"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions -/// RPC method. +/// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. /// -/// Since: cosmos-sdk 0.43 +/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryModuleVersionsResponse { - /// module_versions is a list of module names with their consensus versions. - #[prost(message, repeated, tag = "1")] - pub module_versions: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryModuleVersionsResponse { - const NAME: &'static str = "QueryModuleVersionsResponse"; +pub struct MsgSoftwareUpgradeResponse {} +impl ::prost::Name for MsgSoftwareUpgradeResponse { + const NAME: &'static str = "MsgSoftwareUpgradeResponse"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// QueryAuthorityRequest is the request type for Query/Authority +/// MsgCancelUpgrade is the Msg/CancelUpgrade request type. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAuthorityRequest {} -impl ::prost::Name for QueryAuthorityRequest { - const NAME: &'static str = "QueryAuthorityRequest"; +pub struct MsgCancelUpgrade { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgCancelUpgrade { + const NAME: &'static str = "MsgCancelUpgrade"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) } } -/// QueryAuthorityResponse is the response type for Query/Authority +/// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. /// /// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryAuthorityResponse { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryAuthorityResponse { - const NAME: &'static str = "QueryAuthorityResponse"; +pub struct MsgCancelUpgradeResponse {} +impl ::prost::Name for MsgCancelUpgradeResponse { + const NAME: &'static str = "MsgCancelUpgradeResponse"; const PACKAGE: &'static str = "cosmos.upgrade.v1beta1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("cosmos.upgrade.v1beta1.{}", Self::NAME) @@ -717,16 +978,16 @@ impl ::prost::Name for QueryAuthorityResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query defines the gRPC upgrade querier service. + /// Msg defines the upgrade Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -737,7 +998,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -755,7 +1016,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -769,7 +1030,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -802,102 +1063,14 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CurrentPlan queries the current upgrade plan. - pub async fn current_plan( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Query/CurrentPlan", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "CurrentPlan")); - self.inner.unary(req, path, codec).await - } - /// AppliedPlan queries a previously applied upgrade plan by its name. - pub async fn applied_plan( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Query/AppliedPlan", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "AppliedPlan")); - self.inner.unary(req, path, codec).await - } - /// UpgradedConsensusState queries the consensus state that will serve - /// as a trusted kernel for the next version of this chain. It will only be - /// stored at the last height of this chain. - /// UpgradedConsensusState RPC not supported with legacy querier - /// This rpc is deprecated now that IBC has its own replacement - /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - pub async fn upgraded_consensus_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - > { - self.inner - .ready() - .await - .map_err(|e| { - tonic::Status::new( - tonic::Code::Unknown, - format!("Service was not ready: {}", e.into()), - ) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "cosmos.upgrade.v1beta1.Query", - "UpgradedConsensusState", - ), - ); - self.inner.unary(req, path, codec).await - } - /// ModuleVersions queries the list of module versions from state. + /// SoftwareUpgrade is a governance operation for initiating a software upgrade. /// - /// Since: cosmos-sdk 0.43 - pub async fn module_versions( + /// Since: cosmos-sdk 0.46 + pub async fn software_upgrade( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -911,23 +1084,24 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Query/ModuleVersions", + "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "ModuleVersions"), + GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "SoftwareUpgrade"), ); self.inner.unary(req, path, codec).await } - /// Returns the account with authority to conduct upgrades + /// CancelUpgrade is a governance operation for cancelling a previously + /// approved software upgrade. /// /// Since: cosmos-sdk 0.46 - pub async fn authority( + pub async fn cancel_upgrade( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -941,76 +1115,48 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/cosmos.upgrade.v1beta1.Query/Authority", + "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Query", "Authority")); + .insert(GrpcMethod::new("cosmos.upgrade.v1beta1.Msg", "CancelUpgrade")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// CurrentPlan queries the current upgrade plan. - async fn current_plan( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// AppliedPlan queries a previously applied upgrade plan by its name. - async fn applied_plan( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpgradedConsensusState queries the consensus state that will serve - /// as a trusted kernel for the next version of this chain. It will only be - /// stored at the last height of this chain. - /// UpgradedConsensusState RPC not supported with legacy querier - /// This rpc is deprecated now that IBC has its own replacement - /// (https://github.com/cosmos/ibc-go/blob/2c880a22e9f9cc75f62b527ca94aa75ce1106001/proto/ibc/core/client/v1/query.proto#L54) - async fn upgraded_consensus_state( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ModuleVersions queries the list of module versions from state. + pub trait Msg: Send + Sync + 'static { + /// SoftwareUpgrade is a governance operation for initiating a software upgrade. /// - /// Since: cosmos-sdk 0.43 - async fn module_versions( + /// Since: cosmos-sdk 0.46 + async fn software_upgrade( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Returns the account with authority to conduct upgrades + /// CancelUpgrade is a governance operation for cancelling a previously + /// approved software upgrade. /// /// Since: cosmos-sdk 0.46 - async fn authority( + async fn cancel_upgrade( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query defines the gRPC upgrade querier service. + /// Msg defines the upgrade Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1018,7 +1164,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1070,9 +1216,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1088,167 +1234,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.upgrade.v1beta1.Query/CurrentPlan" => { - #[allow(non_camel_case_types)] - struct CurrentPlanSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for CurrentPlanSvc { - type Response = super::QueryCurrentPlanResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::current_plan(&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 = CurrentPlanSvc(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) - } - "/cosmos.upgrade.v1beta1.Query/AppliedPlan" => { - #[allow(non_camel_case_types)] - struct AppliedPlanSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AppliedPlanSvc { - type Response = super::QueryAppliedPlanResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::applied_plan(&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 = AppliedPlanSvc(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) - } - "/cosmos.upgrade.v1beta1.Query/UpgradedConsensusState" => { - #[allow(non_camel_case_types)] - struct UpgradedConsensusStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryUpgradedConsensusStateRequest, - > for UpgradedConsensusStateSvc { - type Response = super::QueryUpgradedConsensusStateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request< - super::QueryUpgradedConsensusStateRequest, - >, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::upgraded_consensus_state(&inner, request) - .await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = UpgradedConsensusStateSvc(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) - } - "/cosmos.upgrade.v1beta1.Query/ModuleVersions" => { + "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade" => { #[allow(non_camel_case_types)] - struct ModuleVersionsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ModuleVersionsSvc { - type Response = super::QueryModuleVersionsResponse; + struct SoftwareUpgradeSvc(pub Arc); + impl tonic::server::UnaryService + for SoftwareUpgradeSvc { + type Response = super::MsgSoftwareUpgradeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::module_versions(&inner, request).await + ::software_upgrade(&inner, request).await }; Box::pin(fut) } @@ -1260,7 +1262,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ModuleVersionsSvc(inner); + let method = SoftwareUpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1276,25 +1278,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.upgrade.v1beta1.Query/Authority" => { + "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade" => { #[allow(non_camel_case_types)] - struct AuthoritySvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for AuthoritySvc { - type Response = super::QueryAuthorityResponse; + struct CancelUpgradeSvc(pub Arc); + impl tonic::server::UnaryService + for CancelUpgradeSvc { + type Response = super::MsgCancelUpgradeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::authority(&inner, request).await + ::cancel_upgrade(&inner, request).await }; Box::pin(fut) } @@ -1306,7 +1306,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AuthoritySvc(inner); + let method = CancelUpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1337,7 +1337,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1349,7 +1349,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1359,7 +1359,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.upgrade.v1beta1.Msg"; } } diff --git a/src/prost/ibc.applications.fee.v1.rs b/src/prost/ibc.applications.fee.v1.rs index 9d798dce..d4e4bee8 100644 --- a/src/prost/ibc.applications.fee.v1.rs +++ b/src/prost/ibc.applications.fee.v1.rs @@ -1,3 +1,24 @@ +/// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct IncentivizedAcknowledgement { + /// the underlying app acknowledgement bytes + #[prost(bytes = "vec", tag = "1")] + pub app_acknowledgement: ::prost::alloc::vec::Vec, + /// the relayer address which submits the recv packet message + #[prost(string, tag = "2")] + pub forward_relayer_address: ::prost::alloc::string::String, + /// success flag of the base application callback + #[prost(bool, tag = "3")] + pub underlying_app_success: bool, +} +impl ::prost::Name for IncentivizedAcknowledgement { + const NAME: &'static str = "IncentivizedAcknowledgement"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} /// Fee defines the ICS29 receive, acknowledgement and timeout fees #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -81,852 +102,427 @@ impl ::prost::Name for IdentifiedPacketFees { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgRegisterPayee defines the request type for the RegisterPayee rpc +/// GenesisState defines the ICS29 fee middleware genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterPayee { +pub struct GenesisState { + /// list of identified packet fees + #[prost(message, repeated, tag = "1")] + pub identified_fees: ::prost::alloc::vec::Vec, + /// list of fee enabled channels + #[prost(message, repeated, tag = "2")] + pub fee_enabled_channels: ::prost::alloc::vec::Vec, + /// list of registered payees + #[prost(message, repeated, tag = "3")] + pub registered_payees: ::prost::alloc::vec::Vec, + /// list of registered counterparty payees + #[prost(message, repeated, tag = "4")] + pub registered_counterparty_payees: ::prost::alloc::vec::Vec< + RegisteredCounterpartyPayee, + >, + /// list of forward relayer addresses + #[prost(message, repeated, tag = "5")] + pub forward_relayers: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeeEnabledChannel { /// unique port identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, /// unique channel identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// the relayer address - #[prost(string, tag = "3")] - pub relayer: ::prost::alloc::string::String, - /// the payee address - #[prost(string, tag = "4")] - pub payee: ::prost::alloc::string::String, } -impl ::prost::Name for MsgRegisterPayee { - const NAME: &'static str = "MsgRegisterPayee"; +impl ::prost::Name for FeeEnabledChannel { + const NAME: &'static str = "FeeEnabledChannel"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc +/// RegisteredPayee contains the relayer address and payee address for a specific channel #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterPayeeResponse {} -impl ::prost::Name for MsgRegisterPayeeResponse { - const NAME: &'static str = "MsgRegisterPayeeResponse"; +pub struct RegisteredPayee { + /// unique channel identifier + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, + /// the payee address + #[prost(string, tag = "3")] + pub payee: ::prost::alloc::string::String, +} +impl ::prost::Name for RegisteredPayee { + const NAME: &'static str = "RegisteredPayee"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc +/// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used +/// for recv fee distribution) #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterCounterpartyPayee { - /// unique port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, +pub struct RegisteredCounterpartyPayee { /// unique channel identifier - #[prost(string, tag = "2")] + #[prost(string, tag = "1")] pub channel_id: ::prost::alloc::string::String, /// the relayer address - #[prost(string, tag = "3")] + #[prost(string, tag = "2")] pub relayer: ::prost::alloc::string::String, /// the counterparty payee address - #[prost(string, tag = "4")] + #[prost(string, tag = "3")] pub counterparty_payee: ::prost::alloc::string::String, } -impl ::prost::Name for MsgRegisterCounterpartyPayee { - const NAME: &'static str = "MsgRegisterCounterpartyPayee"; +impl ::prost::Name for RegisteredCounterpartyPayee { + const NAME: &'static str = "RegisteredCounterpartyPayee"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc +/// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterCounterpartyPayeeResponse {} -impl ::prost::Name for MsgRegisterCounterpartyPayeeResponse { - const NAME: &'static str = "MsgRegisterCounterpartyPayeeResponse"; +pub struct ForwardRelayerAddress { + /// the forward relayer address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// unique packet identifer comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "2")] + pub packet_id: ::core::option::Option< + super::super::super::core::channel::v1::PacketId, + >, +} +impl ::prost::Name for ForwardRelayerAddress { + const NAME: &'static str = "ForwardRelayerAddress"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgPayPacketFee defines the request type for the PayPacketFee rpc -/// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be -/// paid for +/// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring +/// See ICS004: #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPayPacketFee { - /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet - #[prost(message, optional, tag = "1")] - pub fee: ::core::option::Option, - /// the source port unique identifier +pub struct Metadata { + /// fee_version defines the ICS29 fee version + #[prost(string, tag = "1")] + pub fee_version: ::prost::alloc::string::String, + /// app_version defines the underlying application version, which may or may not be a JSON encoded bytestring #[prost(string, tag = "2")] - pub source_port_id: ::prost::alloc::string::String, - /// the source channel unique identifer - #[prost(string, tag = "3")] - pub source_channel_id: ::prost::alloc::string::String, - /// account address to refund fee if necessary - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, - /// optional list of relayers permitted to the receive packet fees - #[prost(string, repeated, tag = "5")] - pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + pub app_version: ::prost::alloc::string::String, } -impl ::prost::Name for MsgPayPacketFee { - const NAME: &'static str = "MsgPayPacketFee"; +impl ::prost::Name for Metadata { + const NAME: &'static str = "Metadata"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +/// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPayPacketFeeResponse {} -impl ::prost::Name for MsgPayPacketFeeResponse { - const NAME: &'static str = "MsgPayPacketFeeResponse"; +pub struct QueryIncentivizedPacketsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// block height at which to query + #[prost(uint64, tag = "2")] + pub query_height: u64, +} +impl ::prost::Name for QueryIncentivizedPacketsRequest { + const NAME: &'static str = "QueryIncentivizedPacketsRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc -/// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPayPacketFeeAsync { - /// unique packet identifier comprised of the channel ID, port ID and sequence +pub struct QueryIncentivizedPacketsResponse { + /// list of identified fees for incentivized packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryIncentivizedPacketsResponse { + const NAME: &'static str = "QueryIncentivizedPacketsResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryIncentivizedPacketRequest { + /// unique packet identifier comprised of channel ID, port ID and sequence #[prost(message, optional, tag = "1")] pub packet_id: ::core::option::Option< super::super::super::core::channel::v1::PacketId, >, - /// the packet fee associated with a particular IBC packet - #[prost(message, optional, tag = "2")] - pub packet_fee: ::core::option::Option, + /// block height at which to query + #[prost(uint64, tag = "2")] + pub query_height: u64, } -impl ::prost::Name for MsgPayPacketFeeAsync { - const NAME: &'static str = "MsgPayPacketFeeAsync"; +impl ::prost::Name for QueryIncentivizedPacketRequest { + const NAME: &'static str = "QueryIncentivizedPacketRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPayPacketFeeAsyncResponse {} -impl ::prost::Name for MsgPayPacketFeeAsyncResponse { - const NAME: &'static str = "MsgPayPacketFeeAsyncResponse"; +pub struct QueryIncentivizedPacketResponse { + /// the identified fees for the incentivized packet + #[prost(message, optional, tag = "1")] + pub incentivized_packet: ::core::option::Option, +} +impl ::prost::Name for QueryIncentivizedPacketResponse { + const NAME: &'static str = "QueryIncentivizedPacketResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the ICS29 Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, +/// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets +/// for a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryIncentivizedPacketsForChannelRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub channel_id: ::prost::alloc::string::String, + /// Height to query at + #[prost(uint64, tag = "4")] + pub query_height: u64, +} +impl ::prost::Name for QueryIncentivizedPacketsForChannelRequest { + const NAME: &'static str = "QueryIncentivizedPacketsForChannelRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +} +/// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryIncentivizedPacketsForChannelResponse { + /// Map of all incentivized_packets + #[prost(message, repeated, tag = "1")] + pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryIncentivizedPacketsForChannelResponse { + const NAME: &'static str = "QueryIncentivizedPacketsForChannelResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// RegisterPayee defines a rpc handler method for MsgRegisterPayee - /// RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional - /// payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on - /// the source chain from which packets originate as this is where fee distribution takes place. This function may be - /// called more than once by a relayer, in which case, the latest payee is always used. - pub async fn register_payee( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.fee.v1.Msg/RegisterPayee", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.applications.fee.v1.Msg", "RegisterPayee")); - self.inner.unary(req, path, codec).await - } - /// RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee - /// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty - /// payee address before relaying. This ensures they will be properly compensated for forward relaying since - /// the destination chain must include the registered counterparty payee address in the acknowledgement. This function - /// may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. - pub async fn register_counterparty_payee( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.fee.v1.Msg/RegisterCounterpartyPayee", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.applications.fee.v1.Msg", - "RegisterCounterpartyPayee", - ), - ); - self.inner.unary(req, path, codec).await - } - /// PayPacketFee defines a rpc handler method for MsgPayPacketFee - /// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to - /// incentivize the relaying of the packet at the next sequence - /// NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows - /// initiates the lifecycle of the incentivized packet - pub async fn pay_packet_fee( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.fee.v1.Msg/PayPacketFee", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.applications.fee.v1.Msg", "PayPacketFee")); - self.inner.unary(req, path, codec).await - } - /// PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync - /// PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to - /// incentivize the relaying of a known packet (i.e. at a particular sequence) - pub async fn pay_packet_fee_async( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.fee.v1.Msg/PayPacketFeeAsync", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("ibc.applications.fee.v1.Msg", "PayPacketFeeAsync"), - ); - self.inner.unary(req, path, codec).await - } +} +/// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalRecvFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option< + super::super::super::core::channel::v1::PacketId, + >, +} +impl ::prost::Name for QueryTotalRecvFeesRequest { + const NAME: &'static str = "QueryTotalRecvFeesRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// RegisterPayee defines a rpc handler method for MsgRegisterPayee - /// RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional - /// payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on - /// the source chain from which packets originate as this is where fee distribution takes place. This function may be - /// called more than once by a relayer, in which case, the latest payee is always used. - async fn register_payee( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee - /// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty - /// payee address before relaying. This ensures they will be properly compensated for forward relaying since - /// the destination chain must include the registered counterparty payee address in the acknowledgement. This function - /// may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. - async fn register_counterparty_payee( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// PayPacketFee defines a rpc handler method for MsgPayPacketFee - /// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to - /// incentivize the relaying of the packet at the next sequence - /// NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows - /// initiates the lifecycle of the incentivized packet - async fn pay_packet_fee( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync - /// PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to - /// incentivize the relaying of a known packet (i.e. at a particular sequence) - async fn pay_packet_fee_async( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; +/// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalRecvFeesResponse { + /// the total packet receive fees + #[prost(message, repeated, tag = "1")] + pub recv_fees: ::prost::alloc::vec::Vec< + super::super::super::super::cosmos::base::v1beta1::Coin, + >, +} +impl ::prost::Name for QueryTotalRecvFeesResponse { + const NAME: &'static str = "QueryTotalRecvFeesResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } - /// Msg defines the ICS29 Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, +} +/// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalAckFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option< + super::super::super::core::channel::v1::PacketId, + >, +} +impl ::prost::Name for QueryTotalAckFeesRequest { + const NAME: &'static str = "QueryTotalAckFeesRequest"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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.applications.fee.v1.Msg/RegisterPayee" => { - #[allow(non_camel_case_types)] - struct RegisterPayeeSvc(pub Arc); - impl tonic::server::UnaryService - for RegisterPayeeSvc { - type Response = super::MsgRegisterPayeeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::register_payee(&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 = RegisterPayeeSvc(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.fee.v1.Msg/RegisterCounterpartyPayee" => { - #[allow(non_camel_case_types)] - struct RegisterCounterpartyPayeeSvc(pub Arc); - impl< - T: Msg, - > tonic::server::UnaryService - for RegisterCounterpartyPayeeSvc { - type Response = super::MsgRegisterCounterpartyPayeeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::register_counterparty_payee(&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 = RegisterCounterpartyPayeeSvc(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.fee.v1.Msg/PayPacketFee" => { - #[allow(non_camel_case_types)] - struct PayPacketFeeSvc(pub Arc); - impl tonic::server::UnaryService - for PayPacketFeeSvc { - type Response = super::MsgPayPacketFeeResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pay_packet_fee(&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 = PayPacketFeeSvc(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.fee.v1.Msg/PayPacketFeeAsync" => { - #[allow(non_camel_case_types)] - struct PayPacketFeeAsyncSvc(pub Arc); - impl tonic::server::UnaryService - for PayPacketFeeAsyncSvc { - type Response = super::MsgPayPacketFeeAsyncResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::pay_packet_fee_async(&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 = PayPacketFeeAsyncSvc(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 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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.applications.fee.v1.Msg"; +} +/// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalAckFeesResponse { + /// the total packet acknowledgement fees + #[prost(message, repeated, tag = "1")] + pub ack_fees: ::prost::alloc::vec::Vec< + super::super::super::super::cosmos::base::v1beta1::Coin, + >, +} +impl ::prost::Name for QueryTotalAckFeesResponse { + const NAME: &'static str = "QueryTotalAckFeesResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// IncentivizedAcknowledgement is the acknowledgement format to be used by applications wrapped in the fee middleware +/// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct IncentivizedAcknowledgement { - /// the underlying app acknowledgement bytes - #[prost(bytes = "vec", tag = "1")] - pub app_acknowledgement: ::prost::alloc::vec::Vec, - /// the relayer address which submits the recv packet message - #[prost(string, tag = "2")] - pub forward_relayer_address: ::prost::alloc::string::String, - /// success flag of the base application callback - #[prost(bool, tag = "3")] - pub underlying_app_success: bool, +pub struct QueryTotalTimeoutFeesRequest { + /// the packet identifier for the associated fees + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option< + super::super::super::core::channel::v1::PacketId, + >, } -impl ::prost::Name for IncentivizedAcknowledgement { - const NAME: &'static str = "IncentivizedAcknowledgement"; +impl ::prost::Name for QueryTotalTimeoutFeesRequest { + const NAME: &'static str = "QueryTotalTimeoutFeesRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// GenesisState defines the ICS29 fee middleware genesis state +/// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// list of identified packet fees +pub struct QueryTotalTimeoutFeesResponse { + /// the total packet timeout fees #[prost(message, repeated, tag = "1")] - pub identified_fees: ::prost::alloc::vec::Vec, - /// list of fee enabled channels - #[prost(message, repeated, tag = "2")] - pub fee_enabled_channels: ::prost::alloc::vec::Vec, - /// list of registered payees - #[prost(message, repeated, tag = "3")] - pub registered_payees: ::prost::alloc::vec::Vec, - /// list of registered counterparty payees - #[prost(message, repeated, tag = "4")] - pub registered_counterparty_payees: ::prost::alloc::vec::Vec< - RegisteredCounterpartyPayee, + pub timeout_fees: ::prost::alloc::vec::Vec< + super::super::super::super::cosmos::base::v1beta1::Coin, >, - /// list of forward relayer addresses - #[prost(message, repeated, tag = "5")] - pub forward_relayers: ::prost::alloc::vec::Vec, } -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; +impl ::prost::Name for QueryTotalTimeoutFeesResponse { + const NAME: &'static str = "QueryTotalTimeoutFeesResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// FeeEnabledChannel contains the PortID & ChannelID for a fee enabled channel +/// QueryPayeeRequest defines the request type for the Payee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct FeeEnabledChannel { - /// unique port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, +pub struct QueryPayeeRequest { /// unique channel identifier - #[prost(string, tag = "2")] + #[prost(string, tag = "1")] pub channel_id: ::prost::alloc::string::String, + /// the relayer address to which the distribution address is registered + #[prost(string, tag = "2")] + pub relayer: ::prost::alloc::string::String, } -impl ::prost::Name for FeeEnabledChannel { - const NAME: &'static str = "FeeEnabledChannel"; +impl ::prost::Name for QueryPayeeRequest { + const NAME: &'static str = "QueryPayeeRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// RegisteredPayee contains the relayer address and payee address for a specific channel +/// QueryPayeeResponse defines the response type for the Payee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisteredPayee { - /// unique channel identifier +pub struct QueryPayeeResponse { + /// the payee address to which packet fees are paid out #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// the relayer address - #[prost(string, tag = "2")] - pub relayer: ::prost::alloc::string::String, - /// the payee address - #[prost(string, tag = "3")] - pub payee: ::prost::alloc::string::String, + pub payee_address: ::prost::alloc::string::String, } -impl ::prost::Name for RegisteredPayee { - const NAME: &'static str = "RegisteredPayee"; +impl ::prost::Name for QueryPayeeResponse { + const NAME: &'static str = "QueryPayeeResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// RegisteredCounterpartyPayee contains the relayer address and counterparty payee address for a specific channel (used -/// for recv fee distribution) +/// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct RegisteredCounterpartyPayee { +pub struct QueryCounterpartyPayeeRequest { /// unique channel identifier #[prost(string, tag = "1")] pub channel_id: ::prost::alloc::string::String, - /// the relayer address + /// the relayer address to which the counterparty is registered #[prost(string, tag = "2")] pub relayer: ::prost::alloc::string::String, - /// the counterparty payee address - #[prost(string, tag = "3")] - pub counterparty_payee: ::prost::alloc::string::String, } -impl ::prost::Name for RegisteredCounterpartyPayee { - const NAME: &'static str = "RegisteredCounterpartyPayee"; +impl ::prost::Name for QueryCounterpartyPayeeRequest { + const NAME: &'static str = "QueryCounterpartyPayeeRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// ForwardRelayerAddress contains the forward relayer address and PacketId used for async acknowledgements +/// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ForwardRelayerAddress { - /// the forward relayer address +pub struct QueryCounterpartyPayeeResponse { + /// the counterparty payee address used to compensate forward relaying #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, - /// unique packet identifer comprised of the channel ID, port ID and sequence - #[prost(message, optional, tag = "2")] - pub packet_id: ::core::option::Option< - super::super::super::core::channel::v1::PacketId, - >, + pub counterparty_payee: ::prost::alloc::string::String, } -impl ::prost::Name for ForwardRelayerAddress { - const NAME: &'static str = "ForwardRelayerAddress"; +impl ::prost::Name for QueryCounterpartyPayeeResponse { + const NAME: &'static str = "QueryCounterpartyPayeeResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// QueryIncentivizedPacketsRequest defines the request type for the IncentivizedPackets rpc +/// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketsRequest { +pub struct QueryFeeEnabledChannelsRequest { /// pagination defines an optional pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option< @@ -936,375 +532,87 @@ pub struct QueryIncentivizedPacketsRequest { #[prost(uint64, tag = "2")] pub query_height: u64, } -impl ::prost::Name for QueryIncentivizedPacketsRequest { - const NAME: &'static str = "QueryIncentivizedPacketsRequest"; +impl ::prost::Name for QueryFeeEnabledChannelsRequest { + const NAME: &'static str = "QueryFeeEnabledChannelsRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPackets rpc +/// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketsResponse { - /// list of identified fees for incentivized packets +pub struct QueryFeeEnabledChannelsResponse { + /// list of fee enabled channels #[prost(message, repeated, tag = "1")] - pub incentivized_packets: ::prost::alloc::vec::Vec, + pub fee_enabled_channels: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option< super::super::super::super::cosmos::base::query::v1beta1::PageResponse, >, } -impl ::prost::Name for QueryIncentivizedPacketsResponse { - const NAME: &'static str = "QueryIncentivizedPacketsResponse"; +impl ::prost::Name for QueryFeeEnabledChannelsResponse { + const NAME: &'static str = "QueryFeeEnabledChannelsResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc +/// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketRequest { - /// unique packet identifier comprised of channel ID, port ID and sequence - #[prost(message, optional, tag = "1")] - pub packet_id: ::core::option::Option< - super::super::super::core::channel::v1::PacketId, - >, - /// block height at which to query - #[prost(uint64, tag = "2")] - pub query_height: u64, -} -impl ::prost::Name for QueryIncentivizedPacketRequest { - const NAME: &'static str = "QueryIncentivizedPacketRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryIncentivizedPacketsResponse defines the response type for the IncentivizedPacket rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketResponse { - /// the identified fees for the incentivized packet - #[prost(message, optional, tag = "1")] - pub incentivized_packet: ::core::option::Option, -} -impl ::prost::Name for QueryIncentivizedPacketResponse { - const NAME: &'static str = "QueryIncentivizedPacketResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryIncentivizedPacketsForChannelRequest defines the request type for querying for all incentivized packets -/// for a specific channel -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketsForChannelRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - #[prost(string, tag = "2")] +pub struct QueryFeeEnabledChannelRequest { + /// unique port identifier + #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub channel_id: ::prost::alloc::string::String, - /// Height to query at - #[prost(uint64, tag = "4")] - pub query_height: u64, -} -impl ::prost::Name for QueryIncentivizedPacketsForChannelRequest { - const NAME: &'static str = "QueryIncentivizedPacketsForChannelRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryIncentivizedPacketsResponse defines the response type for the incentivized packets RPC -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryIncentivizedPacketsForChannelResponse { - /// Map of all incentivized_packets - #[prost(message, repeated, tag = "1")] - pub incentivized_packets: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryIncentivizedPacketsForChannelResponse { - const NAME: &'static str = "QueryIncentivizedPacketsForChannelResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalRecvFeesRequest { - /// the packet identifier for the associated fees - #[prost(message, optional, tag = "1")] - pub packet_id: ::core::option::Option< - super::super::super::core::channel::v1::PacketId, - >, -} -impl ::prost::Name for QueryTotalRecvFeesRequest { - const NAME: &'static str = "QueryTotalRecvFeesRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalRecvFeesResponse defines the response type for the TotalRecvFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalRecvFeesResponse { - /// the total packet receive fees - #[prost(message, repeated, tag = "1")] - pub recv_fees: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, -} -impl ::prost::Name for QueryTotalRecvFeesResponse { - const NAME: &'static str = "QueryTotalRecvFeesResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalAckFeesRequest defines the request type for the TotalAckFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalAckFeesRequest { - /// the packet identifier for the associated fees - #[prost(message, optional, tag = "1")] - pub packet_id: ::core::option::Option< - super::super::super::core::channel::v1::PacketId, - >, -} -impl ::prost::Name for QueryTotalAckFeesRequest { - const NAME: &'static str = "QueryTotalAckFeesRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalAckFeesResponse defines the response type for the TotalAckFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalAckFeesResponse { - /// the total packet acknowledgement fees - #[prost(message, repeated, tag = "1")] - pub ack_fees: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, -} -impl ::prost::Name for QueryTotalAckFeesResponse { - const NAME: &'static str = "QueryTotalAckFeesResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalTimeoutFeesRequest defines the request type for the TotalTimeoutFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalTimeoutFeesRequest { - /// the packet identifier for the associated fees - #[prost(message, optional, tag = "1")] - pub packet_id: ::core::option::Option< - super::super::super::core::channel::v1::PacketId, - >, -} -impl ::prost::Name for QueryTotalTimeoutFeesRequest { - const NAME: &'static str = "QueryTotalTimeoutFeesRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryTotalTimeoutFeesResponse defines the response type for the TotalTimeoutFees rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalTimeoutFeesResponse { - /// the total packet timeout fees - #[prost(message, repeated, tag = "1")] - pub timeout_fees: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, -} -impl ::prost::Name for QueryTotalTimeoutFeesResponse { - const NAME: &'static str = "QueryTotalTimeoutFeesResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryPayeeRequest defines the request type for the Payee rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPayeeRequest { /// unique channel identifier - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// the relayer address to which the distribution address is registered #[prost(string, tag = "2")] - pub relayer: ::prost::alloc::string::String, + pub channel_id: ::prost::alloc::string::String, } -impl ::prost::Name for QueryPayeeRequest { - const NAME: &'static str = "QueryPayeeRequest"; +impl ::prost::Name for QueryFeeEnabledChannelRequest { + const NAME: &'static str = "QueryFeeEnabledChannelRequest"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// QueryPayeeResponse defines the response type for the Payee rpc +/// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPayeeResponse { - /// the payee address to which packet fees are paid out - #[prost(string, tag = "1")] - pub payee_address: ::prost::alloc::string::String, +pub struct QueryFeeEnabledChannelResponse { + /// boolean flag representing the fee enabled channel status + #[prost(bool, tag = "1")] + pub fee_enabled: bool, } -impl ::prost::Name for QueryPayeeResponse { - const NAME: &'static str = "QueryPayeeResponse"; +impl ::prost::Name for QueryFeeEnabledChannelResponse { + const NAME: &'static str = "QueryFeeEnabledChannelResponse"; const PACKAGE: &'static str = "ibc.applications.fee.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) } } -/// QueryCounterpartyPayeeRequest defines the request type for the CounterpartyPayee rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryCounterpartyPayeeRequest { - /// unique channel identifier - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - /// the relayer address to which the counterparty is registered - #[prost(string, tag = "2")] - pub relayer: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryCounterpartyPayeeRequest { - const NAME: &'static str = "QueryCounterpartyPayeeRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) +/// Generated client implementations. +#[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; + /// Query defines the ICS29 gRPC querier service. + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, } -} -/// QueryCounterpartyPayeeResponse defines the response type for the CounterpartyPayee rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryCounterpartyPayeeResponse { - /// the counterparty payee address used to compensate forward relaying - #[prost(string, tag = "1")] - pub counterparty_payee: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryCounterpartyPayeeResponse { - const NAME: &'static str = "QueryCounterpartyPayeeResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryFeeEnabledChannelsRequest defines the request type for the FeeEnabledChannels rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryFeeEnabledChannelsRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, - /// block height at which to query - #[prost(uint64, tag = "2")] - pub query_height: u64, -} -impl ::prost::Name for QueryFeeEnabledChannelsRequest { - const NAME: &'static str = "QueryFeeEnabledChannelsRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryFeeEnabledChannelsResponse defines the response type for the FeeEnabledChannels rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryFeeEnabledChannelsResponse { - /// list of fee enabled channels - #[prost(message, repeated, tag = "1")] - pub fee_enabled_channels: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryFeeEnabledChannelsResponse { - const NAME: &'static str = "QueryFeeEnabledChannelsResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryFeeEnabledChannelRequest { - /// unique port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// unique channel identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryFeeEnabledChannelRequest { - const NAME: &'static str = "QueryFeeEnabledChannelRequest"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// QueryFeeEnabledChannelResponse defines the response type for the FeeEnabledChannel rpc -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryFeeEnabledChannelResponse { - /// boolean flag representing the fee enabled channel status - #[prost(bool, tag = "1")] - pub fee_enabled: bool, -} -impl ::prost::Name for QueryFeeEnabledChannelResponse { - const NAME: &'static str = "QueryFeeEnabledChannelResponse"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) - } -} -/// Generated client implementations. -#[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; - /// Query defines the ICS29 gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } } impl QueryClient where @@ -2123,21 +1431,737 @@ pub mod query_server { } "/ibc.applications.fee.v1.Query/Payee" => { #[allow(non_camel_case_types)] - struct PayeeSvc(pub Arc); - impl tonic::server::UnaryService - for PayeeSvc { - type Response = super::QueryPayeeResponse; + struct PayeeSvc(pub Arc); + impl tonic::server::UnaryService + for PayeeSvc { + type Response = super::QueryPayeeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::payee(&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 = PayeeSvc(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.fee.v1.Query/CounterpartyPayee" => { + #[allow(non_camel_case_types)] + struct CounterpartyPayeeSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for CounterpartyPayeeSvc { + type Response = super::QueryCounterpartyPayeeResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::counterparty_payee(&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 = CounterpartyPayeeSvc(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.fee.v1.Query/FeeEnabledChannels" => { + #[allow(non_camel_case_types)] + struct FeeEnabledChannelsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for FeeEnabledChannelsSvc { + type Response = super::QueryFeeEnabledChannelsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryFeeEnabledChannelsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::fee_enabled_channels(&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 = FeeEnabledChannelsSvc(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.fee.v1.Query/FeeEnabledChannel" => { + #[allow(non_camel_case_types)] + struct FeeEnabledChannelSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for FeeEnabledChannelSvc { + type Response = super::QueryFeeEnabledChannelResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::fee_enabled_channel(&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 = FeeEnabledChannelSvc(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 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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.applications.fee.v1.Query"; + } +} +/// MsgRegisterPayee defines the request type for the RegisterPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterPayee { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "3")] + pub relayer: ::prost::alloc::string::String, + /// the payee address + #[prost(string, tag = "4")] + pub payee: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgRegisterPayee { + const NAME: &'static str = "MsgRegisterPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgRegisterPayeeResponse defines the response type for the RegisterPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterPayeeResponse {} +impl ::prost::Name for MsgRegisterPayeeResponse { + const NAME: &'static str = "MsgRegisterPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgRegisterCounterpartyPayee defines the request type for the RegisterCounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterCounterpartyPayee { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// the relayer address + #[prost(string, tag = "3")] + pub relayer: ::prost::alloc::string::String, + /// the counterparty payee address + #[prost(string, tag = "4")] + pub counterparty_payee: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgRegisterCounterpartyPayee { + const NAME: &'static str = "MsgRegisterCounterpartyPayee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgRegisterCounterpartyPayeeResponse defines the response type for the RegisterCounterpartyPayee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterCounterpartyPayeeResponse {} +impl ::prost::Name for MsgRegisterCounterpartyPayeeResponse { + const NAME: &'static str = "MsgRegisterCounterpartyPayeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgPayPacketFee defines the request type for the PayPacketFee rpc +/// This Msg can be used to pay for a packet at the next sequence send & should be combined with the Msg that will be +/// paid for +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPayPacketFee { + /// fee encapsulates the recv, ack and timeout fees associated with an IBC packet + #[prost(message, optional, tag = "1")] + pub fee: ::core::option::Option, + /// the source port unique identifier + #[prost(string, tag = "2")] + pub source_port_id: ::prost::alloc::string::String, + /// the source channel unique identifer + #[prost(string, tag = "3")] + pub source_channel_id: ::prost::alloc::string::String, + /// account address to refund fee if necessary + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, + /// optional list of relayers permitted to the receive packet fees + #[prost(string, repeated, tag = "5")] + pub relayers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for MsgPayPacketFee { + const NAME: &'static str = "MsgPayPacketFee"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgPayPacketFeeResponse defines the response type for the PayPacketFee rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPayPacketFeeResponse {} +impl ::prost::Name for MsgPayPacketFeeResponse { + const NAME: &'static str = "MsgPayPacketFeeResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgPayPacketFeeAsync defines the request type for the PayPacketFeeAsync rpc +/// This Msg can be used to pay for a packet at a specified sequence (instead of the next sequence send) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPayPacketFeeAsync { + /// unique packet identifier comprised of the channel ID, port ID and sequence + #[prost(message, optional, tag = "1")] + pub packet_id: ::core::option::Option< + super::super::super::core::channel::v1::PacketId, + >, + /// the packet fee associated with a particular IBC packet + #[prost(message, optional, tag = "2")] + pub packet_fee: ::core::option::Option, +} +impl ::prost::Name for MsgPayPacketFeeAsync { + const NAME: &'static str = "MsgPayPacketFeeAsync"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// MsgPayPacketFeeAsyncResponse defines the response type for the PayPacketFeeAsync rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPayPacketFeeAsyncResponse {} +impl ::prost::Name for MsgPayPacketFeeAsyncResponse { + const NAME: &'static str = "MsgPayPacketFeeAsyncResponse"; + const PACKAGE: &'static str = "ibc.applications.fee.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the ICS29 Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// RegisterPayee defines a rpc handler method for MsgRegisterPayee + /// RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional + /// payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on + /// the source chain from which packets originate as this is where fee distribution takes place. This function may be + /// called more than once by a relayer, in which case, the latest payee is always used. + pub async fn register_payee( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.fee.v1.Msg/RegisterPayee", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.applications.fee.v1.Msg", "RegisterPayee")); + self.inner.unary(req, path, codec).await + } + /// RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee + /// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty + /// payee address before relaying. This ensures they will be properly compensated for forward relaying since + /// the destination chain must include the registered counterparty payee address in the acknowledgement. This function + /// may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. + pub async fn register_counterparty_payee( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.fee.v1.Msg/RegisterCounterpartyPayee", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.fee.v1.Msg", + "RegisterCounterpartyPayee", + ), + ); + self.inner.unary(req, path, codec).await + } + /// PayPacketFee defines a rpc handler method for MsgPayPacketFee + /// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + /// incentivize the relaying of the packet at the next sequence + /// NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + /// initiates the lifecycle of the incentivized packet + pub async fn pay_packet_fee( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.fee.v1.Msg/PayPacketFee", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.applications.fee.v1.Msg", "PayPacketFee")); + self.inner.unary(req, path, codec).await + } + /// PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + /// PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + /// incentivize the relaying of a known packet (i.e. at a particular sequence) + pub async fn pay_packet_fee_async( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.fee.v1.Msg/PayPacketFeeAsync", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.applications.fee.v1.Msg", "PayPacketFeeAsync"), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// RegisterPayee defines a rpc handler method for MsgRegisterPayee + /// RegisterPayee is called by the relayer on each channelEnd and allows them to set an optional + /// payee to which reverse and timeout relayer packet fees will be paid out. The payee should be registered on + /// the source chain from which packets originate as this is where fee distribution takes place. This function may be + /// called more than once by a relayer, in which case, the latest payee is always used. + async fn register_payee( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// RegisterCounterpartyPayee defines a rpc handler method for MsgRegisterCounterpartyPayee + /// RegisterCounterpartyPayee is called by the relayer on each channelEnd and allows them to specify the counterparty + /// payee address before relaying. This ensures they will be properly compensated for forward relaying since + /// the destination chain must include the registered counterparty payee address in the acknowledgement. This function + /// may be called more than once by a relayer, in which case, the latest counterparty payee address is always used. + async fn register_counterparty_payee( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// PayPacketFee defines a rpc handler method for MsgPayPacketFee + /// PayPacketFee is an open callback that may be called by any module/user that wishes to escrow funds in order to + /// incentivize the relaying of the packet at the next sequence + /// NOTE: This method is intended to be used within a multi msg transaction, where the subsequent msg that follows + /// initiates the lifecycle of the incentivized packet + async fn pay_packet_fee( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// PayPacketFeeAsync defines a rpc handler method for MsgPayPacketFeeAsync + /// PayPacketFeeAsync is an open callback that may be called by any module/user that wishes to escrow funds in order to + /// incentivize the relaying of a known packet (i.e. at a particular sequence) + async fn pay_packet_fee_async( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the ICS29 Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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.applications.fee.v1.Msg/RegisterPayee" => { + #[allow(non_camel_case_types)] + struct RegisterPayeeSvc(pub Arc); + impl tonic::server::UnaryService + for RegisterPayeeSvc { + type Response = super::MsgRegisterPayeeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::payee(&inner, request).await + ::register_payee(&inner, request).await }; Box::pin(fut) } @@ -2149,7 +2173,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PayeeSvc(inner); + let method = RegisterPayeeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2165,25 +2189,26 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.fee.v1.Query/CounterpartyPayee" => { + "/ibc.applications.fee.v1.Msg/RegisterCounterpartyPayee" => { #[allow(non_camel_case_types)] - struct CounterpartyPayeeSvc(pub Arc); + struct RegisterCounterpartyPayeeSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for CounterpartyPayeeSvc { - type Response = super::QueryCounterpartyPayeeResponse; + T: Msg, + > tonic::server::UnaryService + for RegisterCounterpartyPayeeSvc { + type Response = super::MsgRegisterCounterpartyPayeeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::counterparty_payee(&inner, request).await + ::register_counterparty_payee(&inner, request) + .await }; Box::pin(fut) } @@ -2195,7 +2220,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CounterpartyPayeeSvc(inner); + let method = RegisterCounterpartyPayeeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2211,27 +2236,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.fee.v1.Query/FeeEnabledChannels" => { + "/ibc.applications.fee.v1.Msg/PayPacketFee" => { #[allow(non_camel_case_types)] - struct FeeEnabledChannelsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for FeeEnabledChannelsSvc { - type Response = super::QueryFeeEnabledChannelsResponse; + struct PayPacketFeeSvc(pub Arc); + impl tonic::server::UnaryService + for PayPacketFeeSvc { + type Response = super::MsgPayPacketFeeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryFeeEnabledChannelsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::fee_enabled_channels(&inner, request).await + ::pay_packet_fee(&inner, request).await }; Box::pin(fut) } @@ -2243,7 +2264,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = FeeEnabledChannelsSvc(inner); + let method = PayPacketFeeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2259,25 +2280,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.fee.v1.Query/FeeEnabledChannel" => { + "/ibc.applications.fee.v1.Msg/PayPacketFeeAsync" => { #[allow(non_camel_case_types)] - struct FeeEnabledChannelSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for FeeEnabledChannelSvc { - type Response = super::QueryFeeEnabledChannelResponse; + struct PayPacketFeeAsyncSvc(pub Arc); + impl tonic::server::UnaryService + for PayPacketFeeAsyncSvc { + type Response = super::MsgPayPacketFeeAsyncResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::fee_enabled_channel(&inner, request).await + ::pay_packet_fee_async(&inner, request).await }; Box::pin(fut) } @@ -2289,7 +2308,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = FeeEnabledChannelSvc(inner); + let method = PayPacketFeeAsyncSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2320,7 +2339,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2332,7 +2351,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2342,26 +2361,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.applications.fee.v1.Query"; - } -} -/// Metadata defines the ICS29 channel specific metadata encoded into the channel version bytestring -/// See ICS004: -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Metadata { - /// fee_version defines the ICS29 fee version - #[prost(string, tag = "1")] - pub fee_version: ::prost::alloc::string::String, - /// app_version defines the underlying application version, which may or may not be a JSON encoded bytestring - #[prost(string, tag = "2")] - pub app_version: ::prost::alloc::string::String, -} -impl ::prost::Name for Metadata { - const NAME: &'static str = "Metadata"; - const PACKAGE: &'static str = "ibc.applications.fee.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.fee.v1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.fee.v1.Msg"; } } diff --git a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs index 81fe9836..1cc36825 100644 --- a/src/prost/ibc.applications.interchain_accounts.controller.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.controller.v1.rs @@ -16,42 +16,17 @@ impl ::prost::Name for Params { ) } } -/// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +/// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterInterchainAccount { +pub struct QueryInterchainAccountRequest { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub connection_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub version: ::prost::alloc::string::String, - #[prost( - enumeration = "super::super::super::super::core::channel::v1::Order", - tag = "4" - )] - pub ordering: i32, } -impl ::prost::Name for MsgRegisterInterchainAccount { - const NAME: &'static str = "MsgRegisterInterchainAccount"; - const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME - ) - } -} -/// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRegisterInterchainAccountResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub port_id: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgRegisterInterchainAccountResponse { - const NAME: &'static str = "MsgRegisterInterchainAccountResponse"; +impl ::prost::Name for QueryInterchainAccountRequest { + const NAME: &'static str = "QueryInterchainAccountRequest"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -59,25 +34,15 @@ impl ::prost::Name for MsgRegisterInterchainAccountResponse { ) } } -/// MsgSendTx defines the payload for Msg/SendTx +/// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSendTx { +pub struct QueryInterchainAccountResponse { #[prost(string, tag = "1")] - pub owner: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub connection_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub packet_data: ::core::option::Option< - super::super::v1::InterchainAccountPacketData, - >, - /// Relative timeout timestamp provided will be added to the current block time during transaction execution. - /// The timeout timestamp must be non-zero. - #[prost(uint64, tag = "4")] - pub relative_timeout: u64, + pub address: ::prost::alloc::string::String, } -impl ::prost::Name for MsgSendTx { - const NAME: &'static str = "MsgSendTx"; +impl ::prost::Name for QueryInterchainAccountResponse { + const NAME: &'static str = "QueryInterchainAccountResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -85,15 +50,12 @@ impl ::prost::Name for MsgSendTx { ) } } -/// MsgSendTxResponse defines the response for MsgSendTx +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSendTxResponse { - #[prost(uint64, tag = "1")] - pub sequence: u64, -} -impl ::prost::Name for MsgSendTxResponse { - const NAME: &'static str = "MsgSendTxResponse"; +pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -101,34 +63,16 @@ impl ::prost::Name for MsgSendTxResponse { ) } } -/// MsgUpdateParams defines the payload for Msg/UpdateParams +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the 27-interchain-accounts/controller parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; - const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!( - "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME - ) - } -} -/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams -#[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"; +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -138,16 +82,16 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the 27-interchain-accounts/controller Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -158,7 +102,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -176,7 +120,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -190,7 +134,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -223,43 +167,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. - pub async fn register_interchain_account( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Msg", - "RegisterInterchainAccount", - ), - ); - self.inner.unary(req, path, codec).await - } - /// SendTx defines a rpc handler for MsgSendTx. - pub async fn send_tx( + /// InterchainAccount returns the interchain account address for a given owner address on a given connection + pub async fn interchain_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -273,24 +186,24 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.controller.v1.Msg/SendTx", + "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Msg", - "SendTx", + "ibc.applications.interchain_accounts.controller.v1.Query", + "InterchainAccount", ), ); self.inner.unary(req, path, codec).await } - /// UpdateParams defines a rpc handler for MsgUpdateParams. - pub async fn update_params( + /// Params queries all parameters of the ICA controller submodule. + pub async fn params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -304,14 +217,14 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams", + "/ibc.applications.interchain_accounts.controller.v1.Query/Params", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Msg", - "UpdateParams", + "ibc.applications.interchain_accounts.controller.v1.Query", + "Params", ), ); self.inner.unary(req, path, codec).await @@ -320,40 +233,32 @@ pub mod msg_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. - async fn register_interchain_account( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// SendTx defines a rpc handler for MsgSendTx. - async fn send_tx( + pub trait Query: Send + Sync + 'static { + /// InterchainAccount returns the interchain account address for a given owner address on a given connection + async fn interchain_account( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateParams defines a rpc handler for MsgUpdateParams. - async fn update_params( + /// Params queries all parameters of the ICA controller submodule. + async fn params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Msg defines the 27-interchain-accounts/controller Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -361,7 +266,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -413,9 +318,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -431,70 +336,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount" => { + "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount" => { #[allow(non_camel_case_types)] - struct RegisterInterchainAccountSvc(pub Arc); + struct InterchainAccountSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for RegisterInterchainAccountSvc { - type Response = super::MsgRegisterInterchainAccountResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::register_interchain_account(&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 = RegisterInterchainAccountSvc(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.interchain_accounts.controller.v1.Msg/SendTx" => { - #[allow(non_camel_case_types)] - struct SendTxSvc(pub Arc); - impl tonic::server::UnaryService - for SendTxSvc { - type Response = super::MsgSendTxResponse; + T: Query, + > tonic::server::UnaryService + for InterchainAccountSvc { + type Response = super::QueryInterchainAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::send_tx(&inner, request).await + ::interchain_account(&inner, request).await }; Box::pin(fut) } @@ -506,7 +366,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SendTxSvc(inner); + let method = InterchainAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -522,23 +382,23 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams" => { + "/ibc.applications.interchain_accounts.controller.v1.Query/Params" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::params(&inner, request).await }; Box::pin(fut) } @@ -550,7 +410,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -581,7 +441,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -593,7 +453,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -603,21 +463,72 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "ibc.applications.interchain_accounts.controller.v1.Msg"; + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.applications.interchain_accounts.controller.v1.Query"; } } -/// QueryInterchainAccountRequest is the request type for the Query/InterchainAccount RPC method. +/// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainAccount { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub connection_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, + #[prost( + enumeration = "super::super::super::super::core::channel::v1::Order", + tag = "4" + )] + pub ordering: i32, +} +impl ::prost::Name for MsgRegisterInterchainAccount { + const NAME: &'static str = "MsgRegisterInterchainAccount"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} +/// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRegisterInterchainAccountResponse { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgRegisterInterchainAccountResponse { + const NAME: &'static str = "MsgRegisterInterchainAccountResponse"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!( + "ibc.applications.interchain_accounts.controller.v1.{}", Self::NAME + ) + } +} +/// MsgSendTx defines the payload for Msg/SendTx #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryInterchainAccountRequest { +pub struct MsgSendTx { #[prost(string, tag = "1")] pub owner: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub connection_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub packet_data: ::core::option::Option< + super::super::v1::InterchainAccountPacketData, + >, + /// Relative timeout timestamp provided will be added to the current block time during transaction execution. + /// The timeout timestamp must be non-zero. + #[prost(uint64, tag = "4")] + pub relative_timeout: u64, } -impl ::prost::Name for QueryInterchainAccountRequest { - const NAME: &'static str = "QueryInterchainAccountRequest"; +impl ::prost::Name for MsgSendTx { + const NAME: &'static str = "MsgSendTx"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -625,15 +536,15 @@ impl ::prost::Name for QueryInterchainAccountRequest { ) } } -/// QueryInterchainAccountResponse the response type for the Query/InterchainAccount RPC method. +/// MsgSendTxResponse defines the response for MsgSendTx #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryInterchainAccountResponse { - #[prost(string, tag = "1")] - pub address: ::prost::alloc::string::String, +pub struct MsgSendTxResponse { + #[prost(uint64, tag = "1")] + pub sequence: u64, } -impl ::prost::Name for QueryInterchainAccountResponse { - const NAME: &'static str = "QueryInterchainAccountResponse"; +impl ::prost::Name for MsgSendTxResponse { + const NAME: &'static str = "MsgSendTxResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -641,12 +552,21 @@ impl ::prost::Name for QueryInterchainAccountResponse { ) } } -/// QueryParamsRequest is the request type for the Query/Params RPC method. +/// MsgUpdateParams defines the payload for Msg/UpdateParams #[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"; +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/controller parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -654,16 +574,12 @@ impl ::prost::Name for QueryParamsRequest { ) } } -/// QueryParamsResponse is the response type for the Query/Params RPC method. +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.controller.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -673,16 +589,16 @@ impl ::prost::Name for QueryParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service. + /// Msg defines the 27-interchain-accounts/controller Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -693,7 +609,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -711,7 +627,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -725,7 +641,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -758,12 +674,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// InterchainAccount returns the interchain account address for a given owner address on a given connection - pub async fn interchain_account( + /// RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. + pub async fn register_interchain_account( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -777,24 +693,24 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount", + "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Query", - "InterchainAccount", + "ibc.applications.interchain_accounts.controller.v1.Msg", + "RegisterInterchainAccount", ), ); self.inner.unary(req, path, codec).await } - /// Params queries all parameters of the ICA controller submodule. - pub async fn params( + /// SendTx defines a rpc handler for MsgSendTx. + pub async fn send_tx( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -808,14 +724,45 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.controller.v1.Query/Params", + "/ibc.applications.interchain_accounts.controller.v1.Msg/SendTx", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.controller.v1.Query", - "Params", + "ibc.applications.interchain_accounts.controller.v1.Msg", + "SendTx", + ), + ); + self.inner.unary(req, path, codec).await + } + /// UpdateParams defines a rpc handler for MsgUpdateParams. + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.interchain_accounts.controller.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.interchain_accounts.controller.v1.Msg", + "UpdateParams", ), ); self.inner.unary(req, path, codec).await @@ -824,32 +771,40 @@ pub mod query_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// InterchainAccount returns the interchain account address for a given owner address on a given connection - async fn interchain_account( + pub trait Msg: Send + Sync + 'static { + /// RegisterInterchainAccount defines a rpc handler for MsgRegisterInterchainAccount. + async fn register_interchain_account( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Params queries all parameters of the ICA controller submodule. - async fn params( + /// SendTx defines a rpc handler for MsgSendTx. + async fn send_tx( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// UpdateParams defines a rpc handler for MsgUpdateParams. + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service. + /// Msg defines the 27-interchain-accounts/controller Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -857,7 +812,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -909,9 +864,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -927,25 +882,26 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.interchain_accounts.controller.v1.Query/InterchainAccount" => { + "/ibc.applications.interchain_accounts.controller.v1.Msg/RegisterInterchainAccount" => { #[allow(non_camel_case_types)] - struct InterchainAccountSvc(pub Arc); + struct RegisterInterchainAccountSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for InterchainAccountSvc { - type Response = super::QueryInterchainAccountResponse; + T: Msg, + > tonic::server::UnaryService + for RegisterInterchainAccountSvc { + type Response = super::MsgRegisterInterchainAccountResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::interchain_account(&inner, request).await + ::register_interchain_account(&inner, request) + .await }; Box::pin(fut) } @@ -957,7 +913,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = InterchainAccountSvc(inner); + let method = RegisterInterchainAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -973,23 +929,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.interchain_accounts.controller.v1.Query/Params" => { + "/ibc.applications.interchain_accounts.controller.v1.Msg/SendTx" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct SendTxSvc(pub Arc); + impl tonic::server::UnaryService + for SendTxSvc { + type Response = super::MsgSendTxResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::send_tx(&inner, request).await }; Box::pin(fut) } @@ -1001,7 +957,51 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = SendTxSvc(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.interchain_accounts.controller.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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( @@ -1032,7 +1032,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1044,7 +1044,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1054,7 +1054,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.applications.interchain_accounts.controller.v1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.interchain_accounts.controller.v1.Msg"; } } diff --git a/src/prost/ibc.applications.interchain_accounts.host.v1.rs b/src/prost/ibc.applications.interchain_accounts.host.v1.rs index 0cbc62ef..12264b74 100644 --- a/src/prost/ibc.applications.interchain_accounts.host.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.host.v1.rs @@ -19,21 +19,12 @@ impl ::prost::Name for Params { ) } } -/// MsgUpdateParams defines the payload for Msg/UpdateParams +/// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the 27-interchain-accounts/host parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -41,12 +32,16 @@ impl ::prost::Name for MsgUpdateParams { ) } } -/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +/// QueryParamsResponse is the response type for the Query/Params RPC method. #[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"; +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -56,16 +51,16 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the 27-interchain-accounts/host Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -76,7 +71,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -94,7 +89,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -108,7 +103,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -141,12 +136,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// UpdateParams defines a rpc handler for MsgUpdateParams. - pub async fn update_params( + /// Params queries all parameters of the ICA host submodule. + pub async fn params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -160,14 +155,14 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams", + "/ibc.applications.interchain_accounts.host.v1.Query/Params", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.host.v1.Msg", - "UpdateParams", + "ibc.applications.interchain_accounts.host.v1.Query", + "Params", ), ); self.inner.unary(req, path, codec).await @@ -176,24 +171,24 @@ pub mod msg_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// UpdateParams defines a rpc handler for MsgUpdateParams. - async fn update_params( + pub trait Query: Send + Sync + 'static { + /// Params queries all parameters of the ICA host submodule. + async fn params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Msg defines the 27-interchain-accounts/host Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -201,7 +196,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -253,9 +248,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -271,23 +266,23 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams" => { + "/ibc.applications.interchain_accounts.host.v1.Query/Params" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::params(&inner, request).await }; Box::pin(fut) } @@ -299,7 +294,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -330,7 +325,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -342,7 +337,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -352,16 +347,25 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Msg"; + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Query"; } } -/// QueryParamsRequest is the request type for the Query/Params RPC method. +/// MsgUpdateParams defines the payload for Msg/UpdateParams #[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"; +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/host parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -369,16 +373,12 @@ impl ::prost::Name for QueryParamsRequest { ) } } -/// QueryParamsResponse is the response type for the Query/Params RPC method. +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "ibc.applications.interchain_accounts.host.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!( @@ -388,16 +388,16 @@ impl ::prost::Name for QueryParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service. + /// Msg defines the 27-interchain-accounts/host Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -408,7 +408,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -426,7 +426,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -440,7 +440,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -473,12 +473,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Params queries all parameters of the ICA host submodule. - pub async fn params( + /// UpdateParams defines a rpc handler for MsgUpdateParams. + pub async fn update_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -492,14 +492,14 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.interchain_accounts.host.v1.Query/Params", + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.interchain_accounts.host.v1.Query", - "Params", + "ibc.applications.interchain_accounts.host.v1.Msg", + "UpdateParams", ), ); self.inner.unary(req, path, codec).await @@ -508,24 +508,24 @@ pub mod query_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Params queries all parameters of the ICA host submodule. - async fn params( + pub trait Msg: Send + Sync + 'static { + /// UpdateParams defines a rpc handler for MsgUpdateParams. + async fn update_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service. + /// Msg defines the 27-interchain-accounts/host Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -533,7 +533,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -585,9 +585,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -603,23 +603,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.interchain_accounts.host.v1.Query/Params" => { + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -631,7 +631,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -662,7 +662,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -674,7 +674,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -684,7 +684,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Msg"; } } diff --git a/src/prost/ibc.applications.interchain_accounts.v1.rs b/src/prost/ibc.applications.interchain_accounts.v1.rs index 045606e3..94bedba8 100644 --- a/src/prost/ibc.applications.interchain_accounts.v1.rs +++ b/src/prost/ibc.applications.interchain_accounts.v1.rs @@ -1,21 +1,3 @@ -/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InterchainAccount { - #[prost(message, optional, tag = "1")] - pub base_account: ::core::option::Option< - super::super::super::super::cosmos::auth::v1beta1::BaseAccount, - >, - #[prost(string, tag = "2")] - pub account_owner: ::prost::alloc::string::String, -} -impl ::prost::Name for InterchainAccount { - const NAME: &'static str = "InterchainAccount"; - const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) - } -} /// InterchainAccountPacketData is comprised of a raw transaction, type of transaction and optional memo field. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -80,6 +62,24 @@ impl Type { } } } +/// An InterchainAccount is defined as a BaseAccount & the address of the account owner on the controller chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterchainAccount { + #[prost(message, optional, tag = "1")] + pub base_account: ::core::option::Option< + super::super::super::super::cosmos::auth::v1beta1::BaseAccount, + >, + #[prost(string, tag = "2")] + pub account_owner: ::prost::alloc::string::String, +} +impl ::prost::Name for InterchainAccount { + const NAME: &'static str = "InterchainAccount"; + const PACKAGE: &'static str = "ibc.applications.interchain_accounts.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.interchain_accounts.v1.{}", Self::NAME) + } +} /// Metadata defines a set of protocol specific data encoded into the ICS27 channel version bytestring /// See ICS004: #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/prost/ibc.applications.nft_transfer.v1.rs b/src/prost/ibc.applications.nft_transfer.v1.rs index bea5ee5a..b0430a8c 100644 --- a/src/prost/ibc.applications.nft_transfer.v1.rs +++ b/src/prost/ibc.applications.nft_transfer.v1.rs @@ -40,95 +40,225 @@ impl ::prost::Name for Params { ::prost::alloc::format!("ibc.applications.nft_transfer.v1.{}", Self::NAME) } } -/// MsgTransfer defines a msg to transfer non fungible tokens between -/// ICS721 enabled chains. See ICS Spec here: +/// GenesisState defines the ibc-nft-transfer genesis state +#[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, + #[prost(message, optional, tag = "3")] + pub params: ::core::option::Option, +} +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) + } +} +/// NonFungibleTokenPacketData defines a struct for the packet payload +/// See NonFungibleTokenPacketData spec: /// #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransfer { - /// the port on which the packet will be sent +pub struct NonFungibleTokenPacketData { + /// the class_id of class to be transferred #[prost(string, tag = "1")] - pub source_port: ::prost::alloc::string::String, - /// the channel by which the packet will be sent + pub class_id: ::prost::alloc::string::String, + /// the class_uri of class to be transferred #[prost(string, tag = "2")] - pub source_channel: ::prost::alloc::string::String, - /// the class_id of tokens to be transferred + pub class_uri: ::prost::alloc::string::String, + /// the class_data of class to be transferred #[prost(string, tag = "3")] - pub class_id: ::prost::alloc::string::String, + pub class_data: ::prost::alloc::string::String, /// the non fungible tokens to be transferred #[prost(string, repeated, tag = "4")] pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the non fungible tokens's uri to be transferred + #[prost(string, repeated, tag = "5")] + pub token_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the non fungible tokens's data to be transferred + #[prost(string, repeated, tag = "6")] + pub token_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// the sender address - #[prost(string, tag = "5")] + #[prost(string, tag = "7")] pub sender: ::prost::alloc::string::String, /// the recipient address on the destination chain - #[prost(string, tag = "6")] + #[prost(string, tag = "8")] pub receiver: ::prost::alloc::string::String, - /// Timeout height relative to the current block height. - /// The timeout is disabled when set to 0. - #[prost(message, optional, tag = "7")] - pub timeout_height: ::core::option::Option< - super::super::super::core::client::v1::Height, - >, - /// Timeout timestamp in absolute nanoseconds since unix epoch. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag = "8")] - pub timeout_timestamp: u64, /// optional memo #[prost(string, tag = "9")] pub memo: ::prost::alloc::string::String, } -impl ::prost::Name for MsgTransfer { - const NAME: &'static str = "MsgTransfer"; +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) } } -/// MsgTransferResponse defines the Msg/Transfer response type. +/// QueryClassTraceRequest is the request type for the Query/ClassDenom RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransferResponse { - /// sequence number of the transfer packet sent - #[prost(uint64, tag = "1")] - pub sequence: u64, +pub struct QueryClassTraceRequest { + /// hash (in hex format) or classID (full classID with ibc prefix) of the + /// denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, } -impl ::prost::Name for MsgTransferResponse { - const NAME: &'static str = "MsgTransferResponse"; +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) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. -/// +/// QueryClassTraceResponse is the response type for the Query/ClassDenom RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the nft-transfer parameters to update. - /// - /// NOTE: All parameters must be supplied. +pub struct QueryClassTraceResponse { + /// class_trace returns the requested class trace information. + #[prost(message, optional, tag = "1")] + pub class_trace: ::core::option::Option, +} +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) + } +} +/// QueryConnectionsRequest is the request type for the Query/ClassTraces RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTracesRequest { + /// pagination defines an optional pagination for the request. + #[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) + } +} +/// QueryClassTracesResponse is the response type for the Query/ClassTraces RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassTracesResponse { + /// class_traces returns all class trace information. + #[prost(message, repeated, tag = "1")] + pub class_traces: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +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) } } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. -/// +/// QueryClassHashRequest is the request type for the Query/ClassHash RPC +/// method #[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"; +pub struct QueryClassHashRequest { + /// The class trace `([port_id]/[channel_id])+/[class]` + #[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) + } +} +/// QueryClassHashResponse is the response type for the Query/ClassHash RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassHashResponse { + /// hash (in hex format) of the denomination trace information. + #[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) + } +} +/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[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) + } +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[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) + } +} +/// QueryParamsRequest is request type for the Query/Params RPC method. +#[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) + } +} +/// QueryParamsResponse is response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params holds all the parameters of this module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +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) @@ -136,16 +266,16 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the ibc/nft-transfer Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -156,7 +286,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -174,7 +304,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -188,7 +318,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -221,12 +351,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Transfer defines a rpc handler method for MsgTransfer. - pub async fn transfer( + /// ClassTrace queries a class trace information. + pub async fn class_trace( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -240,23 +370,24 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.nft_transfer.v1.Msg/Transfer", + "/ibc.applications.nft_transfer.v1.Query/ClassTrace", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.applications.nft_transfer.v1.Msg", "Transfer"), + GrpcMethod::new( + "ibc.applications.nft_transfer.v1.Query", + "ClassTrace", + ), ); self.inner.unary(req, path, codec).await } - /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. - /// The authority is defined in the keeper. - /// - pub async fn update_params( + /// ClassTraces queries all class traces. + pub async fn class_traces( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -270,50 +401,164 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.nft_transfer.v1.Msg/UpdateParams", + "/ibc.applications.nft_transfer.v1.Query/ClassTraces", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.nft_transfer.v1.Msg", - "UpdateParams", + "ibc.applications.nft_transfer.v1.Query", + "ClassTraces", ), ); self.inner.unary(req, path, codec).await } + /// ClassHash queries a class hash information. + pub async fn class_hash( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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 + } + /// EscrowAddress returns the escrow address for a particular port and channel + /// id. + pub async fn escrow_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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 + } + /// Params queries all parameters of the nft-transfer module. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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 + } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// Transfer defines a rpc handler method for MsgTransfer. - async fn transfer( + pub trait Query: Send + Sync + 'static { + /// ClassTrace queries a class trace information. + async fn class_trace( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. - /// The authority is defined in the keeper. - /// - async fn update_params( + /// ClassTraces queries all class traces. + async fn class_traces( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// ClassHash queries a class hash information. + async fn class_hash( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// EscrowAddress returns the escrow address for a particular port and channel + /// id. + async fn escrow_address( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// Params queries all parameters of the nft-transfer module. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the ibc/nft-transfer Msg service. + /// Query provides defines the gRPC querier service. #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -321,7 +566,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -373,9 +618,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -391,23 +636,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.nft_transfer.v1.Msg/Transfer" => { + "/ibc.applications.nft_transfer.v1.Query/ClassTrace" => { #[allow(non_camel_case_types)] - struct TransferSvc(pub Arc); - impl tonic::server::UnaryService - for TransferSvc { - type Response = super::MsgTransferResponse; + struct ClassTraceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassTraceSvc { + type Response = super::QueryClassTraceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::transfer(&inner, request).await + ::class_trace(&inner, request).await }; Box::pin(fut) } @@ -419,7 +666,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TransferSvc(inner); + let method = ClassTraceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -435,23 +682,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.applications.nft_transfer.v1.Msg/UpdateParams" => { + "/ibc.applications.nft_transfer.v1.Query/ClassTraces" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct ClassTracesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassTracesSvc { + type Response = super::QueryClassTracesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::class_traces(&inner, request).await }; Box::pin(fut) } @@ -463,7 +712,143 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + 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(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClassHashSvc { + type Response = super::QueryClassHashResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for EscrowAddressSvc { + type Response = super::QueryEscrowAddressResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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( @@ -494,7 +879,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -504,223 +889,111 @@ pub mod msg_server { max_decoding_message_size: self.max_decoding_message_size, max_encoding_message_size: self.max_encoding_message_size, } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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.applications.nft_transfer.v1.Msg"; - } -} -/// NonFungibleTokenPacketData defines a struct for the packet payload -/// See NonFungibleTokenPacketData spec: -/// -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonFungibleTokenPacketData { - /// the class_id of class to be transferred - #[prost(string, tag = "1")] - pub class_id: ::prost::alloc::string::String, - /// the class_uri of class to be transferred - #[prost(string, tag = "2")] - pub class_uri: ::prost::alloc::string::String, - /// the class_data of class to be transferred - #[prost(string, tag = "3")] - pub class_data: ::prost::alloc::string::String, - /// the non fungible tokens to be transferred - #[prost(string, repeated, tag = "4")] - pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// the non fungible tokens's uri to be transferred - #[prost(string, repeated, tag = "5")] - pub token_uris: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// the non fungible tokens's data to be transferred - #[prost(string, repeated, tag = "6")] - pub token_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// the sender address - #[prost(string, tag = "7")] - pub sender: ::prost::alloc::string::String, - /// the recipient address on the destination chain - #[prost(string, tag = "8")] - pub receiver: ::prost::alloc::string::String, - /// optional memo - #[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) - } -} -/// QueryClassTraceRequest is the request type for the Query/ClassDenom RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassTraceRequest { - /// hash (in hex format) or classID (full classID with ibc prefix) of the - /// denomination trace information. - #[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) - } -} -/// QueryClassTraceResponse is the response type for the Query/ClassDenom RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassTraceResponse { - /// class_trace returns the requested class trace information. - #[prost(message, optional, tag = "1")] - pub class_trace: ::core::option::Option, -} -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) - } -} -/// QueryConnectionsRequest is the request type for the Query/ClassTraces RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassTracesRequest { - /// pagination defines an optional pagination for the request. - #[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) - } -} -/// QueryClassTracesResponse is the response type for the Query/ClassTraces RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassTracesResponse { - /// class_traces returns all class trace information. - #[prost(message, repeated, tag = "1")] - pub class_traces: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[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) - } -} -/// QueryClassHashRequest is the request type for the Query/ClassHash RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassHashRequest { - /// The class trace `([port_id]/[channel_id])+/[class]` - #[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) + } } -} -/// QueryClassHashResponse is the response type for the Query/ClassHash RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClassHashResponse { - /// hash (in hex format) of the denomination trace information. - #[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) + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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.applications.nft_transfer.v1.Query"; } } -/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC -/// method. +/// MsgTransfer defines a msg to transfer non fungible tokens between +/// ICS721 enabled chains. See ICS Spec here: +/// #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressRequest { - /// unique port identifier +pub struct MsgTransfer { + /// the port on which the packet will be sent #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// unique channel identifier + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, + pub source_channel: ::prost::alloc::string::String, + /// the class_id of tokens to be transferred + #[prost(string, tag = "3")] + pub class_id: ::prost::alloc::string::String, + /// the non fungible tokens to be transferred + #[prost(string, repeated, tag = "4")] + pub token_ids: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the sender address + #[prost(string, tag = "5")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "6")] + pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(message, optional, tag = "7")] + pub timeout_height: ::core::option::Option< + super::super::super::core::client::v1::Height, + >, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "8")] + pub timeout_timestamp: u64, + /// optional memo + #[prost(string, tag = "9")] + pub memo: ::prost::alloc::string::String, } -impl ::prost::Name for QueryEscrowAddressRequest { - const NAME: &'static str = "QueryEscrowAddressRequest"; +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) } } -/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC -/// method. +/// MsgTransferResponse defines the Msg/Transfer response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressResponse { - /// the escrow account address - #[prost(string, tag = "1")] - pub escrow_address: ::prost::alloc::string::String, +pub struct MsgTransferResponse { + /// sequence number of the transfer packet sent + #[prost(uint64, tag = "1")] + pub sequence: u64, } -impl ::prost::Name for QueryEscrowAddressResponse { - const NAME: &'static str = "QueryEscrowAddressResponse"; +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) } } -/// QueryParamsRequest is request type for the Query/Params RPC method. +/// MsgUpdateParams is the Msg/UpdateParams request type. +/// #[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"; +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the nft-transfer parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +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) } } -/// QueryParamsResponse is response type for the Query/Params RPC method. +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +/// #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params holds all the parameters of this module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; +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) @@ -728,16 +1001,16 @@ impl ::prost::Name for QueryParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service. + /// Msg defines the ibc/nft-transfer Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -748,7 +1021,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -766,7 +1039,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -780,7 +1053,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -813,74 +1086,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ClassTrace queries a class trace information. - pub async fn class_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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 - } - /// ClassTraces queries all class traces. - pub async fn class_traces( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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 - } - /// ClassHash queries a class hash information. - pub async fn class_hash( + /// Transfer defines a rpc handler method for MsgTransfer. + pub async fn transfer( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -894,25 +1105,23 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.nft_transfer.v1.Query/ClassHash", + "/ibc.applications.nft_transfer.v1.Msg/Transfer", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new( - "ibc.applications.nft_transfer.v1.Query", - "ClassHash", - ), + GrpcMethod::new("ibc.applications.nft_transfer.v1.Msg", "Transfer"), ); self.inner.unary(req, path, codec).await } - /// EscrowAddress returns the escrow address for a particular port and channel - /// id. - pub async fn escrow_address( + /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. + /// The authority is defined in the keeper. + /// + pub async fn update_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -926,101 +1135,50 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.nft_transfer.v1.Query/EscrowAddress", + "/ibc.applications.nft_transfer.v1.Msg/UpdateParams", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.applications.nft_transfer.v1.Query", - "EscrowAddress", + "ibc.applications.nft_transfer.v1.Msg", + "UpdateParams", ), ); self.inner.unary(req, path, codec).await } - /// Params queries all parameters of the nft-transfer module. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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 - } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// ClassTrace queries a class trace information. - async fn class_trace( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ClassTraces queries all class traces. - async fn class_traces( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ClassHash queries a class hash information. - async fn class_hash( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// EscrowAddress returns the escrow address for a particular port and channel - /// id. - async fn escrow_address( + pub trait Msg: Send + Sync + 'static { + /// Transfer defines a rpc handler method for MsgTransfer. + async fn transfer( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Params queries all parameters of the nft-transfer module. - async fn params( + /// UpdateParams defines a governance operation for updating the nft-transfer module parameters. + /// The authority is defined in the keeper. + /// + async fn update_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service. + /// Msg defines the ibc/nft-transfer Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1028,7 +1186,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1080,9 +1238,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1098,163 +1256,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> 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(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClassTraceSvc { - type Response = super::QueryClassTraceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClassTracesSvc { - type Response = super::QueryClassTracesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClassHashSvc { - type Response = super::QueryClassHashResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::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" => { + "/ibc.applications.nft_transfer.v1.Msg/Transfer" => { #[allow(non_camel_case_types)] - struct EscrowAddressSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for EscrowAddressSvc { - type Response = super::QueryEscrowAddressResponse; + struct TransferSvc(pub Arc); + impl tonic::server::UnaryService + for TransferSvc { + type Response = super::MsgTransferResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::escrow_address(&inner, request).await + ::transfer(&inner, request).await }; Box::pin(fut) } @@ -1266,7 +1284,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = EscrowAddressSvc(inner); + let method = TransferSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1282,23 +1300,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.nft_transfer.v1.Query/Params" => { + "/ibc.applications.nft_transfer.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -1310,7 +1328,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1341,7 +1359,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1353,7 +1371,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1363,25 +1381,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.applications.nft_transfer.v1.Query"; - } -} -/// GenesisState defines the ibc-nft-transfer genesis state -#[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, - #[prost(message, optional, tag = "3")] - pub params: ::core::option::Option, -} -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) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.nft_transfer.v1.Msg"; } } diff --git a/src/prost/ibc.applications.transfer.v1.rs b/src/prost/ibc.applications.transfer.v1.rs index 70c3a6c7..7edcd013 100644 --- a/src/prost/ibc.applications.transfer.v1.rs +++ b/src/prost/ibc.applications.transfer.v1.rs @@ -1,3 +1,49 @@ +/// Allocation defines the spend limit for a particular port and channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Allocation { + /// the port on which the packet will be sent + #[prost(string, tag = "1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub source_channel: ::prost::alloc::string::String, + /// spend limitation on the channel + #[prost(message, repeated, tag = "3")] + pub spend_limit: ::prost::alloc::vec::Vec< + super::super::super::super::cosmos::base::v1beta1::Coin, + >, + /// allow list of receivers, an empty allow list permits any receiver address + #[prost(string, repeated, tag = "4")] + pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow list of packet data keys, an empty list prohibits all packet data keys; + /// a list only with "*" permits any packet data key + #[prost(string, repeated, tag = "5")] + pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for Allocation { + const NAME: &'static str = "Allocation"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// TransferAuthorization allows the grantee to spend up to spend_limit coins from +/// the granter's account for ibc transfer on a specific channel +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TransferAuthorization { + /// port and channel amounts + #[prost(message, repeated, tag = "1")] + pub allocations: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for TransferAuthorization { + const NAME: &'static str = "TransferAuthorization"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} /// DenomTrace contains the base denomination for ICS20 fungible tokens and the /// source tracing information path. #[allow(clippy::derive_partial_eq_without_eq)] @@ -41,124 +87,249 @@ impl ::prost::Name for Params { ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } } -/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between -/// ICS20 enabled chains. See ICS Spec here: -/// +/// GenesisState defines the ibc-transfer genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransfer { - /// the port on which the packet will be sent +pub struct GenesisState { #[prost(string, tag = "1")] - pub source_port: ::prost::alloc::string::String, - /// the channel by which the packet will be sent - #[prost(string, tag = "2")] - pub source_channel: ::prost::alloc::string::String, - /// the tokens to be transferred + pub port_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub denom_traces: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] - pub token: ::core::option::Option< + pub params: ::core::option::Option, + /// total_escrowed contains the total amount of tokens escrowed + /// by the transfer module + #[prost(message, repeated, tag = "4")] + pub total_escrowed: ::prost::alloc::vec::Vec< super::super::super::super::cosmos::base::v1beta1::Coin, >, - /// the sender address - #[prost(string, tag = "4")] - pub sender: ::prost::alloc::string::String, - /// the recipient address on the destination chain - #[prost(string, tag = "5")] - pub receiver: ::prost::alloc::string::String, - /// Timeout height relative to the current block height. - /// The timeout is disabled when set to 0. - #[prost(message, optional, tag = "6")] - pub timeout_height: ::core::option::Option< - super::super::super::core::client::v1::Height, - >, - /// Timeout timestamp in absolute nanoseconds since unix epoch. - /// The timeout is disabled when set to 0. - #[prost(uint64, tag = "7")] - pub timeout_timestamp: u64, - /// optional memo - #[prost(string, tag = "8")] - pub memo: ::prost::alloc::string::String, } -impl ::prost::Name for MsgTransfer { - const NAME: &'static str = "MsgTransfer"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } } -/// MsgTransferResponse defines the Msg/Transfer response type. +/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTransferResponse { - /// sequence number of the transfer packet sent - #[prost(uint64, tag = "1")] - pub sequence: u64, +pub struct QueryDenomTraceRequest { + /// hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, } -impl ::prost::Name for MsgTransferResponse { - const NAME: &'static str = "MsgTransferResponse"; +impl ::prost::Name for QueryDenomTraceRequest { + const NAME: &'static str = "QueryDenomTraceRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } } -/// MsgUpdateParams is the Msg/UpdateParams request type. +/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the transfer parameters to update. - /// - /// NOTE: All parameters must be supplied. +pub struct QueryDenomTraceResponse { + /// denom_trace returns the requested denomination trace information. + #[prost(message, optional, tag = "1")] + pub denom_trace: ::core::option::Option, +} +impl ::prost::Name for QueryDenomTraceResponse { + const NAME: &'static str = "QueryDenomTraceResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomTracesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +impl ::prost::Name for QueryDenomTracesRequest { + const NAME: &'static str = "QueryDenomTracesRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomTracesResponse { + /// denom_traces returns all denominations trace information. + #[prost(message, repeated, tag = "1")] + pub denom_traces: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +impl ::prost::Name for QueryDenomTracesResponse { + const NAME: &'static str = "QueryDenomTracesResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[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.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the response structure for executing a -/// MsgUpdateParams message. +/// QueryDenomHashRequest is the request type for the Query/DenomHash RPC +/// method #[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"; +pub struct QueryDenomHashRequest { + /// The denomination trace `([port_id]/[channel_id])+/[denom]` + #[prost(string, tag = "1")] + pub trace: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryDenomHashRequest { + const NAME: &'static str = "QueryDenomHashRequest"; const PACKAGE: &'static str = "ibc.applications.transfer.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the ibc/transfer Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, +/// QueryDenomHashResponse is the response type for the Query/DenomHash RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomHashResponse { + /// hash (in hex format) of the denomination trace information. + #[prost(string, tag = "1")] + pub hash: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryDenomHashResponse { + const NAME: &'static str = "QueryDenomHashResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +} +/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressRequest { + /// unique port identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// unique channel identifier + #[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.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) } - impl MsgClient - where - T: tonic::client::GrpcService, - T::Error: Into, - T::ResponseBody: Body + Send + 'static, +} +/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEscrowAddressResponse { + /// the escrow account address + #[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.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryTotalEscrowForDenomRequest { + const NAME: &'static str = "QueryTotalEscrowForDenomRequest"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomResponse { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option< + super::super::super::super::cosmos::base::v1beta1::Coin, + >, +} +impl ::prost::Name for QueryTotalEscrowForDenomResponse { + const NAME: &'static str = "QueryTotalEscrowForDenomResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Query provides defines the gRPC querier service. + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 { @@ -172,7 +343,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -186,7 +357,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -219,12 +390,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Transfer defines a rpc handler method for MsgTransfer. - pub async fn transfer( + /// DenomTraces queries all denomination traces. + pub async fn denom_traces( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -238,19 +409,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Msg/Transfer", + "/ibc.applications.transfer.v1.Query/DenomTraces", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.applications.transfer.v1.Msg", "Transfer")); + .insert( + GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomTraces"), + ); self.inner.unary(req, path, codec).await } - /// UpdateParams defines a rpc handler for MsgUpdateParams. - pub async fn update_params( + /// DenomTrace queries a denomination trace information. + pub async fn denom_trace( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -264,12 +437,128 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.applications.transfer.v1.Msg/UpdateParams", + "/ibc.applications.transfer.v1.Query/DenomTrace", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.applications.transfer.v1.Msg", "UpdateParams"), + GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomTrace"), + ); + self.inner.unary(req, path, codec).await + } + /// Params queries all parameters of the ibc-transfer module. + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Query/Params", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.applications.transfer.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + /// DenomHash queries a denomination hash information. + pub async fn denom_hash( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Query/DenomHash", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomHash"), + ); + self.inner.unary(req, path, codec).await + } + /// EscrowAddress returns the escrow address for a particular port and channel id. + pub async fn escrow_address( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Query/EscrowAddress", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "EscrowAddress", + ), + ); + self.inner.unary(req, path, codec).await + } + /// TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + pub async fn total_escrow_for_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Query/TotalEscrowForDenom", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "TotalEscrowForDenom", + ), ); self.inner.unary(req, path, codec).await } @@ -277,43 +566,75 @@ pub mod msg_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// Transfer defines a rpc handler method for MsgTransfer. - async fn transfer( + pub trait Query: Send + Sync + 'static { + /// DenomTraces queries all denomination traces. + async fn denom_traces( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateParams defines a rpc handler for MsgUpdateParams. - async fn update_params( + /// DenomTrace queries a denomination trace information. + async fn denom_trace( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - } - /// Msg defines the ibc/transfer Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } + /// Params queries all parameters of the ibc-transfer module. + async fn params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// DenomHash queries a denomination hash information. + async fn denom_hash( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// EscrowAddress returns the escrow address for a particular port and channel id. + async fn escrow_address( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. + async fn total_escrow_for_denom( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Query provides defines the gRPC querier service. + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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 { @@ -362,9 +683,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -380,23 +701,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.applications.transfer.v1.Msg/Transfer" => { + "/ibc.applications.transfer.v1.Query/DenomTraces" => { #[allow(non_camel_case_types)] - struct TransferSvc(pub Arc); - impl tonic::server::UnaryService - for TransferSvc { - type Response = super::MsgTransferResponse; + struct DenomTracesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomTracesSvc { + type Response = super::QueryDenomTracesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::transfer(&inner, request).await + ::denom_traces(&inner, request).await }; Box::pin(fut) } @@ -408,7 +731,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TransferSvc(inner); + let method = DenomTracesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -424,23 +747,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.applications.transfer.v1.Msg/UpdateParams" => { + "/ibc.applications.transfer.v1.Query/DenomTrace" => { #[allow(non_camel_case_types)] - struct UpdateParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct DenomTraceSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for DenomTraceSvc { + type Response = super::QueryDenomTraceResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_params(&inner, request).await + ::denom_trace(&inner, request).await }; Box::pin(fut) } @@ -452,7 +777,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateParamsSvc(inner); + let method = DenomTraceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -468,656 +793,69 @@ pub mod msg_server { }; 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(), - ) - }) + "/ibc.applications.transfer.v1.Query/Params" => { + #[allow(non_camel_case_types)] + struct ParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ParamsSvc { + type Response = super::QueryParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::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) } - } - } - } - 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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.applications.transfer.v1.Msg"; - } -} -/// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTraceRequest { - /// hash (in hex format) or denom (full denom with ibc prefix) of the denomination trace information. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDenomTraceRequest { - const NAME: &'static str = "QueryDenomTraceRequest"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryDenomTraceResponse is the response type for the Query/DenomTrace RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTraceResponse { - /// denom_trace returns the requested denomination trace information. - #[prost(message, optional, tag = "1")] - pub denom_trace: ::core::option::Option, -} -impl ::prost::Name for QueryDenomTraceResponse { - const NAME: &'static str = "QueryDenomTraceResponse"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryConnectionsRequest is the request type for the Query/DenomTraces RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTracesRequest { - /// pagination defines an optional pagination for the request. - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryDenomTracesRequest { - const NAME: &'static str = "QueryDenomTracesRequest"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryConnectionsResponse is the response type for the Query/DenomTraces RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomTracesResponse { - /// denom_traces returns all denominations trace information. - #[prost(message, repeated, tag = "1")] - pub denom_traces: ::prost::alloc::vec::Vec, - /// pagination defines the pagination in the response. - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, - >, -} -impl ::prost::Name for QueryDenomTracesResponse { - const NAME: &'static str = "QueryDenomTracesResponse"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryParamsRequest is the request type for the Query/Params RPC method. -#[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.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryParamsResponse is the response type for the Query/Params RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, -} -impl ::prost::Name for QueryParamsResponse { - const NAME: &'static str = "QueryParamsResponse"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryDenomHashRequest is the request type for the Query/DenomHash RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomHashRequest { - /// The denomination trace `([port_id]/[channel_id])+/[denom]` - #[prost(string, tag = "1")] - pub trace: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDenomHashRequest { - const NAME: &'static str = "QueryDenomHashRequest"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryDenomHashResponse is the response type for the Query/DenomHash RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryDenomHashResponse { - /// hash (in hex format) of the denomination trace information. - #[prost(string, tag = "1")] - pub hash: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryDenomHashResponse { - const NAME: &'static str = "QueryDenomHashResponse"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryEscrowAddressRequest is the request type for the EscrowAddress RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressRequest { - /// unique port identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// unique channel identifier - #[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.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryEscrowAddressResponse is the response type of the EscrowAddress RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryEscrowAddressResponse { - /// the escrow account address - #[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.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalEscrowForDenomRequest { - #[prost(string, tag = "1")] - pub denom: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryTotalEscrowForDenomRequest { - const NAME: &'static str = "QueryTotalEscrowForDenomRequest"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryTotalEscrowForDenomResponse { - #[prost(message, optional, tag = "1")] - pub amount: ::core::option::Option< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, -} -impl ::prost::Name for QueryTotalEscrowForDenomResponse { - const NAME: &'static str = "QueryTotalEscrowForDenomResponse"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// Generated client implementations. -#[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; - /// Query provides defines the gRPC querier service. - #[derive(Debug, Clone)] - pub struct QueryClient { - inner: tonic::client::Grpc, - } - impl QueryClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_encoding_message_size(limit); - self - } - /// DenomTraces queries all denomination traces. - pub async fn denom_traces( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/DenomTraces", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomTraces"), - ); - self.inner.unary(req, path, codec).await - } - /// DenomTrace queries a denomination trace information. - pub async fn denom_trace( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/DenomTrace", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomTrace"), - ); - self.inner.unary(req, path, codec).await - } - /// Params queries all parameters of the ibc-transfer module. - pub async fn params( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/Params", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.applications.transfer.v1.Query", "Params")); - self.inner.unary(req, path, codec).await - } - /// DenomHash queries a denomination hash information. - pub async fn denom_hash( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/DenomHash", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("ibc.applications.transfer.v1.Query", "DenomHash"), - ); - self.inner.unary(req, path, codec).await - } - /// EscrowAddress returns the escrow address for a particular port and channel id. - pub async fn escrow_address( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/EscrowAddress", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "EscrowAddress", - ), - ); - self.inner.unary(req, path, codec).await - } - /// TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. - pub async fn total_escrow_for_denom( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.transfer.v1.Query/TotalEscrowForDenom", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.applications.transfer.v1.Query", - "TotalEscrowForDenom", - ), - ); - self.inner.unary(req, path, codec).await - } - } -} -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - /// DenomTraces queries all denomination traces. - async fn denom_traces( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DenomTrace queries a denomination trace information. - async fn denom_trace( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Params queries all parameters of the ibc-transfer module. - async fn params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// DenomHash queries a denomination hash information. - async fn denom_hash( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// EscrowAddress returns the escrow address for a particular port and channel id. - async fn escrow_address( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// TotalEscrowForDenom returns the total amount of tokens in escrow based on the denom. - async fn total_escrow_for_denom( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - } - /// Query provides defines the gRPC querier service. - #[derive(Debug)] - pub struct QueryServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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.applications.transfer.v1.Query/DenomTraces" => { + "/ibc.applications.transfer.v1.Query/DenomHash" => { #[allow(non_camel_case_types)] - struct DenomTracesSvc(pub Arc); + struct DenomHashSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService - for DenomTracesSvc { - type Response = super::QueryDenomTracesResponse; + > tonic::server::UnaryService + for DenomHashSvc { + type Response = super::QueryDenomHashResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::denom_traces(&inner, request).await + ::denom_hash(&inner, request).await }; Box::pin(fut) } @@ -1129,7 +867,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DenomTracesSvc(inner); + let method = DenomHashSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1145,69 +883,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.transfer.v1.Query/DenomTrace" => { + "/ibc.applications.transfer.v1.Query/EscrowAddress" => { #[allow(non_camel_case_types)] - struct DenomTraceSvc(pub Arc); + struct EscrowAddressSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService - for DenomTraceSvc { - type Response = super::QueryDenomTraceResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::denom_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 = DenomTraceSvc(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.transfer.v1.Query/Params" => { - #[allow(non_camel_case_types)] - struct ParamsSvc(pub Arc); - impl tonic::server::UnaryService - for ParamsSvc { - type Response = super::QueryParamsResponse; + > tonic::server::UnaryService + for EscrowAddressSvc { + type Response = super::QueryEscrowAddressResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::params(&inner, request).await + ::escrow_address(&inner, request).await }; Box::pin(fut) } @@ -1219,7 +913,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ParamsSvc(inner); + let method = EscrowAddressSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1235,25 +929,27 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.transfer.v1.Query/DenomHash" => { + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom" => { #[allow(non_camel_case_types)] - struct DenomHashSvc(pub Arc); + struct TotalEscrowForDenomSvc(pub Arc); impl< T: Query, - > tonic::server::UnaryService - for DenomHashSvc { - type Response = super::QueryDenomHashResponse; + > tonic::server::UnaryService + for TotalEscrowForDenomSvc { + type Response = super::QueryTotalEscrowForDenomResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryTotalEscrowForDenomRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::denom_hash(&inner, request).await + ::total_escrow_for_denom(&inner, request).await }; Box::pin(fut) } @@ -1265,7 +961,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = DenomHashSvc(inner); + let method = TotalEscrowForDenomSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1281,25 +977,403 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.transfer.v1.Query/EscrowAddress" => { + _ => { + 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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.applications.transfer.v1.Query"; + } +} +/// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between +/// ICS20 enabled chains. See ICS Spec here: +/// +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransfer { + /// the port on which the packet will be sent + #[prost(string, tag = "1")] + pub source_port: ::prost::alloc::string::String, + /// the channel by which the packet will be sent + #[prost(string, tag = "2")] + pub source_channel: ::prost::alloc::string::String, + /// the tokens to be transferred + #[prost(message, optional, tag = "3")] + pub token: ::core::option::Option< + super::super::super::super::cosmos::base::v1beta1::Coin, + >, + /// the sender address + #[prost(string, tag = "4")] + pub sender: ::prost::alloc::string::String, + /// the recipient address on the destination chain + #[prost(string, tag = "5")] + pub receiver: ::prost::alloc::string::String, + /// Timeout height relative to the current block height. + /// The timeout is disabled when set to 0. + #[prost(message, optional, tag = "6")] + pub timeout_height: ::core::option::Option< + super::super::super::core::client::v1::Height, + >, + /// Timeout timestamp in absolute nanoseconds since unix epoch. + /// The timeout is disabled when set to 0. + #[prost(uint64, tag = "7")] + pub timeout_timestamp: u64, + /// optional memo + #[prost(string, tag = "8")] + pub memo: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgTransfer { + const NAME: &'static str = "MsgTransfer"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// MsgTransferResponse defines the Msg/Transfer response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTransferResponse { + /// sequence number of the transfer packet sent + #[prost(uint64, tag = "1")] + pub sequence: u64, +} +impl ::prost::Name for MsgTransferResponse { + const NAME: &'static str = "MsgTransferResponse"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the transfer parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "ibc.applications.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[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.transfer.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the ibc/transfer Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + /// Transfer defines a rpc handler method for MsgTransfer. + pub async fn transfer( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Msg/Transfer", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.applications.transfer.v1.Msg", "Transfer")); + self.inner.unary(req, path, codec).await + } + /// UpdateParams defines a rpc handler for MsgUpdateParams. + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.transfer.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.applications.transfer.v1.Msg", "UpdateParams"), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + /// Transfer defines a rpc handler method for MsgTransfer. + async fn transfer( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpdateParams defines a rpc handler for MsgUpdateParams. + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the ibc/transfer Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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.applications.transfer.v1.Msg/Transfer" => { #[allow(non_camel_case_types)] - struct EscrowAddressSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for EscrowAddressSvc { - type Response = super::QueryEscrowAddressResponse; + struct TransferSvc(pub Arc); + impl tonic::server::UnaryService + for TransferSvc { + type Response = super::MsgTransferResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::escrow_address(&inner, request).await + ::transfer(&inner, request).await }; Box::pin(fut) } @@ -1311,7 +1385,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = EscrowAddressSvc(inner); + let method = TransferSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1327,27 +1401,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom" => { + "/ibc.applications.transfer.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] - struct TotalEscrowForDenomSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for TotalEscrowForDenomSvc { - type Response = super::QueryTotalEscrowForDenomResponse; + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryTotalEscrowForDenomRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::total_escrow_for_denom(&inner, request).await + ::update_params(&inner, request).await }; Box::pin(fut) } @@ -1359,7 +1429,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TotalEscrowForDenomSvc(inner); + let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1390,7 +1460,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1402,7 +1472,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1412,77 +1482,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.applications.transfer.v1.Query"; - } -} -/// Allocation defines the spend limit for a particular port and channel -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Allocation { - /// the port on which the packet will be sent - #[prost(string, tag = "1")] - pub source_port: ::prost::alloc::string::String, - /// the channel by which the packet will be sent - #[prost(string, tag = "2")] - pub source_channel: ::prost::alloc::string::String, - /// spend limitation on the channel - #[prost(message, repeated, tag = "3")] - pub spend_limit: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, - /// allow list of receivers, an empty allow list permits any receiver address - #[prost(string, repeated, tag = "4")] - pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// allow list of packet data keys, an empty list prohibits all packet data keys; - /// a list only with "*" permits any packet data key - #[prost(string, repeated, tag = "5")] - pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} -impl ::prost::Name for Allocation { - const NAME: &'static str = "Allocation"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// TransferAuthorization allows the grantee to spend up to spend_limit coins from -/// the granter's account for ibc transfer on a specific channel -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TransferAuthorization { - /// port and channel amounts - #[prost(message, repeated, tag = "1")] - pub allocations: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for TransferAuthorization { - const NAME: &'static str = "TransferAuthorization"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) - } -} -/// GenesisState defines the ibc-transfer genesis state -#[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 denom_traces: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub params: ::core::option::Option, - /// total_escrowed contains the total amount of tokens escrowed - /// by the transfer module - #[prost(message, repeated, tag = "4")] - pub total_escrowed: ::prost::alloc::vec::Vec< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "ibc.applications.transfer.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.applications.transfer.v1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.transfer.v1.Msg"; } } diff --git a/src/prost/ibc.core.channel.v1.rs b/src/prost/ibc.core.channel.v1.rs index 53c79e71..fc2d5a56 100644 --- a/src/prost/ibc.core.channel.v1.rs +++ b/src/prost/ibc.core.channel.v1.rs @@ -450,772 +450,733 @@ impl ::prost::Name for ErrorReceipt { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It -/// is called by a relayer on Chain A. +/// QueryChannelRequest is the request type for the Query/Channel RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenInit { +pub struct QueryChannelRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] - pub channel: ::core::option::Option, - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelOpenInit { - const NAME: &'static str = "MsgChannelOpenInit"; +impl ::prost::Name for QueryChannelRequest { + const NAME: &'static str = "QueryChannelRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. +/// QueryChannelResponse is the response type for the Query/Channel RPC method. +/// Besides the Channel 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 MsgChannelOpenInitResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub version: ::prost::alloc::string::String, +pub struct QueryChannelResponse { + /// channel associated with the request identifiers + #[prost(message, optional, tag = "1")] + pub channel: ::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, } -impl ::prost::Name for MsgChannelOpenInitResponse { - const NAME: &'static str = "MsgChannelOpenInitResponse"; +impl ::prost::Name for QueryChannelResponse { + const NAME: &'static str = "QueryChannelResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel -/// on Chain B. The version field within the Channel field has been deprecated. Its -/// value will be ignored by core IBC. +/// QueryChannelsRequest is the request type for the Query/Channels RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTry { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. - #[deprecated] - #[prost(string, tag = "2")] - pub previous_channel_id: ::prost::alloc::string::String, - /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. - #[prost(message, optional, tag = "3")] - pub channel: ::core::option::Option, - #[prost(string, tag = "4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - pub proof_init: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, +pub struct QueryChannelsRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgChannelOpenTry { - const NAME: &'static str = "MsgChannelOpenTry"; +impl ::prost::Name for QueryChannelsRequest { + const NAME: &'static str = "QueryChannelsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. +/// QueryChannelsResponse is the response type for the Query/Channels RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenTryResponse { - #[prost(string, tag = "1")] - pub version: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, +pub struct QueryChannelsResponse { + /// list of stored channels of the chain. + #[prost(message, repeated, tag = "1")] + pub channels: ::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, } -impl ::prost::Name for MsgChannelOpenTryResponse { - const NAME: &'static str = "MsgChannelOpenTryResponse"; +impl ::prost::Name for QueryChannelsResponse { + const NAME: &'static str = "QueryChannelsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge -/// the change of channel state to TRYOPEN on Chain B. -/// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel -/// in the same block as executing this message otherwise the counterparty will -/// be incapable of opening. +/// QueryConnectionChannelsRequest is the request type for the +/// Query/QueryConnectionChannels RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAck { +pub struct QueryConnectionChannelsRequest { + /// connection unique identifier #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub counterparty_channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "4")] - pub counterparty_version: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "5")] - pub proof_try: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, + pub connection: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgChannelOpenAck { - const NAME: &'static str = "MsgChannelOpenAck"; +impl ::prost::Name for QueryConnectionChannelsRequest { + const NAME: &'static str = "QueryConnectionChannelsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. +/// QueryConnectionChannelsResponse is the Response type for the +/// Query/QueryConnectionChannels RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenAckResponse {} -impl ::prost::Name for MsgChannelOpenAckResponse { - const NAME: &'static str = "MsgChannelOpenAckResponse"; +pub struct QueryConnectionChannelsResponse { + /// list of channels associated with a connection. + #[prost(message, repeated, tag = "1")] + pub channels: ::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, +} +impl ::prost::Name for QueryConnectionChannelsResponse { + const NAME: &'static str = "QueryConnectionChannelsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of channel state to OPEN on Chain A. +/// QueryChannelClientStateRequest is the request type for the Query/ClientState +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirm { +pub struct QueryChannelClientStateRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] - pub proof_ack: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelOpenConfirm { - const NAME: &'static str = "MsgChannelOpenConfirm"; +impl ::prost::Name for QueryChannelClientStateRequest { + const NAME: &'static str = "QueryChannelClientStateRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response -/// type. +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelOpenConfirmResponse {} -impl ::prost::Name for MsgChannelOpenConfirmResponse { - const NAME: &'static str = "MsgChannelOpenConfirmResponse"; +pub struct QueryChannelClientStateResponse { + /// client state associated with the channel + #[prost(message, optional, tag = "1")] + pub identified_client_state: ::core::option::Option< + super::super::client::v1::IdentifiedClientState, + >, + /// 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, +} +impl ::prost::Name for QueryChannelClientStateResponse { + const NAME: &'static str = "QueryChannelClientStateResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A -/// to close a channel with Chain B. +/// QueryChannelConsensusStateRequest is the request type for the +/// Query/ConsensusState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInit { +pub struct QueryChannelConsensusStateRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, + /// revision number of the consensus state + #[prost(uint64, tag = "3")] + pub revision_number: u64, + /// revision height of the consensus state + #[prost(uint64, tag = "4")] + pub revision_height: u64, } -impl ::prost::Name for MsgChannelCloseInit { - const NAME: &'static str = "MsgChannelCloseInit"; +impl ::prost::Name for QueryChannelConsensusStateRequest { + const NAME: &'static str = "QueryChannelConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. +/// QueryChannelClientStateResponse is the Response type for the +/// Query/QueryChannelClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseInitResponse {} -impl ::prost::Name for MsgChannelCloseInitResponse { - const NAME: &'static str = "MsgChannelCloseInitResponse"; +pub struct QueryChannelConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::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, +} +impl ::prost::Name for QueryChannelConsensusStateResponse { + const NAME: &'static str = "QueryChannelConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B -/// to acknowledge the change of channel state to CLOSED on Chain A. +/// QueryPacketCommitmentRequest is the request type for the +/// Query/PacketCommitment RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirm { +pub struct QueryPacketCommitmentRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "3")] - pub proof_init: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, - #[prost(uint64, tag = "6")] - pub counterparty_upgrade_sequence: u64, + /// packet sequence + #[prost(uint64, tag = "3")] + pub sequence: u64, } -impl ::prost::Name for MsgChannelCloseConfirm { - const NAME: &'static str = "MsgChannelCloseConfirm"; +impl ::prost::Name for QueryPacketCommitmentRequest { + const NAME: &'static str = "QueryPacketCommitmentRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response -/// type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelCloseConfirmResponse {} -impl ::prost::Name for MsgChannelCloseConfirmResponse { - const NAME: &'static str = "MsgChannelCloseConfirmResponse"; - const PACKAGE: &'static str = "ibc.core.channel.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) - } -} -/// MsgRecvPacket receives incoming IBC packet +/// QueryPacketCommitmentResponse defines the client query response for a packet +/// which also 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 MsgRecvPacket { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, +pub struct QueryPacketCommitmentResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] + pub commitment: ::prost::alloc::vec::Vec, + /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] - pub proof_commitment: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgRecvPacket { - const NAME: &'static str = "MsgRecvPacket"; +impl ::prost::Name for QueryPacketCommitmentResponse { + const NAME: &'static str = "QueryPacketCommitmentResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. +/// QueryPacketCommitmentsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecvPacketResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct QueryPacketCommitmentsRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// pagination request + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, } -impl ::prost::Name for MsgRecvPacketResponse { - const NAME: &'static str = "MsgRecvPacketResponse"; +impl ::prost::Name for QueryPacketCommitmentsRequest { + const NAME: &'static str = "QueryPacketCommitmentsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgTimeout receives timed-out packet +/// QueryPacketCommitmentsResponse is the request type for the +/// Query/QueryPacketCommitments RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeout { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, +pub struct QueryPacketCommitmentsResponse { + #[prost(message, repeated, tag = "1")] + pub commitments: ::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 proof_height: ::core::option::Option, - #[prost(uint64, tag = "4")] - pub next_sequence_recv: u64, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, + pub height: ::core::option::Option, } -impl ::prost::Name for MsgTimeout { - const NAME: &'static str = "MsgTimeout"; +impl ::prost::Name for QueryPacketCommitmentsResponse { + const NAME: &'static str = "QueryPacketCommitmentsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgTimeoutResponse defines the Msg/Timeout response type. +/// QueryPacketReceiptRequest is the request type for the +/// Query/PacketReceipt RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct QueryPacketReceiptRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + pub sequence: u64, } -impl ::prost::Name for MsgTimeoutResponse { - const NAME: &'static str = "MsgTimeoutResponse"; +impl ::prost::Name for QueryPacketReceiptRequest { + const NAME: &'static str = "QueryPacketReceiptRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. +/// QueryPacketReceiptResponse defines the client query response for a packet +/// receipt which also 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 MsgTimeoutOnClose { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] - pub proof_unreceived: ::prost::alloc::vec::Vec, +pub struct QueryPacketReceiptResponse { + /// success flag for if receipt exists + #[prost(bool, tag = "2")] + pub received: bool, + /// merkle proof of existence #[prost(bytes = "vec", tag = "3")] - pub proof_close: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, - #[prost(uint64, tag = "5")] - pub next_sequence_recv: u64, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, - #[prost(uint64, tag = "7")] - pub counterparty_upgrade_sequence: u64, } -impl ::prost::Name for MsgTimeoutOnClose { - const NAME: &'static str = "MsgTimeoutOnClose"; +impl ::prost::Name for QueryPacketReceiptResponse { + const NAME: &'static str = "QueryPacketReceiptResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. +/// QueryPacketAcknowledgementRequest is the request type for the +/// Query/PacketAcknowledgement RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgTimeoutOnCloseResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct QueryPacketAcknowledgementRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// packet sequence + #[prost(uint64, tag = "3")] + pub sequence: u64, } -impl ::prost::Name for MsgTimeoutOnCloseResponse { - const NAME: &'static str = "MsgTimeoutOnCloseResponse"; +impl ::prost::Name for QueryPacketAcknowledgementRequest { + const NAME: &'static str = "QueryPacketAcknowledgementRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgAcknowledgement receives incoming IBC acknowledgement +/// QueryPacketAcknowledgementResponse defines the client query response for a +/// packet which also 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 MsgAcknowledgement { - #[prost(message, optional, tag = "1")] - pub packet: ::core::option::Option, - #[prost(bytes = "vec", tag = "2")] +pub struct QueryPacketAcknowledgementResponse { + /// packet associated with the request fields + #[prost(bytes = "vec", tag = "1")] pub acknowledgement: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub proof_acked: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] + /// 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, - #[prost(string, tag = "5")] - pub signer: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgAcknowledgement { - const NAME: &'static str = "MsgAcknowledgement"; - const PACKAGE: &'static str = "ibc.core.channel.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) - } -} -/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAcknowledgementResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, } -impl ::prost::Name for MsgAcknowledgementResponse { - const NAME: &'static str = "MsgAcknowledgementResponse"; +impl ::prost::Name for QueryPacketAcknowledgementResponse { + const NAME: &'static str = "QueryPacketAcknowledgementResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc -/// WARNING: Initializing a channel upgrade in the same block as opening the channel -/// may result in the counterparty being incapable of opening. +/// QueryPacketAcknowledgementsRequest is the request type for the +/// Query/QueryPacketCommitments RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeInit { +pub struct QueryPacketAcknowledgementsRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, + /// pagination request #[prost(message, optional, tag = "3")] - pub fields: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, + /// list of packet sequences + #[prost(uint64, repeated, tag = "4")] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgChannelUpgradeInit { - const NAME: &'static str = "MsgChannelUpgradeInit"; +impl ::prost::Name for QueryPacketAcknowledgementsRequest { + const NAME: &'static str = "QueryPacketAcknowledgementsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +/// QueryPacketAcknowledgemetsResponse is the request type for the +/// Query/QueryPacketAcknowledgements RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeInitResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "2")] - pub upgrade_sequence: u64, +pub struct QueryPacketAcknowledgementsResponse { + #[prost(message, repeated, tag = "1")] + pub acknowledgements: ::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, } -impl ::prost::Name for MsgChannelUpgradeInitResponse { - const NAME: &'static str = "MsgChannelUpgradeInitResponse"; +impl ::prost::Name for QueryPacketAcknowledgementsResponse { + const NAME: &'static str = "QueryPacketAcknowledgementsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +/// QueryUnreceivedPacketsRequest is the request type for the +/// Query/UnreceivedPackets RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTry { +pub struct QueryUnreceivedPacketsRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(string, repeated, tag = "3")] - pub proposed_upgrade_connection_hops: ::prost::alloc::vec::Vec< - ::prost::alloc::string::String, - >, - #[prost(message, optional, tag = "4")] - pub counterparty_upgrade_fields: ::core::option::Option, - #[prost(uint64, tag = "5")] - pub counterparty_upgrade_sequence: u64, - #[prost(bytes = "vec", tag = "6")] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "7")] - pub proof_upgrade: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "9")] - pub signer: ::prost::alloc::string::String, + /// list of packet sequences + #[prost(uint64, repeated, tag = "3")] + pub packet_commitment_sequences: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgChannelUpgradeTry { - const NAME: &'static str = "MsgChannelUpgradeTry"; +impl ::prost::Name for QueryUnreceivedPacketsRequest { + const NAME: &'static str = "QueryUnreceivedPacketsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +/// QueryUnreceivedPacketsResponse is the response type for the +/// Query/UnreceivedPacketCommitments RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTryResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "2")] - pub upgrade_sequence: u64, - #[prost(enumeration = "ResponseResultType", tag = "3")] - pub result: i32, +pub struct QueryUnreceivedPacketsResponse { + /// list of unreceived packet sequences + #[prost(uint64, repeated, tag = "1")] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, } -impl ::prost::Name for MsgChannelUpgradeTryResponse { - const NAME: &'static str = "MsgChannelUpgradeTryResponse"; +impl ::prost::Name for QueryUnreceivedPacketsResponse { + const NAME: &'static str = "QueryUnreceivedPacketsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +/// QueryUnreceivedAcks is the request type for the +/// Query/UnreceivedAcks RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeAck { +pub struct QueryUnreceivedAcksRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub counterparty_upgrade: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "5")] - pub proof_upgrade: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, + /// list of acknowledgement sequences + #[prost(uint64, repeated, tag = "3")] + pub packet_ack_sequences: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MsgChannelUpgradeAck { - const NAME: &'static str = "MsgChannelUpgradeAck"; +impl ::prost::Name for QueryUnreceivedAcksRequest { + const NAME: &'static str = "QueryUnreceivedAcksRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +/// QueryUnreceivedAcksResponse is the response type for the +/// Query/UnreceivedAcks RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeAckResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct QueryUnreceivedAcksResponse { + /// list of unreceived acknowledgement sequences + #[prost(uint64, repeated, tag = "1")] + pub sequences: ::prost::alloc::vec::Vec, + /// query block height + #[prost(message, optional, tag = "2")] + pub height: ::core::option::Option, } -impl ::prost::Name for MsgChannelUpgradeAckResponse { - const NAME: &'static str = "MsgChannelUpgradeAckResponse"; +impl ::prost::Name for QueryUnreceivedAcksResponse { + const NAME: &'static str = "QueryUnreceivedAcksResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +/// QueryNextSequenceReceiveRequest is the request type for the +/// Query/QueryNextSequenceReceiveRequest RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeConfirm { +pub struct QueryNextSequenceReceiveRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(enumeration = "State", tag = "3")] - pub counterparty_channel_state: i32, - #[prost(message, optional, tag = "4")] - pub counterparty_upgrade: ::core::option::Option, - #[prost(bytes = "vec", tag = "5")] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "6")] - pub proof_upgrade: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "7")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "8")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelUpgradeConfirm { - const NAME: &'static str = "MsgChannelUpgradeConfirm"; +impl ::prost::Name for QueryNextSequenceReceiveRequest { + const NAME: &'static str = "QueryNextSequenceReceiveRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +/// QuerySequenceResponse is the response type for the +/// Query/QueryNextSequenceReceiveResponse RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeConfirmResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, +pub struct QueryNextSequenceReceiveResponse { + /// next sequence receive number + #[prost(uint64, tag = "1")] + pub next_sequence_receive: u64, + /// 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, } -impl ::prost::Name for MsgChannelUpgradeConfirmResponse { - const NAME: &'static str = "MsgChannelUpgradeConfirmResponse"; +impl ::prost::Name for QueryNextSequenceReceiveResponse { + const NAME: &'static str = "QueryNextSequenceReceiveResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +/// QueryNextSequenceSendRequest is the request type for the +/// Query/QueryNextSequenceSend RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeOpen { +pub struct QueryNextSequenceSendRequest { + /// port unique identifier #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, + /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(enumeration = "State", tag = "3")] - pub counterparty_channel_state: i32, - #[prost(uint64, tag = "4")] - pub counterparty_upgrade_sequence: u64, - #[prost(bytes = "vec", tag = "5")] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "6")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "7")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelUpgradeOpen { - const NAME: &'static str = "MsgChannelUpgradeOpen"; +impl ::prost::Name for QueryNextSequenceSendRequest { + const NAME: &'static str = "QueryNextSequenceSendRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +/// QueryNextSequenceSendResponse is the request type for the +/// Query/QueryNextSequenceSend RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeOpenResponse {} -impl ::prost::Name for MsgChannelUpgradeOpenResponse { - const NAME: &'static str = "MsgChannelUpgradeOpenResponse"; +pub struct QueryNextSequenceSendResponse { + /// next sequence send number + #[prost(uint64, tag = "1")] + pub next_sequence_send: u64, + /// 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, +} +impl ::prost::Name for QueryNextSequenceSendResponse { + const NAME: &'static str = "QueryNextSequenceSendResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +/// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTimeout { +pub struct QueryUpgradeErrorRequest { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub counterparty_channel: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - pub proof_channel: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelUpgradeTimeout { - const NAME: &'static str = "MsgChannelUpgradeTimeout"; +impl ::prost::Name for QueryUpgradeErrorRequest { + const NAME: &'static str = "QueryUpgradeErrorRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +/// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTimeoutResponse {} -impl ::prost::Name for MsgChannelUpgradeTimeoutResponse { - const NAME: &'static str = "MsgChannelUpgradeTimeoutResponse"; +pub struct QueryUpgradeErrorResponse { + #[prost(message, optional, tag = "1")] + pub error_receipt: ::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, +} +impl ::prost::Name for QueryUpgradeErrorResponse { + const NAME: &'static str = "QueryUpgradeErrorResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +/// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeCancel { +pub struct QueryUpgradeRequest { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "3")] - pub error_receipt: ::core::option::Option, - #[prost(bytes = "vec", tag = "4")] - pub proof_error_receipt: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "5")] - pub proof_height: ::core::option::Option, - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgChannelUpgradeCancel { - const NAME: &'static str = "MsgChannelUpgradeCancel"; +impl ::prost::Name for QueryUpgradeRequest { + const NAME: &'static str = "QueryUpgradeRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +/// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeCancelResponse {} -impl ::prost::Name for MsgChannelUpgradeCancelResponse { - const NAME: &'static str = "MsgChannelUpgradeCancelResponse"; +pub struct QueryUpgradeResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::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, +} +impl ::prost::Name for QueryUpgradeResponse { + const NAME: &'static str = "QueryUpgradeResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgUpdateParams is the MsgUpdateParams request type. +/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// authority is the address that controls the module (defaults to x/gov unless overwritten). - #[prost(string, tag = "1")] - pub authority: ::prost::alloc::string::String, - /// params defines the channel parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, -} -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +pub struct QueryChannelParamsRequest {} +impl ::prost::Name for QueryChannelParamsRequest { + const NAME: &'static str = "QueryChannelParamsRequest"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. #[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"; +pub struct QueryChannelParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryChannelParamsResponse { + const NAME: &'static str = "QueryChannelParamsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPruneAcknowledgements { - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub limit: u64, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, -} -impl ::prost::Name for MsgPruneAcknowledgements { - const NAME: &'static str = "MsgPruneAcknowledgements"; - const PACKAGE: &'static str = "ibc.core.channel.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) - } -} -/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgPruneAcknowledgementsResponse { - /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). - #[prost(uint64, tag = "1")] - pub total_pruned_sequences: u64, - /// Number of sequences left after pruning. - #[prost(uint64, tag = "2")] - pub total_remaining_sequences: u64, -} -impl ::prost::Name for MsgPruneAcknowledgementsResponse { - const NAME: &'static str = "MsgPruneAcknowledgementsResponse"; - const PACKAGE: &'static str = "ibc.core.channel.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) - } -} -/// ResponseResultType defines the possible outcomes of the execution of a message -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum ResponseResultType { - /// Default zero value enumeration - Unspecified = 0, - /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) - Noop = 1, - /// The message was executed successfully - Success = 2, - /// The message was executed unsuccessfully - Failure = 3, -} -impl ResponseResultType { - /// 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 { - ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", - ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", - ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", - ResponseResultType::Failure => "RESPONSE_RESULT_TYPE_FAILURE", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), - "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), - "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), - "RESPONSE_RESULT_TYPE_FAILURE" => Some(Self::Failure), - _ => None, - } - } -} /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the ibc/channel Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1226,7 +1187,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1244,7 +1205,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1258,7 +1219,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1291,12 +1252,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - pub async fn channel_open_init( + /// Channel queries an IBC Channel. + pub async fn channel( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1310,19 +1271,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenInit", + "/ibc.core.channel.v1.Query/Channel", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenInit")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channel")); self.inner.unary(req, path, codec).await } - /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - pub async fn channel_open_try( + /// Channels queries all the IBC channels of a chain. + pub async fn channels( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1336,19 +1297,20 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenTry", + "/ibc.core.channel.v1.Query/Channels", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenTry")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channels")); self.inner.unary(req, path, codec).await } - /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - pub async fn channel_open_ack( + /// ConnectionChannels queries all the channels associated with a connection + /// end. + pub async fn connection_channels( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1362,19 +1324,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenAck", + "/ibc.core.channel.v1.Query/ConnectionChannels", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenAck")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Query", "ConnectionChannels"), + ); self.inner.unary(req, path, codec).await } - /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - pub async fn channel_open_confirm( + /// ChannelClientState queries for the client state for the channel associated + /// with the provided channel identifiers. + pub async fn channel_client_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1388,21 +1353,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelOpenConfirm", + "/ibc.core.channel.v1.Query/ChannelClientState", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenConfirm"), + GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelClientState"), ); self.inner.unary(req, path, codec).await } - /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - pub async fn channel_close_init( + /// ChannelConsensusState queries for the consensus state for the channel + /// associated with the provided channel identifiers. + pub async fn channel_consensus_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1416,20 +1382,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelCloseInit", + "/ibc.core.channel.v1.Query/ChannelConsensusState", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelCloseInit")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelConsensusState"), + ); self.inner.unary(req, path, codec).await } - /// ChannelCloseConfirm defines a rpc handler method for - /// MsgChannelCloseConfirm. - pub async fn channel_close_confirm( + /// PacketCommitment queries a stored packet commitment hash. + pub async fn packet_commitment( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1443,21 +1410,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelCloseConfirm", + "/ibc.core.channel.v1.Query/PacketCommitment", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelCloseConfirm"), + GrpcMethod::new("ibc.core.channel.v1.Query", "PacketCommitment"), ); self.inner.unary(req, path, codec).await } - /// RecvPacket defines a rpc handler method for MsgRecvPacket. - pub async fn recv_packet( + /// PacketCommitments returns all the packet commitments hashes associated + /// with a channel. + pub async fn packet_commitments( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1471,19 +1439,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/RecvPacket", + "/ibc.core.channel.v1.Query/PacketCommitments", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "RecvPacket")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Query", "PacketCommitments"), + ); self.inner.unary(req, path, codec).await } - /// Timeout defines a rpc handler method for MsgTimeout. - pub async fn timeout( + /// PacketReceipt queries if a given packet sequence has been received on the + /// queried chain + pub async fn packet_receipt( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1497,19 +1468,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/Timeout", + "/ibc.core.channel.v1.Query/PacketReceipt", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "Timeout")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "PacketReceipt")); self.inner.unary(req, path, codec).await } - /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - pub async fn timeout_on_close( + /// PacketAcknowledgement queries a stored packet acknowledgement hash. + pub async fn packet_acknowledgement( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1523,19 +1494,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/TimeoutOnClose", + "/ibc.core.channel.v1.Query/PacketAcknowledgement", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "TimeoutOnClose")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Query", "PacketAcknowledgement"), + ); self.inner.unary(req, path, codec).await } - /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. - pub async fn acknowledgement( + /// PacketAcknowledgements returns all the packet acknowledgements associated + /// with a channel. + pub async fn packet_acknowledgements( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1549,19 +1523,25 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/Acknowledgement", + "/ibc.core.channel.v1.Query/PacketAcknowledgements", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "Acknowledgement")); + .insert( + GrpcMethod::new( + "ibc.core.channel.v1.Query", + "PacketAcknowledgements", + ), + ); self.inner.unary(req, path, codec).await } - /// ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. - pub async fn channel_upgrade_init( + /// UnreceivedPackets returns all the unreceived IBC packets associated with a + /// channel and sequences. + pub async fn unreceived_packets( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1575,21 +1555,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelUpgradeInit", + "/ibc.core.channel.v1.Query/UnreceivedPackets", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeInit"), + GrpcMethod::new("ibc.core.channel.v1.Query", "UnreceivedPackets"), ); self.inner.unary(req, path, codec).await } - /// ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. - pub async fn channel_upgrade_try( + /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated + /// with a channel and sequences. + pub async fn unreceived_acks( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1603,19 +1584,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelUpgradeTry", + "/ibc.core.channel.v1.Query/UnreceivedAcks", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeTry")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "UnreceivedAcks")); self.inner.unary(req, path, codec).await } - /// ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. - pub async fn channel_upgrade_ack( + /// NextSequenceReceive returns the next receive sequence for a given channel. + pub async fn next_sequence_receive( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1629,75 +1610,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelUpgradeAck", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeAck")); - self.inner.unary(req, path, codec).await - } - /// ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. - pub async fn channel_upgrade_confirm( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.channel.v1.Msg/ChannelUpgradeConfirm", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm"), - ); - self.inner.unary(req, path, codec).await - } - /// ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. - pub async fn channel_upgrade_open( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.channel.v1.Msg/ChannelUpgradeOpen", + "/ibc.core.channel.v1.Query/NextSequenceReceive", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen"), + GrpcMethod::new("ibc.core.channel.v1.Query", "NextSequenceReceive"), ); self.inner.unary(req, path, codec).await } - /// ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. - pub async fn channel_upgrade_timeout( + /// NextSequenceSend returns the next send sequence for a given channel. + pub async fn next_sequence_send( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1711,21 +1638,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout", + "/ibc.core.channel.v1.Query/NextSequenceSend", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout"), + GrpcMethod::new("ibc.core.channel.v1.Query", "NextSequenceSend"), ); self.inner.unary(req, path, codec).await } - /// ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. - pub async fn channel_upgrade_cancel( + /// UpgradeError returns the error receipt if the upgrade handshake failed. + pub async fn upgrade_error( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1739,21 +1666,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel", + "/ibc.core.channel.v1.Query/UpgradeError", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "UpgradeError")); self.inner.unary(req, path, codec).await } - /// UpdateChannelParams defines a rpc handler method for MsgUpdateParams. - pub async fn update_channel_params( + /// Upgrade returns the upgrade for a given port and channel id. + pub async fn upgrade( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1767,21 +1692,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/UpdateChannelParams", + "/ibc.core.channel.v1.Query/Upgrade", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "UpdateChannelParams"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Upgrade")); self.inner.unary(req, path, codec).await } - /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. - pub async fn prune_acknowledgements( + /// ChannelParams queries all parameters of the ibc channel submodule. + pub async fn channel_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1795,182 +1718,171 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Msg/PruneAcknowledgements", + "/ibc.core.channel.v1.Query/ChannelParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Msg", "PruneAcknowledgements"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelParams")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. - async fn channel_open_init( + pub trait Query: Send + Sync + 'static { + /// Channel queries an IBC Channel. + async fn channel( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. - async fn channel_open_try( + /// Channels queries all the IBC channels of a chain. + async fn channels( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. - async fn channel_open_ack( + /// ConnectionChannels queries all the channels associated with a connection + /// end. + async fn connection_channels( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. - async fn channel_open_confirm( + /// ChannelClientState queries for the client state for the channel associated + /// with the provided channel identifiers. + async fn channel_client_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. - async fn channel_close_init( + /// ChannelConsensusState queries for the consensus state for the channel + /// associated with the provided channel identifiers. + async fn channel_consensus_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelCloseConfirm defines a rpc handler method for - /// MsgChannelCloseConfirm. - async fn channel_close_confirm( + /// PacketCommitment queries a stored packet commitment hash. + async fn packet_commitment( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// RecvPacket defines a rpc handler method for MsgRecvPacket. - async fn recv_packet( + /// PacketCommitments returns all the packet commitments hashes associated + /// with a channel. + async fn packet_commitments( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Timeout defines a rpc handler method for MsgTimeout. - async fn timeout( + /// PacketReceipt queries if a given packet sequence has been received on the + /// queried chain + async fn packet_receipt( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. - async fn timeout_on_close( + /// PacketAcknowledgement queries a stored packet acknowledgement hash. + async fn packet_acknowledgement( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. - async fn acknowledgement( + /// PacketAcknowledgements returns all the packet acknowledgements associated + /// with a channel. + async fn packet_acknowledgements( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. - async fn channel_upgrade_init( + /// UnreceivedPackets returns all the unreceived IBC packets associated with a + /// channel and sequences. + async fn unreceived_packets( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. - async fn channel_upgrade_try( + /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated + /// with a channel and sequences. + async fn unreceived_acks( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. - async fn channel_upgrade_ack( + /// NextSequenceReceive returns the next receive sequence for a given channel. + async fn next_sequence_receive( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. - async fn channel_upgrade_confirm( + /// NextSequenceSend returns the next send sequence for a given channel. + async fn next_sequence_send( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. - async fn channel_upgrade_open( + /// UpgradeError returns the error receipt if the upgrade handshake failed. + async fn upgrade_error( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. - async fn channel_upgrade_timeout( + /// Upgrade returns the upgrade for a given port and channel id. + async fn upgrade( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. - async fn channel_upgrade_cancel( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// UpdateChannelParams defines a rpc handler method for MsgUpdateParams. - async fn update_channel_params( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. - async fn prune_acknowledgements( + /// ChannelParams queries all parameters of the ibc channel submodule. + async fn channel_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Msg defines the ibc/channel Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1978,7 +1890,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -2030,9 +1942,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -2048,23 +1960,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.core.channel.v1.Msg/ChannelOpenInit" => { + "/ibc.core.channel.v1.Query/Channel" => { #[allow(non_camel_case_types)] - struct ChannelOpenInitSvc(pub Arc); - impl tonic::server::UnaryService - for ChannelOpenInitSvc { - type Response = super::MsgChannelOpenInitResponse; + struct ChannelSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChannelSvc { + type Response = super::QueryChannelResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_open_init(&inner, request).await + ::channel(&inner, request).await }; Box::pin(fut) } @@ -2076,7 +1990,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelOpenInitSvc(inner); + let method = ChannelSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2092,23 +2006,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelOpenTry" => { + "/ibc.core.channel.v1.Query/Channels" => { #[allow(non_camel_case_types)] - struct ChannelOpenTrySvc(pub Arc); - impl tonic::server::UnaryService - for ChannelOpenTrySvc { - type Response = super::MsgChannelOpenTryResponse; + struct ChannelsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChannelsSvc { + type Response = super::QueryChannelsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_open_try(&inner, request).await + ::channels(&inner, request).await }; Box::pin(fut) } @@ -2120,7 +2036,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelOpenTrySvc(inner); + let method = ChannelsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2136,23 +2052,27 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelOpenAck" => { + "/ibc.core.channel.v1.Query/ConnectionChannels" => { #[allow(non_camel_case_types)] - struct ChannelOpenAckSvc(pub Arc); - impl tonic::server::UnaryService - for ChannelOpenAckSvc { - type Response = super::MsgChannelOpenAckResponse; + struct ConnectionChannelsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConnectionChannelsSvc { + type Response = super::QueryConnectionChannelsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryConnectionChannelsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_open_ack(&inner, request).await + ::connection_channels(&inner, request).await }; Box::pin(fut) } @@ -2164,7 +2084,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelOpenAckSvc(inner); + let method = ConnectionChannelsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2180,25 +2100,27 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelOpenConfirm" => { + "/ibc.core.channel.v1.Query/ChannelClientState" => { #[allow(non_camel_case_types)] - struct ChannelOpenConfirmSvc(pub Arc); + struct ChannelClientStateSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelOpenConfirmSvc { - type Response = super::MsgChannelOpenConfirmResponse; + T: Query, + > tonic::server::UnaryService + for ChannelClientStateSvc { + type Response = super::QueryChannelClientStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryChannelClientStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_open_confirm(&inner, request).await + ::channel_client_state(&inner, request).await }; Box::pin(fut) } @@ -2210,7 +2132,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelOpenConfirmSvc(inner); + let method = ChannelClientStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2226,23 +2148,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelCloseInit" => { + "/ibc.core.channel.v1.Query/ChannelConsensusState" => { #[allow(non_camel_case_types)] - struct ChannelCloseInitSvc(pub Arc); - impl tonic::server::UnaryService - for ChannelCloseInitSvc { - type Response = super::MsgChannelCloseInitResponse; + struct ChannelConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryChannelConsensusStateRequest, + > for ChannelConsensusStateSvc { + type Response = super::QueryChannelConsensusStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryChannelConsensusStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_close_init(&inner, request).await + ::channel_consensus_state(&inner, request).await }; Box::pin(fut) } @@ -2254,7 +2181,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelCloseInitSvc(inner); + let method = ChannelConsensusStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2270,25 +2197,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelCloseConfirm" => { + "/ibc.core.channel.v1.Query/PacketCommitment" => { #[allow(non_camel_case_types)] - struct ChannelCloseConfirmSvc(pub Arc); + struct PacketCommitmentSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelCloseConfirmSvc { - type Response = super::MsgChannelCloseConfirmResponse; + T: Query, + > tonic::server::UnaryService + for PacketCommitmentSvc { + type Response = super::QueryPacketCommitmentResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_close_confirm(&inner, request).await + ::packet_commitment(&inner, request).await }; Box::pin(fut) } @@ -2300,7 +2227,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelCloseConfirmSvc(inner); + let method = PacketCommitmentSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2316,23 +2243,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/RecvPacket" => { + "/ibc.core.channel.v1.Query/PacketCommitments" => { #[allow(non_camel_case_types)] - struct RecvPacketSvc(pub Arc); - impl tonic::server::UnaryService - for RecvPacketSvc { - type Response = super::MsgRecvPacketResponse; + struct PacketCommitmentsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for PacketCommitmentsSvc { + type Response = super::QueryPacketCommitmentsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::recv_packet(&inner, request).await + ::packet_commitments(&inner, request).await }; Box::pin(fut) } @@ -2344,7 +2273,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RecvPacketSvc(inner); + let method = PacketCommitmentsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2360,23 +2289,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/Timeout" => { + "/ibc.core.channel.v1.Query/PacketReceipt" => { #[allow(non_camel_case_types)] - struct TimeoutSvc(pub Arc); - impl tonic::server::UnaryService - for TimeoutSvc { - type Response = super::MsgTimeoutResponse; + struct PacketReceiptSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for PacketReceiptSvc { + type Response = super::QueryPacketReceiptResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::timeout(&inner, request).await + ::packet_receipt(&inner, request).await }; Box::pin(fut) } @@ -2388,7 +2319,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TimeoutSvc(inner); + let method = PacketReceiptSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2404,23 +2335,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/TimeoutOnClose" => { + "/ibc.core.channel.v1.Query/PacketAcknowledgement" => { #[allow(non_camel_case_types)] - struct TimeoutOnCloseSvc(pub Arc); - impl tonic::server::UnaryService - for TimeoutOnCloseSvc { - type Response = super::MsgTimeoutOnCloseResponse; + struct PacketAcknowledgementSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryPacketAcknowledgementRequest, + > for PacketAcknowledgementSvc { + type Response = super::QueryPacketAcknowledgementResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryPacketAcknowledgementRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::timeout_on_close(&inner, request).await + ::packet_acknowledgement(&inner, request).await }; Box::pin(fut) } @@ -2432,7 +2368,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = TimeoutOnCloseSvc(inner); + let method = PacketAcknowledgementSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2448,23 +2384,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/Acknowledgement" => { + "/ibc.core.channel.v1.Query/PacketAcknowledgements" => { #[allow(non_camel_case_types)] - struct AcknowledgementSvc(pub Arc); - impl tonic::server::UnaryService - for AcknowledgementSvc { - type Response = super::MsgAcknowledgementResponse; + struct PacketAcknowledgementsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryPacketAcknowledgementsRequest, + > for PacketAcknowledgementsSvc { + type Response = super::QueryPacketAcknowledgementsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryPacketAcknowledgementsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::acknowledgement(&inner, request).await + ::packet_acknowledgements(&inner, request).await }; Box::pin(fut) } @@ -2476,7 +2417,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = AcknowledgementSvc(inner); + let method = PacketAcknowledgementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2492,25 +2433,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeInit" => { + "/ibc.core.channel.v1.Query/UnreceivedPackets" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeInitSvc(pub Arc); + struct UnreceivedPacketsSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelUpgradeInitSvc { - type Response = super::MsgChannelUpgradeInitResponse; + T: Query, + > tonic::server::UnaryService + for UnreceivedPacketsSvc { + type Response = super::QueryUnreceivedPacketsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_upgrade_init(&inner, request).await + ::unreceived_packets(&inner, request).await }; Box::pin(fut) } @@ -2522,7 +2463,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelUpgradeInitSvc(inner); + let method = UnreceivedPacketsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2538,67 +2479,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeTry" => { + "/ibc.core.channel.v1.Query/UnreceivedAcks" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeTrySvc(pub Arc); - impl tonic::server::UnaryService - for ChannelUpgradeTrySvc { - type Response = super::MsgChannelUpgradeTryResponse; + struct UnreceivedAcksSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for UnreceivedAcksSvc { + type Response = super::QueryUnreceivedAcksResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::channel_upgrade_try(&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 = ChannelUpgradeTrySvc(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.core.channel.v1.Msg/ChannelUpgradeAck" => { - #[allow(non_camel_case_types)] - struct ChannelUpgradeAckSvc(pub Arc); - impl tonic::server::UnaryService - for ChannelUpgradeAckSvc { - type Response = super::MsgChannelUpgradeAckResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_upgrade_ack(&inner, request).await + ::unreceived_acks(&inner, request).await }; Box::pin(fut) } @@ -2610,7 +2509,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelUpgradeAckSvc(inner); + let method = UnreceivedAcksSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2626,25 +2525,27 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm" => { + "/ibc.core.channel.v1.Query/NextSequenceReceive" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeConfirmSvc(pub Arc); + struct NextSequenceReceiveSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelUpgradeConfirmSvc { - type Response = super::MsgChannelUpgradeConfirmResponse; + T: Query, + > tonic::server::UnaryService + for NextSequenceReceiveSvc { + type Response = super::QueryNextSequenceReceiveResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryNextSequenceReceiveRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_upgrade_confirm(&inner, request).await + ::next_sequence_receive(&inner, request).await }; Box::pin(fut) } @@ -2656,7 +2557,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelUpgradeConfirmSvc(inner); + let method = NextSequenceReceiveSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2672,25 +2573,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen" => { + "/ibc.core.channel.v1.Query/NextSequenceSend" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeOpenSvc(pub Arc); + struct NextSequenceSendSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelUpgradeOpenSvc { - type Response = super::MsgChannelUpgradeOpenResponse; + T: Query, + > tonic::server::UnaryService + for NextSequenceSendSvc { + type Response = super::QueryNextSequenceSendResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_upgrade_open(&inner, request).await + ::next_sequence_send(&inner, request).await }; Box::pin(fut) } @@ -2702,7 +2603,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelUpgradeOpenSvc(inner); + let method = NextSequenceSendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2718,25 +2619,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout" => { + "/ibc.core.channel.v1.Query/UpgradeError" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeTimeoutSvc(pub Arc); + struct UpgradeErrorSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelUpgradeTimeoutSvc { - type Response = super::MsgChannelUpgradeTimeoutResponse; + T: Query, + > tonic::server::UnaryService + for UpgradeErrorSvc { + type Response = super::QueryUpgradeErrorResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_upgrade_timeout(&inner, request).await + ::upgrade_error(&inner, request).await }; Box::pin(fut) } @@ -2748,7 +2649,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelUpgradeTimeoutSvc(inner); + let method = UpgradeErrorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2764,69 +2665,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel" => { + "/ibc.core.channel.v1.Query/Upgrade" => { #[allow(non_camel_case_types)] - struct ChannelUpgradeCancelSvc(pub Arc); + struct UpgradeSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ChannelUpgradeCancelSvc { - type Response = super::MsgChannelUpgradeCancelResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::channel_upgrade_cancel(&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 = ChannelUpgradeCancelSvc(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.core.channel.v1.Msg/UpdateChannelParams" => { - #[allow(non_camel_case_types)] - struct UpdateChannelParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateChannelParamsSvc { - type Response = super::MsgUpdateParamsResponse; + T: Query, + > tonic::server::UnaryService + for UpgradeSvc { + type Response = super::QueryUpgradeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_channel_params(&inner, request).await + ::upgrade(&inner, request).await }; Box::pin(fut) } @@ -2838,7 +2695,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateChannelParamsSvc(inner); + let method = UpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2854,25 +2711,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Msg/PruneAcknowledgements" => { + "/ibc.core.channel.v1.Query/ChannelParams" => { #[allow(non_camel_case_types)] - struct PruneAcknowledgementsSvc(pub Arc); + struct ChannelParamsSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for PruneAcknowledgementsSvc { - type Response = super::MsgPruneAcknowledgementsResponse; + T: Query, + > tonic::server::UnaryService + for ChannelParamsSvc { + type Response = super::QueryChannelParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::prune_acknowledgements(&inner, request).await + ::channel_params(&inner, request).await }; Box::pin(fut) } @@ -2884,7 +2741,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PruneAcknowledgementsSvc(inner); + let method = ChannelParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2915,7 +2772,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2927,7 +2784,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2937,737 +2794,776 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "ibc.core.channel.v1.Msg"; + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.core.channel.v1.Query"; } } -/// QueryChannelRequest is the request type for the Query/Channel RPC method +/// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It +/// is called by a relayer on Chain A. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelRequest { - /// port unique identifier +pub struct MsgChannelOpenInit { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryChannelRequest { - const NAME: &'static str = "QueryChannelRequest"; - const PACKAGE: &'static str = "ibc.core.channel.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) - } -} -/// QueryChannelResponse is the response type for the Query/Channel RPC method. -/// Besides the Channel 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 QueryChannelResponse { - /// channel associated with the request identifiers - #[prost(message, optional, tag = "1")] + #[prost(message, optional, tag = "2")] pub channel: ::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, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryChannelResponse { - const NAME: &'static str = "QueryChannelResponse"; +impl ::prost::Name for MsgChannelOpenInit { + const NAME: &'static str = "MsgChannelOpenInit"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelsRequest is the request type for the Query/Channels RPC method +/// MsgChannelOpenInitResponse defines the Msg/ChannelOpenInit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsRequest { - /// pagination request - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, +pub struct MsgChannelOpenInitResponse { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub version: ::prost::alloc::string::String, } -impl ::prost::Name for QueryChannelsRequest { - const NAME: &'static str = "QueryChannelsRequest"; +impl ::prost::Name for MsgChannelOpenInitResponse { + const NAME: &'static str = "MsgChannelOpenInitResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelsResponse is the response type for the Query/Channels RPC method. +/// MsgChannelOpenInit defines a msg sent by a Relayer to try to open a channel +/// on Chain B. The version field within the Channel field has been deprecated. Its +/// value will be ignored by core IBC. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelsResponse { - /// list of stored channels of the chain. - #[prost(message, repeated, tag = "1")] - pub channels: ::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 +pub struct MsgChannelOpenTry { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// Deprecated: this field is unused. Crossing hello's are no longer supported in core IBC. + #[deprecated] + #[prost(string, tag = "2")] + pub previous_channel_id: ::prost::alloc::string::String, + /// NOTE: the version field within the channel has been deprecated. Its value will be ignored by core IBC. #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, + pub channel: ::core::option::Option, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryChannelsResponse { - const NAME: &'static str = "QueryChannelsResponse"; +impl ::prost::Name for MsgChannelOpenTry { + const NAME: &'static str = "MsgChannelOpenTry"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryConnectionChannelsRequest is the request type for the -/// Query/QueryConnectionChannels RPC method +/// MsgChannelOpenTryResponse defines the Msg/ChannelOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsRequest { - /// connection unique identifier +pub struct MsgChannelOpenTryResponse { #[prost(string, tag = "1")] - pub connection: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, + pub version: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConnectionChannelsRequest { - const NAME: &'static str = "QueryConnectionChannelsRequest"; +impl ::prost::Name for MsgChannelOpenTryResponse { + const NAME: &'static str = "MsgChannelOpenTryResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryConnectionChannelsResponse is the Response type for the -/// Query/QueryConnectionChannels RPC method +/// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge +/// the change of channel state to TRYOPEN on Chain B. +/// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +/// in the same block as executing this message otherwise the counterparty will +/// be incapable of opening. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConnectionChannelsResponse { - /// list of channels associated with a connection. - #[prost(message, repeated, tag = "1")] - pub channels: ::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, +pub struct MsgChannelOpenAck { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub counterparty_channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub counterparty_version: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "5")] + pub proof_try: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConnectionChannelsResponse { - const NAME: &'static str = "QueryConnectionChannelsResponse"; +impl ::prost::Name for MsgChannelOpenAck { + const NAME: &'static str = "MsgChannelOpenAck"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelClientStateRequest is the request type for the Query/ClientState -/// RPC method +/// MsgChannelOpenAckResponse defines the Msg/ChannelOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateRequest { - /// port unique identifier +pub struct MsgChannelOpenAckResponse {} +impl ::prost::Name for MsgChannelOpenAckResponse { + const NAME: &'static str = "MsgChannelOpenAckResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgChannelOpenConfirm defines a msg sent by a Relayer to Chain B to +/// acknowledge the change of channel state to OPEN on Chain A. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelOpenConfirm { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + pub proof_ack: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryChannelClientStateRequest { - const NAME: &'static str = "QueryChannelClientStateRequest"; +impl ::prost::Name for MsgChannelOpenConfirm { + const NAME: &'static str = "MsgChannelOpenConfirm"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method +/// MsgChannelOpenConfirmResponse defines the Msg/ChannelOpenConfirm response +/// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag = "1")] - pub identified_client_state: ::core::option::Option< - super::super::client::v1::IdentifiedClientState, - >, - /// 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, -} -impl ::prost::Name for QueryChannelClientStateResponse { - const NAME: &'static str = "QueryChannelClientStateResponse"; +pub struct MsgChannelOpenConfirmResponse {} +impl ::prost::Name for MsgChannelOpenConfirmResponse { + const NAME: &'static str = "MsgChannelOpenConfirmResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelConsensusStateRequest is the request type for the -/// Query/ConsensusState RPC method +/// MsgChannelCloseInit defines a msg sent by a Relayer to Chain A +/// to close a channel with Chain B. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateRequest { - /// port unique identifier +pub struct MsgChannelCloseInit { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// revision number of the consensus state - #[prost(uint64, tag = "3")] - pub revision_number: u64, - /// revision height of the consensus state - #[prost(uint64, tag = "4")] - pub revision_height: u64, + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryChannelConsensusStateRequest { - const NAME: &'static str = "QueryChannelConsensusStateRequest"; +impl ::prost::Name for MsgChannelCloseInit { + const NAME: &'static str = "MsgChannelCloseInit"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelClientStateResponse is the Response type for the -/// Query/QueryChannelClientState RPC method +/// MsgChannelCloseInitResponse defines the Msg/ChannelCloseInit response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelConsensusStateResponse { - /// consensus state associated with the channel - #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option< - super::super::super::super::google::protobuf::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, -} -impl ::prost::Name for QueryChannelConsensusStateResponse { - const NAME: &'static str = "QueryChannelConsensusStateResponse"; +pub struct MsgChannelCloseInitResponse {} +impl ::prost::Name for MsgChannelCloseInitResponse { + const NAME: &'static str = "MsgChannelCloseInitResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketCommitmentRequest is the request type for the -/// Query/PacketCommitment RPC method +/// MsgChannelCloseConfirm defines a msg sent by a Relayer to Chain B +/// to acknowledge the change of channel state to CLOSED on Chain A. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentRequest { - /// port unique identifier +pub struct MsgChannelCloseConfirm { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, + #[prost(bytes = "vec", tag = "3")] + pub proof_init: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "6")] + pub counterparty_upgrade_sequence: u64, } -impl ::prost::Name for QueryPacketCommitmentRequest { - const NAME: &'static str = "QueryPacketCommitmentRequest"; +impl ::prost::Name for MsgChannelCloseConfirm { + const NAME: &'static str = "MsgChannelCloseConfirm"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketCommitmentResponse defines the client query response for a packet -/// which also includes a proof and the height from which the proof was -/// retrieved +/// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response +/// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentResponse { - /// packet associated with the request fields - #[prost(bytes = "vec", tag = "1")] - pub commitment: ::prost::alloc::vec::Vec, - /// merkle proof of existence +pub struct MsgChannelCloseConfirmResponse {} +impl ::prost::Name for MsgChannelCloseConfirmResponse { + const NAME: &'static str = "MsgChannelCloseConfirmResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgRecvPacket receives incoming IBC packet +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRecvPacket { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, #[prost(bytes = "vec", tag = "2")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + pub proof_commitment: ::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, } -impl ::prost::Name for QueryPacketCommitmentResponse { - const NAME: &'static str = "QueryPacketCommitmentResponse"; +impl ::prost::Name for MsgRecvPacket { + const NAME: &'static str = "MsgRecvPacket"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketCommitmentsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgRecvPacketResponse defines the Msg/RecvPacket response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, +pub struct MsgRecvPacketResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, } -impl ::prost::Name for QueryPacketCommitmentsRequest { - const NAME: &'static str = "QueryPacketCommitmentsRequest"; +impl ::prost::Name for MsgRecvPacketResponse { + const NAME: &'static str = "MsgRecvPacketResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketCommitmentsResponse is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgTimeout receives timed-out packet #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketCommitmentsResponse { - #[prost(message, repeated, tag = "1")] - pub commitments: ::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 +pub struct MsgTimeout { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub proof_unreceived: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] - pub height: ::core::option::Option, + pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "4")] + pub next_sequence_recv: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryPacketCommitmentsResponse { - const NAME: &'static str = "QueryPacketCommitmentsResponse"; +impl ::prost::Name for MsgTimeout { + const NAME: &'static str = "MsgTimeout"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketReceiptRequest is the request type for the -/// Query/PacketReceipt RPC method +/// MsgTimeoutResponse defines the Msg/Timeout response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptRequest { - /// port unique identifier - #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - /// channel unique identifier - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, +pub struct MsgTimeoutResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, } -impl ::prost::Name for QueryPacketReceiptRequest { - const NAME: &'static str = "QueryPacketReceiptRequest"; +impl ::prost::Name for MsgTimeoutResponse { + const NAME: &'static str = "MsgTimeoutResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketReceiptResponse defines the client query response for a packet -/// receipt which also includes a proof, and the height from which the proof was -/// retrieved +/// MsgTimeoutOnClose timed-out packet upon counterparty channel closure. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketReceiptResponse { - /// success flag for if receipt exists - #[prost(bool, tag = "2")] - pub received: bool, - /// merkle proof of existence +pub struct MsgTimeoutOnClose { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub proof_unreceived: ::prost::alloc::vec::Vec, #[prost(bytes = "vec", tag = "3")] - pub proof: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + pub proof_close: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "4")] pub proof_height: ::core::option::Option, + #[prost(uint64, tag = "5")] + pub next_sequence_recv: u64, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "7")] + pub counterparty_upgrade_sequence: u64, } -impl ::prost::Name for QueryPacketReceiptResponse { - const NAME: &'static str = "QueryPacketReceiptResponse"; +impl ::prost::Name for MsgTimeoutOnClose { + const NAME: &'static str = "MsgTimeoutOnClose"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketAcknowledgementRequest is the request type for the -/// Query/PacketAcknowledgement RPC method +/// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementRequest { - /// port unique identifier +pub struct MsgTimeoutOnCloseResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, +} +impl ::prost::Name for MsgTimeoutOnCloseResponse { + const NAME: &'static str = "MsgTimeoutOnCloseResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgAcknowledgement receives incoming IBC acknowledgement +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAcknowledgement { + #[prost(message, optional, tag = "1")] + pub packet: ::core::option::Option, + #[prost(bytes = "vec", tag = "2")] + pub acknowledgement: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub proof_acked: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgAcknowledgement { + const NAME: &'static str = "MsgAcknowledgement"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgAcknowledgementResponse defines the Msg/Acknowledgement response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAcknowledgementResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, +} +impl ::prost::Name for MsgAcknowledgementResponse { + const NAME: &'static str = "MsgAcknowledgementResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) + } +} +/// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +/// WARNING: Initializing a channel upgrade in the same block as opening the channel +/// may result in the counterparty being incapable of opening. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeInit { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// packet sequence - #[prost(uint64, tag = "3")] - pub sequence: u64, + #[prost(message, optional, tag = "3")] + pub fields: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryPacketAcknowledgementRequest { - const NAME: &'static str = "QueryPacketAcknowledgementRequest"; +impl ::prost::Name for MsgChannelUpgradeInit { + const NAME: &'static str = "MsgChannelUpgradeInit"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketAcknowledgementResponse defines the client query response for a -/// packet which also includes a proof and the height from which the -/// proof was retrieved +/// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementResponse { - /// packet associated with the request fields - #[prost(bytes = "vec", tag = "1")] - pub acknowledgement: ::prost::alloc::vec::Vec, - /// 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, +pub struct MsgChannelUpgradeInitResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub upgrade_sequence: u64, } -impl ::prost::Name for QueryPacketAcknowledgementResponse { - const NAME: &'static str = "QueryPacketAcknowledgementResponse"; +impl ::prost::Name for MsgChannelUpgradeInitResponse { + const NAME: &'static str = "MsgChannelUpgradeInitResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketAcknowledgementsRequest is the request type for the -/// Query/QueryPacketCommitments RPC method +/// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsRequest { - /// port unique identifier +pub struct MsgChannelUpgradeTry { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "3")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + #[prost(string, repeated, tag = "3")] + pub proposed_upgrade_connection_hops: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, >, - /// list of packet sequences - #[prost(uint64, repeated, tag = "4")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade_fields: ::core::option::Option, + #[prost(uint64, tag = "5")] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "6")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "9")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryPacketAcknowledgementsRequest { - const NAME: &'static str = "QueryPacketAcknowledgementsRequest"; +impl ::prost::Name for MsgChannelUpgradeTry { + const NAME: &'static str = "MsgChannelUpgradeTry"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryPacketAcknowledgemetsResponse is the request type for the -/// Query/QueryPacketAcknowledgements RPC method +/// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryPacketAcknowledgementsResponse { - #[prost(message, repeated, tag = "1")] - pub acknowledgements: ::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, +pub struct MsgChannelUpgradeTryResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub upgrade_sequence: u64, + #[prost(enumeration = "ResponseResultType", tag = "3")] + pub result: i32, } -impl ::prost::Name for QueryPacketAcknowledgementsResponse { - const NAME: &'static str = "QueryPacketAcknowledgementsResponse"; +impl ::prost::Name for MsgChannelUpgradeTryResponse { + const NAME: &'static str = "MsgChannelUpgradeTryResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUnreceivedPacketsRequest is the request type for the -/// Query/UnreceivedPackets RPC method +/// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsRequest { - /// port unique identifier +pub struct MsgChannelUpgradeAck { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// list of packet sequences - #[prost(uint64, repeated, tag = "3")] - pub packet_commitment_sequences: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryUnreceivedPacketsRequest { - const NAME: &'static str = "QueryUnreceivedPacketsRequest"; +impl ::prost::Name for MsgChannelUpgradeAck { + const NAME: &'static str = "MsgChannelUpgradeAck"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUnreceivedPacketsResponse is the response type for the -/// Query/UnreceivedPacketCommitments RPC method +/// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedPacketsResponse { - /// list of unreceived packet sequences - #[prost(uint64, repeated, tag = "1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, +pub struct MsgChannelUpgradeAckResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, } -impl ::prost::Name for QueryUnreceivedPacketsResponse { - const NAME: &'static str = "QueryUnreceivedPacketsResponse"; +impl ::prost::Name for MsgChannelUpgradeAckResponse { + const NAME: &'static str = "MsgChannelUpgradeAckResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUnreceivedAcks is the request type for the -/// Query/UnreceivedAcks RPC method +/// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksRequest { - /// port unique identifier +pub struct MsgChannelUpgradeConfirm { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, - /// list of acknowledgement sequences - #[prost(uint64, repeated, tag = "3")] - pub packet_ack_sequences: ::prost::alloc::vec::Vec, + #[prost(enumeration = "State", tag = "3")] + pub counterparty_channel_state: i32, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "5")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "6")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "8")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryUnreceivedAcksRequest { - const NAME: &'static str = "QueryUnreceivedAcksRequest"; +impl ::prost::Name for MsgChannelUpgradeConfirm { + const NAME: &'static str = "MsgChannelUpgradeConfirm"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUnreceivedAcksResponse is the response type for the -/// Query/UnreceivedAcks RPC method +/// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUnreceivedAcksResponse { - /// list of unreceived acknowledgement sequences - #[prost(uint64, repeated, tag = "1")] - pub sequences: ::prost::alloc::vec::Vec, - /// query block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, +pub struct MsgChannelUpgradeConfirmResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, } -impl ::prost::Name for QueryUnreceivedAcksResponse { - const NAME: &'static str = "QueryUnreceivedAcksResponse"; +impl ::prost::Name for MsgChannelUpgradeConfirmResponse { + const NAME: &'static str = "MsgChannelUpgradeConfirmResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryNextSequenceReceiveRequest is the request type for the -/// Query/QueryNextSequenceReceiveRequest RPC method +/// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveRequest { - /// port unique identifier +pub struct MsgChannelUpgradeOpen { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, + #[prost(enumeration = "State", tag = "3")] + pub counterparty_channel_state: i32, + #[prost(uint64, tag = "4")] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "5")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryNextSequenceReceiveRequest { - const NAME: &'static str = "QueryNextSequenceReceiveRequest"; +impl ::prost::Name for MsgChannelUpgradeOpen { + const NAME: &'static str = "MsgChannelUpgradeOpen"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QuerySequenceResponse is the response type for the -/// Query/QueryNextSequenceReceiveResponse RPC method +/// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceReceiveResponse { - /// next sequence receive number - #[prost(uint64, tag = "1")] - pub next_sequence_receive: u64, - /// 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, -} -impl ::prost::Name for QueryNextSequenceReceiveResponse { - const NAME: &'static str = "QueryNextSequenceReceiveResponse"; +pub struct MsgChannelUpgradeOpenResponse {} +impl ::prost::Name for MsgChannelUpgradeOpenResponse { + const NAME: &'static str = "MsgChannelUpgradeOpenResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryNextSequenceSendRequest is the request type for the -/// Query/QueryNextSequenceSend RPC method +/// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceSendRequest { - /// port unique identifier +pub struct MsgChannelUpgradeTimeout { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, - /// channel unique identifier #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub counterparty_channel: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryNextSequenceSendRequest { - const NAME: &'static str = "QueryNextSequenceSendRequest"; +impl ::prost::Name for MsgChannelUpgradeTimeout { + const NAME: &'static str = "MsgChannelUpgradeTimeout"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryNextSequenceSendResponse is the request type for the -/// Query/QueryNextSequenceSend RPC method +/// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryNextSequenceSendResponse { - /// next sequence send number - #[prost(uint64, tag = "1")] - pub next_sequence_send: u64, - /// 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, -} -impl ::prost::Name for QueryNextSequenceSendResponse { - const NAME: &'static str = "QueryNextSequenceSendResponse"; +pub struct MsgChannelUpgradeTimeoutResponse {} +impl ::prost::Name for MsgChannelUpgradeTimeoutResponse { + const NAME: &'static str = "MsgChannelUpgradeTimeoutResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +/// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradeErrorRequest { +pub struct MsgChannelUpgradeCancel { #[prost(string, tag = "1")] pub port_id: ::prost::alloc::string::String, #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub error_receipt: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_error_receipt: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryUpgradeErrorRequest { - const NAME: &'static str = "QueryUpgradeErrorRequest"; +impl ::prost::Name for MsgChannelUpgradeCancel { + const NAME: &'static str = "MsgChannelUpgradeCancel"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +/// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradeErrorResponse { - #[prost(message, optional, tag = "1")] - pub error_receipt: ::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, -} -impl ::prost::Name for QueryUpgradeErrorResponse { - const NAME: &'static str = "QueryUpgradeErrorResponse"; +pub struct MsgChannelUpgradeCancelResponse {} +impl ::prost::Name for MsgChannelUpgradeCancelResponse { + const NAME: &'static str = "MsgChannelUpgradeCancelResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +/// MsgUpdateParams is the MsgUpdateParams request type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradeRequest { +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). #[prost(string, tag = "1")] - pub port_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, + pub authority: ::prost::alloc::string::String, + /// params defines the channel parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, } -impl ::prost::Name for QueryUpgradeRequest { - const NAME: &'static str = "QueryUpgradeRequest"; +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradeResponse { - #[prost(message, optional, tag = "1")] - pub upgrade: ::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, -} -impl ::prost::Name for QueryUpgradeResponse { - const NAME: &'static str = "QueryUpgradeResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelParamsRequest {} -impl ::prost::Name for QueryChannelParamsRequest { - const NAME: &'static str = "QueryChannelParamsRequest"; +pub struct MsgPruneAcknowledgements { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub limit: u64, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgPruneAcknowledgements { + const NAME: &'static str = "MsgPruneAcknowledgements"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } -/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryChannelParamsResponse { - /// params defines the parameters of the module. - #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, +pub struct MsgPruneAcknowledgementsResponse { + /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + #[prost(uint64, tag = "1")] + pub total_pruned_sequences: u64, + /// Number of sequences left after pruning. + #[prost(uint64, tag = "2")] + pub total_remaining_sequences: u64, } -impl ::prost::Name for QueryChannelParamsResponse { - const NAME: &'static str = "QueryChannelParamsResponse"; +impl ::prost::Name for MsgPruneAcknowledgementsResponse { + const NAME: &'static str = "MsgPruneAcknowledgementsResponse"; const PACKAGE: &'static str = "ibc.core.channel.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.channel.v1.{}", Self::NAME) } } +/// ResponseResultType defines the possible outcomes of the execution of a message +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ResponseResultType { + /// Default zero value enumeration + Unspecified = 0, + /// The message did not call the IBC application callbacks (because, for example, the packet had already been relayed) + Noop = 1, + /// The message was executed successfully + Success = 2, + /// The message was executed unsuccessfully + Failure = 3, +} +impl ResponseResultType { + /// 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 { + ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", + ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", + ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + ResponseResultType::Failure => "RESPONSE_RESULT_TYPE_FAILURE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), + "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), + "RESPONSE_RESULT_TYPE_FAILURE" => Some(Self::Failure), + _ => None, + } + } +} /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/channel Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -3678,7 +3574,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -3696,7 +3592,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -3710,7 +3606,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -3743,12 +3639,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Channel queries an IBC Channel. - pub async fn channel( + /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + pub async fn channel_open_init( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3762,19 +3658,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/Channel", + "/ibc.core.channel.v1.Msg/ChannelOpenInit", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channel")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenInit")); self.inner.unary(req, path, codec).await } - /// Channels queries all the IBC channels of a chain. - pub async fn channels( + /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + pub async fn channel_open_try( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3788,20 +3684,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/Channels", + "/ibc.core.channel.v1.Msg/ChannelOpenTry", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Channels")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenTry")); self.inner.unary(req, path, codec).await } - /// ConnectionChannels queries all the channels associated with a connection - /// end. - pub async fn connection_channels( + /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + pub async fn channel_open_ack( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3815,22 +3710,47 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ConnectionChannels", + "/ibc.core.channel.v1.Msg/ChannelOpenAck", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenAck")); + self.inner.unary(req, path, codec).await + } + /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + pub async fn channel_open_confirm( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.channel.v1.Msg/ChannelOpenConfirm", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "ConnectionChannels"), + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelOpenConfirm"), ); self.inner.unary(req, path, codec).await } - /// ChannelClientState queries for the client state for the channel associated - /// with the provided channel identifiers. - pub async fn channel_client_state( + /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + pub async fn channel_close_init( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3844,22 +3764,48 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelClientState", + "/ibc.core.channel.v1.Msg/ChannelCloseInit", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelCloseInit")); + self.inner.unary(req, path, codec).await + } + /// ChannelCloseConfirm defines a rpc handler method for + /// MsgChannelCloseConfirm. + pub async fn channel_close_confirm( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.channel.v1.Msg/ChannelCloseConfirm", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelClientState"), + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelCloseConfirm"), ); self.inner.unary(req, path, codec).await } - /// ChannelConsensusState queries for the consensus state for the channel - /// associated with the provided channel identifiers. - pub async fn channel_consensus_state( + /// RecvPacket defines a rpc handler method for MsgRecvPacket. + pub async fn recv_packet( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3873,21 +3819,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelConsensusState", + "/ibc.core.channel.v1.Msg/RecvPacket", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelConsensusState"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "RecvPacket")); self.inner.unary(req, path, codec).await } - /// PacketCommitment queries a stored packet commitment hash. - pub async fn packet_commitment( + /// Timeout defines a rpc handler method for MsgTimeout. + pub async fn timeout( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3901,22 +3845,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketCommitment", + "/ibc.core.channel.v1.Msg/Timeout", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "PacketCommitment"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "Timeout")); self.inner.unary(req, path, codec).await } - /// PacketCommitments returns all the packet commitments hashes associated - /// with a channel. - pub async fn packet_commitments( + /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + pub async fn timeout_on_close( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3930,22 +3871,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketCommitments", + "/ibc.core.channel.v1.Msg/TimeoutOnClose", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "PacketCommitments"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "TimeoutOnClose")); self.inner.unary(req, path, codec).await } - /// PacketReceipt queries if a given packet sequence has been received on the - /// queried chain - pub async fn packet_receipt( + /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. + pub async fn acknowledgement( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3959,19 +3897,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketReceipt", + "/ibc.core.channel.v1.Msg/Acknowledgement", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "PacketReceipt")); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "Acknowledgement")); self.inner.unary(req, path, codec).await } - /// PacketAcknowledgement queries a stored packet acknowledgement hash. - pub async fn packet_acknowledgement( + /// ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + pub async fn channel_upgrade_init( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -3985,22 +3923,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgement", + "/ibc.core.channel.v1.Msg/ChannelUpgradeInit", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "PacketAcknowledgement"), + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeInit"), ); self.inner.unary(req, path, codec).await } - /// PacketAcknowledgements returns all the packet acknowledgements associated - /// with a channel. - pub async fn packet_acknowledgements( + /// ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + pub async fn channel_upgrade_try( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4014,25 +3951,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/PacketAcknowledgements", + "/ibc.core.channel.v1.Msg/ChannelUpgradeTry", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.core.channel.v1.Query", - "PacketAcknowledgements", - ), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeTry")); self.inner.unary(req, path, codec).await } - /// UnreceivedPackets returns all the unreceived IBC packets associated with a - /// channel and sequences. - pub async fn unreceived_packets( + /// ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + pub async fn channel_upgrade_ack( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4046,22 +3977,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UnreceivedPackets", + "/ibc.core.channel.v1.Msg/ChannelUpgradeAck", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "UnreceivedPackets"), - ); + .insert(GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeAck")); self.inner.unary(req, path, codec).await } - /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated - /// with a channel and sequences. - pub async fn unreceived_acks( + /// ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + pub async fn channel_upgrade_confirm( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4075,19 +4003,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UnreceivedAcks", + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "UnreceivedAcks")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeConfirm"), + ); self.inner.unary(req, path, codec).await } - /// NextSequenceReceive returns the next receive sequence for a given channel. - pub async fn next_sequence_receive( + /// ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + pub async fn channel_upgrade_open( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4101,21 +4031,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/NextSequenceReceive", + "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "NextSequenceReceive"), + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeOpen"), ); self.inner.unary(req, path, codec).await } - /// NextSequenceSend returns the next send sequence for a given channel. - pub async fn next_sequence_send( + /// ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + pub async fn channel_upgrade_timeout( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4129,21 +4059,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/NextSequenceSend", + "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.channel.v1.Query", "NextSequenceSend"), + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeTimeout"), ); self.inner.unary(req, path, codec).await } - /// UpgradeError returns the error receipt if the upgrade handshake failed. - pub async fn upgrade_error( + /// ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + pub async fn channel_upgrade_cancel( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4157,19 +4087,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/UpgradeError", + "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "UpgradeError")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelUpgradeCancel"), + ); self.inner.unary(req, path, codec).await } - /// Upgrade returns the upgrade for a given port and channel id. - pub async fn upgrade( + /// UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + pub async fn update_channel_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4183,19 +4115,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/Upgrade", + "/ibc.core.channel.v1.Msg/UpdateChannelParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Upgrade")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "UpdateChannelParams"), + ); self.inner.unary(req, path, codec).await } - /// ChannelParams queries all parameters of the ibc channel submodule. - pub async fn channel_params( + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + pub async fn prune_acknowledgements( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -4209,171 +4143,182 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.channel.v1.Query/ChannelParams", + "/ibc.core.channel.v1.Msg/PruneAcknowledgements", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelParams")); + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "PruneAcknowledgements"), + ); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Channel queries an IBC Channel. - async fn channel( + pub trait Msg: Send + Sync + 'static { + /// ChannelOpenInit defines a rpc handler method for MsgChannelOpenInit. + async fn channel_open_init( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Channels queries all the IBC channels of a chain. - async fn channels( + /// ChannelOpenTry defines a rpc handler method for MsgChannelOpenTry. + async fn channel_open_try( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionChannels queries all the channels associated with a connection - /// end. - async fn connection_channels( + /// ChannelOpenAck defines a rpc handler method for MsgChannelOpenAck. + async fn channel_open_ack( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelClientState queries for the client state for the channel associated - /// with the provided channel identifiers. - async fn channel_client_state( + /// ChannelOpenConfirm defines a rpc handler method for MsgChannelOpenConfirm. + async fn channel_open_confirm( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelConsensusState queries for the consensus state for the channel - /// associated with the provided channel identifiers. - async fn channel_consensus_state( + /// ChannelCloseInit defines a rpc handler method for MsgChannelCloseInit. + async fn channel_close_init( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PacketCommitment queries a stored packet commitment hash. - async fn packet_commitment( + /// ChannelCloseConfirm defines a rpc handler method for + /// MsgChannelCloseConfirm. + async fn channel_close_confirm( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PacketCommitments returns all the packet commitments hashes associated - /// with a channel. - async fn packet_commitments( + /// RecvPacket defines a rpc handler method for MsgRecvPacket. + async fn recv_packet( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// Timeout defines a rpc handler method for MsgTimeout. + async fn timeout( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// TimeoutOnClose defines a rpc handler method for MsgTimeoutOnClose. + async fn timeout_on_close( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; - /// PacketReceipt queries if a given packet sequence has been received on the - /// queried chain - async fn packet_receipt( + /// Acknowledgement defines a rpc handler method for MsgAcknowledgement. + async fn acknowledgement( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PacketAcknowledgement queries a stored packet acknowledgement hash. - async fn packet_acknowledgement( + /// ChannelUpgradeInit defines a rpc handler method for MsgChannelUpgradeInit. + async fn channel_upgrade_init( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// PacketAcknowledgements returns all the packet acknowledgements associated - /// with a channel. - async fn packet_acknowledgements( + /// ChannelUpgradeTry defines a rpc handler method for MsgChannelUpgradeTry. + async fn channel_upgrade_try( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UnreceivedPackets returns all the unreceived IBC packets associated with a - /// channel and sequences. - async fn unreceived_packets( + /// ChannelUpgradeAck defines a rpc handler method for MsgChannelUpgradeAck. + async fn channel_upgrade_ack( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UnreceivedAcks returns all the unreceived IBC acknowledgements associated - /// with a channel and sequences. - async fn unreceived_acks( + /// ChannelUpgradeConfirm defines a rpc handler method for MsgChannelUpgradeConfirm. + async fn channel_upgrade_confirm( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// NextSequenceReceive returns the next receive sequence for a given channel. - async fn next_sequence_receive( + /// ChannelUpgradeOpen defines a rpc handler method for MsgChannelUpgradeOpen. + async fn channel_upgrade_open( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// NextSequenceSend returns the next send sequence for a given channel. - async fn next_sequence_send( + /// ChannelUpgradeTimeout defines a rpc handler method for MsgChannelUpgradeTimeout. + async fn channel_upgrade_timeout( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpgradeError returns the error receipt if the upgrade handshake failed. - async fn upgrade_error( + /// ChannelUpgradeCancel defines a rpc handler method for MsgChannelUpgradeCancel. + async fn channel_upgrade_cancel( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Upgrade returns the upgrade for a given port and channel id. - async fn upgrade( + /// UpdateChannelParams defines a rpc handler method for MsgUpdateParams. + async fn update_channel_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ChannelParams queries all parameters of the ibc channel submodule. - async fn channel_params( + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + async fn prune_acknowledgements( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/channel Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -4381,7 +4326,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -4433,9 +4378,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -4451,25 +4396,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.core.channel.v1.Query/Channel" => { + "/ibc.core.channel.v1.Msg/ChannelOpenInit" => { #[allow(non_camel_case_types)] - struct ChannelSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ChannelSvc { - type Response = super::QueryChannelResponse; + struct ChannelOpenInitSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelOpenInitSvc { + type Response = super::MsgChannelOpenInitResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel(&inner, request).await + ::channel_open_init(&inner, request).await }; Box::pin(fut) } @@ -4481,7 +4424,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelSvc(inner); + let method = ChannelOpenInitSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4497,25 +4440,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/Channels" => { + "/ibc.core.channel.v1.Msg/ChannelOpenTry" => { #[allow(non_camel_case_types)] - struct ChannelsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ChannelsSvc { - type Response = super::QueryChannelsResponse; + struct ChannelOpenTrySvc(pub Arc); + impl tonic::server::UnaryService + for ChannelOpenTrySvc { + type Response = super::MsgChannelOpenTryResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channels(&inner, request).await + ::channel_open_try(&inner, request).await }; Box::pin(fut) } @@ -4527,7 +4468,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelsSvc(inner); + let method = ChannelOpenTrySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4543,27 +4484,69 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/ConnectionChannels" => { + "/ibc.core.channel.v1.Msg/ChannelOpenAck" => { #[allow(non_camel_case_types)] - struct ConnectionChannelsSvc(pub Arc); + struct ChannelOpenAckSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelOpenAckSvc { + type Response = super::MsgChannelOpenAckResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::channel_open_ack(&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 = ChannelOpenAckSvc(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.core.channel.v1.Msg/ChannelOpenConfirm" => { + #[allow(non_camel_case_types)] + struct ChannelOpenConfirmSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for ConnectionChannelsSvc { - type Response = super::QueryConnectionChannelsResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelOpenConfirmSvc { + type Response = super::MsgChannelOpenConfirmResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryConnectionChannelsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_channels(&inner, request).await + ::channel_open_confirm(&inner, request).await }; Box::pin(fut) } @@ -4575,7 +4558,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionChannelsSvc(inner); + let method = ChannelOpenConfirmSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4591,27 +4574,69 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/ChannelClientState" => { + "/ibc.core.channel.v1.Msg/ChannelCloseInit" => { #[allow(non_camel_case_types)] - struct ChannelClientStateSvc(pub Arc); + struct ChannelCloseInitSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelCloseInitSvc { + type Response = super::MsgChannelCloseInitResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::channel_close_init(&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 = ChannelCloseInitSvc(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.core.channel.v1.Msg/ChannelCloseConfirm" => { + #[allow(non_camel_case_types)] + struct ChannelCloseConfirmSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for ChannelClientStateSvc { - type Response = super::QueryChannelClientStateResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelCloseConfirmSvc { + type Response = super::MsgChannelCloseConfirmResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryChannelClientStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_client_state(&inner, request).await + ::channel_close_confirm(&inner, request).await }; Box::pin(fut) } @@ -4623,7 +4648,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelClientStateSvc(inner); + let method = ChannelCloseConfirmSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4639,28 +4664,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/ChannelConsensusState" => { + "/ibc.core.channel.v1.Msg/RecvPacket" => { #[allow(non_camel_case_types)] - struct ChannelConsensusStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryChannelConsensusStateRequest, - > for ChannelConsensusStateSvc { - type Response = super::QueryChannelConsensusStateResponse; + struct RecvPacketSvc(pub Arc); + impl tonic::server::UnaryService + for RecvPacketSvc { + type Response = super::MsgRecvPacketResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryChannelConsensusStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_consensus_state(&inner, request).await + ::recv_packet(&inner, request).await }; Box::pin(fut) } @@ -4672,7 +4692,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelConsensusStateSvc(inner); + let method = RecvPacketSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4688,25 +4708,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/PacketCommitment" => { + "/ibc.core.channel.v1.Msg/Timeout" => { #[allow(non_camel_case_types)] - struct PacketCommitmentSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for PacketCommitmentSvc { - type Response = super::QueryPacketCommitmentResponse; + struct TimeoutSvc(pub Arc); + impl tonic::server::UnaryService + for TimeoutSvc { + type Response = super::MsgTimeoutResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::packet_commitment(&inner, request).await + ::timeout(&inner, request).await }; Box::pin(fut) } @@ -4718,7 +4736,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PacketCommitmentSvc(inner); + let method = TimeoutSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4734,25 +4752,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/PacketCommitments" => { + "/ibc.core.channel.v1.Msg/TimeoutOnClose" => { #[allow(non_camel_case_types)] - struct PacketCommitmentsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for PacketCommitmentsSvc { - type Response = super::QueryPacketCommitmentsResponse; + struct TimeoutOnCloseSvc(pub Arc); + impl tonic::server::UnaryService + for TimeoutOnCloseSvc { + type Response = super::MsgTimeoutOnCloseResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::packet_commitments(&inner, request).await + ::timeout_on_close(&inner, request).await }; Box::pin(fut) } @@ -4764,7 +4780,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PacketCommitmentsSvc(inner); + let method = TimeoutOnCloseSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4780,25 +4796,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/PacketReceipt" => { + "/ibc.core.channel.v1.Msg/Acknowledgement" => { #[allow(non_camel_case_types)] - struct PacketReceiptSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for PacketReceiptSvc { - type Response = super::QueryPacketReceiptResponse; + struct AcknowledgementSvc(pub Arc); + impl tonic::server::UnaryService + for AcknowledgementSvc { + type Response = super::MsgAcknowledgementResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::packet_receipt(&inner, request).await + ::acknowledgement(&inner, request).await }; Box::pin(fut) } @@ -4810,7 +4824,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PacketReceiptSvc(inner); + let method = AcknowledgementSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4826,28 +4840,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/PacketAcknowledgement" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeInit" => { #[allow(non_camel_case_types)] - struct PacketAcknowledgementSvc(pub Arc); + struct ChannelUpgradeInitSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService< - super::QueryPacketAcknowledgementRequest, - > for PacketAcknowledgementSvc { - type Response = super::QueryPacketAcknowledgementResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelUpgradeInitSvc { + type Response = super::MsgChannelUpgradeInitResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryPacketAcknowledgementRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::packet_acknowledgement(&inner, request).await + ::channel_upgrade_init(&inner, request).await }; Box::pin(fut) } @@ -4859,7 +4870,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PacketAcknowledgementSvc(inner); + let method = ChannelUpgradeInitSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4875,28 +4886,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/PacketAcknowledgements" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeTry" => { #[allow(non_camel_case_types)] - struct PacketAcknowledgementsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryPacketAcknowledgementsRequest, - > for PacketAcknowledgementsSvc { - type Response = super::QueryPacketAcknowledgementsResponse; + struct ChannelUpgradeTrySvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeTrySvc { + type Response = super::MsgChannelUpgradeTryResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryPacketAcknowledgementsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::packet_acknowledgements(&inner, request).await + ::channel_upgrade_try(&inner, request).await }; Box::pin(fut) } @@ -4908,7 +4914,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = PacketAcknowledgementsSvc(inner); + let method = ChannelUpgradeTrySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4924,25 +4930,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/UnreceivedPackets" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeAck" => { #[allow(non_camel_case_types)] - struct UnreceivedPacketsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for UnreceivedPacketsSvc { - type Response = super::QueryUnreceivedPacketsResponse; + struct ChannelUpgradeAckSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeAckSvc { + type Response = super::MsgChannelUpgradeAckResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::unreceived_packets(&inner, request).await + ::channel_upgrade_ack(&inner, request).await }; Box::pin(fut) } @@ -4954,7 +4958,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UnreceivedPacketsSvc(inner); + let method = ChannelUpgradeAckSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -4970,25 +4974,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/UnreceivedAcks" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm" => { #[allow(non_camel_case_types)] - struct UnreceivedAcksSvc(pub Arc); + struct ChannelUpgradeConfirmSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for UnreceivedAcksSvc { - type Response = super::QueryUnreceivedAcksResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelUpgradeConfirmSvc { + type Response = super::MsgChannelUpgradeConfirmResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::unreceived_acks(&inner, request).await + ::channel_upgrade_confirm(&inner, request).await }; Box::pin(fut) } @@ -5000,7 +5004,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UnreceivedAcksSvc(inner); + let method = ChannelUpgradeConfirmSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5016,27 +5020,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/NextSequenceReceive" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen" => { #[allow(non_camel_case_types)] - struct NextSequenceReceiveSvc(pub Arc); + struct ChannelUpgradeOpenSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for NextSequenceReceiveSvc { - type Response = super::QueryNextSequenceReceiveResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelUpgradeOpenSvc { + type Response = super::MsgChannelUpgradeOpenResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryNextSequenceReceiveRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::next_sequence_receive(&inner, request).await + ::channel_upgrade_open(&inner, request).await }; Box::pin(fut) } @@ -5048,7 +5050,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = NextSequenceReceiveSvc(inner); + let method = ChannelUpgradeOpenSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5064,25 +5066,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/NextSequenceSend" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout" => { #[allow(non_camel_case_types)] - struct NextSequenceSendSvc(pub Arc); + struct ChannelUpgradeTimeoutSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for NextSequenceSendSvc { - type Response = super::QueryNextSequenceSendResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelUpgradeTimeoutSvc { + type Response = super::MsgChannelUpgradeTimeoutResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::next_sequence_send(&inner, request).await + ::channel_upgrade_timeout(&inner, request).await }; Box::pin(fut) } @@ -5094,7 +5096,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = NextSequenceSendSvc(inner); + let method = ChannelUpgradeTimeoutSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5110,25 +5112,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/UpgradeError" => { + "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel" => { #[allow(non_camel_case_types)] - struct UpgradeErrorSvc(pub Arc); + struct ChannelUpgradeCancelSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for UpgradeErrorSvc { - type Response = super::QueryUpgradeErrorResponse; + T: Msg, + > tonic::server::UnaryService + for ChannelUpgradeCancelSvc { + type Response = super::MsgChannelUpgradeCancelResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::upgrade_error(&inner, request).await + ::channel_upgrade_cancel(&inner, request).await }; Box::pin(fut) } @@ -5140,7 +5142,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpgradeErrorSvc(inner); + let method = ChannelUpgradeCancelSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5156,25 +5158,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/Upgrade" => { + "/ibc.core.channel.v1.Msg/UpdateChannelParams" => { #[allow(non_camel_case_types)] - struct UpgradeSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for UpgradeSvc { - type Response = super::QueryUpgradeResponse; + struct UpdateChannelParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateChannelParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::upgrade(&inner, request).await + ::update_channel_params(&inner, request).await }; Box::pin(fut) } @@ -5186,7 +5186,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpgradeSvc(inner); + let method = UpdateChannelParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5202,25 +5202,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.channel.v1.Query/ChannelParams" => { + "/ibc.core.channel.v1.Msg/PruneAcknowledgements" => { #[allow(non_camel_case_types)] - struct ChannelParamsSvc(pub Arc); + struct PruneAcknowledgementsSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for ChannelParamsSvc { - type Response = super::QueryChannelParamsResponse; + T: Msg, + > tonic::server::UnaryService + for PruneAcknowledgementsSvc { + type Response = super::MsgPruneAcknowledgementsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::channel_params(&inner, request).await + ::prune_acknowledgements(&inner, request).await }; Box::pin(fut) } @@ -5232,7 +5232,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ChannelParamsSvc(inner); + let method = PruneAcknowledgementsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -5263,7 +5263,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -5275,7 +5275,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -5285,7 +5285,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.core.channel.v1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.core.channel.v1.Msg"; } } diff --git a/src/prost/ibc.core.client.v1.rs b/src/prost/ibc.core.client.v1.rs index fc33ec80..25d097ed 100644 --- a/src/prost/ibc.core.client.v1.rs +++ b/src/prost/ibc.core.client.v1.rs @@ -238,263 +238,335 @@ impl ::prost::Name for IdentifiedGenesisMetadata { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgCreateClient defines a message to create an IBC client +/// QueryClientStateRequest is the request type for the Query/ClientState RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClient { - /// light client state +pub struct QueryClientStateRequest { + /// client state unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryClientStateRequest { + const NAME: &'static str = "QueryClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} +/// QueryClientStateResponse is the response type for the Query/ClientState RPC +/// method. Besides the client state, 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 QueryClientStateResponse { + /// client state associated with the request identifier #[prost(message, optional, tag = "1")] pub client_state: ::core::option::Option< super::super::super::super::google::protobuf::Any, >, - /// consensus state associated with the client that corresponds to a given - /// height. - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, + /// 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, +} +impl ::prost::Name for QueryClientStateResponse { + const NAME: &'static str = "QueryClientStateResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} +/// QueryClientStatesRequest is the request type for the Query/ClientStates RPC +/// method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClientStatesRequest { + /// pagination request + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgCreateClient { - const NAME: &'static str = "MsgCreateClient"; +impl ::prost::Name for QueryClientStatesRequest { + const NAME: &'static str = "QueryClientStatesRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgCreateClientResponse defines the Msg/CreateClient response type. +/// QueryClientStatesResponse is the response type for the Query/ClientStates RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateClientResponse {} -impl ::prost::Name for MsgCreateClientResponse { - const NAME: &'static str = "MsgCreateClientResponse"; +pub struct QueryClientStatesResponse { + /// list of stored ClientStates of the chain. + #[prost(message, repeated, tag = "1")] + pub client_states: ::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, + >, +} +impl ::prost::Name for QueryClientStatesResponse { + const NAME: &'static str = "QueryClientStatesResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given client message. +/// QueryConsensusStateRequest is the request type for the Query/ConsensusState +/// RPC method. Besides the consensus state, 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 MsgUpdateClient { - /// client unique identifier +pub struct QueryConsensusStateRequest { + /// client identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, - /// client message to update the light client - #[prost(message, optional, tag = "2")] - pub client_message: ::core::option::Option< - super::super::super::super::google::protobuf::Any, - >, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, + /// consensus state revision number + #[prost(uint64, tag = "2")] + pub revision_number: u64, + /// consensus state revision height + #[prost(uint64, tag = "3")] + pub revision_height: u64, + /// latest_height overrrides the height field and queries the latest stored + /// ConsensusState + #[prost(bool, tag = "4")] + pub latest_height: bool, } -impl ::prost::Name for MsgUpdateClient { - const NAME: &'static str = "MsgUpdateClient"; +impl ::prost::Name for QueryConsensusStateRequest { + const NAME: &'static str = "QueryConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. +/// QueryConsensusStateResponse is the response type for the Query/ConsensusState +/// RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateClientResponse {} -impl ::prost::Name for MsgUpdateClientResponse { - const NAME: &'static str = "MsgUpdateClientResponse"; +pub struct QueryConsensusStateResponse { + /// consensus state associated with the client identifier at the given height + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, + >, + /// 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, +} +impl ::prost::Name for QueryConsensusStateResponse { + const NAME: &'static str = "QueryConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client -/// state +/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates +/// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClient { - /// client unique identifier +pub struct QueryConsensusStatesRequest { + /// client identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, - /// upgraded client state + /// pagination request #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, - >, - /// upgraded consensus state, only contains enough information to serve as a - /// basis of trust in update logic - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, - /// proof that old chain committed to new client - #[prost(bytes = "vec", tag = "4")] - pub proof_upgrade_client: ::prost::alloc::vec::Vec, - /// proof that old chain committed to new consensus state - #[prost(bytes = "vec", tag = "5")] - pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, - /// signer address - #[prost(string, tag = "6")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgUpgradeClient { - const NAME: &'static str = "MsgUpgradeClient"; +impl ::prost::Name for QueryConsensusStatesRequest { + const NAME: &'static str = "QueryConsensusStatesRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. +/// QueryConsensusStatesResponse is the response type for the +/// Query/ConsensusStates RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpgradeClientResponse {} -impl ::prost::Name for MsgUpgradeClientResponse { - const NAME: &'static str = "MsgUpgradeClientResponse"; +pub struct QueryConsensusStatesResponse { + /// consensus states associated with the identifier + #[prost(message, repeated, tag = "1")] + pub consensus_states: ::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, + >, +} +impl ::prost::Name for QueryConsensusStatesResponse { + const NAME: &'static str = "QueryConsensusStatesResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for -/// light client misbehaviour. -/// This message has been deprecated. Use MsgUpdateClient instead. +/// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights +/// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviour { - /// client unique identifier +pub struct QueryConsensusStateHeightsRequest { + /// client identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, - /// misbehaviour used for freezing the light client + /// pagination request #[prost(message, optional, tag = "2")] - pub misbehaviour: ::core::option::Option< - super::super::super::super::google::protobuf::Any, + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgSubmitMisbehaviour { - const NAME: &'static str = "MsgSubmitMisbehaviour"; +impl ::prost::Name for QueryConsensusStateHeightsRequest { + const NAME: &'static str = "QueryConsensusStateHeightsRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response -/// type. +/// QueryConsensusStateHeightsResponse is the response type for the +/// Query/ConsensusStateHeights RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitMisbehaviourResponse {} -impl ::prost::Name for MsgSubmitMisbehaviourResponse { - const NAME: &'static str = "MsgSubmitMisbehaviourResponse"; +pub struct QueryConsensusStateHeightsResponse { + /// consensus state heights + #[prost(message, repeated, tag = "1")] + pub consensus_state_heights: ::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, + >, +} +impl ::prost::Name for QueryConsensusStateHeightsResponse { + const NAME: &'static str = "QueryConsensusStateHeightsResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgRecoverClient defines the message used to recover a frozen or expired client. +/// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC +/// method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecoverClient { - /// the client identifier for the client to be updated if the proposal passes +pub struct QueryClientStatusRequest { + /// client unique identifier #[prost(string, tag = "1")] - pub subject_client_id: ::prost::alloc::string::String, - /// the substitute client identifier for the client which will replace the subject - /// client - #[prost(string, tag = "2")] - pub substitute_client_id: ::prost::alloc::string::String, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, + pub client_id: ::prost::alloc::string::String, } -impl ::prost::Name for MsgRecoverClient { - const NAME: &'static str = "MsgRecoverClient"; +impl ::prost::Name for QueryClientStatusRequest { + const NAME: &'static str = "QueryClientStatusRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgRecoverClientResponse defines the Msg/RecoverClient response type. +/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC +/// method. It returns the current status of the IBC client. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgRecoverClientResponse {} -impl ::prost::Name for MsgRecoverClientResponse { - const NAME: &'static str = "MsgRecoverClientResponse"; +pub struct QueryClientStatusResponse { + #[prost(string, tag = "1")] + pub status: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryClientStatusResponse { + const NAME: &'static str = "QueryClientStatusResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal +/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC +/// method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgIbcSoftwareUpgrade { +pub struct QueryClientParamsRequest {} +impl ::prost::Name for QueryClientParamsRequest { + const NAME: &'static str = "QueryClientParamsRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} +/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClientParamsResponse { + /// params defines the parameters of the module. #[prost(message, optional, tag = "1")] - pub plan: ::core::option::Option< - super::super::super::super::cosmos::upgrade::v1beta1::Plan, - >, - /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. - /// This will make the chain commit to the correct upgraded (self) client state - /// before the upgrade occurs, so that connecting chains can verify that the - /// new upgraded client is valid by verifying a proof on the previous version - /// of the chain. This will allow IBC connections to persist smoothly across - /// planned chain upgrades. Correspondingly, the UpgradedClientState field has been - /// deprecated in the Cosmos SDK to allow for this logic to exist solely in - /// the 02-client module. - #[prost(message, optional, tag = "2")] - pub upgraded_client_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, - >, - /// signer address - #[prost(string, tag = "3")] - pub signer: ::prost::alloc::string::String, + pub params: ::core::option::Option, } -impl ::prost::Name for MsgIbcSoftwareUpgrade { - const NAME: &'static str = "MsgIBCSoftwareUpgrade"; +impl ::prost::Name for QueryClientParamsResponse { + const NAME: &'static str = "QueryClientParamsResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. +/// QueryUpgradedClientStateRequest is the request type for the +/// Query/UpgradedClientState RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgIbcSoftwareUpgradeResponse {} -impl ::prost::Name for MsgIbcSoftwareUpgradeResponse { - const NAME: &'static str = "MsgIBCSoftwareUpgradeResponse"; +pub struct QueryUpgradedClientStateRequest {} +impl ::prost::Name for QueryUpgradedClientStateRequest { + const NAME: &'static str = "QueryUpgradedClientStateRequest"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpdateParams defines the sdk.Msg type to update the client parameters. +/// QueryUpgradedClientStateResponse is the response type for the +/// Query/UpgradedClientState RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the client parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, +pub struct QueryUpgradedClientStateResponse { + /// client state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_client_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, + >, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryUpgradedClientStateResponse { + const NAME: &'static str = "QueryUpgradedClientStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +/// QueryUpgradedConsensusStateRequest is the request type for the +/// Query/UpgradedConsensusState RPC method #[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"; +pub struct QueryUpgradedConsensusStateRequest {} +impl ::prost::Name for QueryUpgradedConsensusStateRequest { + const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + } +} +/// QueryUpgradedConsensusStateResponse is the response type for the +/// Query/UpgradedConsensusState RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradedConsensusStateResponse { + /// Consensus state associated with the request identifier + #[prost(message, optional, tag = "1")] + pub upgraded_consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, + >, +} +impl ::prost::Name for QueryUpgradedConsensusStateResponse { + const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) @@ -502,16 +574,16 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the ibc/client Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -522,7 +594,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -540,7 +612,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -554,7 +626,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -587,12 +659,65 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// CreateClient defines a rpc handler method for MsgCreateClient. - pub async fn create_client( + /// ClientState queries an IBC light client. + pub async fn client_state( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.client.v1.Query/ClientState", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientState")); + self.inner.unary(req, path, codec).await + } + /// ClientStates queries all the IBC light clients of a chain. + pub async fn client_states( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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.client.v1.Query/ClientStates", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStates")); + self.inner.unary(req, path, codec).await + } + /// ConsensusState queries a consensus state associated with a client state at + /// a given height. + pub async fn consensus_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -606,19 +731,20 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/CreateClient", + "/ibc.core.client.v1.Query/ConsensusState", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "CreateClient")); + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusState")); self.inner.unary(req, path, codec).await } - /// UpdateClient defines a rpc handler method for MsgUpdateClient. - pub async fn update_client( + /// ConsensusStates queries all the consensus state associated with a given + /// client. + pub async fn consensus_states( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -632,19 +758,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/UpdateClient", + "/ibc.core.client.v1.Query/ConsensusStates", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpdateClient")); + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusStates")); self.inner.unary(req, path, codec).await } - /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. - pub async fn upgrade_client( + /// ConsensusStateHeights queries the height of every consensus states associated with a given client. + pub async fn consensus_state_heights( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -658,19 +784,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/UpgradeClient", + "/ibc.core.client.v1.Query/ConsensusStateHeights", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpgradeClient")); + .insert( + GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusStateHeights"), + ); self.inner.unary(req, path, codec).await } - /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - pub async fn submit_misbehaviour( + /// Status queries the status of an IBC client. + pub async fn client_status( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -684,19 +812,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/SubmitMisbehaviour", + "/ibc.core.client.v1.Query/ClientStatus", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "SubmitMisbehaviour")); + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStatus")); self.inner.unary(req, path, codec).await } - /// RecoverClient defines a rpc handler method for MsgRecoverClient. - pub async fn recover_client( + /// ClientParams queries all parameters of the ibc client submodule. + pub async fn client_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -710,19 +838,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/RecoverClient", + "/ibc.core.client.v1.Query/ClientParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "RecoverClient")); + .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientParams")); self.inner.unary(req, path, codec).await } - /// IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. - pub async fn ibc_software_upgrade( + /// UpgradedClientState queries an Upgraded IBC light client. + pub async fn upgraded_client_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -736,19 +864,21 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade", + "/ibc.core.client.v1.Query/UpgradedClientState", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade")); + .insert( + GrpcMethod::new("ibc.core.client.v1.Query", "UpgradedClientState"), + ); self.inner.unary(req, path, codec).await } - /// UpdateClientParams defines a rpc handler method for MsgUpdateParams. - pub async fn update_client_params( + /// UpgradedConsensusState queries an Upgraded IBC consensus state. + pub async fn upgraded_consensus_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -762,83 +892,103 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Msg/UpdateClientParams", + "/ibc.core.client.v1.Query/UpgradedConsensusState", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpdateClientParams")); + .insert( + GrpcMethod::new("ibc.core.client.v1.Query", "UpgradedConsensusState"), + ); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// CreateClient defines a rpc handler method for MsgCreateClient. - async fn create_client( + pub trait Query: Send + Sync + 'static { + /// ClientState queries an IBC light client. + async fn client_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateClient defines a rpc handler method for MsgUpdateClient. - async fn update_client( + /// ClientStates queries all the IBC light clients of a chain. + async fn client_states( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. - async fn upgrade_client( + /// ConsensusState queries a consensus state associated with a client state at + /// a given height. + async fn consensus_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. - async fn submit_misbehaviour( + /// ConsensusStates queries all the consensus state associated with a given + /// client. + async fn consensus_states( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// RecoverClient defines a rpc handler method for MsgRecoverClient. - async fn recover_client( + /// ConsensusStateHeights queries the height of every consensus states associated with a given client. + async fn consensus_state_heights( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. - async fn ibc_software_upgrade( + /// Status queries the status of an IBC client. + async fn client_status( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateClientParams defines a rpc handler method for MsgUpdateParams. - async fn update_client_params( + /// ClientParams queries all parameters of the ibc client submodule. + async fn client_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// UpgradedClientState queries an Upgraded IBC light client. + async fn upgraded_client_state( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + /// UpgradedConsensusState queries an Upgraded IBC consensus state. + async fn upgraded_consensus_state( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the ibc/client Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -846,7 +996,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -898,9 +1048,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -916,23 +1066,117 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.core.client.v1.Msg/CreateClient" => { + "/ibc.core.client.v1.Query/ClientState" => { + #[allow(non_camel_case_types)] + struct ClientStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClientStateSvc { + type Response = super::QueryClientStateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::client_state(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClientStateSvc(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.core.client.v1.Query/ClientStates" => { + #[allow(non_camel_case_types)] + struct ClientStatesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClientStatesSvc { + type Response = super::QueryClientStatesResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::client_states(&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 = ClientStatesSvc(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.core.client.v1.Query/ConsensusState" => { #[allow(non_camel_case_types)] - struct CreateClientSvc(pub Arc); - impl tonic::server::UnaryService - for CreateClientSvc { - type Response = super::MsgCreateClientResponse; + struct ConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConsensusStateSvc { + type Response = super::QueryConsensusStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_client(&inner, request).await + ::consensus_state(&inner, request).await }; Box::pin(fut) } @@ -944,7 +1188,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = CreateClientSvc(inner); + let method = ConsensusStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -960,23 +1204,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/UpdateClient" => { + "/ibc.core.client.v1.Query/ConsensusStates" => { #[allow(non_camel_case_types)] - struct UpdateClientSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateClientSvc { - type Response = super::MsgUpdateClientResponse; + struct ConsensusStatesSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConsensusStatesSvc { + type Response = super::QueryConsensusStatesResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_client(&inner, request).await + ::consensus_states(&inner, request).await }; Box::pin(fut) } @@ -988,7 +1234,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateClientSvc(inner); + let method = ConsensusStatesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1004,23 +1250,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/UpgradeClient" => { + "/ibc.core.client.v1.Query/ConsensusStateHeights" => { #[allow(non_camel_case_types)] - struct UpgradeClientSvc(pub Arc); - impl tonic::server::UnaryService - for UpgradeClientSvc { - type Response = super::MsgUpgradeClientResponse; + struct ConsensusStateHeightsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryConsensusStateHeightsRequest, + > for ConsensusStateHeightsSvc { + type Response = super::QueryConsensusStateHeightsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryConsensusStateHeightsRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::upgrade_client(&inner, request).await + ::consensus_state_heights(&inner, request).await }; Box::pin(fut) } @@ -1032,7 +1283,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpgradeClientSvc(inner); + let method = ConsensusStateHeightsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1048,25 +1299,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/SubmitMisbehaviour" => { + "/ibc.core.client.v1.Query/ClientStatus" => { #[allow(non_camel_case_types)] - struct SubmitMisbehaviourSvc(pub Arc); + struct ClientStatusSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for SubmitMisbehaviourSvc { - type Response = super::MsgSubmitMisbehaviourResponse; + T: Query, + > tonic::server::UnaryService + for ClientStatusSvc { + type Response = super::QueryClientStatusResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::submit_misbehaviour(&inner, request).await + ::client_status(&inner, request).await }; Box::pin(fut) } @@ -1078,7 +1329,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = SubmitMisbehaviourSvc(inner); + let method = ClientStatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1094,23 +1345,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/RecoverClient" => { + "/ibc.core.client.v1.Query/ClientParams" => { #[allow(non_camel_case_types)] - struct RecoverClientSvc(pub Arc); - impl tonic::server::UnaryService - for RecoverClientSvc { - type Response = super::MsgRecoverClientResponse; + struct ClientParamsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClientParamsSvc { + type Response = super::QueryClientParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::recover_client(&inner, request).await + ::client_params(&inner, request).await }; Box::pin(fut) } @@ -1122,7 +1375,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = RecoverClientSvc(inner); + let method = ClientParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1138,25 +1391,27 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade" => { + "/ibc.core.client.v1.Query/UpgradedClientState" => { #[allow(non_camel_case_types)] - struct IBCSoftwareUpgradeSvc(pub Arc); + struct UpgradedClientStateSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for IBCSoftwareUpgradeSvc { - type Response = super::MsgIbcSoftwareUpgradeResponse; + T: Query, + > tonic::server::UnaryService + for UpgradedClientStateSvc { + type Response = super::QueryUpgradedClientStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryUpgradedClientStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::ibc_software_upgrade(&inner, request).await + ::upgraded_client_state(&inner, request).await }; Box::pin(fut) } @@ -1168,7 +1423,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = IBCSoftwareUpgradeSvc(inner); + let method = UpgradedClientStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1184,23 +1439,29 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Msg/UpdateClientParams" => { + "/ibc.core.client.v1.Query/UpgradedConsensusState" => { #[allow(non_camel_case_types)] - struct UpdateClientParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateClientParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct UpgradedConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryUpgradedConsensusStateRequest, + > for UpgradedConsensusStateSvc { + type Response = super::QueryUpgradedConsensusStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryUpgradedConsensusStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_client_params(&inner, request).await + ::upgraded_consensus_state(&inner, request) + .await }; Box::pin(fut) } @@ -1212,7 +1473,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateClientParamsSvc(inner); + let method = UpgradedConsensusStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1243,7 +1504,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1255,7 +1516,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1265,339 +1526,267 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "ibc.core.client.v1.Msg"; - } -} -/// QueryClientStateRequest is the request type for the Query/ClientState RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStateRequest { - /// client state unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryClientStateRequest { - const NAME: &'static str = "QueryClientStateRequest"; - const PACKAGE: &'static str = "ibc.core.client.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.core.client.v1.Query"; } } -/// QueryClientStateResponse is the response type for the Query/ClientState RPC -/// method. Besides the client state, it includes a proof and the height from -/// which the proof was retrieved. +/// MsgCreateClient defines a message to create an IBC client #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStateResponse { - /// client state associated with the request identifier +pub struct MsgCreateClient { + /// light client state #[prost(message, optional, tag = "1")] pub client_state: ::core::option::Option< super::super::super::super::google::protobuf::Any, >, - /// 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, -} -impl ::prost::Name for QueryClientStateResponse { - const NAME: &'static str = "QueryClientStateResponse"; - const PACKAGE: &'static str = "ibc.core.client.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) - } -} -/// QueryClientStatesRequest is the request type for the Query/ClientStates RPC -/// method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatesRequest { - /// pagination request - #[prost(message, optional, tag = "1")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryClientStatesRequest { - const NAME: &'static str = "QueryClientStatesRequest"; - const PACKAGE: &'static str = "ibc.core.client.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) - } -} -/// QueryClientStatesResponse is the response type for the Query/ClientStates RPC -/// method. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatesResponse { - /// list of stored ClientStates of the chain. - #[prost(message, repeated, tag = "1")] - pub client_states: ::prost::alloc::vec::Vec, - /// pagination response + /// consensus state associated with the client that corresponds to a given + /// height. #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + pub consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, >, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryClientStatesResponse { - const NAME: &'static str = "QueryClientStatesResponse"; +impl ::prost::Name for MsgCreateClient { + const NAME: &'static str = "MsgCreateClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStateRequest is the request type for the Query/ConsensusState -/// RPC method. Besides the consensus state, it includes a proof and the height -/// from which the proof was retrieved. +/// MsgCreateClientResponse defines the Msg/CreateClient response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateRequest { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// consensus state revision number - #[prost(uint64, tag = "2")] - pub revision_number: u64, - /// consensus state revision height - #[prost(uint64, tag = "3")] - pub revision_height: u64, - /// latest_height overrrides the height field and queries the latest stored - /// ConsensusState - #[prost(bool, tag = "4")] - pub latest_height: bool, -} -impl ::prost::Name for QueryConsensusStateRequest { - const NAME: &'static str = "QueryConsensusStateRequest"; +pub struct MsgCreateClientResponse {} +impl ::prost::Name for MsgCreateClientResponse { + const NAME: &'static str = "MsgCreateClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStateResponse is the response type for the Query/ConsensusState -/// RPC method +/// MsgUpdateClient defines an sdk.Msg to update a IBC client state using +/// the given client message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateResponse { - /// consensus state associated with the client identifier at the given height - #[prost(message, optional, tag = "1")] - pub consensus_state: ::core::option::Option< +pub struct MsgUpdateClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// client message to update the light client + #[prost(message, optional, tag = "2")] + pub client_message: ::core::option::Option< super::super::super::super::google::protobuf::Any, >, - /// 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, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConsensusStateResponse { - const NAME: &'static str = "QueryConsensusStateResponse"; +impl ::prost::Name for MsgUpdateClient { + const NAME: &'static str = "MsgUpdateClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStatesRequest is the request type for the Query/ConsensusStates -/// RPC method. +/// MsgUpdateClientResponse defines the Msg/UpdateClient response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStatesRequest { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryConsensusStatesRequest { - const NAME: &'static str = "QueryConsensusStatesRequest"; +pub struct MsgUpdateClientResponse {} +impl ::prost::Name for MsgUpdateClientResponse { + const NAME: &'static str = "MsgUpdateClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStatesResponse is the response type for the -/// Query/ConsensusStates RPC method +/// MsgUpgradeClient defines an sdk.Msg to upgrade an IBC client to a new client +/// state #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStatesResponse { - /// consensus states associated with the identifier - #[prost(message, repeated, tag = "1")] - pub consensus_states: ::prost::alloc::vec::Vec, - /// pagination response +pub struct MsgUpgradeClient { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// upgraded client state #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + pub client_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, + >, + /// upgraded consensus state, only contains enough information to serve as a + /// basis of trust in update logic + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, >, + /// proof that old chain committed to new client + #[prost(bytes = "vec", tag = "4")] + pub proof_upgrade_client: ::prost::alloc::vec::Vec, + /// proof that old chain committed to new consensus state + #[prost(bytes = "vec", tag = "5")] + pub proof_upgrade_consensus_state: ::prost::alloc::vec::Vec, + /// signer address + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConsensusStatesResponse { - const NAME: &'static str = "QueryConsensusStatesResponse"; +impl ::prost::Name for MsgUpgradeClient { + const NAME: &'static str = "MsgUpgradeClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights -/// RPC method. +/// MsgUpgradeClientResponse defines the Msg/UpgradeClient response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateHeightsRequest { - /// client identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - /// pagination request - #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageRequest, - >, -} -impl ::prost::Name for QueryConsensusStateHeightsRequest { - const NAME: &'static str = "QueryConsensusStateHeightsRequest"; +pub struct MsgUpgradeClientResponse {} +impl ::prost::Name for MsgUpgradeClientResponse { + const NAME: &'static str = "MsgUpgradeClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryConsensusStateHeightsResponse is the response type for the -/// Query/ConsensusStateHeights RPC method +/// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for +/// light client misbehaviour. +/// This message has been deprecated. Use MsgUpdateClient instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsensusStateHeightsResponse { - /// consensus state heights - #[prost(message, repeated, tag = "1")] - pub consensus_state_heights: ::prost::alloc::vec::Vec, - /// pagination response +pub struct MsgSubmitMisbehaviour { + /// client unique identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// misbehaviour used for freezing the light client #[prost(message, optional, tag = "2")] - pub pagination: ::core::option::Option< - super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + pub misbehaviour: ::core::option::Option< + super::super::super::super::google::protobuf::Any, >, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConsensusStateHeightsResponse { - const NAME: &'static str = "QueryConsensusStateHeightsResponse"; +impl ::prost::Name for MsgSubmitMisbehaviour { + const NAME: &'static str = "MsgSubmitMisbehaviour"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryClientStatusRequest is the request type for the Query/ClientStatus RPC -/// method +/// MsgSubmitMisbehaviourResponse defines the Msg/SubmitMisbehaviour response +/// type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatusRequest { - /// client unique identifier - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryClientStatusRequest { - const NAME: &'static str = "QueryClientStatusRequest"; +pub struct MsgSubmitMisbehaviourResponse {} +impl ::prost::Name for MsgSubmitMisbehaviourResponse { + const NAME: &'static str = "MsgSubmitMisbehaviourResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryClientStatusResponse is the response type for the Query/ClientStatus RPC -/// method. It returns the current status of the IBC client. +/// MsgRecoverClient defines the message used to recover a frozen or expired client. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientStatusResponse { +pub struct MsgRecoverClient { + /// the client identifier for the client to be updated if the proposal passes #[prost(string, tag = "1")] - pub status: ::prost::alloc::string::String, + pub subject_client_id: ::prost::alloc::string::String, + /// the substitute client identifier for the client which will replace the subject + /// client + #[prost(string, tag = "2")] + pub substitute_client_id: ::prost::alloc::string::String, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryClientStatusResponse { - const NAME: &'static str = "QueryClientStatusResponse"; +impl ::prost::Name for MsgRecoverClient { + const NAME: &'static str = "MsgRecoverClient"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryClientParamsRequest is the request type for the Query/ClientParams RPC -/// method. +/// MsgRecoverClientResponse defines the Msg/RecoverClient response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientParamsRequest {} -impl ::prost::Name for QueryClientParamsRequest { - const NAME: &'static str = "QueryClientParamsRequest"; +pub struct MsgRecoverClientResponse {} +impl ::prost::Name for MsgRecoverClientResponse { + const NAME: &'static str = "MsgRecoverClientResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryClientParamsResponse is the response type for the Query/ClientParams RPC -/// method. +/// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryClientParamsResponse { - /// params defines the parameters of the module. +pub struct MsgIbcSoftwareUpgrade { #[prost(message, optional, tag = "1")] - pub params: ::core::option::Option, + pub plan: ::core::option::Option< + super::super::super::super::cosmos::upgrade::v1beta1::Plan, + >, + /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. + /// This will make the chain commit to the correct upgraded (self) client state + /// before the upgrade occurs, so that connecting chains can verify that the + /// new upgraded client is valid by verifying a proof on the previous version + /// of the chain. This will allow IBC connections to persist smoothly across + /// planned chain upgrades. Correspondingly, the UpgradedClientState field has been + /// deprecated in the Cosmos SDK to allow for this logic to exist solely in + /// the 02-client module. + #[prost(message, optional, tag = "2")] + pub upgraded_client_state: ::core::option::Option< + super::super::super::super::google::protobuf::Any, + >, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryClientParamsResponse { - const NAME: &'static str = "QueryClientParamsResponse"; +impl ::prost::Name for MsgIbcSoftwareUpgrade { + const NAME: &'static str = "MsgIBCSoftwareUpgrade"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryUpgradedClientStateRequest is the request type for the -/// Query/UpgradedClientState RPC method +/// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedClientStateRequest {} -impl ::prost::Name for QueryUpgradedClientStateRequest { - const NAME: &'static str = "QueryUpgradedClientStateRequest"; +pub struct MsgIbcSoftwareUpgradeResponse {} +impl ::prost::Name for MsgIbcSoftwareUpgradeResponse { + const NAME: &'static str = "MsgIBCSoftwareUpgradeResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryUpgradedClientStateResponse is the response type for the -/// Query/UpgradedClientState RPC method. +/// MsgUpdateParams defines the sdk.Msg type to update the client parameters. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedClientStateResponse { - /// client state associated with the request identifier - #[prost(message, optional, tag = "1")] - pub upgraded_client_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, - >, -} -impl ::prost::Name for QueryUpgradedClientStateResponse { - const NAME: &'static str = "QueryUpgradedClientStateResponse"; - const PACKAGE: &'static str = "ibc.core.client.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) - } +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the client parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, } -/// QueryUpgradedConsensusStateRequest is the request type for the -/// Query/UpgradedConsensusState RPC method -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateRequest {} -impl ::prost::Name for QueryUpgradedConsensusStateRequest { - const NAME: &'static str = "QueryUpgradedConsensusStateRequest"; +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) } } -/// QueryUpgradedConsensusStateResponse is the response type for the -/// Query/UpgradedConsensusState RPC method. +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryUpgradedConsensusStateResponse { - /// Consensus state associated with the request identifier - #[prost(message, optional, tag = "1")] - pub upgraded_consensus_state: ::core::option::Option< - super::super::super::super::google::protobuf::Any, - >, -} -impl ::prost::Name for QueryUpgradedConsensusStateResponse { - const NAME: &'static str = "QueryUpgradedConsensusStateResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "ibc.core.client.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.client.v1.{}", Self::NAME) @@ -1605,16 +1794,16 @@ impl ::prost::Name for QueryUpgradedConsensusStateResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/client Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1625,7 +1814,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1643,7 +1832,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1657,7 +1846,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1690,65 +1879,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ClientState queries an IBC light client. - pub async fn client_state( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.client.v1.Query/ClientState", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientState")); - self.inner.unary(req, path, codec).await - } - /// ClientStates queries all the IBC light clients of a chain. - pub async fn client_states( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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.client.v1.Query/ClientStates", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStates")); - self.inner.unary(req, path, codec).await - } - /// ConsensusState queries a consensus state associated with a client state at - /// a given height. - pub async fn consensus_state( + /// CreateClient defines a rpc handler method for MsgCreateClient. + pub async fn create_client( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1762,20 +1898,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/ConsensusState", + "/ibc.core.client.v1.Msg/CreateClient", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusState")); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "CreateClient")); self.inner.unary(req, path, codec).await } - /// ConsensusStates queries all the consensus state associated with a given - /// client. - pub async fn consensus_states( + /// UpdateClient defines a rpc handler method for MsgUpdateClient. + pub async fn update_client( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1789,19 +1924,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/ConsensusStates", + "/ibc.core.client.v1.Msg/UpdateClient", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusStates")); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpdateClient")); self.inner.unary(req, path, codec).await } - /// ConsensusStateHeights queries the height of every consensus states associated with a given client. - pub async fn consensus_state_heights( + /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. + pub async fn upgrade_client( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1815,21 +1950,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/ConsensusStateHeights", + "/ibc.core.client.v1.Msg/UpgradeClient", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusStateHeights"), - ); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpgradeClient")); self.inner.unary(req, path, codec).await } - /// Status queries the status of an IBC client. - pub async fn client_status( + /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + pub async fn submit_misbehaviour( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1843,19 +1976,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/ClientStatus", + "/ibc.core.client.v1.Msg/SubmitMisbehaviour", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientStatus")); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "SubmitMisbehaviour")); self.inner.unary(req, path, codec).await } - /// ClientParams queries all parameters of the ibc client submodule. - pub async fn client_params( + /// RecoverClient defines a rpc handler method for MsgRecoverClient. + pub async fn recover_client( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1869,19 +2002,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/ClientParams", + "/ibc.core.client.v1.Msg/RecoverClient", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ClientParams")); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "RecoverClient")); self.inner.unary(req, path, codec).await } - /// UpgradedClientState queries an Upgraded IBC light client. - pub async fn upgraded_client_state( + /// IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. + pub async fn ibc_software_upgrade( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1895,21 +2028,19 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/UpgradedClientState", + "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.client.v1.Query", "UpgradedClientState"), - ); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "IBCSoftwareUpgrade")); self.inner.unary(req, path, codec).await } - /// UpgradedConsensusState queries an Upgraded IBC consensus state. - pub async fn upgraded_consensus_state( + /// UpdateClientParams defines a rpc handler method for MsgUpdateParams. + pub async fn update_client_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1923,103 +2054,83 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.client.v1.Query/UpgradedConsensusState", + "/ibc.core.client.v1.Msg/UpdateClientParams", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.client.v1.Query", "UpgradedConsensusState"), - ); + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "UpdateClientParams")); self.inner.unary(req, path, codec).await } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// ClientState queries an IBC light client. - async fn client_state( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ClientStates queries all the IBC light clients of a chain. - async fn client_states( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// ConsensusState queries a consensus state associated with a client state at - /// a given height. - async fn consensus_state( + pub trait Msg: Send + Sync + 'static { + /// CreateClient defines a rpc handler method for MsgCreateClient. + async fn create_client( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConsensusStates queries all the consensus state associated with a given - /// client. - async fn consensus_states( + /// UpdateClient defines a rpc handler method for MsgUpdateClient. + async fn update_client( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConsensusStateHeights queries the height of every consensus states associated with a given client. - async fn consensus_state_heights( + /// UpgradeClient defines a rpc handler method for MsgUpgradeClient. + async fn upgrade_client( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// Status queries the status of an IBC client. - async fn client_status( + /// SubmitMisbehaviour defines a rpc handler method for MsgSubmitMisbehaviour. + async fn submit_misbehaviour( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ClientParams queries all parameters of the ibc client submodule. - async fn client_params( + /// RecoverClient defines a rpc handler method for MsgRecoverClient. + async fn recover_client( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpgradedClientState queries an Upgraded IBC light client. - async fn upgraded_client_state( + /// IBCSoftwareUpgrade defines a rpc handler method for MsgIBCSoftwareUpgrade. + async fn ibc_software_upgrade( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpgradedConsensusState queries an Upgraded IBC consensus state. - async fn upgraded_consensus_state( + /// UpdateClientParams defines a rpc handler method for MsgUpdateParams. + async fn update_client_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/client Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -2027,7 +2138,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -2079,9 +2190,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -2097,117 +2208,23 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.core.client.v1.Query/ClientState" => { - #[allow(non_camel_case_types)] - struct ClientStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClientStateSvc { - type Response = super::QueryClientStateResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::client_state(&inner, request).await - }; - Box::pin(fut) - } - } - let accept_compression_encodings = self.accept_compression_encodings; - let send_compression_encodings = self.send_compression_encodings; - let max_decoding_message_size = self.max_decoding_message_size; - let max_encoding_message_size = self.max_encoding_message_size; - let inner = self.inner.clone(); - let fut = async move { - let inner = inner.0; - let method = ClientStateSvc(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.core.client.v1.Query/ClientStates" => { - #[allow(non_camel_case_types)] - struct ClientStatesSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClientStatesSvc { - type Response = super::QueryClientStatesResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::client_states(&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 = ClientStatesSvc(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.core.client.v1.Query/ConsensusState" => { + "/ibc.core.client.v1.Msg/CreateClient" => { #[allow(non_camel_case_types)] - struct ConsensusStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ConsensusStateSvc { - type Response = super::QueryConsensusStateResponse; + struct CreateClientSvc(pub Arc); + impl tonic::server::UnaryService + for CreateClientSvc { + type Response = super::MsgCreateClientResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::consensus_state(&inner, request).await + ::create_client(&inner, request).await }; Box::pin(fut) } @@ -2219,7 +2236,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConsensusStateSvc(inner); + let method = CreateClientSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2235,25 +2252,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/ConsensusStates" => { + "/ibc.core.client.v1.Msg/UpdateClient" => { #[allow(non_camel_case_types)] - struct ConsensusStatesSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ConsensusStatesSvc { - type Response = super::QueryConsensusStatesResponse; + struct UpdateClientSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateClientSvc { + type Response = super::MsgUpdateClientResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::consensus_states(&inner, request).await + ::update_client(&inner, request).await }; Box::pin(fut) } @@ -2265,7 +2280,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConsensusStatesSvc(inner); + let method = UpdateClientSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2281,28 +2296,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/ConsensusStateHeights" => { + "/ibc.core.client.v1.Msg/UpgradeClient" => { #[allow(non_camel_case_types)] - struct ConsensusStateHeightsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryConsensusStateHeightsRequest, - > for ConsensusStateHeightsSvc { - type Response = super::QueryConsensusStateHeightsResponse; + struct UpgradeClientSvc(pub Arc); + impl tonic::server::UnaryService + for UpgradeClientSvc { + type Response = super::MsgUpgradeClientResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryConsensusStateHeightsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::consensus_state_heights(&inner, request).await + ::upgrade_client(&inner, request).await }; Box::pin(fut) } @@ -2314,7 +2324,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConsensusStateHeightsSvc(inner); + let method = UpgradeClientSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2330,25 +2340,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/ClientStatus" => { + "/ibc.core.client.v1.Msg/SubmitMisbehaviour" => { #[allow(non_camel_case_types)] - struct ClientStatusSvc(pub Arc); + struct SubmitMisbehaviourSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for ClientStatusSvc { - type Response = super::QueryClientStatusResponse; + T: Msg, + > tonic::server::UnaryService + for SubmitMisbehaviourSvc { + type Response = super::MsgSubmitMisbehaviourResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::client_status(&inner, request).await + ::submit_misbehaviour(&inner, request).await }; Box::pin(fut) } @@ -2360,7 +2370,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ClientStatusSvc(inner); + let method = SubmitMisbehaviourSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2376,25 +2386,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/ClientParams" => { + "/ibc.core.client.v1.Msg/RecoverClient" => { #[allow(non_camel_case_types)] - struct ClientParamsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClientParamsSvc { - type Response = super::QueryClientParamsResponse; + struct RecoverClientSvc(pub Arc); + impl tonic::server::UnaryService + for RecoverClientSvc { + type Response = super::MsgRecoverClientResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::client_params(&inner, request).await + ::recover_client(&inner, request).await }; Box::pin(fut) } @@ -2406,7 +2414,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ClientParamsSvc(inner); + let method = RecoverClientSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2422,27 +2430,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/UpgradedClientState" => { + "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade" => { #[allow(non_camel_case_types)] - struct UpgradedClientStateSvc(pub Arc); + struct IBCSoftwareUpgradeSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for UpgradedClientStateSvc { - type Response = super::QueryUpgradedClientStateResponse; + T: Msg, + > tonic::server::UnaryService + for IBCSoftwareUpgradeSvc { + type Response = super::MsgIbcSoftwareUpgradeResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryUpgradedClientStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::upgraded_client_state(&inner, request).await + ::ibc_software_upgrade(&inner, request).await }; Box::pin(fut) } @@ -2454,7 +2460,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpgradedClientStateSvc(inner); + let method = IBCSoftwareUpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2470,29 +2476,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.client.v1.Query/UpgradedConsensusState" => { + "/ibc.core.client.v1.Msg/UpdateClientParams" => { #[allow(non_camel_case_types)] - struct UpgradedConsensusStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryUpgradedConsensusStateRequest, - > for UpgradedConsensusStateSvc { - type Response = super::QueryUpgradedConsensusStateResponse; + struct UpdateClientParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateClientParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryUpgradedConsensusStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::upgraded_consensus_state(&inner, request) - .await + ::update_client_params(&inner, request).await }; Box::pin(fut) } @@ -2504,7 +2504,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpgradedConsensusStateSvc(inner); + let method = UpdateClientParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2535,7 +2535,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2547,7 +2547,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2557,7 +2557,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.core.client.v1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.core.client.v1.Msg"; } } diff --git a/src/prost/ibc.core.connection.v1.rs b/src/prost/ibc.core.connection.v1.rs index 01a54671..96192f83 100644 --- a/src/prost/ibc.core.connection.v1.rs +++ b/src/prost/ibc.core.connection.v1.rs @@ -227,213 +227,232 @@ impl ::prost::Name for GenesisState { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenInit defines the msg sent by an account on Chain A to -/// initialize a connection with Chain B. +/// 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 MsgConnectionOpenInit { +pub struct QueryConnectionRequest { + /// connection unique identifier #[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, + pub connection_id: ::prost::alloc::string::String, } -impl ::prost::Name for MsgConnectionOpenInit { - const NAME: &'static str = "MsgConnectionOpenInit"; +impl ::prost::Name for QueryConnectionRequest { + const NAME: &'static str = "QueryConnectionRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response -/// type. +/// 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 MsgConnectionOpenInitResponse {} -impl ::prost::Name for MsgConnectionOpenInitResponse { - const NAME: &'static str = "MsgConnectionOpenInitResponse"; +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, +} +impl ::prost::Name for QueryConnectionResponse { + const NAME: &'static str = "QueryConnectionResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenTry defines a msg sent by a Relayer to try to open a -/// connection on Chain B. +/// 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 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< - super::super::super::super::google::protobuf::Any, +pub struct QueryConnectionsRequest { + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, >, - #[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, } -impl ::prost::Name for MsgConnectionOpenTry { - const NAME: &'static str = "MsgConnectionOpenTry"; +impl ::prost::Name for QueryConnectionsRequest { + const NAME: &'static str = "QueryConnectionsRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. +/// 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 MsgConnectionOpenTryResponse {} -impl ::prost::Name for MsgConnectionOpenTryResponse { - const NAME: &'static str = "MsgConnectionOpenTryResponse"; +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, +} +impl ::prost::Name for QueryConnectionsResponse { + const NAME: &'static str = "QueryConnectionsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenAck defines a msg sent by a Relayer to Chain A to -/// acknowledge the change of connection state to TRYOPEN on Chain B. +/// 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 MsgConnectionOpenAck { +pub struct QueryClientConnectionsRequest { + /// client identifier associated with a connection #[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< - super::super::super::super::google::protobuf::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, + pub client_id: ::prost::alloc::string::String, } -impl ::prost::Name for MsgConnectionOpenAck { - const NAME: &'static str = "MsgConnectionOpenAck"; +impl ::prost::Name for QueryClientConnectionsRequest { + const NAME: &'static str = "QueryClientConnectionsRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. +/// 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 MsgConnectionOpenAckResponse {} -impl ::prost::Name for MsgConnectionOpenAckResponse { - const NAME: &'static str = "MsgConnectionOpenAckResponse"; +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, +} +impl ::prost::Name for QueryClientConnectionsResponse { + const NAME: &'static str = "QueryClientConnectionsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenConfirm defines a msg sent by a Relayer to Chain B to -/// acknowledge the change of connection state to OPEN on Chain A. +/// 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 MsgConnectionOpenConfirm { +pub struct QueryConnectionClientStateRequest { + /// connection identifier #[prost(string, tag = "1")] pub connection_id: ::prost::alloc::string::String, - /// proof for the change of the connection state on Chain A: `INIT -> OPEN` +} +impl ::prost::Name for QueryConnectionClientStateRequest { + const NAME: &'static str = "QueryConnectionClientStateRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} +/// 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< + super::super::client::v1::IdentifiedClientState, + >, + /// merkle proof of existence #[prost(bytes = "vec", tag = "2")] - pub proof_ack: ::prost::alloc::vec::Vec, + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, - #[prost(string, tag = "4")] - pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for MsgConnectionOpenConfirm { - const NAME: &'static str = "MsgConnectionOpenConfirm"; +impl ::prost::Name for QueryConnectionClientStateResponse { + const NAME: &'static str = "QueryConnectionClientStateResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm -/// response type. +/// 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 MsgConnectionOpenConfirmResponse {} -impl ::prost::Name for MsgConnectionOpenConfirmResponse { - const NAME: &'static str = "MsgConnectionOpenConfirmResponse"; +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, +} +impl ::prost::Name for QueryConnectionConsensusStateRequest { + const NAME: &'static str = "QueryConnectionConsensusStateRequest"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +/// 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 MsgUpdateParams { - /// signer address - #[prost(string, tag = "1")] - pub signer: ::prost::alloc::string::String, - /// params defines the connection parameters to update. - /// - /// NOTE: All parameters must be supplied. - #[prost(message, optional, tag = "2")] - pub params: ::core::option::Option, +pub struct QueryConnectionConsensusStateResponse { + /// consensus state associated with the channel + #[prost(message, optional, tag = "1")] + pub consensus_state: ::core::option::Option< + super::super::super::super::google::protobuf::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, } -impl ::prost::Name for MsgUpdateParams { - const NAME: &'static str = "MsgUpdateParams"; +impl ::prost::Name for QueryConnectionConsensusStateResponse { + const NAME: &'static str = "QueryConnectionConsensusStateResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +/// 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 MsgUpdateParamsResponse {} -impl ::prost::Name for MsgUpdateParamsResponse { - const NAME: &'static str = "MsgUpdateParamsResponse"; +pub struct QueryConnectionParamsRequest {} +impl ::prost::Name for QueryConnectionParamsRequest { + const NAME: &'static str = "QueryConnectionParamsRequest"; + const PACKAGE: &'static str = "ibc.core.connection.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) + } +} +/// 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, +} +impl ::prost::Name for QueryConnectionParamsResponse { + const NAME: &'static str = "QueryConnectionParamsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) @@ -441,16 +460,16 @@ impl ::prost::Name for MsgUpdateParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod msg_client { +pub mod query_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Msg defines the ibc/connection Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug, Clone)] - pub struct MsgClient { + pub struct QueryClient { inner: tonic::client::Grpc, } - impl MsgClient { + impl QueryClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -461,7 +480,7 @@ pub mod msg_client { Ok(Self::new(conn)) } } - impl MsgClient + impl QueryClient where T: tonic::client::GrpcService, T::Error: Into, @@ -479,7 +498,7 @@ pub mod msg_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> MsgClient> + ) -> QueryClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -493,7 +512,7 @@ pub mod msg_client { http::Request, >>::Error: Into + Send + Sync, { - MsgClient::new(InterceptedService::new(inner, interceptor)) + QueryClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -526,12 +545,12 @@ pub mod msg_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - pub async fn connection_open_init( + /// Connection queries an IBC connection end. + pub async fn connection( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -545,21 +564,19 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenInit", + "/ibc.core.connection.v1.Query/Connection", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenInit"), - ); + .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connection")); self.inner.unary(req, path, codec).await } - /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - pub async fn connection_open_try( + /// Connections queries all the IBC connections of a chain. + pub async fn connections( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -573,21 +590,20 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenTry", + "/ibc.core.connection.v1.Query/Connections", ); let mut req = request.into_request(); req.extensions_mut() - .insert( - GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenTry"), - ); + .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connections")); self.inner.unary(req, path, codec).await } - /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - pub async fn connection_open_ack( + /// ClientConnections queries the connection paths associated with a client + /// state. + pub async fn client_connections( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -601,22 +617,22 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenAck", + "/ibc.core.connection.v1.Query/ClientConnections", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenAck"), + GrpcMethod::new("ibc.core.connection.v1.Query", "ClientConnections"), ); self.inner.unary(req, path, codec).await } - /// ConnectionOpenConfirm defines a rpc handler method for - /// MsgConnectionOpenConfirm. - pub async fn connection_open_confirm( + /// ConnectionClientState queries the client state associated with the + /// connection. + pub async fn connection_client_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -630,25 +646,25 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", + "/ibc.core.connection.v1.Query/ConnectionClientState", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "ConnectionOpenConfirm", + "ibc.core.connection.v1.Query", + "ConnectionClientState", ), ); self.inner.unary(req, path, codec).await } - /// UpdateConnectionParams defines a rpc handler method for - /// MsgUpdateParams. - pub async fn update_connection_params( + /// ConnectionConsensusState queries the consensus state associated with the + /// connection. + pub async fn connection_consensus_state( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -662,74 +678,111 @@ pub mod msg_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Msg/UpdateConnectionParams", + "/ibc.core.connection.v1.Query/ConnectionConsensusState", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.core.connection.v1.Msg", - "UpdateConnectionParams", + "ibc.core.connection.v1.Query", + "ConnectionConsensusState", ), ); self.inner.unary(req, path, codec).await } + /// ConnectionParams queries all parameters of the ibc connection submodule. + pub async fn connection_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.core.connection.v1.Query", "ConnectionParams"), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. #[cfg(feature = "server")] -pub mod msg_server { +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 MsgServer. + /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] - pub trait Msg: Send + Sync + 'static { - /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. - async fn connection_open_init( + pub trait Query: Send + Sync + 'static { + /// Connection queries an IBC connection end. + async fn connection( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. - async fn connection_open_try( + /// Connections queries all the IBC connections of a chain. + async fn connections( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. - async fn connection_open_ack( + /// ClientConnections queries the connection paths associated with a client + /// state. + async fn client_connections( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionOpenConfirm defines a rpc handler method for - /// MsgConnectionOpenConfirm. - async fn connection_open_confirm( + /// ConnectionClientState queries the client state associated with the + /// connection. + async fn connection_client_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// UpdateConnectionParams defines a rpc handler method for - /// MsgUpdateParams. - async fn update_connection_params( + /// ConnectionConsensusState queries the consensus state associated with the + /// connection. + async fn connection_consensus_state( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, + tonic::Status, + >; + /// ConnectionParams queries all parameters of the ibc connection submodule. + async fn connection_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, tonic::Status, >; } - /// Msg defines the ibc/connection Msg service. + /// Query provides defines the gRPC querier service #[derive(Debug)] - pub struct MsgServer { + pub struct QueryServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -737,7 +790,7 @@ pub mod msg_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl MsgServer { + impl QueryServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -789,9 +842,9 @@ pub mod msg_server { self } } - impl tonic::codegen::Service> for MsgServer + impl tonic::codegen::Service> for QueryServer where - T: Msg, + T: Query, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -807,25 +860,25 @@ pub mod msg_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { - "/ibc.core.connection.v1.Msg/ConnectionOpenInit" => { + "/ibc.core.connection.v1.Query/Connection" => { #[allow(non_camel_case_types)] - struct ConnectionOpenInitSvc(pub Arc); + struct ConnectionSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ConnectionOpenInitSvc { - type Response = super::MsgConnectionOpenInitResponse; + T: Query, + > tonic::server::UnaryService + for ConnectionSvc { + type Response = super::QueryConnectionResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_open_init(&inner, request).await + ::connection(&inner, request).await }; Box::pin(fut) } @@ -837,7 +890,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionOpenInitSvc(inner); + let method = ConnectionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -853,23 +906,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Msg/ConnectionOpenTry" => { + "/ibc.core.connection.v1.Query/Connections" => { #[allow(non_camel_case_types)] - struct ConnectionOpenTrySvc(pub Arc); - impl tonic::server::UnaryService - for ConnectionOpenTrySvc { - type Response = super::MsgConnectionOpenTryResponse; + struct ConnectionsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConnectionsSvc { + type Response = super::QueryConnectionsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_open_try(&inner, request).await + ::connections(&inner, request).await }; Box::pin(fut) } @@ -881,7 +936,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionOpenTrySvc(inner); + let method = ConnectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -897,23 +952,25 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Msg/ConnectionOpenAck" => { + "/ibc.core.connection.v1.Query/ClientConnections" => { #[allow(non_camel_case_types)] - struct ConnectionOpenAckSvc(pub Arc); - impl tonic::server::UnaryService - for ConnectionOpenAckSvc { - type Response = super::MsgConnectionOpenAckResponse; + struct ClientConnectionsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ClientConnectionsSvc { + type Response = super::QueryClientConnectionsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_open_ack(&inner, request).await + ::client_connections(&inner, request).await }; Box::pin(fut) } @@ -925,7 +982,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionOpenAckSvc(inner); + let method = ClientConnectionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -941,25 +998,28 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm" => { + "/ibc.core.connection.v1.Query/ConnectionClientState" => { #[allow(non_camel_case_types)] - struct ConnectionOpenConfirmSvc(pub Arc); + struct ConnectionClientStateSvc(pub Arc); impl< - T: Msg, - > tonic::server::UnaryService - for ConnectionOpenConfirmSvc { - type Response = super::MsgConnectionOpenConfirmResponse; + T: Query, + > tonic::server::UnaryService< + super::QueryConnectionClientStateRequest, + > for ConnectionClientStateSvc { + type Response = super::QueryConnectionClientStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryConnectionClientStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_open_confirm(&inner, request).await + ::connection_client_state(&inner, request).await }; Box::pin(fut) } @@ -971,7 +1031,7 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionOpenConfirmSvc(inner); + let method = ConnectionClientStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -987,23 +1047,29 @@ pub mod msg_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Msg/UpdateConnectionParams" => { + "/ibc.core.connection.v1.Query/ConnectionConsensusState" => { #[allow(non_camel_case_types)] - struct UpdateConnectionParamsSvc(pub Arc); - impl tonic::server::UnaryService - for UpdateConnectionParamsSvc { - type Response = super::MsgUpdateParamsResponse; + struct ConnectionConsensusStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryConnectionConsensusStateRequest, + > for ConnectionConsensusStateSvc { + type Response = super::QueryConnectionConsensusStateResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request< + super::QueryConnectionConsensusStateRequest, + >, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_connection_params(&inner, request).await + ::connection_consensus_state(&inner, request) + .await }; Box::pin(fut) } @@ -1015,7 +1081,53 @@ pub mod msg_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = UpdateConnectionParamsSvc(inner); + 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, + ) + .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.core.connection.v1.Query/ConnectionParams" => { + #[allow(non_camel_case_types)] + struct ConnectionParamsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ConnectionParamsSvc { + type Response = super::QueryConnectionParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::connection_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 = ConnectionParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1046,7 +1158,7 @@ pub mod msg_server { } } } - impl Clone for MsgServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1058,7 +1170,7 @@ pub mod msg_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -1068,236 +1180,217 @@ pub mod msg_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = "ibc.core.connection.v1.Msg"; + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.core.connection.v1.Query"; } } -/// QueryConnectionRequest is the request type for the Query/Connection RPC -/// method +/// 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 QueryConnectionRequest { - /// connection unique identifier +pub struct MsgConnectionOpenInit { #[prost(string, tag = "1")] - pub connection_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryConnectionRequest { - const NAME: &'static str = "QueryConnectionRequest"; - const PACKAGE: &'static str = "ibc.core.connection.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) - } -} -/// 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 + pub client_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub counterparty: ::core::option::Option, #[prost(message, optional, tag = "3")] - pub proof_height: ::core::option::Option, + pub version: ::core::option::Option, + #[prost(uint64, tag = "4")] + pub delay_period: u64, + #[prost(string, tag = "5")] + pub signer: ::prost::alloc::string::String, } -impl ::prost::Name for QueryConnectionResponse { - const NAME: &'static str = "QueryConnectionResponse"; +impl ::prost::Name for MsgConnectionOpenInit { + const NAME: &'static str = "MsgConnectionOpenInit"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionsRequest is the request type for the Query/Connections RPC -/// method +/// MsgConnectionOpenInitResponse defines the Msg/ConnectionOpenInit response +/// type. #[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, - >, -} -impl ::prost::Name for QueryConnectionsRequest { - const NAME: &'static str = "QueryConnectionsRequest"; +pub struct MsgConnectionOpenInitResponse {} +impl ::prost::Name for MsgConnectionOpenInitResponse { + const NAME: &'static str = "MsgConnectionOpenInitResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionsResponse is the response type for the Query/Connections RPC -/// method. +/// 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 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 +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 height: ::core::option::Option, + pub client_state: ::core::option::Option< + super::super::super::super::google::protobuf::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, } -impl ::prost::Name for QueryConnectionsResponse { - const NAME: &'static str = "QueryConnectionsResponse"; +impl ::prost::Name for MsgConnectionOpenTry { + const NAME: &'static str = "MsgConnectionOpenTry"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryClientConnectionsRequest is the request type for the -/// Query/ClientConnections RPC method +/// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[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, -} -impl ::prost::Name for QueryClientConnectionsRequest { - const NAME: &'static str = "QueryClientConnectionsRequest"; +pub struct MsgConnectionOpenTryResponse {} +impl ::prost::Name for MsgConnectionOpenTryResponse { + const NAME: &'static str = "MsgConnectionOpenTryResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryClientConnectionsResponse is the response type for the -/// Query/ClientConnections RPC method +/// 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 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 +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< + super::super::super::super::google::protobuf::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, } -impl ::prost::Name for QueryClientConnectionsResponse { - const NAME: &'static str = "QueryClientConnectionsResponse"; +impl ::prost::Name for MsgConnectionOpenAck { + const NAME: &'static str = "MsgConnectionOpenAck"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionClientStateRequest is the request type for the -/// Query/ConnectionClientState RPC method +/// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[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, -} -impl ::prost::Name for QueryConnectionClientStateRequest { - const NAME: &'static str = "QueryConnectionClientStateRequest"; +pub struct MsgConnectionOpenAckResponse {} +impl ::prost::Name for MsgConnectionOpenAckResponse { + const NAME: &'static str = "MsgConnectionOpenAckResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionClientStateResponse is the response type for the -/// Query/ConnectionClientState RPC method +/// 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 QueryConnectionClientStateResponse { - /// client state associated with the channel - #[prost(message, optional, tag = "1")] - pub identified_client_state: ::core::option::Option< - super::super::client::v1::IdentifiedClientState, - >, - /// merkle proof of existence +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: ::prost::alloc::vec::Vec, - /// height at which the proof was retrieved + 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, } -impl ::prost::Name for QueryConnectionClientStateResponse { - const NAME: &'static str = "QueryConnectionClientStateResponse"; +impl ::prost::Name for MsgConnectionOpenConfirm { + const NAME: &'static str = "MsgConnectionOpenConfirm"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionConsensusStateRequest is the request type for the -/// Query/ConnectionConsensusState RPC method +/// MsgConnectionOpenConfirmResponse defines the Msg/ConnectionOpenConfirm +/// response type. #[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, -} -impl ::prost::Name for QueryConnectionConsensusStateRequest { - const NAME: &'static str = "QueryConnectionConsensusStateRequest"; +pub struct MsgConnectionOpenConfirmResponse {} +impl ::prost::Name for MsgConnectionOpenConfirmResponse { + const NAME: &'static str = "MsgConnectionOpenConfirmResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionConsensusStateResponse is the response type for the -/// Query/ConnectionConsensusState RPC method +/// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. #[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< - super::super::super::super::google::protobuf::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, -} -impl ::prost::Name for QueryConnectionConsensusStateResponse { - const NAME: &'static str = "QueryConnectionConsensusStateResponse"; - const PACKAGE: &'static str = "ibc.core.connection.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) - } +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the connection parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::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 {} -impl ::prost::Name for QueryConnectionParamsRequest { - const NAME: &'static str = "QueryConnectionParamsRequest"; +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) } } -/// QueryConnectionParamsResponse is the response type for the Query/ConnectionParams RPC method. +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. #[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, -} -impl ::prost::Name for QueryConnectionParamsResponse { - const NAME: &'static str = "QueryConnectionParamsResponse"; +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; const PACKAGE: &'static str = "ibc.core.connection.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("ibc.core.connection.v1.{}", Self::NAME) @@ -1305,16 +1398,16 @@ impl ::prost::Name for QueryConnectionParamsResponse { } /// Generated client implementations. #[cfg(feature = "client")] -pub mod query_client { +pub mod msg_client { #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::*; use tonic::codegen::http::Uri; - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/connection Msg service. #[derive(Debug, Clone)] - pub struct QueryClient { + pub struct MsgClient { inner: tonic::client::Grpc, } - impl QueryClient { + impl MsgClient { /// Attempt to create a new client by connecting to a given endpoint. pub async fn connect(dst: D) -> Result where @@ -1325,7 +1418,7 @@ pub mod query_client { Ok(Self::new(conn)) } } - impl QueryClient + impl MsgClient where T: tonic::client::GrpcService, T::Error: Into, @@ -1343,7 +1436,7 @@ pub mod query_client { pub fn with_interceptor( inner: T, interceptor: F, - ) -> QueryClient> + ) -> MsgClient> where F: tonic::service::Interceptor, T::ResponseBody: Default, @@ -1357,7 +1450,7 @@ pub mod query_client { http::Request, >>::Error: Into + Send + Sync, { - QueryClient::new(InterceptedService::new(inner, interceptor)) + MsgClient::new(InterceptedService::new(inner, interceptor)) } /// Compress requests with the given encoding. /// @@ -1390,38 +1483,12 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /// Connection queries an IBC connection end. - pub async fn connection( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connection")); - self.inner.unary(req, path, codec).await - } - /// Connections queries all the IBC connections of a chain. - pub async fn connections( + /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + pub async fn connection_open_init( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1435,20 +1502,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/Connections", + "/ibc.core.connection.v1.Msg/ConnectionOpenInit", ); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("ibc.core.connection.v1.Query", "Connections")); + .insert( + GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenInit"), + ); self.inner.unary(req, path, codec).await } - /// ClientConnections queries the connection paths associated with a client - /// state. - pub async fn client_connections( + /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + pub async fn connection_open_try( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1462,22 +1530,21 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ClientConnections", + "/ibc.core.connection.v1.Msg/ConnectionOpenTry", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.connection.v1.Query", "ClientConnections"), + GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenTry"), ); self.inner.unary(req, path, codec).await } - /// ConnectionClientState queries the client state associated with the - /// connection. - pub async fn connection_client_state( + /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + pub async fn connection_open_ack( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1491,25 +1558,22 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionClientState", + "/ibc.core.connection.v1.Msg/ConnectionOpenAck", ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "ibc.core.connection.v1.Query", - "ConnectionClientState", - ), + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.core.connection.v1.Msg", "ConnectionOpenAck"), ); self.inner.unary(req, path, codec).await } - /// ConnectionConsensusState queries the consensus state associated with the - /// connection. - pub async fn connection_consensus_state( + /// ConnectionOpenConfirm defines a rpc handler method for + /// MsgConnectionOpenConfirm. + pub async fn connection_open_confirm( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1523,24 +1587,25 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionConsensusState", + "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm", ); let mut req = request.into_request(); req.extensions_mut() .insert( GrpcMethod::new( - "ibc.core.connection.v1.Query", - "ConnectionConsensusState", + "ibc.core.connection.v1.Msg", + "ConnectionOpenConfirm", ), ); self.inner.unary(req, path, codec).await } - /// ConnectionParams queries all parameters of the ibc connection submodule. - pub async fn connection_params( + /// UpdateConnectionParams defines a rpc handler method for + /// MsgUpdateParams. + pub async fn update_connection_params( &mut self, - request: impl tonic::IntoRequest, + request: impl tonic::IntoRequest, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, > { self.inner @@ -1554,12 +1619,15 @@ pub mod query_client { })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( - "/ibc.core.connection.v1.Query/ConnectionParams", + "/ibc.core.connection.v1.Msg/UpdateConnectionParams", ); let mut req = request.into_request(); req.extensions_mut() .insert( - GrpcMethod::new("ibc.core.connection.v1.Query", "ConnectionParams"), + GrpcMethod::new( + "ibc.core.connection.v1.Msg", + "UpdateConnectionParams", + ), ); self.inner.unary(req, path, codec).await } @@ -1567,67 +1635,58 @@ pub mod query_client { } /// Generated server implementations. #[cfg(feature = "server")] -pub mod query_server { +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 QueryServer. + /// Generated trait containing gRPC methods that should be implemented for use with MsgServer. #[async_trait] - pub trait Query: Send + Sync + 'static { - /// Connection queries an IBC connection end. - async fn connection( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - /// Connections queries all the IBC connections of a chain. - async fn connections( + pub trait Msg: Send + Sync + 'static { + /// ConnectionOpenInit defines a rpc handler method for MsgConnectionOpenInit. + async fn connection_open_init( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ClientConnections queries the connection paths associated with a client - /// state. - async fn client_connections( + /// ConnectionOpenTry defines a rpc handler method for MsgConnectionOpenTry. + async fn connection_open_try( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionClientState queries the client state associated with the - /// connection. - async fn connection_client_state( + /// ConnectionOpenAck defines a rpc handler method for MsgConnectionOpenAck. + async fn connection_open_ack( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionConsensusState queries the consensus state associated with the - /// connection. - async fn connection_consensus_state( + /// ConnectionOpenConfirm defines a rpc handler method for + /// MsgConnectionOpenConfirm. + async fn connection_open_confirm( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; - /// ConnectionParams queries all parameters of the ibc connection submodule. - async fn connection_params( + /// UpdateConnectionParams defines a rpc handler method for + /// MsgUpdateParams. + async fn update_connection_params( &self, - request: tonic::Request, + request: tonic::Request, ) -> std::result::Result< - tonic::Response, + tonic::Response, tonic::Status, >; } - /// Query provides defines the gRPC querier service + /// Msg defines the ibc/connection Msg service. #[derive(Debug)] - pub struct QueryServer { + pub struct MsgServer { inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, @@ -1635,7 +1694,7 @@ pub mod query_server { max_encoding_message_size: Option, } struct _Inner(Arc); - impl QueryServer { + impl MsgServer { pub fn new(inner: T) -> Self { Self::from_arc(Arc::new(inner)) } @@ -1687,9 +1746,9 @@ pub mod query_server { self } } - impl tonic::codegen::Service> for QueryServer + impl tonic::codegen::Service> for MsgServer where - T: Query, + T: Msg, B: Body + Send + 'static, B::Error: Into + Send + 'static, { @@ -1705,71 +1764,25 @@ pub mod query_server { 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< - T: Query, - > tonic::server::UnaryService - for ConnectionSvc { - type Response = super::QueryConnectionResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::connection(&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 = 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, - ) - .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.core.connection.v1.Query/Connections" => { + "/ibc.core.connection.v1.Msg/ConnectionOpenInit" => { #[allow(non_camel_case_types)] - struct ConnectionsSvc(pub Arc); + struct ConnectionOpenInitSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService - for ConnectionsSvc { - type Response = super::QueryConnectionsResponse; + T: Msg, + > tonic::server::UnaryService + for ConnectionOpenInitSvc { + type Response = super::MsgConnectionOpenInitResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connections(&inner, request).await + ::connection_open_init(&inner, request).await }; Box::pin(fut) } @@ -1781,7 +1794,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionsSvc(inner); + let method = ConnectionOpenInitSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1797,25 +1810,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Query/ClientConnections" => { + "/ibc.core.connection.v1.Msg/ConnectionOpenTry" => { #[allow(non_camel_case_types)] - struct ClientConnectionsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ClientConnectionsSvc { - type Response = super::QueryClientConnectionsResponse; + struct ConnectionOpenTrySvc(pub Arc); + impl tonic::server::UnaryService + for ConnectionOpenTrySvc { + type Response = super::MsgConnectionOpenTryResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::client_connections(&inner, request).await + ::connection_open_try(&inner, request).await }; Box::pin(fut) } @@ -1827,7 +1838,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ClientConnectionsSvc(inner); + let method = ConnectionOpenTrySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1843,28 +1854,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Query/ConnectionClientState" => { + "/ibc.core.connection.v1.Msg/ConnectionOpenAck" => { #[allow(non_camel_case_types)] - struct ConnectionClientStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService< - super::QueryConnectionClientStateRequest, - > for ConnectionClientStateSvc { - type Response = super::QueryConnectionClientStateResponse; + struct ConnectionOpenAckSvc(pub Arc); + impl tonic::server::UnaryService + for ConnectionOpenAckSvc { + type Response = super::MsgConnectionOpenAckResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryConnectionClientStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_client_state(&inner, request).await + ::connection_open_ack(&inner, request).await }; Box::pin(fut) } @@ -1876,7 +1882,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionClientStateSvc(inner); + let method = ConnectionOpenAckSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1892,29 +1898,25 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Query/ConnectionConsensusState" => { + "/ibc.core.connection.v1.Msg/ConnectionOpenConfirm" => { #[allow(non_camel_case_types)] - struct ConnectionConsensusStateSvc(pub Arc); + struct ConnectionOpenConfirmSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService< - super::QueryConnectionConsensusStateRequest, - > for ConnectionConsensusStateSvc { - type Response = super::QueryConnectionConsensusStateResponse; + T: Msg, + > tonic::server::UnaryService + for ConnectionOpenConfirmSvc { + type Response = super::MsgConnectionOpenConfirmResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryConnectionConsensusStateRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_consensus_state(&inner, request) - .await + ::connection_open_confirm(&inner, request).await }; Box::pin(fut) } @@ -1926,7 +1928,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionConsensusStateSvc(inner); + let method = ConnectionOpenConfirmSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -1942,25 +1944,23 @@ pub mod query_server { }; Box::pin(fut) } - "/ibc.core.connection.v1.Query/ConnectionParams" => { + "/ibc.core.connection.v1.Msg/UpdateConnectionParams" => { #[allow(non_camel_case_types)] - struct ConnectionParamsSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for ConnectionParamsSvc { - type Response = super::QueryConnectionParamsResponse; + struct UpdateConnectionParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateConnectionParamsSvc { + type Response = super::MsgUpdateParamsResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::connection_params(&inner, request).await + ::update_connection_params(&inner, request).await }; Box::pin(fut) } @@ -1972,7 +1972,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = ConnectionParamsSvc(inner); + let method = UpdateConnectionParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2003,7 +2003,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2015,7 +2015,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2025,7 +2025,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "ibc.core.connection.v1.Query"; + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.core.connection.v1.Msg"; } } diff --git a/src/prost/ibc.lightclients.tendermint.v1.rs b/src/prost/ibc.lightclients.tendermint.v1.rs index ff15fefe..fda4aeef 100644 --- a/src/prost/ibc.lightclients.tendermint.v1.rs +++ b/src/prost/ibc.lightclients.tendermint.v1.rs @@ -125,16 +125,16 @@ impl ::prost::Name for Misbehaviour { #[derive(Clone, PartialEq, ::prost::Message)] pub struct Header { #[prost(message, optional, tag = "1")] - pub signed_header: ::core::option::Option<::tendermint_proto::types::SignedHeader>, + pub signed_header: ::core::option::Option<::cometbft_proto::types::v1::SignedHeader>, #[prost(message, optional, tag = "2")] - pub validator_set: ::core::option::Option<::tendermint_proto::types::ValidatorSet>, + pub validator_set: ::core::option::Option<::cometbft_proto::types::v1::ValidatorSet>, #[prost(message, optional, tag = "3")] pub trusted_height: ::core::option::Option< super::super::super::core::client::v1::Height, >, #[prost(message, optional, tag = "4")] pub trusted_validators: ::core::option::Option< - ::tendermint_proto::types::ValidatorSet, + ::cometbft_proto::types::v1::ValidatorSet, >, } impl ::prost::Name for Header { diff --git a/src/prost/interchain_security.ccv.provider.v1.rs b/src/prost/interchain_security.ccv.provider.v1.rs index f0561dee..d44ba204 100644 --- a/src/prost/interchain_security.ccv.provider.v1.rs +++ b/src/prost/interchain_security.ccv.provider.v1.rs @@ -1,915 +1,607 @@ +/// ConsumerAdditionProposal is a governance proposal on the provider chain to +/// spawn a new consumer chain. If it passes, then all validators on the provider +/// chain are expected to validate the consumer chain at spawn time or get +/// slashed. It is recommended that spawn time occurs after the proposal end +/// time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAssignConsumerKey { - /// The chain id of the consumer chain to assign a consensus public key to +pub struct ConsumerAdditionProposal { + /// the title of the proposal #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - /// The validator address on the provider + pub title: ::prost::alloc::string::String, + /// the description of the proposal #[prost(string, tag = "2")] - pub provider_addr: ::prost::alloc::string::String, - /// The consensus public key to use on the consumer. - /// in json string format corresponding to proto-any, ex: - /// `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}` + pub description: ::prost::alloc::string::String, + /// the proposed chain-id of the new consumer chain, must be different from all + /// other consumer chain ids of the executing provider chain. #[prost(string, tag = "3")] - pub consumer_key: ::prost::alloc::string::String, + pub chain_id: ::prost::alloc::string::String, + /// the proposed initial height of new consumer chain. + /// For a completely new chain, this will be {0,1}. However, it may be + /// different if this is a chain that is converting to a consumer chain. + #[prost(message, optional, tag = "4")] + pub initial_height: ::core::option::Option< + super::super::super::super::ibc::core::client::v1::Height, + >, + /// The hash of the consumer chain genesis state without the consumer CCV + /// module genesis params. It is used for off-chain confirmation of + /// genesis.json validity by validators and other parties. + #[prost(bytes = "vec", tag = "5")] + pub genesis_hash: ::prost::alloc::vec::Vec, + /// The hash of the consumer chain binary that should be run by validators on + /// chain initialization. It is used for off-chain confirmation of binary + /// validity by validators and other parties. + #[prost(bytes = "vec", tag = "6")] + pub binary_hash: ::prost::alloc::vec::Vec, + /// spawn time is the time on the provider chain at which the consumer chain + /// genesis is finalized and all validators will be responsible for starting + /// their consumer chain validator node. + #[prost(message, optional, tag = "7")] + pub spawn_time: ::core::option::Option< + super::super::super::super::google::protobuf::Timestamp, + >, + /// Unbonding period for the consumer, + /// which should be smaller than that of the provider in general. + #[prost(message, optional, tag = "8")] + pub unbonding_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// Sent CCV related IBC packets will timeout after this duration + #[prost(message, optional, tag = "9")] + pub ccv_timeout_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// Sent transfer related IBC packets will timeout after this duration + #[prost(message, optional, tag = "10")] + pub transfer_timeout_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// The fraction of tokens allocated to the consumer redistribution address + /// during distribution events. The fraction is a string representing a + /// decimal number. For example "0.75" would represent 75%. + #[prost(string, tag = "11")] + pub consumer_redistribution_fraction: ::prost::alloc::string::String, + /// BlocksPerDistributionTransmission is the number of blocks between + /// ibc-token-transfers from the consumer chain to the provider chain. On + /// sending transmission event, `consumer_redistribution_fraction` of the + /// accumulated tokens are sent to the consumer redistribution address. + #[prost(int64, tag = "12")] + pub blocks_per_distribution_transmission: i64, + /// The number of historical info entries to persist in store. + /// This param is a part of the cosmos sdk staking module. In the case of + /// a ccv enabled consumer chain, the ccv module acts as the staking module. + #[prost(int64, tag = "13")] + pub historical_entries: i64, + /// The ID of a token transfer channel used for the Reward Distribution + /// sub-protocol. If DistributionTransmissionChannel == "", a new transfer + /// channel is created on top of the same connection as the CCV channel. + /// Note that transfer_channel_id is the ID of the channel end on the consumer + /// chain. it is most relevant for chains performing a sovereign to consumer + /// changeover in order to maintan the existing ibc transfer channel + #[prost(string, tag = "14")] + pub distribution_transmission_channel: ::prost::alloc::string::String, } -impl ::prost::Name for MsgAssignConsumerKey { - const NAME: &'static str = "MsgAssignConsumerKey"; +impl ::prost::Name for ConsumerAdditionProposal { + const NAME: &'static str = "ConsumerAdditionProposal"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } +/// ConsumerRemovalProposal is a governance proposal on the provider chain to +/// remove (and stop) a consumer chain. If it passes, all the consumer chain's +/// state is removed from the provider chain. The outstanding unbonding operation +/// funds are released. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgAssignConsumerKeyResponse {} -impl ::prost::Name for MsgAssignConsumerKeyResponse { - const NAME: &'static str = "MsgAssignConsumerKeyResponse"; +pub struct ConsumerRemovalProposal { + /// the title of the proposal + #[prost(string, tag = "1")] + pub title: ::prost::alloc::string::String, + /// the description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// the chain-id of the consumer chain to be stopped + #[prost(string, tag = "3")] + pub chain_id: ::prost::alloc::string::String, + /// the time on the provider chain at which all validators are responsible to + /// stop their consumer chain validator node + #[prost(message, optional, tag = "4")] + pub stop_time: ::core::option::Option< + super::super::super::super::google::protobuf::Timestamp, + >, +} +impl ::prost::Name for ConsumerRemovalProposal { + const NAME: &'static str = "ConsumerRemovalProposal"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// MsgSubmitConsumerMisbehaviour defines a message that reports a light client attack, -/// also known as a misbehaviour, observed on a consumer chain +/// ChangeRewardDenomsProposal is a governance proposal on the provider chain to +/// mutate the set of denoms accepted by the provider as rewards. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitConsumerMisbehaviour { +pub struct ChangeRewardDenomsProposal { + /// the title of the proposal #[prost(string, tag = "1")] - pub submitter: ::prost::alloc::string::String, - /// The Misbehaviour of the consumer chain wrapping - /// two conflicting IBC headers - #[prost(message, optional, tag = "2")] - pub misbehaviour: ::core::option::Option< - super::super::super::super::ibc::lightclients::tendermint::v1::Misbehaviour, - >, + pub title: ::prost::alloc::string::String, + /// the description of the proposal + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// the list of consumer reward denoms to add + #[prost(string, repeated, tag = "3")] + pub denoms_to_add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// the list of consumer reward denoms to remove + #[prost(string, repeated, tag = "4")] + pub denoms_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } -impl ::prost::Name for MsgSubmitConsumerMisbehaviour { - const NAME: &'static str = "MsgSubmitConsumerMisbehaviour"; +impl ::prost::Name for ChangeRewardDenomsProposal { + const NAME: &'static str = "ChangeRewardDenomsProposal"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } +/// A persisted queue entry indicating that a slash packet data instance needs to +/// be handled. This type belongs in the "global" queue, to coordinate slash +/// packet handling times between consumers. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitConsumerMisbehaviourResponse {} -impl ::prost::Name for MsgSubmitConsumerMisbehaviourResponse { - const NAME: &'static str = "MsgSubmitConsumerMisbehaviourResponse"; +pub struct GlobalSlashEntry { + /// Block time that slash packet was received by provider chain. + /// This field is used for store key iteration ordering. + #[prost(message, optional, tag = "1")] + pub recv_time: ::core::option::Option< + super::super::super::super::google::protobuf::Timestamp, + >, + /// The consumer that sent a slash packet. + #[prost(string, tag = "2")] + pub consumer_chain_id: ::prost::alloc::string::String, + /// The IBC sequence number of the recv packet. + /// This field is used in the store key to ensure uniqueness. + #[prost(uint64, tag = "3")] + pub ibc_seq_num: u64, + /// The provider's consensus address of the validator being slashed. + /// This field is used to obtain validator power in HandleThrottleQueues. + /// + /// This field is not used in the store key, but is persisted in value bytes, + /// see QueueGlobalSlashEntry. + #[prost(bytes = "vec", tag = "4")] + pub provider_val_cons_addr: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GlobalSlashEntry { + const NAME: &'static str = "GlobalSlashEntry"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// MsgSubmitConsumerDoubleVoting defines a message that reports -/// a double signing infraction observed on a consumer chain +/// Params defines the parameters for CCV Provider module #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitConsumerDoubleVoting { - #[prost(string, tag = "1")] - pub submitter: ::prost::alloc::string::String, - /// The equivocation of the consumer chain wrapping - /// an evidence of a validator that signed two conflicting votes - #[prost(message, optional, tag = "2")] - pub duplicate_vote_evidence: ::core::option::Option< - ::tendermint_proto::types::DuplicateVoteEvidence, +pub struct Params { + #[prost(message, optional, tag = "1")] + pub template_client: ::core::option::Option< + super::super::super::super::ibc::lightclients::tendermint::v1::ClientState, >, - /// The light client header of the infraction block + /// TrustingPeriodFraction is used to compute the consumer and provider IBC + /// client's TrustingPeriod from the chain defined UnbondingPeriod + #[prost(string, tag = "2")] + pub trusting_period_fraction: ::prost::alloc::string::String, + /// Sent IBC packets will timeout after this duration #[prost(message, optional, tag = "3")] - pub infraction_block_header: ::core::option::Option< - super::super::super::super::ibc::lightclients::tendermint::v1::Header, + pub ccv_timeout_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// The channel initialization (IBC channel opening handshake) will timeout + /// after this duration + #[prost(message, optional, tag = "4")] + pub init_timeout_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// The VSC packets sent by the provider will timeout after this duration. + /// Note that unlike ccv_timeout_period which is an IBC param, + /// the vsc_timeout_period is a provider-side param that enables the provider + /// to timeout VSC packets even when a consumer chain is not live. + #[prost(message, optional, tag = "5")] + pub vsc_timeout_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// The period for which the slash meter is replenished + #[prost(message, optional, tag = "6")] + pub slash_meter_replenish_period: ::core::option::Option< + super::super::super::super::google::protobuf::Duration, + >, + /// The fraction of total voting power that is replenished to the slash meter + /// every replenish period. This param also serves as a maximum fraction of + /// total voting power that the slash meter can hold. + #[prost(string, tag = "7")] + pub slash_meter_replenish_fraction: ::prost::alloc::string::String, + /// The maximum amount of throttled slash or vsc matured packets + /// that can be queued for a single consumer before the provider chain halts. + #[prost(int64, tag = "8")] + pub max_throttled_packets: i64, + /// The fee required to be paid to add a reward denom + #[prost(message, optional, tag = "9")] + pub consumer_reward_denom_registration_fee: ::core::option::Option< + super::super::super::super::cosmos::base::v1beta1::Coin, >, } -impl ::prost::Name for MsgSubmitConsumerDoubleVoting { - const NAME: &'static str = "MsgSubmitConsumerDoubleVoting"; +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } +/// SlashAcks contains cons addresses of consumer chain validators +/// successfully slashed on the provider chain. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgSubmitConsumerDoubleVotingResponse {} -impl ::prost::Name for MsgSubmitConsumerDoubleVotingResponse { - const NAME: &'static str = "MsgSubmitConsumerDoubleVotingResponse"; +pub struct SlashAcks { + #[prost(string, repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +impl ::prost::Name for SlashAcks { + const NAME: &'static str = "SlashAcks"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// Generated client implementations. -#[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; - /// Msg defines the Msg service. - #[derive(Debug, Clone)] - pub struct MsgClient { - inner: tonic::client::Grpc, +/// ConsumerAdditionProposals holds pending governance proposals on the provider +/// chain to spawn a new chain. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsumerAdditionProposals { + /// proposals waiting for spawn_time to pass + #[prost(message, repeated, tag = "1")] + pub pending: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ConsumerAdditionProposals { + const NAME: &'static str = "ConsumerAdditionProposals"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } - impl MsgClient { - /// Attempt to create a new client by connecting to a given endpoint. - pub async fn connect(dst: D) -> Result - where - D: TryInto, - D::Error: Into, - { - let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; - Ok(Self::new(conn)) - } +} +/// ConsumerRemovalProposals holds pending governance proposals on the provider +/// chain to remove (and stop) a consumer chain. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsumerRemovalProposals { + /// proposals waiting for stop_time to pass + #[prost(message, repeated, tag = "1")] + pub pending: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for ConsumerRemovalProposals { + const NAME: &'static str = "ConsumerRemovalProposals"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.inner = self.inner.max_decoding_message_size(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[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 assign_consumer_key( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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( - "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "interchain_security.ccv.provider.v1.Msg", - "AssignConsumerKey", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn submit_consumer_misbehaviour( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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( - "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "interchain_security.ccv.provider.v1.Msg", - "SubmitConsumerMisbehaviour", - ), - ); - self.inner.unary(req, path, codec).await - } - pub async fn submit_consumer_double_voting( - &mut self, - request: impl tonic::IntoRequest, - ) -> std::result::Result< - tonic::Response, - 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( - "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", - ); - let mut req = request.into_request(); - req.extensions_mut() - .insert( - GrpcMethod::new( - "interchain_security.ccv.provider.v1.Msg", - "SubmitConsumerDoubleVoting", - ), - ); - self.inner.unary(req, path, codec).await - } +} +/// AddressList contains a list of consensus addresses +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressList { + #[prost(bytes = "vec", repeated, tag = "1")] + pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +impl ::prost::Name for AddressList { + const NAME: &'static str = "AddressList"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// Generated server implementations. -#[cfg(feature = "server")] -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 { - async fn assign_consumer_key( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn submit_consumer_misbehaviour( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn submit_consumer_double_voting( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ChannelToChain { + #[prost(string, tag = "1")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, +} +impl ::prost::Name for ChannelToChain { + const NAME: &'static str = "ChannelToChain"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } - /// Msg defines the Msg service. - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, +} +/// VscUnbondingOps contains the IDs of unbonding operations that are waiting for +/// at least one VSCMaturedPacket with vscID from a consumer chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VscUnbondingOps { + #[prost(uint64, tag = "1")] + pub vsc_id: u64, + #[prost(uint64, repeated, tag = "2")] + pub unbonding_op_ids: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for VscUnbondingOps { + const NAME: &'static str = "VscUnbondingOps"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } - 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(), - max_decoding_message_size: None, - max_encoding_message_size: None, - } - } - 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 - } - /// Limits the maximum size of a decoded message. - /// - /// Default: `4MB` - #[must_use] - pub fn max_decoding_message_size(mut self, limit: usize) -> Self { - self.max_decoding_message_size = Some(limit); - self - } - /// Limits the maximum size of an encoded message. - /// - /// Default: `usize::MAX` - #[must_use] - pub fn max_encoding_message_size(mut self, limit: usize) -> Self { - self.max_encoding_message_size = Some(limit); - 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() { - "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey" => { - #[allow(non_camel_case_types)] - struct AssignConsumerKeySvc(pub Arc); - impl tonic::server::UnaryService - for AssignConsumerKeySvc { - type Response = super::MsgAssignConsumerKeyResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::assign_consumer_key(&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 = AssignConsumerKeySvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour" => { - #[allow(non_camel_case_types)] - struct SubmitConsumerMisbehaviourSvc(pub Arc); - impl< - T: Msg, - > tonic::server::UnaryService - for SubmitConsumerMisbehaviourSvc { - type Response = super::MsgSubmitConsumerMisbehaviourResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::submit_consumer_misbehaviour(&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 = SubmitConsumerMisbehaviourSvc(inner); - let codec = tonic::codec::ProstCodec::default(); - let mut grpc = tonic::server::Grpc::new(codec) - .apply_compression_config( - accept_compression_encodings, - send_compression_encodings, - ) - .apply_max_message_size_config( - max_decoding_message_size, - max_encoding_message_size, - ); - let res = grpc.unary(method, req).await; - Ok(res) - }; - Box::pin(fut) - } - "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting" => { - #[allow(non_camel_case_types)] - struct SubmitConsumerDoubleVotingSvc(pub Arc); - impl< - T: Msg, - > tonic::server::UnaryService - for SubmitConsumerDoubleVotingSvc { - type Response = super::MsgSubmitConsumerDoubleVotingResponse; - type Future = BoxFuture< - tonic::Response, - tonic::Status, - >; - fn call( - &mut self, - request: tonic::Request, - ) -> Self::Future { - let inner = Arc::clone(&self.0); - let fut = async move { - ::submit_consumer_double_voting(&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 = SubmitConsumerDoubleVotingSvc(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 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, - max_decoding_message_size: self.max_decoding_message_size, - max_encoding_message_size: self.max_encoding_message_size, - } - } - } - impl Clone for _Inner { - fn clone(&self) -> Self { - Self(Arc::clone(&self.0)) - } - } - 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 = "interchain_security.ccv.provider.v1.Msg"; +} +/// UnbondingOp contains the ids of consumer chains that need to unbond before +/// the unbonding operation with the given ID can unbond +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UnbondingOp { + #[prost(uint64, tag = "1")] + pub id: u64, + /// consumer chains that are still unbonding + #[prost(string, repeated, tag = "2")] + pub unbonding_consumer_chains: ::prost::alloc::vec::Vec< + ::prost::alloc::string::String, + >, +} +impl ::prost::Name for UnbondingOp { + const NAME: &'static str = "UnbondingOp"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ConsumerAdditionProposal is a governance proposal on the provider chain to -/// spawn a new consumer chain. If it passes, then all validators on the provider -/// chain are expected to validate the consumer chain at spawn time or get -/// slashed. It is recommended that spawn time occurs after the proposal end -/// time. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerAdditionProposal { - /// the title of the proposal +pub struct InitTimeoutTimestamp { #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// the description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// the proposed chain-id of the new consumer chain, must be different from all - /// other consumer chain ids of the executing provider chain. - #[prost(string, tag = "3")] pub chain_id: ::prost::alloc::string::String, - /// the proposed initial height of new consumer chain. - /// For a completely new chain, this will be {0,1}. However, it may be - /// different if this is a chain that is converting to a consumer chain. - #[prost(message, optional, tag = "4")] - pub initial_height: ::core::option::Option< - super::super::super::super::ibc::core::client::v1::Height, - >, - /// The hash of the consumer chain genesis state without the consumer CCV - /// module genesis params. It is used for off-chain confirmation of - /// genesis.json validity by validators and other parties. - #[prost(bytes = "vec", tag = "5")] - pub genesis_hash: ::prost::alloc::vec::Vec, - /// The hash of the consumer chain binary that should be run by validators on - /// chain initialization. It is used for off-chain confirmation of binary - /// validity by validators and other parties. - #[prost(bytes = "vec", tag = "6")] - pub binary_hash: ::prost::alloc::vec::Vec, - /// spawn time is the time on the provider chain at which the consumer chain - /// genesis is finalized and all validators will be responsible for starting - /// their consumer chain validator node. - #[prost(message, optional, tag = "7")] - pub spawn_time: ::core::option::Option< - super::super::super::super::google::protobuf::Timestamp, - >, - /// Unbonding period for the consumer, - /// which should be smaller than that of the provider in general. - #[prost(message, optional, tag = "8")] - pub unbonding_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// Sent CCV related IBC packets will timeout after this duration - #[prost(message, optional, tag = "9")] - pub ccv_timeout_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// Sent transfer related IBC packets will timeout after this duration - #[prost(message, optional, tag = "10")] - pub transfer_timeout_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// The fraction of tokens allocated to the consumer redistribution address - /// during distribution events. The fraction is a string representing a - /// decimal number. For example "0.75" would represent 75%. - #[prost(string, tag = "11")] - pub consumer_redistribution_fraction: ::prost::alloc::string::String, - /// BlocksPerDistributionTransmission is the number of blocks between - /// ibc-token-transfers from the consumer chain to the provider chain. On - /// sending transmission event, `consumer_redistribution_fraction` of the - /// accumulated tokens are sent to the consumer redistribution address. - #[prost(int64, tag = "12")] - pub blocks_per_distribution_transmission: i64, - /// The number of historical info entries to persist in store. - /// This param is a part of the cosmos sdk staking module. In the case of - /// a ccv enabled consumer chain, the ccv module acts as the staking module. - #[prost(int64, tag = "13")] - pub historical_entries: i64, - /// The ID of a token transfer channel used for the Reward Distribution - /// sub-protocol. If DistributionTransmissionChannel == "", a new transfer - /// channel is created on top of the same connection as the CCV channel. - /// Note that transfer_channel_id is the ID of the channel end on the consumer - /// chain. it is most relevant for chains performing a sovereign to consumer - /// changeover in order to maintan the existing ibc transfer channel - #[prost(string, tag = "14")] - pub distribution_transmission_channel: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub timestamp: u64, } -impl ::prost::Name for ConsumerAdditionProposal { - const NAME: &'static str = "ConsumerAdditionProposal"; +impl ::prost::Name for InitTimeoutTimestamp { + const NAME: &'static str = "InitTimeoutTimestamp"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ConsumerRemovalProposal is a governance proposal on the provider chain to -/// remove (and stop) a consumer chain. If it passes, all the consumer chain's -/// state is removed from the provider chain. The outstanding unbonding operation -/// funds are released. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerRemovalProposal { - /// the title of the proposal - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// the description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// the chain-id of the consumer chain to be stopped - #[prost(string, tag = "3")] - pub chain_id: ::prost::alloc::string::String, - /// the time on the provider chain at which all validators are responsible to - /// stop their consumer chain validator node - #[prost(message, optional, tag = "4")] - pub stop_time: ::core::option::Option< +pub struct VscSendTimestamp { + #[prost(uint64, tag = "1")] + pub vsc_id: u64, + #[prost(message, optional, tag = "2")] + pub timestamp: ::core::option::Option< super::super::super::super::google::protobuf::Timestamp, >, } -impl ::prost::Name for ConsumerRemovalProposal { - const NAME: &'static str = "ConsumerRemovalProposal"; +impl ::prost::Name for VscSendTimestamp { + const NAME: &'static str = "VscSendTimestamp"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ChangeRewardDenomsProposal is a governance proposal on the provider chain to -/// mutate the set of denoms accepted by the provider as rewards. +/// ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChangeRewardDenomsProposal { - /// the title of the proposal - #[prost(string, tag = "1")] - pub title: ::prost::alloc::string::String, - /// the description of the proposal - #[prost(string, tag = "2")] - pub description: ::prost::alloc::string::String, - /// the list of consumer reward denoms to add - #[prost(string, repeated, tag = "3")] - pub denoms_to_add: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// the list of consumer reward denoms to remove - #[prost(string, repeated, tag = "4")] - pub denoms_to_remove: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct ValidatorSetChangePackets { + #[prost(message, repeated, tag = "1")] + pub list: ::prost::alloc::vec::Vec, } -impl ::prost::Name for ChangeRewardDenomsProposal { - const NAME: &'static str = "ChangeRewardDenomsProposal"; +impl ::prost::Name for ValidatorSetChangePackets { + const NAME: &'static str = "ValidatorSetChangePackets"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// A persisted queue entry indicating that a slash packet data instance needs to -/// be handled. This type belongs in the "global" queue, to coordinate slash -/// packet handling times between consumers. +/// MaturedUnbondingOps defines a list of ids corresponding to ids of matured +/// unbonding operations. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct GlobalSlashEntry { - /// Block time that slash packet was received by provider chain. - /// This field is used for store key iteration ordering. - #[prost(message, optional, tag = "1")] - pub recv_time: ::core::option::Option< - super::super::super::super::google::protobuf::Timestamp, - >, - /// The consumer that sent a slash packet. - #[prost(string, tag = "2")] - pub consumer_chain_id: ::prost::alloc::string::String, - /// The IBC sequence number of the recv packet. - /// This field is used in the store key to ensure uniqueness. - #[prost(uint64, tag = "3")] - pub ibc_seq_num: u64, - /// The provider's consensus address of the validator being slashed. - /// This field is used to obtain validator power in HandleThrottleQueues. - /// - /// This field is not used in the store key, but is persisted in value bytes, - /// see QueueGlobalSlashEntry. - #[prost(bytes = "vec", tag = "4")] - pub provider_val_cons_addr: ::prost::alloc::vec::Vec, +pub struct MaturedUnbondingOps { + #[prost(uint64, repeated, tag = "1")] + pub ids: ::prost::alloc::vec::Vec, } -impl ::prost::Name for GlobalSlashEntry { - const NAME: &'static str = "GlobalSlashEntry"; +impl ::prost::Name for MaturedUnbondingOps { + const NAME: &'static str = "MaturedUnbondingOps"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// Params defines the parameters for CCV Provider module +/// ExportedVscSendTimestamps is VscSendTimestamp with chainID info for exporting to genesis #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - #[prost(message, optional, tag = "1")] - pub template_client: ::core::option::Option< - super::super::super::super::ibc::lightclients::tendermint::v1::ClientState, - >, - /// TrustingPeriodFraction is used to compute the consumer and provider IBC - /// client's TrustingPeriod from the chain defined UnbondingPeriod - #[prost(string, tag = "2")] - pub trusting_period_fraction: ::prost::alloc::string::String, - /// Sent IBC packets will timeout after this duration - #[prost(message, optional, tag = "3")] - pub ccv_timeout_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// The channel initialization (IBC channel opening handshake) will timeout - /// after this duration - #[prost(message, optional, tag = "4")] - pub init_timeout_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// The VSC packets sent by the provider will timeout after this duration. - /// Note that unlike ccv_timeout_period which is an IBC param, - /// the vsc_timeout_period is a provider-side param that enables the provider - /// to timeout VSC packets even when a consumer chain is not live. - #[prost(message, optional, tag = "5")] - pub vsc_timeout_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// The period for which the slash meter is replenished - #[prost(message, optional, tag = "6")] - pub slash_meter_replenish_period: ::core::option::Option< - super::super::super::super::google::protobuf::Duration, - >, - /// The fraction of total voting power that is replenished to the slash meter - /// every replenish period. This param also serves as a maximum fraction of - /// total voting power that the slash meter can hold. - #[prost(string, tag = "7")] - pub slash_meter_replenish_fraction: ::prost::alloc::string::String, - /// The maximum amount of throttled slash or vsc matured packets - /// that can be queued for a single consumer before the provider chain halts. - #[prost(int64, tag = "8")] - pub max_throttled_packets: i64, - /// The fee required to be paid to add a reward denom - #[prost(message, optional, tag = "9")] - pub consumer_reward_denom_registration_fee: ::core::option::Option< - super::super::super::super::cosmos::base::v1beta1::Coin, - >, +pub struct ExportedVscSendTimestamp { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub vsc_send_timestamps: ::prost::alloc::vec::Vec, } -impl ::prost::Name for Params { - const NAME: &'static str = "Params"; +impl ::prost::Name for ExportedVscSendTimestamp { + const NAME: &'static str = "ExportedVscSendTimestamp"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// SlashAcks contains cons addresses of consumer chain validators -/// successfully slashed on the provider chain. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct SlashAcks { - #[prost(string, repeated, tag = "1")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +pub struct KeyAssignmentReplacement { + #[prost(bytes = "vec", tag = "1")] + pub provider_addr: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub prev_c_key: ::core::option::Option<::cometbft_proto::crypto::v1::PublicKey>, + #[prost(int64, tag = "3")] + pub power: i64, } -impl ::prost::Name for SlashAcks { - const NAME: &'static str = "SlashAcks"; +impl ::prost::Name for KeyAssignmentReplacement { + const NAME: &'static str = "KeyAssignmentReplacement"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ConsumerAdditionProposals holds pending governance proposals on the provider -/// chain to spawn a new chain. +/// Used to serialize the ValidatorConsumerPubKey index from key assignment +/// ValidatorConsumerPubKey: (chainID, providerAddr consAddr) -> consumerKey +/// tmprotocrypto.PublicKey #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerAdditionProposals { - /// proposals waiting for spawn_time to pass - #[prost(message, repeated, tag = "1")] - pub pending: ::prost::alloc::vec::Vec, +pub struct ValidatorConsumerPubKey { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub provider_addr: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub consumer_key: ::core::option::Option<::cometbft_proto::crypto::v1::PublicKey>, } -impl ::prost::Name for ConsumerAdditionProposals { - const NAME: &'static str = "ConsumerAdditionProposals"; +impl ::prost::Name for ValidatorConsumerPubKey { + const NAME: &'static str = "ValidatorConsumerPubKey"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ConsumerRemovalProposals holds pending governance proposals on the provider -/// chain to remove (and stop) a consumer chain. +/// Used to serialize the ValidatorConsumerAddr index from key assignment +/// ValidatorByConsumerAddr: (chainID, consumerAddr consAddr) -> providerAddr +/// consAddr #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerRemovalProposals { - /// proposals waiting for stop_time to pass - #[prost(message, repeated, tag = "1")] - pub pending: ::prost::alloc::vec::Vec, +pub struct ValidatorByConsumerAddr { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub consumer_addr: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub provider_addr: ::prost::alloc::vec::Vec, } -impl ::prost::Name for ConsumerRemovalProposals { - const NAME: &'static str = "ConsumerRemovalProposals"; +impl ::prost::Name for ValidatorByConsumerAddr { + const NAME: &'static str = "ValidatorByConsumerAddr"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// AddressList contains a list of consensus addresses +/// Used to serialize the ConsumerAddrsToPrune index from key assignment +/// ConsumerAddrsToPrune: (chainID, vscID uint64) -> consumerAddrs AddressList #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct AddressList { - #[prost(bytes = "vec", repeated, tag = "1")] - pub addresses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +pub struct ConsumerAddrsToPrune { + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "2")] + pub vsc_id: u64, + #[prost(message, optional, tag = "3")] + pub consumer_addrs: ::core::option::Option, } -impl ::prost::Name for AddressList { - const NAME: &'static str = "AddressList"; +impl ::prost::Name for ConsumerAddrsToPrune { + const NAME: &'static str = "ConsumerAddrsToPrune"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } +/// GenesisState defines the CCV provider chain genesis state #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChannelToChain { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub chain_id: ::prost::alloc::string::String, +pub struct GenesisState { + /// strictly positive and set to 1 (DefaultValsetUpdateID) for a new chain + #[prost(uint64, tag = "1")] + pub valset_update_id: u64, + /// empty for a new chain + #[prost(message, repeated, tag = "2")] + pub consumer_states: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, repeated, tag = "3")] + pub unbonding_ops: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, optional, tag = "4")] + pub mature_unbonding_ops: ::core::option::Option, + /// empty for a new chain + #[prost(message, repeated, tag = "5")] + pub valset_update_id_to_height: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, repeated, tag = "6")] + pub consumer_addition_proposals: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, repeated, tag = "7")] + pub consumer_removal_proposals: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub params: ::core::option::Option, + /// empty for a new chain + #[prost(message, repeated, tag = "9")] + pub validator_consumer_pubkeys: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, repeated, tag = "10")] + pub validators_by_consumer_addr: ::prost::alloc::vec::Vec, + /// empty for a new chain + #[prost(message, repeated, tag = "11")] + pub consumer_addrs_to_prune: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "12")] + pub init_timeout_timestamps: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "13")] + pub exported_vsc_send_timestamps: ::prost::alloc::vec::Vec, } -impl ::prost::Name for ChannelToChain { - const NAME: &'static str = "ChannelToChain"; +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// VscUnbondingOps contains the IDs of unbonding operations that are waiting for -/// at least one VSCMaturedPacket with vscID from a consumer chain +/// The provider CCV module's knowledge of consumer state. +/// +/// Note this type is only used internally to the provider CCV module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct VscUnbondingOps { - #[prost(uint64, tag = "1")] - pub vsc_id: u64, - #[prost(uint64, repeated, tag = "2")] - pub unbonding_op_ids: ::prost::alloc::vec::Vec, +pub struct ConsumerState { + /// ChainID defines the chain ID for the consumer chain + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + /// ChannelID defines the IBC channel ID for the consumer chain + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + /// ClientID defines the IBC client ID for the consumer chain + #[prost(string, tag = "3")] + pub client_id: ::prost::alloc::string::String, + /// InitalHeight defines the initial block height for the consumer chain + #[prost(uint64, tag = "4")] + pub initial_height: u64, + /// ConsumerGenesis defines the initial consumer chain genesis states + #[prost(message, optional, tag = "5")] + pub consumer_genesis: ::core::option::Option, + /// PendingValsetChanges defines the pending validator set changes for the + /// consumer chain + #[prost(message, repeated, tag = "6")] + pub pending_valset_changes: ::prost::alloc::vec::Vec< + super::super::v1::ValidatorSetChangePacketData, + >, + #[prost(string, repeated, tag = "7")] + pub slash_downtime_ack: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// UnbondingOpsIndex defines the unbonding operations waiting on this consumer + /// chain + #[prost(message, repeated, tag = "8")] + pub unbonding_ops_index: ::prost::alloc::vec::Vec, } -impl ::prost::Name for VscUnbondingOps { - const NAME: &'static str = "VscUnbondingOps"; +impl ::prost::Name for ConsumerState { + const NAME: &'static str = "ConsumerState"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// UnbondingOp contains the ids of consumer chains that need to unbond before -/// the unbonding operation with the given ID can unbond +/// ValsetUpdateIdToHeight defines the genesis information for the mapping +/// of each valset udpate id to a block height #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct UnbondingOp { +pub struct ValsetUpdateIdToHeight { #[prost(uint64, tag = "1")] - pub id: u64, - /// consumer chains that are still unbonding - #[prost(string, repeated, tag = "2")] - pub unbonding_consumer_chains: ::prost::alloc::vec::Vec< - ::prost::alloc::string::String, - >, + pub valset_update_id: u64, + #[prost(uint64, tag = "2")] + pub height: u64, } -impl ::prost::Name for UnbondingOp { - const NAME: &'static str = "UnbondingOp"; +impl ::prost::Name for ValsetUpdateIdToHeight { + const NAME: &'static str = "ValsetUpdateIdToHeight"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) @@ -917,14 +609,12 @@ impl ::prost::Name for UnbondingOp { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct InitTimeoutTimestamp { +pub struct QueryConsumerGenesisRequest { #[prost(string, tag = "1")] pub chain_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub timestamp: u64, } -impl ::prost::Name for InitTimeoutTimestamp { - const NAME: &'static str = "InitTimeoutTimestamp"; +impl ::prost::Name for QueryConsumerGenesisRequest { + const NAME: &'static str = "QueryConsumerGenesisRequest"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) @@ -932,61 +622,45 @@ impl ::prost::Name for InitTimeoutTimestamp { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct VscSendTimestamp { - #[prost(uint64, tag = "1")] - pub vsc_id: u64, - #[prost(message, optional, tag = "2")] - pub timestamp: ::core::option::Option< - super::super::super::super::google::protobuf::Timestamp, - >, +pub struct QueryConsumerGenesisResponse { + #[prost(message, optional, tag = "1")] + pub genesis_state: ::core::option::Option, } -impl ::prost::Name for VscSendTimestamp { - const NAME: &'static str = "VscSendTimestamp"; +impl ::prost::Name for QueryConsumerGenesisResponse { + const NAME: &'static str = "QueryConsumerGenesisResponse"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ValidatorSetChangePackets is a pb list of ccv.ValidatorSetChangePacketData. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValidatorSetChangePackets { - #[prost(message, repeated, tag = "1")] - pub list: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ValidatorSetChangePackets { - const NAME: &'static str = "ValidatorSetChangePackets"; +pub struct QueryConsumerChainsRequest {} +impl ::prost::Name for QueryConsumerChainsRequest { + const NAME: &'static str = "QueryConsumerChainsRequest"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// MaturedUnbondingOps defines a list of ids corresponding to ids of matured -/// unbonding operations. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MaturedUnbondingOps { - #[prost(uint64, repeated, tag = "1")] - pub ids: ::prost::alloc::vec::Vec, +pub struct QueryConsumerChainsResponse { + #[prost(message, repeated, tag = "1")] + pub chains: ::prost::alloc::vec::Vec, } -impl ::prost::Name for MaturedUnbondingOps { - const NAME: &'static str = "MaturedUnbondingOps"; +impl ::prost::Name for QueryConsumerChainsResponse { + const NAME: &'static str = "QueryConsumerChainsResponse"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) } } -/// ExportedVscSendTimestamps is VscSendTimestamp with chainID info for exporting to genesis #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExportedVscSendTimestamp { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - #[prost(message, repeated, tag = "2")] - pub vsc_send_timestamps: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ExportedVscSendTimestamp { - const NAME: &'static str = "ExportedVscSendTimestamp"; +pub struct QueryConsumerChainStartProposalsRequest {} +impl ::prost::Name for QueryConsumerChainStartProposalsRequest { + const NAME: &'static str = "QueryConsumerChainStartProposalsRequest"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) @@ -994,147 +668,12 @@ impl ::prost::Name for ExportedVscSendTimestamp { } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct KeyAssignmentReplacement { - #[prost(bytes = "vec", tag = "1")] - pub provider_addr: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub prev_c_key: ::core::option::Option<::tendermint_proto::crypto::PublicKey>, - #[prost(int64, tag = "3")] - pub power: i64, +pub struct QueryConsumerChainStartProposalsResponse { + #[prost(message, optional, tag = "1")] + pub proposals: ::core::option::Option, } -impl ::prost::Name for KeyAssignmentReplacement { - const NAME: &'static str = "KeyAssignmentReplacement"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -/// Used to serialize the ValidatorConsumerPubKey index from key assignment -/// ValidatorConsumerPubKey: (chainID, providerAddr consAddr) -> consumerKey -/// tmprotocrypto.PublicKey -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValidatorConsumerPubKey { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub provider_addr: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub consumer_key: ::core::option::Option<::tendermint_proto::crypto::PublicKey>, -} -impl ::prost::Name for ValidatorConsumerPubKey { - const NAME: &'static str = "ValidatorConsumerPubKey"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -/// Used to serialize the ValidatorConsumerAddr index from key assignment -/// ValidatorByConsumerAddr: (chainID, consumerAddr consAddr) -> providerAddr -/// consAddr -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValidatorByConsumerAddr { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - #[prost(bytes = "vec", tag = "2")] - pub consumer_addr: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub provider_addr: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ValidatorByConsumerAddr { - const NAME: &'static str = "ValidatorByConsumerAddr"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -/// Used to serialize the ConsumerAddrsToPrune index from key assignment -/// ConsumerAddrsToPrune: (chainID, vscID uint64) -> consumerAddrs AddressList -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerAddrsToPrune { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub vsc_id: u64, - #[prost(message, optional, tag = "3")] - pub consumer_addrs: ::core::option::Option, -} -impl ::prost::Name for ConsumerAddrsToPrune { - const NAME: &'static str = "ConsumerAddrsToPrune"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerGenesisRequest { - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, -} -impl ::prost::Name for QueryConsumerGenesisRequest { - const NAME: &'static str = "QueryConsumerGenesisRequest"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerGenesisResponse { - #[prost(message, optional, tag = "1")] - pub genesis_state: ::core::option::Option, -} -impl ::prost::Name for QueryConsumerGenesisResponse { - const NAME: &'static str = "QueryConsumerGenesisResponse"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerChainsRequest {} -impl ::prost::Name for QueryConsumerChainsRequest { - const NAME: &'static str = "QueryConsumerChainsRequest"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerChainsResponse { - #[prost(message, repeated, tag = "1")] - pub chains: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for QueryConsumerChainsResponse { - const NAME: &'static str = "QueryConsumerChainsResponse"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerChainStartProposalsRequest {} -impl ::prost::Name for QueryConsumerChainStartProposalsRequest { - const NAME: &'static str = "QueryConsumerChainStartProposalsRequest"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct QueryConsumerChainStartProposalsResponse { - #[prost(message, optional, tag = "1")] - pub proposals: ::core::option::Option, -} -impl ::prost::Name for QueryConsumerChainStartProposalsResponse { - const NAME: &'static str = "QueryConsumerChainStartProposalsResponse"; +impl ::prost::Name for QueryConsumerChainStartProposalsResponse { + const NAME: &'static str = "QueryConsumerChainStartProposalsResponse"; const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; fn full_name() -> ::prost::alloc::string::String { ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) @@ -2216,23 +1755,602 @@ pub mod query_server { } "/interchain_security.ccv.provider.v1.Query/QueryThrottleState" => { #[allow(non_camel_case_types)] - struct QueryThrottleStateSvc(pub Arc); - impl< - T: Query, - > tonic::server::UnaryService - for QueryThrottleStateSvc { - type Response = super::QueryThrottleStateResponse; + struct QueryThrottleStateSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for QueryThrottleStateSvc { + type Response = super::QueryThrottleStateResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::query_throttle_state(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = QueryThrottleStateSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/interchain_security.ccv.provider.v1.Query/QueryThrottledConsumerPacketData" => { + #[allow(non_camel_case_types)] + struct QueryThrottledConsumerPacketDataSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryThrottledConsumerPacketDataRequest, + > for QueryThrottledConsumerPacketDataSvc { + type Response = super::QueryThrottledConsumerPacketDataResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryThrottledConsumerPacketDataRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::query_throttled_consumer_packet_data( + &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 = QueryThrottledConsumerPacketDataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/interchain_security.ccv.provider.v1.Query/QueryRegisteredConsumerRewardDenoms" => { + #[allow(non_camel_case_types)] + struct QueryRegisteredConsumerRewardDenomsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryRegisteredConsumerRewardDenomsRequest, + > for QueryRegisteredConsumerRewardDenomsSvc { + type Response = super::QueryRegisteredConsumerRewardDenomsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryRegisteredConsumerRewardDenomsRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::query_registered_consumer_reward_denoms( + &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 = QueryRegisteredConsumerRewardDenomsSvc(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 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, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + 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 = "interchain_security.ccv.provider.v1.Query"; + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAssignConsumerKey { + /// The chain id of the consumer chain to assign a consensus public key to + #[prost(string, tag = "1")] + pub chain_id: ::prost::alloc::string::String, + /// The validator address on the provider + #[prost(string, tag = "2")] + pub provider_addr: ::prost::alloc::string::String, + /// The consensus public key to use on the consumer. + /// in json string format corresponding to proto-any, ex: + /// `{"@type":"/cosmos.crypto.ed25519.PubKey","key":"Ui5Gf1+mtWUdH8u3xlmzdKID+F3PK0sfXZ73GZ6q6is="}` + #[prost(string, tag = "3")] + pub consumer_key: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgAssignConsumerKey { + const NAME: &'static str = "MsgAssignConsumerKey"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAssignConsumerKeyResponse {} +impl ::prost::Name for MsgAssignConsumerKeyResponse { + const NAME: &'static str = "MsgAssignConsumerKeyResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +/// MsgSubmitConsumerMisbehaviour defines a message that reports a light client attack, +/// also known as a misbehaviour, observed on a consumer chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitConsumerMisbehaviour { + #[prost(string, tag = "1")] + pub submitter: ::prost::alloc::string::String, + /// The Misbehaviour of the consumer chain wrapping + /// two conflicting IBC headers + #[prost(message, optional, tag = "2")] + pub misbehaviour: ::core::option::Option< + super::super::super::super::ibc::lightclients::tendermint::v1::Misbehaviour, + >, +} +impl ::prost::Name for MsgSubmitConsumerMisbehaviour { + const NAME: &'static str = "MsgSubmitConsumerMisbehaviour"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitConsumerMisbehaviourResponse {} +impl ::prost::Name for MsgSubmitConsumerMisbehaviourResponse { + const NAME: &'static str = "MsgSubmitConsumerMisbehaviourResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +/// MsgSubmitConsumerDoubleVoting defines a message that reports +/// a double signing infraction observed on a consumer chain +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitConsumerDoubleVoting { + #[prost(string, tag = "1")] + pub submitter: ::prost::alloc::string::String, + /// The equivocation of the consumer chain wrapping + /// an evidence of a validator that signed two conflicting votes + #[prost(message, optional, tag = "2")] + pub duplicate_vote_evidence: ::core::option::Option< + ::cometbft_proto::types::v1::DuplicateVoteEvidence, + >, + /// The light client header of the infraction block + #[prost(message, optional, tag = "3")] + pub infraction_block_header: ::core::option::Option< + super::super::super::super::ibc::lightclients::tendermint::v1::Header, + >, +} +impl ::prost::Name for MsgSubmitConsumerDoubleVoting { + const NAME: &'static str = "MsgSubmitConsumerDoubleVoting"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitConsumerDoubleVotingResponse {} +impl ::prost::Name for MsgSubmitConsumerDoubleVotingResponse { + const NAME: &'static str = "MsgSubmitConsumerDoubleVotingResponse"; + const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + } +} +/// Generated client implementations. +#[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; + /// Msg defines the Msg service. + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[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 assign_consumer_key( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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( + "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "interchain_security.ccv.provider.v1.Msg", + "AssignConsumerKey", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn submit_consumer_misbehaviour( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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( + "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "interchain_security.ccv.provider.v1.Msg", + "SubmitConsumerMisbehaviour", + ), + ); + self.inner.unary(req, path, codec).await + } + pub async fn submit_consumer_double_voting( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + 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( + "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "interchain_security.ccv.provider.v1.Msg", + "SubmitConsumerDoubleVoting", + ), + ); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "server")] +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 { + async fn assign_consumer_key( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn submit_consumer_misbehaviour( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn submit_consumer_double_voting( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + } + /// Msg defines the Msg service. + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + 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 + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + 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() { + "/interchain_security.ccv.provider.v1.Msg/AssignConsumerKey" => { + #[allow(non_camel_case_types)] + struct AssignConsumerKeySvc(pub Arc); + impl tonic::server::UnaryService + for AssignConsumerKeySvc { + type Response = super::MsgAssignConsumerKeyResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::query_throttle_state(&inner, request).await + ::assign_consumer_key(&inner, request).await }; Box::pin(fut) } @@ -2244,7 +2362,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = QueryThrottleStateSvc(inner); + let method = AssignConsumerKeySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2260,31 +2378,25 @@ pub mod query_server { }; Box::pin(fut) } - "/interchain_security.ccv.provider.v1.Query/QueryThrottledConsumerPacketData" => { + "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerMisbehaviour" => { #[allow(non_camel_case_types)] - struct QueryThrottledConsumerPacketDataSvc(pub Arc); + struct SubmitConsumerMisbehaviourSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService< - super::QueryThrottledConsumerPacketDataRequest, - > for QueryThrottledConsumerPacketDataSvc { - type Response = super::QueryThrottledConsumerPacketDataResponse; + T: Msg, + > tonic::server::UnaryService + for SubmitConsumerMisbehaviourSvc { + type Response = super::MsgSubmitConsumerMisbehaviourResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryThrottledConsumerPacketDataRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::query_throttled_consumer_packet_data( - &inner, - request, - ) + ::submit_consumer_misbehaviour(&inner, request) .await }; Box::pin(fut) @@ -2297,7 +2409,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = QueryThrottledConsumerPacketDataSvc(inner); + let method = SubmitConsumerMisbehaviourSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2313,31 +2425,25 @@ pub mod query_server { }; Box::pin(fut) } - "/interchain_security.ccv.provider.v1.Query/QueryRegisteredConsumerRewardDenoms" => { + "/interchain_security.ccv.provider.v1.Msg/SubmitConsumerDoubleVoting" => { #[allow(non_camel_case_types)] - struct QueryRegisteredConsumerRewardDenomsSvc(pub Arc); + struct SubmitConsumerDoubleVotingSvc(pub Arc); impl< - T: Query, - > tonic::server::UnaryService< - super::QueryRegisteredConsumerRewardDenomsRequest, - > for QueryRegisteredConsumerRewardDenomsSvc { - type Response = super::QueryRegisteredConsumerRewardDenomsResponse; + T: Msg, + > tonic::server::UnaryService + for SubmitConsumerDoubleVotingSvc { + type Response = super::MsgSubmitConsumerDoubleVotingResponse; type Future = BoxFuture< tonic::Response, tonic::Status, >; fn call( &mut self, - request: tonic::Request< - super::QueryRegisteredConsumerRewardDenomsRequest, - >, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::query_registered_consumer_reward_denoms( - &inner, - request, - ) + ::submit_consumer_double_voting(&inner, request) .await }; Box::pin(fut) @@ -2350,7 +2456,7 @@ pub mod query_server { let inner = self.inner.clone(); let fut = async move { let inner = inner.0; - let method = QueryRegisteredConsumerRewardDenomsSvc(inner); + let method = SubmitConsumerDoubleVotingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -2381,7 +2487,7 @@ pub mod query_server { } } } - impl Clone for QueryServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2393,7 +2499,7 @@ pub mod query_server { } } } - impl Clone for _Inner { + impl Clone for _Inner { fn clone(&self) -> Self { Self(Arc::clone(&self.0)) } @@ -2403,113 +2509,7 @@ pub mod query_server { write!(f, "{:?}", self.0) } } - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = "interchain_security.ccv.provider.v1.Query"; - } -} -/// GenesisState defines the CCV provider chain genesis state -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// strictly positive and set to 1 (DefaultValsetUpdateID) for a new chain - #[prost(uint64, tag = "1")] - pub valset_update_id: u64, - /// empty for a new chain - #[prost(message, repeated, tag = "2")] - pub consumer_states: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, repeated, tag = "3")] - pub unbonding_ops: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, optional, tag = "4")] - pub mature_unbonding_ops: ::core::option::Option, - /// empty for a new chain - #[prost(message, repeated, tag = "5")] - pub valset_update_id_to_height: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, repeated, tag = "6")] - pub consumer_addition_proposals: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, repeated, tag = "7")] - pub consumer_removal_proposals: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "8")] - pub params: ::core::option::Option, - /// empty for a new chain - #[prost(message, repeated, tag = "9")] - pub validator_consumer_pubkeys: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, repeated, tag = "10")] - pub validators_by_consumer_addr: ::prost::alloc::vec::Vec, - /// empty for a new chain - #[prost(message, repeated, tag = "11")] - pub consumer_addrs_to_prune: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "12")] - pub init_timeout_timestamps: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "13")] - pub exported_vsc_send_timestamps: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for GenesisState { - const NAME: &'static str = "GenesisState"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -/// The provider CCV module's knowledge of consumer state. -/// -/// Note this type is only used internally to the provider CCV module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsumerState { - /// ChainID defines the chain ID for the consumer chain - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - /// ChannelID defines the IBC channel ID for the consumer chain - #[prost(string, tag = "2")] - pub channel_id: ::prost::alloc::string::String, - /// ClientID defines the IBC client ID for the consumer chain - #[prost(string, tag = "3")] - pub client_id: ::prost::alloc::string::String, - /// InitalHeight defines the initial block height for the consumer chain - #[prost(uint64, tag = "4")] - pub initial_height: u64, - /// ConsumerGenesis defines the initial consumer chain genesis states - #[prost(message, optional, tag = "5")] - pub consumer_genesis: ::core::option::Option, - /// PendingValsetChanges defines the pending validator set changes for the - /// consumer chain - #[prost(message, repeated, tag = "6")] - pub pending_valset_changes: ::prost::alloc::vec::Vec< - super::super::v1::ValidatorSetChangePacketData, - >, - #[prost(string, repeated, tag = "7")] - pub slash_downtime_ack: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, - /// UnbondingOpsIndex defines the unbonding operations waiting on this consumer - /// chain - #[prost(message, repeated, tag = "8")] - pub unbonding_ops_index: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for ConsumerState { - const NAME: &'static str = "ConsumerState"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) - } -} -/// ValsetUpdateIdToHeight defines the genesis information for the mapping -/// of each valset udpate id to a block height -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ValsetUpdateIdToHeight { - #[prost(uint64, tag = "1")] - pub valset_update_id: u64, - #[prost(uint64, tag = "2")] - pub height: u64, -} -impl ::prost::Name for ValsetUpdateIdToHeight { - const NAME: &'static str = "ValsetUpdateIdToHeight"; - const PACKAGE: &'static str = "interchain_security.ccv.provider.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("interchain_security.ccv.provider.v1.{}", Self::NAME) + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "interchain_security.ccv.provider.v1.Msg"; } } diff --git a/src/prost/interchain_security.ccv.v1.rs b/src/prost/interchain_security.ccv.v1.rs index c072c5f1..48dbe8e0 100644 --- a/src/prost/interchain_security.ccv.v1.rs +++ b/src/prost/interchain_security.ccv.v1.rs @@ -8,7 +8,7 @@ pub struct ValidatorSetChangePacketData { #[prost(message, repeated, tag = "1")] pub validator_updates: ::prost::alloc::vec::Vec< - ::tendermint_proto::abci::ValidatorUpdate, + ::cometbft_proto::abci::v1beta1::ValidatorUpdate, >, #[prost(uint64, tag = "2")] pub valset_update_id: u64, @@ -47,7 +47,7 @@ impl ::prost::Name for VscMaturedPacketData { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SlashPacketData { #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option<::tendermint_proto::abci::Validator>, + pub validator: ::core::option::Option<::cometbft_proto::abci::v1beta1::Validator>, /// map to the infraction block height on the provider #[prost(uint64, tag = "2")] pub valset_update_id: u64, @@ -142,7 +142,7 @@ impl ::prost::Name for ConsumerPacketDataV1 { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SlashPacketDataV1 { #[prost(message, optional, tag = "1")] - pub validator: ::core::option::Option<::tendermint_proto::abci::Validator>, + pub validator: ::core::option::Option<::cometbft_proto::abci::v1beta1::Validator>, /// map to the infraction block height on the provider #[prost(uint64, tag = "2")] pub valset_update_id: u64, @@ -340,7 +340,7 @@ pub struct ConsumerGenesisState { /// InitialValset filled in on new chain and on restart. #[prost(message, repeated, tag = "8")] pub initial_val_set: ::prost::alloc::vec::Vec< - ::tendermint_proto::abci::ValidatorUpdate, + ::cometbft_proto::abci::v1beta1::ValidatorUpdate, >, /// HeightToValsetUpdateId nil on new chain, filled in on restart. #[prost(message, repeated, tag = "9")] diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index a785e760..f93ad416 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ diff --git a/src/prost/stride.interchainquery.v1.rs b/src/prost/stride.interchainquery.v1.rs index b13204f6..7881d6c7 100644 --- a/src/prost/stride.interchainquery.v1.rs +++ b/src/prost/stride.interchainquery.v1.rs @@ -9,7 +9,7 @@ pub struct MsgSubmitQueryResponse { #[prost(bytes = "vec", tag = "3")] pub result: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "4")] - pub proof_ops: ::core::option::Option<::tendermint_proto::crypto::ProofOps>, + pub proof_ops: ::core::option::Option<::cometbft_proto::crypto::v1::ProofOps>, #[prost(int64, tag = "5")] pub height: i64, #[prost(string, tag = "6")] diff --git a/tools/proto-compiler/src/cmd/compile.rs b/tools/proto-compiler/src/cmd/compile.rs index bb325564..7caffdc5 100644 --- a/tools/proto-compiler/src/cmd/compile.rs +++ b/tools/proto-compiler/src/cmd/compile.rs @@ -32,14 +32,7 @@ pub struct CompileCmd { impl CompileCmd { pub fn run(&self) { - Self::compile_ibc_protos( - self.ibc.as_ref(), - self.sdk.as_ref(), - self.ics.as_ref(), - self.nft.as_ref(), - self.out.as_ref(), - ) - .unwrap_or_else(|e| { + self.compile_ibc_protos().unwrap_or_else(|e| { eprintln!("[error] failed to compile protos: {}", e); process::exit(1); }); @@ -57,16 +50,10 @@ impl CompileCmd { println!("[info ] Done!"); } - fn compile_ibc_protos( - ibc_dir: &Path, - sdk_dir: &Path, - ics_dir: &Path, - nft_dir: &Path, - out_dir: &Path, - ) -> Result<(), Box> { + fn compile_ibc_protos(&self) -> Result<(), Box> { println!( "[info ] Compiling IBC .proto files to Rust into '{}'...", - out_dir.display() + self.out.display() ); let root = Path::new(env!("CARGO_MANIFEST_DIR")); @@ -76,26 +63,26 @@ impl CompileCmd { root.join("../../definitions/mock"), root.join("../../definitions/ibc/lightclients/localhost/v1"), root.join("../../definitions/stride/interchainquery/v1"), - ibc_dir.join("ibc"), - sdk_dir.join("cosmos/auth"), - sdk_dir.join("cosmos/gov"), - sdk_dir.join("cosmos/tx"), - sdk_dir.join("cosmos/base"), - sdk_dir.join("cosmos/crypto"), - sdk_dir.join("cosmos/bank"), - sdk_dir.join("cosmos/staking"), - sdk_dir.join("cosmos/upgrade"), - ics_dir.join("interchain_security/ccv/v1"), - ics_dir.join("interchain_security/ccv/provider"), - ics_dir.join("interchain_security/ccv/consumer"), - nft_dir.join("ibc"), + self.ibc.join("ibc"), + self.sdk.join("cosmos/auth"), + self.sdk.join("cosmos/gov"), + self.sdk.join("cosmos/tx"), + self.sdk.join("cosmos/base"), + self.sdk.join("cosmos/crypto"), + self.sdk.join("cosmos/bank"), + self.sdk.join("cosmos/staking"), + self.sdk.join("cosmos/upgrade"), + self.ics.join("interchain_security/ccv/v1"), + self.ics.join("interchain_security/ccv/provider"), + self.ics.join("interchain_security/ccv/consumer"), + self.nft.join("ibc"), ]; let proto_includes_paths = [ - sdk_dir.to_path_buf(), - ibc_dir.to_path_buf(), - ics_dir.to_path_buf(), - nft_dir.to_path_buf(), + self.sdk.to_path_buf(), + self.ibc.to_path_buf(), + self.ics.to_path_buf(), + self.nft.to_path_buf(), root.join("../../definitions/mock"), root.join("../../definitions/ibc/lightclients/localhost/v1"), root.join("../../definitions/stride/interchainquery/v1"), @@ -142,19 +129,33 @@ impl CompileCmd { .client_mod_attribute(".", r#"#[cfg(feature = "client")]"#) .build_server(true) .server_mod_attribute(".", r#"#[cfg(feature = "server")]"#) - .out_dir(out_dir) - .file_descriptor_set_path(out_dir.join("proto_descriptor.bin")) + .out_dir(&self.out) + .file_descriptor_set_path(self.out.join("proto_descriptor.bin")) // Use the v0.34 definition of `abci.Event` which does not enforce valid UTF-8 data // for its `key` and `value` attributes, specifying them as `bytes` instead of `string`. - // This is required, because ibc-go emits event attributes which are not valid UTF-8, + // This is required, because ibc-go emits event attributes which are not valid UTF-8 + // (sounds like a bug if it's up to CometBFT 0.38?), // so we need to use this definition to be able to parse them. // In Protobuf, `bytes` and `string` are wire-compatible, so doing this strictly // increases the amount fo data we can parse. .extern_path( ".tendermint.abci.Event", - "::tendermint_proto::v0_34::abci::Event", + "::cometbft_proto::abci::v1beta1::Event", + ) + // All other types should be up to CometBFT 0.38 + .extern_path( + ".tendermint.abci.Validator", + "::cometbft_proto::abci::v1beta1::Validator", + ) + .extern_path( + ".tendermint.abci.ValidatorUpdate", + "::cometbft_proto::abci::v1beta1::ValidatorUpdate", ) - .extern_path(".tendermint", "::tendermint_proto") + .extern_path(".tendermint.abci", "::cometbft_proto::abci::v1beta3") + .extern_path(".tendermint.crypto", "::cometbft_proto::crypto::v1") + .extern_path(".tendermint.p2p", "::cometbft_proto::p2p::v1") + .extern_path(".tendermint.types", "::cometbft_proto::types::v1") + .extern_path(".tendermint.version", "::cometbft_proto::version::v1") .extern_path(".ics23", "::ics23") .type_attribute(".google.protobuf.Any", attrs_eq) .type_attribute(".google.protobuf.Any", attrs_jsonschema)