diff --git a/cosmos-sdk-go b/cosmos-sdk-go index ad9e5620..5cd0b231 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit ad9e5620fb3445c716e9de45cfcdb56e8f1745bf +Subproject commit 5cd0b2316a7103468af38eab5d886f9f069c9cd7 diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT index db3ad2f4..22ced787 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT @@ -1 +1 @@ -v0.45.4 \ No newline at end of file +v0.46.12 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs new file mode 100644 index 00000000..c37f344f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.module.v1alpha1.rs @@ -0,0 +1,5 @@ +// @generated +/// Module is the module config object for the cosmos.app v1 app module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs new file mode 100644 index 00000000..e857bec1 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs @@ -0,0 +1,123 @@ +// @generated +/// ModuleDescriptor describes an app module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleDescriptor { + /// go_import names the package that should be imported by an app to load the + /// module in the runtime module registry. It is required to make debugging + /// of configuration errors easier for users. + #[prost(string, tag = "1")] + pub go_import: ::prost::alloc::string::String, + /// use_package refers to a protobuf package that this module + /// uses and exposes to the world. In an app, only one module should "use" + /// or own a single protobuf package. It is assumed that the module uses + /// all of the .proto files in a single package. + #[prost(message, repeated, tag = "2")] + pub use_package: ::prost::alloc::vec::Vec, + /// can_migrate_from defines which module versions this module can migrate + /// state from. The framework will check that one module version is able to + /// migrate from a previous module version before attempting to update its + /// config. It is assumed that modules can transitively migrate from earlier + /// versions. For instance if v3 declares it can migrate from v2, and v2 + /// declares it can migrate from v1, the framework knows how to migrate + /// from v1 to v3, assuming all 3 module versions are registered at runtime. + #[prost(message, repeated, tag = "3")] + pub can_migrate_from: ::prost::alloc::vec::Vec, +} +/// PackageReference is a reference to a protobuf package used by a module. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PackageReference { + /// name is the fully-qualified name of the package. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// revision is the optional revision of the package that is being used. + /// Protobuf packages used in Cosmos should generally have a major version + /// as the last part of the package name, ex. foo.bar.baz.v1. + /// The revision of a package can be thought of as the minor version of a + /// package which has additional backwards compatible definitions that weren't + /// present in a previous version. + /// + /// A package should indicate its revision with a source code comment + /// above the package declaration in one of its files containing the + /// text "Revision N" where N is an integer revision. All packages start + /// at revision 0 the first time they are released in a module. + /// + /// 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. + /// + /// When the module runtime starts up, it will check the pinned proto + /// image and panic if there are runtime protobuf definitions that are not + /// in the pinned descriptor which do not have + /// a "Since Revision N" comment or have a "Since Revision N" comment where + /// N is <= to the revision specified here. This indicates that the protobuf + /// files have been updated, but the pinned file descriptor hasn't. + /// + /// If there are items in the pinned file descriptor with a revision + /// greater than the value indicated here, this will also cause a panic + /// as it may mean that the pinned descriptor for a legacy module has been + /// improperly updated or that there is some other versioning discrepancy. + /// Runtime protobuf definitions will also be checked for compatibility + /// with pinned file descriptors to make sure there are no incompatible changes. + /// + /// This behavior ensures that: + /// * pinned proto images are up-to-date + /// * protobuf files are carefully annotated with revision comments which + /// are important good client UX + /// * protobuf files are changed in backwards and forwards compatible ways + #[prost(uint32, tag = "2")] + pub revision: u32, +} +/// MigrateFromInfo is information on a module version that a newer module +/// can migrate from. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MigrateFromInfo { + /// module is the fully-qualified protobuf name of the module config object + /// for the previous module version, ex: "cosmos.group.module.v1.Module". + #[prost(string, tag = "1")] + pub module: ::prost::alloc::string::String, +} +/// Config represents the configuration for a Cosmos SDK ABCI app. +/// It is intended that all state machine logic including the version of +/// baseapp and tx handlers (and possibly even Tendermint) that an app needs +/// can be described in a config object. For compatibility, the framework should +/// allow a mixture of declarative and imperative app wiring, however, apps +/// that strive for the maximum ease of maintainability should be able to describe +/// their state machine with a config object alone. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Config { + /// modules are the module configurations for the app. + #[prost(message, repeated, tag = "1")] + pub modules: ::prost::alloc::vec::Vec, +} +/// ModuleConfig is a module configuration for an app. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleConfig { + /// name is the unique name of the module within the app. It should be a name + /// that persists between different versions of a module so that modules + /// can be smoothly upgraded to new versions. + /// + /// For example, for the module cosmos.bank.module.v1.Module, we may chose + /// to simply name the module "bank" in the app. When we upgrade to + /// cosmos.bank.module.v2.Module, the app-specific name "bank" stays the same + /// and the framework knows that the v2 module should receive all the same state + /// that the v1 module had. Note: modules should provide info on which versions + /// they can migrate from in the ModuleDescriptor.can_migration_from field. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// config is the config object for the module. Module config messages should + /// define a ModuleDescriptor using the cosmos.app.v1alpha1.is_module extension. + #[prost(message, optional, tag = "2")] + pub config: ::core::option::Option<::prost_types::Any>, +} +/// QueryConfigRequest is the Query/Config request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConfigRequest {} +/// QueryConfigRequest is the Query/Config response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConfigResponse { + /// config is the current app config. + #[prost(message, optional, tag = "1")] + pub config: ::core::option::Option, +} +include!("cosmos.app.v1alpha1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.tonic.rs new file mode 100644 index 00000000..2b400c61 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.tonic.rs @@ -0,0 +1,230 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + /** Query is the app module query service. + */ + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /** Config returns the current app config. + */ + pub async fn config( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.app.v1alpha1.Query/Config"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + /** Config returns the current app config. + */ + async fn config( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + /** Query is the app module query service. + */ + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.app.v1alpha1.Query/Config" => { + #[allow(non_camel_case_types)] + struct ConfigSvc(pub Arc); + impl tonic::server::UnaryService for ConfigSvc { + type Response = super::QueryConfigResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).config(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ConfigSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.app.v1alpha1.Query"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs index 25df39f8..e14153ef 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.rs @@ -92,5 +92,94 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleAccountsRequest {} +/// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleAccountsResponse { + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +/// QueryModuleAccountByNameRequest is the request type for the Query/ModuleAccountByName RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleAccountByNameRequest { + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, +} +/// QueryModuleAccountByNameResponse is the response type for the Query/ModuleAccountByName RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryModuleAccountByNameResponse { + #[prost(message, optional, tag = "1")] + pub account: ::core::option::Option<::prost_types::Any>, +} +/// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Bech32PrefixRequest {} +/// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Bech32PrefixResponse { + #[prost(string, tag = "1")] + pub bech32_prefix: ::prost::alloc::string::String, +} +/// AddressBytesToStringRequest is the request type for AddressString rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressBytesToStringRequest { + #[prost(bytes = "vec", tag = "1")] + pub address_bytes: ::prost::alloc::vec::Vec, +} +/// AddressBytesToStringResponse is the response type for AddressString rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressBytesToStringResponse { + #[prost(string, tag = "1")] + pub address_string: ::prost::alloc::string::String, +} +/// AddressStringToBytesRequest is the request type for AccountBytes rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressStringToBytesRequest { + #[prost(string, tag = "1")] + pub address_string: ::prost::alloc::string::String, +} +/// AddressStringToBytesResponse is the response type for AddressBytes rpc method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AddressStringToBytesResponse { + #[prost(bytes = "vec", tag = "1")] + pub address_bytes: ::prost::alloc::vec::Vec, +} +/// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method +/// +/// Since: cosmos-sdk 0.46.2 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountAddressByIdRequest { + /// id is the account number of the address to be queried. This field + /// should have been an uint64 (like all account numbers), and will be + /// updated to uint64 in a future version of the auth query. + #[prost(int64, tag = "1")] + pub id: i64, +} +/// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method +/// +/// Since: cosmos-sdk 0.46.2 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountAddressByIdResponse { + #[prost(string, tag = "1")] + pub account_address: ::prost::alloc::string::String, +} include!("cosmos.auth.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs index cb9b3788..3a3ffccd 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.v1beta1.tonic.rs @@ -99,6 +99,23 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Account"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn account_address_by_id( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/AccountAddressByID", + ); + self.inner.unary(request.into_request(), path, codec).await + } pub async fn params( &mut self, request: impl tonic::IntoRequest, @@ -113,6 +130,85 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn module_accounts( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/ModuleAccounts"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn module_account_by_name( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/ModuleAccountByName", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn bech32_prefix( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Bech32Prefix"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn address_bytes_to_string( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/AddressBytesToString", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn address_string_to_bytes( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.auth.v1beta1.Query/AddressStringToBytes", + ); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -132,10 +228,34 @@ pub mod query_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn account_address_by_id( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; async fn params( &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn module_accounts( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn module_account_by_name( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn bech32_prefix( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn address_bytes_to_string( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn address_string_to_bytes( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -252,6 +372,40 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.auth.v1beta1.Query/AccountAddressByID" => { + #[allow(non_camel_case_types)] + struct AccountAddressByIDSvc(pub Arc); + impl + tonic::server::UnaryService + for AccountAddressByIDSvc + { + type Response = super::QueryAccountAddressByIdResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).account_address_by_id(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AccountAddressByIDSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.auth.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] struct ParamsSvc(pub Arc); @@ -283,6 +437,172 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.auth.v1beta1.Query/ModuleAccounts" => { + #[allow(non_camel_case_types)] + struct ModuleAccountsSvc(pub Arc); + impl tonic::server::UnaryService + for ModuleAccountsSvc + { + type Response = super::QueryModuleAccountsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).module_accounts(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ModuleAccountsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/ModuleAccountByName" => { + #[allow(non_camel_case_types)] + struct ModuleAccountByNameSvc(pub Arc); + impl + tonic::server::UnaryService + for ModuleAccountByNameSvc + { + type Response = super::QueryModuleAccountByNameResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).module_account_by_name(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ModuleAccountByNameSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/Bech32Prefix" => { + #[allow(non_camel_case_types)] + struct Bech32PrefixSvc(pub Arc); + impl tonic::server::UnaryService for Bech32PrefixSvc { + type Response = super::Bech32PrefixResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).bech32_prefix(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = Bech32PrefixSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/AddressBytesToString" => { + #[allow(non_camel_case_types)] + struct AddressBytesToStringSvc(pub Arc); + impl tonic::server::UnaryService + for AddressBytesToStringSvc + { + type Response = super::AddressBytesToStringResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).address_bytes_to_string(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddressBytesToStringSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.auth.v1beta1.Query/AddressStringToBytes" => { + #[allow(non_camel_case_types)] + struct AddressStringToBytesSvc(pub Arc); + impl tonic::server::UnaryService + for AddressStringToBytesSvc + { + type Response = super::AddressStringToBytesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).address_string_to_bytes(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AddressStringToBytesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index f7a0655b..8d38d9f9 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs @@ -13,13 +13,14 @@ pub struct GenericAuthorization { pub struct Grant { #[prost(message, optional, tag = "1")] pub authorization: ::core::option::Option<::prost_types::Any>, + /// time when the grant will expire and will be pruned. If null, then the grant + /// doesn't have a time expiration (other conditions in `authorization` + /// may apply to invalidate the grant) #[prost(message, optional, tag = "2")] pub expiration: ::core::option::Option<::prost_types::Timestamp>, } /// GrantAuthorization extends a grant with both the addresses of the grantee and granter. /// It is used in genesis.proto and query.proto -/// -/// Since: cosmos-sdk 0.45.2 #[derive(Clone, PartialEq, ::prost::Message)] pub struct GrantAuthorization { #[prost(string, tag = "1")] @@ -31,6 +32,13 @@ pub struct GrantAuthorization { #[prost(message, optional, tag = "4")] pub expiration: ::core::option::Option<::prost_types::Timestamp>, } +/// GrantQueueItem contains the list of TypeURL of a sdk.Msg. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GrantQueueItem { + /// msg_type_urls contains the list of TypeURL of a sdk.Msg. + #[prost(string, repeated, tag = "1")] + pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} /// EventGrant is emitted on Msg/Grant #[derive(Clone, PartialEq, ::prost::Message)] pub struct EventGrant { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs index 02d781ff..4574722a 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.rs @@ -58,7 +58,7 @@ pub struct DenomUnit { pub denom: ::prost::alloc::string::String, /// exponent represents power of 10 exponent that one must /// raise the base_denom to in order to equal the given DenomUnit's denom - /// 1 denom = 1^exponent base_denom + /// 1 denom = 10^exponent base_denom /// (e.g. with a base_denom of uatom, one can create a DenomUnit of 'atom' with /// exponent = 6, thus: 1 atom = 10^6 uatom). #[prost(uint32, tag = "2")] @@ -94,6 +94,17 @@ pub struct Metadata { /// Since: cosmos-sdk 0.43 #[prost(string, tag = "6")] pub symbol: ::prost::alloc::string::String, + /// URI to a document (on or off-chain) that contains additional information. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "7")] + pub uri: ::prost::alloc::string::String, + /// URIHash is a sha256 hash of a document pointed by URI. It's used to verify that + /// the document didn't change. Optional. + /// + /// Since: cosmos-sdk 0.46 + #[prost(string, tag = "8")] + pub uri_hash: ::prost::alloc::string::String, } /// GenesisState defines the bank module's genesis state. #[derive(Clone, PartialEq, ::prost::Message)] @@ -163,6 +174,8 @@ pub struct QueryAllBalancesResponse { } /// QuerySpendableBalancesRequest defines the gRPC request structure for querying /// an account's spendable balances. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { /// address is the address to query spendable balances for. @@ -174,6 +187,8 @@ pub struct QuerySpendableBalancesRequest { } /// QuerySpendableBalancesResponse defines the gRPC response structure for querying /// an account's spendable balances. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { /// balances is the spendable balances of all the coins. @@ -262,6 +277,43 @@ pub struct QueryDenomMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } +/// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, +/// which queries for a paginated set of all account holders of a particular +/// denomination. +#[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, +} +/// 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 +#[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, +} +/// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. +/// +/// Since: cosmos-sdk 0.46 +#[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, +} /// MsgSend represents a message to send coins from one account to another. #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSend { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs index e20cc86f..a9c40591 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.tonic.rs @@ -189,6 +189,21 @@ pub mod query_client { http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomsMetadata"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn denom_owners( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomOwners"); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -232,6 +247,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn denom_owners( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -540,6 +559,37 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Query/DenomOwners" => { + #[allow(non_camel_case_types)] + struct DenomOwnersSvc(pub Arc); + impl tonic::server::UnaryService for DenomOwnersSvc { + type Response = super::QueryDenomOwnersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).denom_owners(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs index 72588a1c..94c0e4b0 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.rs @@ -44,7 +44,7 @@ pub struct TxResponse { pub timestamp: ::prost::alloc::string::String, /// Events defines all the events emitted by processing a transaction. Note, /// these events include those emitted by processing all the messages and those - /// emitted from the ante handler. Whereas Logs contains the events, with + /// emitted from the ante. Whereas Logs contains the events, with /// additional metadata, emitted only by processing the messages. /// /// Since: cosmos-sdk 0.42.11, 0.44.5, 0.45 @@ -96,6 +96,9 @@ pub struct GasInfo { pub struct Result { /// Data is any data returned from message or handler execution. It MUST be /// length prefixed in order to separate data from multiple message executions. + /// Deprecated. This field is still populated, but prefer msg_response instead + /// because it also contains the Msg response typeURL. + #[deprecated] #[prost(bytes = "vec", tag = "1")] pub data: ::prost::alloc::vec::Vec, /// Log contains the log information from message or handler execution. @@ -105,6 +108,11 @@ pub struct Result { /// or handler execution. #[prost(message, repeated, tag = "3")] pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>, + /// msg_responses contains the Msg handler responses type packed in Anys. + /// + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "4")] + pub msg_responses: ::prost::alloc::vec::Vec<::prost_types::Any>, } /// SimulationResponse defines the response generated when a transaction is /// successfully simulated. @@ -128,8 +136,15 @@ pub struct MsgData { /// for each message. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxMsgData { + /// data field is deprecated and not populated. + #[deprecated] #[prost(message, repeated, tag = "1")] pub data: ::prost::alloc::vec::Vec, + /// msg_responses contains the Msg handler responses packed into Anys. + /// + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "2")] + pub msg_responses: ::prost::alloc::vec::Vec<::prost_types::Any>, } /// SearchTxsResult defines a structure for querying txs pageable #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs new file mode 100644 index 00000000..20a2cbf8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs @@ -0,0 +1,12 @@ +// @generated +/// ConfigRequest defines the request structure for the Config gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigRequest {} +/// ConfigResponse defines the response structure for the Config gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConfigResponse { + #[prost(string, tag = "1")] + pub minimum_gas_price: ::prost::alloc::string::String, +} +include!("cosmos.base.node.v1beta1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.tonic.rs new file mode 100644 index 00000000..94ba0e42 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.tonic.rs @@ -0,0 +1,223 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod service_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct ServiceClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl ServiceClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl ServiceClient + 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, + ) -> ServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + ServiceClient::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 + } + pub async fn config( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.base.node.v1beta1.Service/Config"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod service_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 ServiceServer. + #[async_trait] + pub trait Service: Send + Sync + 'static { + async fn config( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct ServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl ServiceServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for ServiceServer + where + T: Service, + 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.base.node.v1beta1.Service/Config" => { + #[allow(non_camel_case_types)] + struct ConfigSvc(pub Arc); + impl tonic::server::UnaryService for ConfigSvc { + type Response = super::ConfigResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).config(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ConfigSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for ServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ServiceServer { + const NAME: &'static str = "cosmos.base.node.v1beta1.Service"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs index 1ec8cee5..f37d3872 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.query.v1beta1.rs @@ -44,7 +44,8 @@ pub struct PageRequest { #[derive(Clone, PartialEq, ::prost::Message)] pub struct PageResponse { /// next_key is the key to be passed to PageRequest.key to - /// query the next page most efficiently + /// query the next page most efficiently. It will be empty if + /// there are no more results. #[prost(bytes = "vec", tag = "1")] pub next_key: ::prost::alloc::vec::Vec, /// total is total number of results available if PageRequest.count_total diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs index 9c0cb9fc..8d80a25d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs @@ -21,10 +21,12 @@ pub struct Metadata { pub chunk_hashes: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, } /// SnapshotItem is an item contained in a rootmulti.Store snapshot. +/// +/// Since: cosmos-sdk 0.46 #[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")] + #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4, 5, 6")] pub item: ::core::option::Option, } /// Nested message and enum types in `SnapshotItem`. @@ -40,15 +42,23 @@ pub mod snapshot_item { Extension(super::SnapshotExtensionMeta), #[prost(message, tag = "4")] ExtensionPayload(super::SnapshotExtensionPayload), + #[prost(message, tag = "5")] + Kv(super::SnapshotKvItem), + #[prost(message, tag = "6")] + Schema(super::SnapshotSchema), } } /// SnapshotStoreItem contains metadata about a snapshotted store. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotStoreItem { #[prost(string, tag = "1")] pub name: ::prost::alloc::string::String, } /// SnapshotIAVLItem is an exported IAVL node. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotIavlItem { #[prost(bytes = "vec", tag = "1")] @@ -63,6 +73,8 @@ pub struct SnapshotIavlItem { pub height: i32, } /// SnapshotExtensionMeta contains metadata about an external snapshotter. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionMeta { #[prost(string, tag = "1")] @@ -71,9 +83,29 @@ pub struct SnapshotExtensionMeta { pub format: u32, } /// SnapshotExtensionPayload contains payloads of an external snapshotter. +/// +/// Since: cosmos-sdk 0.46 #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionPayload { #[prost(bytes = "vec", tag = "1")] pub payload: ::prost::alloc::vec::Vec, } +/// SnapshotKVItem is an exported Key/Value Pair +/// +/// Since: cosmos-sdk 0.46 +#[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, +} +/// SnapshotSchema is an exported schema of smt store +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SnapshotSchema { + #[prost(bytes = "vec", repeated, tag = "1")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs index 4f7b6512..7bc08e4e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs @@ -44,4 +44,32 @@ pub struct StoreKvPair { #[prost(bytes = "vec", tag = "4")] pub value: ::prost::alloc::vec::Vec, } +/// BlockMetadata contains all the abci event data of a block +/// the file streamer dump them into files together with the state changes. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockMetadata { + #[prost(message, optional, tag = "1")] + pub request_begin_block: ::core::option::Option<::tendermint_proto::abci::RequestBeginBlock>, + #[prost(message, optional, tag = "2")] + pub response_begin_block: ::core::option::Option<::tendermint_proto::abci::ResponseBeginBlock>, + #[prost(message, repeated, tag = "3")] + pub deliver_txs: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub request_end_block: ::core::option::Option<::tendermint_proto::abci::RequestEndBlock>, + #[prost(message, optional, tag = "5")] + pub response_end_block: ::core::option::Option<::tendermint_proto::abci::ResponseEndBlock>, + #[prost(message, optional, tag = "6")] + pub response_commit: ::core::option::Option<::tendermint_proto::abci::ResponseCommit>, +} +/// Nested message and enum types in `BlockMetadata`. +pub mod block_metadata { + /// DeliverTx encapulate deliver tx request and response. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct DeliverTx { + #[prost(message, optional, tag = "1")] + pub request: ::core::option::Option<::tendermint_proto::abci::RequestDeliverTx>, + #[prost(message, optional, tag = "2")] + pub response: ::core::option::Option<::tendermint_proto::abci::ResponseDeliverTx>, + } +} // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs index 3b6e22fa..73c81a51 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs @@ -1,5 +1,72 @@ // @generated -/// GetValidatorSetByHeightRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +/// Block is tendermint type Block, with the Header proposer address +/// field converted to bech32 string. +#[derive(Clone, PartialEq, ::prost::Message)] +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>, + #[prost(message, optional, tag = "3")] + pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceList>, + #[prost(message, optional, tag = "4")] + pub last_commit: ::core::option::Option<::tendermint_proto::types::Commit>, +} +/// Header defines the structure of a Tendermint block header. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Header { + /// basic block info + #[prost(message, optional, tag = "1")] + pub version: ::core::option::Option<::tendermint_proto::version::Consensus>, + #[prost(string, tag = "2")] + pub chain_id: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub height: i64, + #[prost(message, optional, tag = "4")] + pub time: ::core::option::Option<::prost_types::Timestamp>, + /// prev block info + #[prost(message, optional, tag = "5")] + pub last_block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + /// hashes of block data + /// + /// commit from validators from the last block + #[prost(bytes = "vec", tag = "6")] + pub last_commit_hash: ::prost::alloc::vec::Vec, + /// transactions + #[prost(bytes = "vec", tag = "7")] + pub data_hash: ::prost::alloc::vec::Vec, + /// hashes from the app output from the prev block + /// + /// validators for the current block + #[prost(bytes = "vec", tag = "8")] + pub validators_hash: ::prost::alloc::vec::Vec, + /// validators for the next block + #[prost(bytes = "vec", tag = "9")] + pub next_validators_hash: ::prost::alloc::vec::Vec, + /// consensus params for current block + #[prost(bytes = "vec", tag = "10")] + pub consensus_hash: ::prost::alloc::vec::Vec, + /// state after txs from the previous block + #[prost(bytes = "vec", tag = "11")] + pub app_hash: ::prost::alloc::vec::Vec, + /// root hash of all results from the txs from the previous block + #[prost(bytes = "vec", tag = "12")] + pub last_results_hash: ::prost::alloc::vec::Vec, + /// consensus info + /// + /// evidence included in the block + #[prost(bytes = "vec", tag = "13")] + pub evidence_hash: ::prost::alloc::vec::Vec, + /// proposer_address is the original block proposer address, formatted as a Bech32 string. + /// In Tendermint, this type is `bytes`, but in the SDK, we convert it to a Bech32 string + /// for better UX. + /// + /// original proposer of the block + #[prost(string, tag = "14")] + pub proposer_address: ::prost::alloc::string::String, +} +/// GetValidatorSetByHeightRequest is the request type for the +/// Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightRequest { #[prost(int64, tag = "1")] @@ -8,7 +75,8 @@ pub struct GetValidatorSetByHeightRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// GetValidatorSetByHeightResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +/// GetValidatorSetByHeightResponse is the response type for the +/// Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetValidatorSetByHeightResponse { #[prost(int64, tag = "1")] @@ -19,14 +87,16 @@ pub struct GetValidatorSetByHeightResponse { #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetRequest is the request type for the Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetRequest is the request type for the +/// Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetRequest { /// pagination defines an pagination for the request. #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } -/// GetLatestValidatorSetResponse is the response type for the Query/GetValidatorSetByHeight RPC method. +/// GetLatestValidatorSetResponse is the response type for the +/// Query/GetValidatorSetByHeight RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestValidatorSetResponse { #[prost(int64, tag = "1")] @@ -49,30 +119,42 @@ pub struct Validator { #[prost(int64, tag = "4")] pub proposer_priority: i64, } -/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight RPC method. +/// GetBlockByHeightRequest is the request type for the Query/GetBlockByHeight +/// RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightRequest { #[prost(int64, tag = "1")] pub height: i64, } -/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight RPC method. +/// GetBlockByHeightResponse is the response type for the Query/GetBlockByHeight +/// RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockByHeightResponse { #[prost(message, optional, tag = "1")] pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] pub block: ::core::option::Option<::tendermint_proto::types::Block>, + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "3")] + pub sdk_block: ::core::option::Option, } -/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC method. +/// GetLatestBlockRequest is the request type for the Query/GetLatestBlock RPC +/// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockRequest {} -/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC method. +/// GetLatestBlockResponse is the response type for the Query/GetLatestBlock RPC +/// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetLatestBlockResponse { #[prost(message, optional, tag = "1")] pub block_id: ::core::option::Option<::tendermint_proto::types::BlockId>, + /// Deprecated: please use `sdk_block` instead #[prost(message, optional, tag = "2")] pub block: ::core::option::Option<::tendermint_proto::types::Block>, + /// Since: cosmos-sdk 0.47 + #[prost(message, optional, tag = "3")] + pub sdk_block: ::core::option::Option, } /// GetSyncingRequest is the request type for the Query/GetSyncing RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -86,7 +168,8 @@ pub struct GetSyncingResponse { /// GetNodeInfoRequest is the request type for the Query/GetNodeInfo RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoRequest {} -/// GetNodeInfoResponse is the request type for the Query/GetNodeInfo RPC method. +/// GetNodeInfoResponse is the response type for the Query/GetNodeInfo RPC +/// method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetNodeInfoResponse { #[prost(message, optional, tag = "1")] @@ -128,5 +211,69 @@ pub struct Module { #[prost(string, tag = "3")] pub sum: ::prost::alloc::string::String, } +/// ABCIQueryRequest defines the request structure for the ABCIQuery gRPC query. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AbciQueryRequest { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, + #[prost(string, tag = "2")] + pub path: ::prost::alloc::string::String, + #[prost(int64, tag = "3")] + pub height: i64, + #[prost(bool, tag = "4")] + pub prove: bool, +} +/// ABCIQueryResponse defines the response structure for the ABCIQuery gRPC +/// query. +/// +/// Note: This type is a duplicate of the ResponseQuery proto type defined in +/// Tendermint. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AbciQueryResponse { + #[prost(uint32, tag = "1")] + pub code: u32, + /// nondeterministic + #[prost(string, tag = "3")] + pub log: ::prost::alloc::string::String, + /// nondeterministic + #[prost(string, tag = "4")] + pub info: ::prost::alloc::string::String, + #[prost(int64, tag = "5")] + pub index: i64, + #[prost(bytes = "vec", tag = "6")] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_ops: ::core::option::Option, + #[prost(int64, tag = "9")] + pub height: i64, + #[prost(string, tag = "10")] + pub codespace: ::prost::alloc::string::String, +} +/// ProofOp defines an operation used for calculating Merkle root. The data could +/// be arbitrary format, providing nessecary data for example neighbouring node +/// hash. +/// +/// Note: This type is a duplicate of the ProofOp proto type defined in +/// Tendermint. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProofOp { + #[prost(string, tag = "1")] + pub r#type: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "2")] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, +} +/// ProofOps is Merkle proof defined by the list of ProofOps. +/// +/// Note: This type is a duplicate of the ProofOps proto type defined in +/// Tendermint. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ProofOps { + #[prost(message, repeated, tag = "1")] + pub ops: ::prost::alloc::vec::Vec, +} include!("cosmos.base.tendermint.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.tonic.rs index 169652f6..e1868655 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.tonic.rs @@ -168,6 +168,22 @@ pub mod service_client { ); self.inner.unary(request.into_request(), path, codec).await } + pub async fn abci_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery", + ); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -203,6 +219,10 @@ pub mod service_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn abci_query( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct ServiceServer { @@ -455,6 +475,37 @@ pub mod service_server { }; Box::pin(fut) } + "/cosmos.base.tendermint.v1beta1.Service/ABCIQuery" => { + #[allow(non_camel_case_types)] + struct ABCIQuerySvc(pub Arc); + impl tonic::server::UnaryService for ABCIQuerySvc { + type Response = super::AbciQueryResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).abci_query(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ABCIQuerySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs new file mode 100644 index 00000000..1ff415b4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.hd.v1.rs @@ -0,0 +1,22 @@ +// @generated +/// BIP44Params is used as path field in ledger item in Record. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Bip44Params { + /// purpose is a constant set to 44' (or 0x8000002C) following the BIP43 recommendation + #[prost(uint32, tag = "1")] + pub purpose: u32, + /// coin_type is a constant that improves privacy + #[prost(uint32, tag = "2")] + pub coin_type: u32, + /// account splits the key space into independent user identities + #[prost(uint32, tag = "3")] + pub account: u32, + /// change is a constant used for public derivation. Constant 0 is used for external chain and constant 1 for internal + /// chain. + #[prost(bool, tag = "4")] + pub change: bool, + /// address_index is used as child index in BIP32 derivation + #[prost(uint32, tag = "5")] + pub address_index: u32, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs new file mode 100644 index 00000000..6f72e275 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.keyring.v1.rs @@ -0,0 +1,53 @@ +// @generated +/// Record is used for representing a key in the keyring. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Record { + /// name represents a name of Record + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// pub_key represents a public key in any format + #[prost(message, optional, tag = "2")] + pub pub_key: ::core::option::Option<::prost_types::Any>, + /// Record contains one of the following items + #[prost(oneof = "record::Item", tags = "3, 4, 5, 6")] + pub item: ::core::option::Option, +} +/// Nested message and enum types in `Record`. +pub mod record { + /// Item is a keyring item stored in a keyring backend. + /// Local item + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Local { + #[prost(message, optional, tag = "1")] + pub priv_key: ::core::option::Option<::prost_types::Any>, + } + /// Ledger item + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Ledger { + #[prost(message, optional, tag = "1")] + pub path: ::core::option::Option, + } + /// Multi item + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Multi {} + /// Offline item + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Offline {} + /// Record contains one of the following items + #[derive(Clone, PartialEq, ::prost::Oneof)] + pub enum Item { + /// local stores the private key locally. + #[prost(message, tag = "3")] + Local(Local), + /// ledger stores the information about a Ledger key. + #[prost(message, tag = "4")] + Ledger(Ledger), + /// Multi does not store any other information. + #[prost(message, tag = "5")] + Multi(Multi), + /// Offline does not store any other information. + #[prost(message, tag = "6")] + Offline(Offline), + } +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index eb16b89d..85d64736 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs @@ -425,7 +425,11 @@ pub struct MsgWithdrawDelegatorReward { } /// MsgWithdrawDelegatorRewardResponse defines the Msg/WithdrawDelegatorReward response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawDelegatorRewardResponse {} +pub struct MsgWithdrawDelegatorRewardResponse { + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, +} /// MsgWithdrawValidatorCommission withdraws the full commission to the validator /// address. #[derive(Clone, PartialEq, ::prost::Message)] @@ -435,7 +439,11 @@ pub struct MsgWithdrawValidatorCommission { } /// MsgWithdrawValidatorCommissionResponse defines the Msg/WithdrawValidatorCommission response type. #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgWithdrawValidatorCommissionResponse {} +pub struct MsgWithdrawValidatorCommissionResponse { + /// Since: cosmos-sdk 0.46 + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, +} /// MsgFundCommunityPool allows an account to directly /// fund the community pool. #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs index d28d15ee..6715da41 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.rs @@ -1,10 +1,10 @@ // @generated -/// BasicAllowance implements Allowance with a one-time grant of tokens +/// BasicAllowance implements Allowance with a one-time grant of coins /// that optionally expires. The grantee can use up to SpendLimit to cover fees. #[derive(Clone, PartialEq, ::prost::Message)] pub struct BasicAllowance { - /// spend_limit specifies the maximum amount of tokens that can be spent - /// by this allowance and will be updated as tokens are spent. If it is + /// spend_limit specifies the maximum amount of coins that can be spent + /// by this allowance and will be updated as coins are spent. If it is /// empty, there is no spend limit and any amount of coins can be spent. #[prost(message, repeated, tag = "1")] pub spend_limit: ::prost::alloc::vec::Vec, @@ -39,7 +39,7 @@ pub struct PeriodicAllowance { /// AllowedMsgAllowance creates allowance only for specified message types. #[derive(Clone, PartialEq, ::prost::Message)] pub struct AllowedMsgAllowance { - /// allowance can be any of basic and filtered fee allowance. + /// allowance can be any of basic and periodic fee allowance. #[prost(message, optional, tag = "1")] pub allowance: ::core::option::Option<::prost_types::Any>, /// allowed_messages are the messages for which the grantee has the access. @@ -55,7 +55,7 @@ pub struct Grant { /// grantee is the address of the user being granted an allowance of another user's funds. #[prost(string, tag = "2")] pub grantee: ::prost::alloc::string::String, - /// allowance can be any of basic and filtered fee allowance. + /// allowance can be any of basic, periodic, allowed fee allowance. #[prost(message, optional, tag = "3")] pub allowance: ::core::option::Option<::prost_types::Any>, } @@ -101,6 +101,29 @@ pub struct QueryAllowancesResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllowancesByGranterRequest { + #[prost(string, tag = "1")] + pub granter: ::prost::alloc::string::String, + /// pagination defines an pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAllowancesByGranterResponse { + /// allowances that have been issued by the granter. + #[prost(message, repeated, tag = "1")] + pub allowances: ::prost::alloc::vec::Vec, + /// pagination defines an pagination for the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} /// MsgGrantAllowance adds permission for Grantee to spend up to Allowance /// of fees from the account of Granter. #[derive(Clone, PartialEq, ::prost::Message)] @@ -111,7 +134,7 @@ pub struct MsgGrantAllowance { /// grantee is the address of the user being granted an allowance of another user's funds. #[prost(string, tag = "2")] pub grantee: ::prost::alloc::string::String, - /// allowance can be any of basic and filtered fee allowance. + /// allowance can be any of basic, periodic, allowed fee allowance. #[prost(message, optional, tag = "3")] pub allowance: ::core::option::Option<::prost_types::Any>, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.tonic.rs index 00250109..1dda0514 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.tonic.rs @@ -101,6 +101,23 @@ pub mod query_client { http::uri::PathAndQuery::from_static("/cosmos.feegrant.v1beta1.Query/Allowances"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn allowances_by_granter( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter", + ); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -120,6 +137,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn allowances_by_granter( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -236,6 +257,40 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.feegrant.v1beta1.Query/AllowancesByGranter" => { + #[allow(non_camel_case_types)] + struct AllowancesByGranterSvc(pub Arc); + impl + tonic::server::UnaryService + for AllowancesByGranterSvc + { + type Response = super::QueryAllowancesByGranterResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).allowances_by_granter(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = AllowancesByGranterSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs new file mode 100644 index 00000000..97baf541 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs @@ -0,0 +1,426 @@ +// @generated +/// WeightedVoteOption defines a unit of vote for vote split. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct WeightedVoteOption { + #[prost(enumeration = "VoteOption", tag = "1")] + pub option: i32, + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, +} +/// Deposit defines an amount deposited by an account address to an active +/// proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Deposit { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// Proposal defines the core field members of a governance proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Proposal { + #[prost(uint64, tag = "1")] + pub id: u64, + #[prost(message, repeated, tag = "2")] + pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + #[prost(enumeration = "ProposalStatus", tag = "3")] + pub status: i32, + /// final_tally_result is the final tally result of the proposal. When + /// querying a proposal via gRPC, this field is not populated until the + /// proposal's voting period has ended. + #[prost(message, optional, tag = "4")] + pub final_tally_result: ::core::option::Option, + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag = "6")] + pub deposit_end_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, repeated, tag = "7")] + pub total_deposit: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub voting_start_time: ::core::option::Option<::prost_types::Timestamp>, + #[prost(message, optional, tag = "9")] + pub voting_end_time: ::core::option::Option<::prost_types::Timestamp>, + /// metadata is any arbitrary metadata attached to the proposal. + #[prost(string, tag = "10")] + pub metadata: ::prost::alloc::string::String, +} +/// TallyResult defines a standard tally for a governance proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TallyResult { + #[prost(string, tag = "1")] + pub yes_count: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub abstain_count: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub no_count: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub no_with_veto_count: ::prost::alloc::string::String, +} +/// Vote defines a vote on a governance proposal. +/// A Vote consists of a proposal ID, the voter, and the vote option. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Vote { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "4")] + pub options: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata to attached to the vote. + #[prost(string, tag = "5")] + pub metadata: ::prost::alloc::string::String, +} +/// DepositParams defines the params for deposits on governance proposals. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DepositParams { + /// Minimum deposit for a proposal to enter voting period. + #[prost(message, repeated, tag = "1")] + pub min_deposit: ::prost::alloc::vec::Vec, + /// Maximum period for Atom holders to deposit on a proposal. Initial value: 2 + /// months. + #[prost(message, optional, tag = "2")] + pub max_deposit_period: ::core::option::Option<::prost_types::Duration>, +} +/// VotingParams defines the params for voting on governance proposals. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct VotingParams { + /// Length of the voting period. + #[prost(message, optional, tag = "1")] + pub voting_period: ::core::option::Option<::prost_types::Duration>, +} +/// TallyParams defines the params for tallying votes on governance proposals. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TallyParams { + /// Minimum percentage of total stake needed to vote for a result to be + /// considered valid. + #[prost(string, tag = "1")] + pub quorum: ::prost::alloc::string::String, + /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.5. + #[prost(string, tag = "2")] + pub threshold: ::prost::alloc::string::String, + /// Minimum value of Veto votes to Total votes ratio for proposal to be + /// vetoed. Default value: 1/3. + #[prost(string, tag = "3")] + pub veto_threshold: ::prost::alloc::string::String, +} +/// VoteOption enumerates the valid vote options for a given governance proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VoteOption { + /// VOTE_OPTION_UNSPECIFIED defines a no-op vote option. + Unspecified = 0, + /// VOTE_OPTION_YES defines a yes vote option. + Yes = 1, + /// VOTE_OPTION_ABSTAIN defines an abstain vote option. + Abstain = 2, + /// VOTE_OPTION_NO defines a no vote option. + No = 3, + /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + NoWithVeto = 4, +} +impl VoteOption { + /// 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 { + VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", + VoteOption::Yes => "VOTE_OPTION_YES", + VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", + VoteOption::No => "VOTE_OPTION_NO", + VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + } + } +} +/// ProposalStatus enumerates the valid statuses of a proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ProposalStatus { + /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. + Unspecified = 0, + /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit + /// period. + DepositPeriod = 1, + /// PROPOSAL_STATUS_VOTING_PERIOD defines a proposal status during the voting + /// period. + VotingPeriod = 2, + /// PROPOSAL_STATUS_PASSED defines a proposal status of a proposal that has + /// passed. + Passed = 3, + /// PROPOSAL_STATUS_REJECTED defines a proposal status of a proposal that has + /// been rejected. + Rejected = 4, + /// PROPOSAL_STATUS_FAILED defines a proposal status of a proposal that has + /// failed. + Failed = 5, +} +impl ProposalStatus { + /// 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 { + ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + ProposalStatus::DepositPeriod => "PROPOSAL_STATUS_DEPOSIT_PERIOD", + ProposalStatus::VotingPeriod => "PROPOSAL_STATUS_VOTING_PERIOD", + ProposalStatus::Passed => "PROPOSAL_STATUS_PASSED", + ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", + ProposalStatus::Failed => "PROPOSAL_STATUS_FAILED", + } + } +} +/// GenesisState defines the gov module's genesis state. +#[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 paramaters of related to deposit. + #[prost(message, optional, tag = "5")] + pub deposit_params: ::core::option::Option, + /// params defines all the paramaters of related to voting. + #[prost(message, optional, tag = "6")] + pub voting_params: ::core::option::Option, + /// params defines all the paramaters of related to tally. + #[prost(message, optional, tag = "7")] + pub tally_params: ::core::option::Option, +} +/// QueryProposalRequest is the request type for the Query/Proposal RPC method. +#[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, +} +/// QueryProposalResponse is the response type for the Query/Proposal RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalResponse { + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// QueryProposalsRequest is the request type for the Query/Proposals RPC method. +#[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, +} +/// QueryProposalsResponse is the response type for the Query/Proposals RPC +/// method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalsResponse { + #[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, +} +/// QueryVoteRequest is the request type for the Query/Vote RPC method. +#[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, +} +/// QueryVoteResponse is the response type for the Query/Vote RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVoteResponse { + /// vote defined the queried vote. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +/// QueryVotesRequest is the request type for the Query/Votes RPC method. +#[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, +} +/// QueryVotesResponse is the response type for the Query/Votes RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVotesResponse { + /// votes defined 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, +} +/// QueryParamsRequest is the request type for the Query/Params RPC method. +#[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, +} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[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, +} +/// QueryDepositRequest is the request type for the Query/Deposit RPC method. +#[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, +} +/// QueryDepositResponse is the response type for the Query/Deposit RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositResponse { + /// deposit defines the requested deposit. + #[prost(message, optional, tag = "1")] + pub deposit: ::core::option::Option, +} +/// QueryDepositsRequest is the request type for the Query/Deposits RPC method. +#[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, +} +/// QueryDepositsResponse is the response type for the Query/Deposits RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDepositsResponse { + #[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, +} +/// QueryTallyResultRequest is the request type for the Query/Tally RPC method. +#[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, +} +/// QueryTallyResultResponse is the response type for the Query/Tally RPC method. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +/// MsgSubmitProposal defines an sdk.Msg type that supports submitting arbitrary +/// proposal Content. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposal { + #[prost(message, repeated, tag = "1")] + pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + #[prost(message, repeated, tag = "2")] + pub initial_deposit: ::prost::alloc::vec::Vec, + #[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, +} +/// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposalResponse { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// MsgExecLegacyContent is used to wrap the legacy content field into a message. +/// This ensures backwards compatibility with v1beta1.MsgSubmitProposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgExecLegacyContent { + /// content is the proposal's content. + #[prost(message, optional, tag = "1")] + pub content: ::core::option::Option<::prost_types::Any>, + /// authority must be the gov module address. + #[prost(string, tag = "2")] + pub authority: ::prost::alloc::string::String, +} +/// MsgExecLegacyContentResponse defines the Msg/ExecLegacyContent response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgExecLegacyContentResponse {} +/// MsgVote defines a message to cast a vote. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVote { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + #[prost(enumeration = "VoteOption", tag = "3")] + pub option: i32, + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgVoteResponse defines the Msg/Vote response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteResponse {} +/// MsgVoteWeighted defines a message to cast a vote. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteWeighted { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub options: ::prost::alloc::vec::Vec, + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteWeightedResponse {} +/// MsgDeposit defines a message to submit a deposit to an existing proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDeposit { + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + #[prost(string, tag = "2")] + pub depositor: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// MsgDepositResponse defines the Msg/Deposit response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgDepositResponse {} +include!("cosmos.gov.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs new file mode 100644 index 00000000..5948293e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.tonic.rs @@ -0,0 +1,979 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Proposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn proposals( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Proposals"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn vote( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Vote"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn votes( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Votes"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Params"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn deposit( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Deposit"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn deposits( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Deposits"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn tally_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/TallyResult"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn proposals( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn vote( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn votes( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn params( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn deposit( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn deposits( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn tally_result( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.gov.v1.Query/Proposal" => { + #[allow(non_camel_case_types)] + struct ProposalSvc(pub Arc); + impl tonic::server::UnaryService for ProposalSvc { + type Response = super::QueryProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Query/Proposals" => { + #[allow(non_camel_case_types)] + struct ProposalsSvc(pub Arc); + impl tonic::server::UnaryService for ProposalsSvc { + type Response = super::QueryProposalsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).proposals(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + 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::QueryVoteResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + 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::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).votes(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + 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::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + 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 tonic::server::UnaryService for DepositSvc { + type Response = super::QueryDepositResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposit(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DepositSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Query/Deposits" => { + #[allow(non_camel_case_types)] + struct DepositsSvc(pub Arc); + impl tonic::server::UnaryService for DepositsSvc { + type Response = super::QueryDepositsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposits(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Query/TallyResult" => { + #[allow(non_camel_case_types)] + struct TallyResultSvc(pub Arc); + impl tonic::server::UnaryService for TallyResultSvc { + type Response = super::QueryTallyResultResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).tally_result(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.gov.v1.Query"; + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn submit_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/SubmitProposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn exec_legacy_content( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/ExecLegacyContent"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn vote( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Vote"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn vote_weighted( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/VoteWeighted"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn deposit( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/Deposit"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn submit_proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn exec_legacy_content( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn vote( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn vote_weighted( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn deposit( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.gov.v1.Msg/SubmitProposal" => { + #[allow(non_camel_case_types)] + struct SubmitProposalSvc(pub Arc); + impl tonic::server::UnaryService for SubmitProposalSvc { + type Response = super::MsgSubmitProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).submit_proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SubmitProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Msg/ExecLegacyContent" => { + #[allow(non_camel_case_types)] + struct ExecLegacyContentSvc(pub Arc); + impl tonic::server::UnaryService for ExecLegacyContentSvc { + type Response = super::MsgExecLegacyContentResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).exec_legacy_content(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ExecLegacyContentSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Msg/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService for VoteSvc { + type Response = super::MsgVoteResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Msg/VoteWeighted" => { + #[allow(non_camel_case_types)] + struct VoteWeightedSvc(pub Arc); + impl tonic::server::UnaryService for VoteWeightedSvc { + type Response = super::MsgVoteWeightedResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote_weighted(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VoteWeightedSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.gov.v1.Msg/Deposit" => { + #[allow(non_camel_case_types)] + struct DepositSvc(pub Arc); + impl tonic::server::UnaryService for DepositSvc { + type Response = super::MsgDepositResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).deposit(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DepositSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.gov.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs index 24bf4b06..ede6c2bc 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.rs @@ -38,6 +38,9 @@ pub struct Proposal { pub content: ::core::option::Option<::prost_types::Any>, #[prost(enumeration = "ProposalStatus", tag = "3")] pub status: i32, + /// final_tally_result is the final tally result of the proposal. When + /// querying a proposal via gRPC, this field is not populated until the + /// proposal's voting period has ended. #[prost(message, optional, tag = "4")] pub final_tally_result: ::core::option::Option, #[prost(message, optional, tag = "5")] @@ -148,7 +151,7 @@ impl VoteOption { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum ProposalStatus { - /// PROPOSAL_STATUS_UNSPECIFIED defines the default propopsal status. + /// PROPOSAL_STATUS_UNSPECIFIED defines the default proposal status. Unspecified = 0, /// PROPOSAL_STATUS_DEPOSIT_PERIOD defines a proposal status during the deposit /// period. @@ -252,7 +255,7 @@ pub struct QueryVoteRequest { /// proposal_id defines the unique id of the proposal. #[prost(uint64, tag = "1")] pub proposal_id: u64, - /// voter defines the oter address for the proposals. + /// voter defines the voter address for the proposals. #[prost(string, tag = "2")] pub voter: ::prost::alloc::string::String, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs new file mode 100644 index 00000000..6453e258 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs @@ -0,0 +1,999 @@ +// @generated +/// Member represents a group member with an account address, +/// non-zero weight, metadata and added_at timestamp. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Member { + /// address is the member's account address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// weight is the member's voting weight that should be greater than 0. + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the member. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// added_at is a timestamp specifying when a member was added. + #[prost(message, optional, tag = "4")] + pub added_at: ::core::option::Option<::prost_types::Timestamp>, +} +/// MemberRequest represents a group member to be used in Msg server requests. +/// Contrary to `Member`, it doesn't have any `added_at` field +/// since this field cannot be set as part of requests. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MemberRequest { + /// address is the member's account address. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// weight is the member's voting weight that should be greater than 0. + #[prost(string, tag = "2")] + pub weight: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata attached to the member. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// ThresholdDecisionPolicy is a decision policy where a proposal passes when it +/// satisfies the two following conditions: +/// 1. The sum of all `YES` voters' weights is greater or equal than the defined +/// `threshold`. +/// 2. The voting and execution periods of the proposal respect the parameters +/// given by `windows`. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ThresholdDecisionPolicy { + /// threshold is the minimum weighted sum of `YES` votes that must be met or + /// exceeded for a proposal to succeed. + #[prost(string, tag = "1")] + pub threshold: ::prost::alloc::string::String, + /// windows defines the different windows for voting and execution. + #[prost(message, optional, tag = "2")] + pub windows: ::core::option::Option, +} +/// PercentageDecisionPolicy is a decision policy where a proposal passes when +/// it satisfies the two following conditions: +/// 1. The percentage of all `YES` voters' weights out of the total group weight +/// is greater or equal than the given `percentage`. +/// 2. The voting and execution periods of the proposal respect the parameters +/// given by `windows`. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PercentageDecisionPolicy { + /// percentage is the minimum percentage the weighted sum of `YES` votes must + /// meet for a proposal to succeed. + #[prost(string, tag = "1")] + pub percentage: ::prost::alloc::string::String, + /// windows defines the different windows for voting and execution. + #[prost(message, optional, tag = "2")] + pub windows: ::core::option::Option, +} +/// DecisionPolicyWindows defines the different windows for voting and execution. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DecisionPolicyWindows { + /// voting_period is the duration from submission of a proposal to the end of voting period + /// Within this times votes can be submitted with MsgVote. + #[prost(message, optional, tag = "1")] + pub voting_period: ::core::option::Option<::prost_types::Duration>, + /// min_execution_period is the minimum duration after the proposal submission + /// where members can start sending MsgExec. This means that the window for + /// sending a MsgExec transaction is: + /// `[ submission + min_execution_period ; submission + voting_period + max_execution_period]` + /// where max_execution_period is a app-specific config, defined in the keeper. + /// If not set, min_execution_period will default to 0. + /// + /// Please make sure to set a `min_execution_period` that is smaller than + /// `voting_period + max_execution_period`, or else the above execution window + /// is empty, meaning that all proposals created with this decision policy + /// won't be able to be executed. + #[prost(message, optional, tag = "2")] + pub min_execution_period: ::core::option::Option<::prost_types::Duration>, +} +// +// State +// + +/// GroupInfo represents the high-level on-chain information for a group. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GroupInfo { + /// id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub id: u64, + /// admin is the account address of the group's admin. + #[prost(string, tag = "2")] + pub admin: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata to attached to the group. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// version is used to track changes to a group's membership structure that + /// would break existing proposals. Whenever any members weight is changed, + /// or any member is added or removed this version is incremented and will + /// cause proposals based on older versions of this group to fail + #[prost(uint64, tag = "4")] + pub version: u64, + /// total_weight is the sum of the group members' weights. + #[prost(string, tag = "5")] + pub total_weight: ::prost::alloc::string::String, + /// created_at is a timestamp specifying when a group was created. + #[prost(message, optional, tag = "6")] + pub created_at: ::core::option::Option<::prost_types::Timestamp>, +} +/// GroupMember represents the relationship between a group and a member. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GroupMember { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, + /// member is the member data. + #[prost(message, optional, tag = "2")] + pub member: ::core::option::Option, +} +/// GroupPolicyInfo represents the high-level on-chain information for a group policy. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GroupPolicyInfo { + /// address is the account address of group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, + /// admin is the account address of the group admin. + #[prost(string, tag = "3")] + pub admin: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata to attached to the group policy. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// version is used to track changes to a group's GroupPolicyInfo structure that + /// would create a different result on a running proposal. + #[prost(uint64, tag = "5")] + pub version: u64, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "6")] + pub decision_policy: ::core::option::Option<::prost_types::Any>, + /// created_at is a timestamp specifying when a group policy was created. + #[prost(message, optional, tag = "7")] + pub created_at: ::core::option::Option<::prost_types::Timestamp>, +} +/// Proposal defines a group proposal. Any member of a group can submit a proposal +/// for a group policy to decide upon. +/// A proposal consists of a set of `sdk.Msg`s that will be executed if the proposal +/// passes as well as some optional metadata associated with the proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Proposal { + /// id is the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub id: u64, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// metadata is any arbitrary metadata to attached to the proposal. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// proposers are the account addresses of the proposers. + #[prost(string, repeated, tag = "4")] + pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// submit_time is a timestamp specifying when a proposal was submitted. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option<::prost_types::Timestamp>, + /// group_version tracks the version of the group at proposal submission. + /// This field is here for informational purposes only. + #[prost(uint64, tag = "6")] + pub group_version: u64, + /// group_policy_version tracks the version of the group policy at proposal submission. + /// When a decision policy is changed, existing proposals from previous policy + /// versions will become invalid with the `ABORTED` status. + /// This field is here for informational purposes only. + #[prost(uint64, tag = "7")] + pub group_policy_version: u64, + /// status represents the high level position in the life cycle of the proposal. Initial value is Submitted. + #[prost(enumeration = "ProposalStatus", tag = "8")] + pub status: i32, + /// final_tally_result contains the sums of all weighted votes for this + /// proposal for each vote option. It is empty at submission, and only + /// populated after tallying, at voting period end or at proposal execution, + /// whichever happens first. + #[prost(message, optional, tag = "9")] + pub final_tally_result: ::core::option::Option, + /// voting_period_end is the timestamp before which voting must be done. + /// Unless a successfull MsgExec is called before (to execute a proposal whose + /// tally is successful before the voting period ends), tallying will be done + /// at this point, and the `final_tally_result`and `status` fields will be + /// accordingly updated. + #[prost(message, optional, tag = "10")] + pub voting_period_end: ::core::option::Option<::prost_types::Timestamp>, + /// executor_result is the final result of the proposal execution. Initial value is NotRun. + #[prost(enumeration = "ProposalExecutorResult", tag = "11")] + pub executor_result: i32, + /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + #[prost(message, repeated, tag = "12")] + pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, +} +/// TallyResult represents the sum of weighted votes for each vote option. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TallyResult { + /// yes_count is the weighted sum of yes votes. + #[prost(string, tag = "1")] + pub yes_count: ::prost::alloc::string::String, + /// abstain_count is the weighted sum of abstainers. + #[prost(string, tag = "2")] + pub abstain_count: ::prost::alloc::string::String, + /// no_count is the weighted sum of no votes. + #[prost(string, tag = "3")] + pub no_count: ::prost::alloc::string::String, + /// no_with_veto_count is the weighted sum of veto. + #[prost(string, tag = "4")] + pub no_with_veto_count: ::prost::alloc::string::String, +} +/// Vote represents a vote for a proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Vote { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// voter is the account address of the voter. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// option is the voter's choice on the proposal. + #[prost(enumeration = "VoteOption", tag = "3")] + pub option: i32, + /// metadata is any arbitrary metadata to attached to the vote. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// submit_time is the timestamp when the vote was submitted. + #[prost(message, optional, tag = "5")] + pub submit_time: ::core::option::Option<::prost_types::Timestamp>, +} +/// VoteOption enumerates the valid vote options for a given proposal. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum VoteOption { + /// VOTE_OPTION_UNSPECIFIED defines an unspecified vote option which will + /// return an error. + Unspecified = 0, + /// VOTE_OPTION_YES defines a yes vote option. + Yes = 1, + /// VOTE_OPTION_ABSTAIN defines an abstain vote option. + Abstain = 2, + /// VOTE_OPTION_NO defines a no vote option. + No = 3, + /// VOTE_OPTION_NO_WITH_VETO defines a no with veto vote option. + NoWithVeto = 4, +} +impl VoteOption { + /// 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 { + VoteOption::Unspecified => "VOTE_OPTION_UNSPECIFIED", + VoteOption::Yes => "VOTE_OPTION_YES", + VoteOption::Abstain => "VOTE_OPTION_ABSTAIN", + VoteOption::No => "VOTE_OPTION_NO", + VoteOption::NoWithVeto => "VOTE_OPTION_NO_WITH_VETO", + } + } +} +/// ProposalStatus defines proposal statuses. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ProposalStatus { + /// An empty value is invalid and not allowed. + Unspecified = 0, + /// Initial status of a proposal when submitted. + Submitted = 1, + /// Final status of a proposal when the final tally is done and the outcome + /// passes the group policy's decision policy. + Accepted = 2, + /// Final status of a proposal when the final tally is done and the outcome + /// is rejected by the group policy's decision policy. + Rejected = 3, + /// Final status of a proposal when the group policy is modified before the + /// final tally. + Aborted = 4, + /// A proposal can be withdrawn before the voting start time by the owner. + /// When this happens the final status is Withdrawn. + Withdrawn = 5, +} +impl ProposalStatus { + /// 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 { + ProposalStatus::Unspecified => "PROPOSAL_STATUS_UNSPECIFIED", + ProposalStatus::Submitted => "PROPOSAL_STATUS_SUBMITTED", + ProposalStatus::Accepted => "PROPOSAL_STATUS_ACCEPTED", + ProposalStatus::Rejected => "PROPOSAL_STATUS_REJECTED", + ProposalStatus::Aborted => "PROPOSAL_STATUS_ABORTED", + ProposalStatus::Withdrawn => "PROPOSAL_STATUS_WITHDRAWN", + } + } +} +/// ProposalExecutorResult defines types of proposal executor results. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ProposalExecutorResult { + /// An empty value is not allowed. + Unspecified = 0, + /// We have not yet run the executor. + NotRun = 1, + /// The executor was successful and proposed action updated state. + Success = 2, + /// The executor returned an error and proposed action didn't update state. + Failure = 3, +} +impl ProposalExecutorResult { + /// 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 { + ProposalExecutorResult::Unspecified => "PROPOSAL_EXECUTOR_RESULT_UNSPECIFIED", + ProposalExecutorResult::NotRun => "PROPOSAL_EXECUTOR_RESULT_NOT_RUN", + ProposalExecutorResult::Success => "PROPOSAL_EXECUTOR_RESULT_SUCCESS", + ProposalExecutorResult::Failure => "PROPOSAL_EXECUTOR_RESULT_FAILURE", + } + } +} +/// EventCreateGroup is an event emitted when a group is created. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventCreateGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, +} +/// EventUpdateGroup is an event emitted when a group is updated. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventUpdateGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, +} +/// EventCreateGroupPolicy is an event emitted when a group policy is created. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventCreateGroupPolicy { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventUpdateGroupPolicy is an event emitted when a group policy is updated. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventUpdateGroupPolicy { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// EventSubmitProposal is an event emitted when a proposal is created. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventSubmitProposal { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// EventWithdrawProposal is an event emitted when a proposal is withdrawn. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventWithdrawProposal { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// EventVote is an event emitted when a voter votes on a proposal. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventVote { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// EventExec is an event emitted when a proposal is executed. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventExec { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// result is the proposal execution result. + #[prost(enumeration = "ProposalExecutorResult", tag = "2")] + pub result: i32, + /// logs contains error logs in case the execution result is FAILURE. + #[prost(string, tag = "3")] + pub logs: ::prost::alloc::string::String, +} +/// EventLeaveGroup is an event emitted when group member leaves the group. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventLeaveGroup { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, + /// address is the account address of the group member. + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, +} +/// GenesisState defines the group module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// group_seq is the group table orm.Sequence, + /// it is used to get the next group ID. + #[prost(uint64, tag = "1")] + pub group_seq: u64, + /// groups is the list of groups info. + #[prost(message, repeated, tag = "2")] + pub groups: ::prost::alloc::vec::Vec, + /// group_members is the list of groups members. + #[prost(message, repeated, tag = "3")] + pub group_members: ::prost::alloc::vec::Vec, + /// group_policy_seq is the group policy table orm.Sequence, + /// it is used to generate the next group policy account address. + #[prost(uint64, tag = "4")] + pub group_policy_seq: u64, + /// group_policies is the list of group policies info. + #[prost(message, repeated, tag = "5")] + pub group_policies: ::prost::alloc::vec::Vec, + /// proposal_seq is the proposal table orm.Sequence, + /// it is used to get the next proposal ID. + #[prost(uint64, tag = "6")] + pub proposal_seq: u64, + /// proposals is the list of proposals. + #[prost(message, repeated, tag = "7")] + pub proposals: ::prost::alloc::vec::Vec, + /// votes is the list of votes. + #[prost(message, repeated, tag = "8")] + pub votes: ::prost::alloc::vec::Vec, +} +/// QueryGroupInfoRequest is the Query/GroupInfo request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupInfoRequest { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, +} +/// QueryGroupInfoResponse is the Query/GroupInfo response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupInfoResponse { + /// info is the GroupInfo for the group. + #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// QueryGroupPolicyInfoRequest is the Query/GroupPolicyInfo request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPolicyInfoRequest { + /// address is the account address of the group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// QueryGroupPolicyInfoResponse is the Query/GroupPolicyInfo response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPolicyInfoResponse { + /// info is the GroupPolicyInfo for the group policy. + #[prost(message, optional, tag = "1")] + pub info: ::core::option::Option, +} +/// QueryGroupMembersRequest is the Query/GroupMembers request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupMembersRequest { + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "1")] + pub group_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupMembersResponse is the Query/GroupMembersResponse response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupMembersResponse { + /// members are the members of the group with given group_id. + #[prost(message, repeated, tag = "1")] + pub members: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByAdminRequest is the Query/GroupsByAdmin request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsByAdminRequest { + /// admin is the account address of a group's admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsByAdminResponse is the Query/GroupsByAdminResponse response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsByAdminResponse { + /// groups are the groups info with the provided admin. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByGroupRequest is the Query/GroupPoliciesByGroup request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPoliciesByGroupRequest { + /// group_id is the unique ID of the group policy's group. + #[prost(uint64, tag = "1")] + pub group_id: u64, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByGroupResponse is the Query/GroupPoliciesByGroup response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPoliciesByGroupResponse { + /// group_policies are the group policies info associated with the provided group. + #[prost(message, repeated, tag = "1")] + pub group_policies: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByAdminRequest is the Query/GroupPoliciesByAdmin request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPoliciesByAdminRequest { + /// admin is the admin address of the group policy. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupPoliciesByAdminResponse is the Query/GroupPoliciesByAdmin response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupPoliciesByAdminResponse { + /// group_policies are the group policies info with provided admin. + #[prost(message, repeated, tag = "1")] + pub group_policies: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryProposalRequest is the Query/Proposal request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalRequest { + /// proposal_id is the unique ID of a proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// QueryProposalResponse is the Query/Proposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalResponse { + /// proposal is the proposal info. + #[prost(message, optional, tag = "1")] + pub proposal: ::core::option::Option, +} +/// QueryProposalsByGroupPolicyRequest is the Query/ProposalByGroupPolicy request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalsByGroupPolicyRequest { + /// address is the account address of the group policy related to proposals. + #[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, +} +/// QueryProposalsByGroupPolicyResponse is the Query/ProposalByGroupPolicy response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryProposalsByGroupPolicyResponse { + /// proposals are the proposals with given group policy. + #[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, +} +/// QueryVoteByProposalVoterRequest is the Query/VoteByProposalVoter request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVoteByProposalVoterRequest { + /// proposal_id is the unique ID of a proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// voter is a proposal voter account address. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, +} +/// QueryVoteByProposalVoterResponse is the Query/VoteByProposalVoter response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVoteByProposalVoterResponse { + /// vote is the vote with given proposal_id and voter. + #[prost(message, optional, tag = "1")] + pub vote: ::core::option::Option, +} +/// QueryVotesByProposalRequest is the Query/VotesByProposal request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVotesByProposalRequest { + /// proposal_id is the unique ID of a 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, +} +/// QueryVotesByProposalResponse is the Query/VotesByProposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVotesByProposalResponse { + /// votes are the list of votes for given proposal_id. + #[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, +} +/// QueryVotesByVoterRequest is the Query/VotesByVoter request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVotesByVoterRequest { + /// voter is a proposal voter account address. + #[prost(string, tag = "1")] + pub voter: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryVotesByVoterResponse is the Query/VotesByVoter response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVotesByVoterResponse { + /// votes are the list of votes by given voter. + #[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, +} +/// QueryGroupsByMemberRequest is the Query/GroupsByMember request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsByMemberRequest { + /// address is the group member address. + #[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, +} +/// QueryGroupsByMemberResponse is the Query/GroupsByMember response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsByMemberResponse { + /// groups are the groups info with the provided group member. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryTallyResultRequest is the Query/TallyResult request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultRequest { + /// proposal_id is the unique id of a proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// QueryTallyResultResponse is the Query/TallyResult response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTallyResultResponse { + /// tally defines the requested tally. + #[prost(message, optional, tag = "1")] + pub tally: ::core::option::Option, +} +/// QueryGroupsRequest is the Query/Groups request type. +/// +/// Since: cosmos-sdk 0.47.1 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryGroupsResponse is the Query/Groups response type. +/// +/// Since: cosmos-sdk 0.47.1 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGroupsResponse { + /// `groups` is all the groups present in state. + #[prost(message, repeated, tag = "1")] + pub groups: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +// +// Groups +// + +/// MsgCreateGroup is the Msg/CreateGroup request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroup { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// members defines the group members. + #[prost(message, repeated, tag = "2")] + pub members: ::prost::alloc::vec::Vec, + /// metadata is any arbitrary metadata to attached to the group. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgCreateGroupResponse is the Msg/CreateGroup response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroupResponse { + /// group_id is the unique ID of the newly created group. + #[prost(uint64, tag = "1")] + pub group_id: u64, +} +/// MsgUpdateGroupMembers is the Msg/UpdateGroupMembers request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupMembers { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, + /// member_updates is the list of members to update, + /// set weight to 0 to remove a member. + #[prost(message, repeated, tag = "3")] + pub member_updates: ::prost::alloc::vec::Vec, +} +/// MsgUpdateGroupMembersResponse is the Msg/UpdateGroupMembers response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupMembersResponse {} +/// MsgUpdateGroupAdmin is the Msg/UpdateGroupAdmin request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupAdmin { + /// admin is the current account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, + /// new_admin is the group new admin account address. + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgUpdateGroupAdminResponse is the Msg/UpdateGroupAdmin response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupAdminResponse {} +/// MsgUpdateGroupMetadata is the Msg/UpdateGroupMetadata request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupMetadata { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, + /// metadata is the updated group's metadata. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgUpdateGroupMetadataResponse is the Msg/UpdateGroupMetadata response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupMetadataResponse {} +// +// Group Policies +// + +/// MsgCreateGroupPolicy is the Msg/CreateGroupPolicy request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroupPolicy { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, + /// metadata is any arbitrary metadata attached to the group policy. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "4")] + pub decision_policy: ::core::option::Option<::prost_types::Any>, +} +/// MsgCreateGroupPolicyResponse is the Msg/CreateGroupPolicy response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroupPolicyResponse { + /// address is the account address of the newly created group policy. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyAdmin is the Msg/UpdateGroupPolicyAdmin request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyAdmin { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of the group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// new_admin is the new group policy admin. + #[prost(string, tag = "3")] + pub new_admin: ::prost::alloc::string::String, +} +/// MsgCreateGroupWithPolicy is the Msg/CreateGroupWithPolicy request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroupWithPolicy { + /// admin is the account address of the group and group policy admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// members defines the group members. + #[prost(message, repeated, tag = "2")] + pub members: ::prost::alloc::vec::Vec, + /// group_metadata is any arbitrary metadata attached to the group. + #[prost(string, tag = "3")] + pub group_metadata: ::prost::alloc::string::String, + /// group_policy_metadata is any arbitrary metadata attached to the group policy. + #[prost(string, tag = "4")] + pub group_policy_metadata: ::prost::alloc::string::String, + /// group_policy_as_admin is a boolean field, if set to true, the group policy account address will be used as group + /// and group policy admin. + #[prost(bool, tag = "5")] + pub group_policy_as_admin: bool, + /// decision_policy specifies the group policy's decision policy. + #[prost(message, optional, tag = "6")] + pub decision_policy: ::core::option::Option<::prost_types::Any>, +} +/// MsgCreateGroupWithPolicyResponse is the Msg/CreateGroupWithPolicy response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateGroupWithPolicyResponse { + /// group_id is the unique ID of the newly created group with policy. + #[prost(uint64, tag = "1")] + pub group_id: u64, + /// group_policy_address is the account address of the newly created group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyAdminResponse is the Msg/UpdateGroupPolicyAdmin response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyAdminResponse {} +/// MsgUpdateGroupPolicyDecisionPolicy is the Msg/UpdateGroupPolicyDecisionPolicy request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyDecisionPolicy { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// decision_policy is the updated group policy's decision policy. + #[prost(message, optional, tag = "3")] + pub decision_policy: ::core::option::Option<::prost_types::Any>, +} +/// MsgUpdateGroupPolicyDecisionPolicyResponse is the Msg/UpdateGroupPolicyDecisionPolicy response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyDecisionPolicyResponse {} +/// MsgUpdateGroupPolicyMetadata is the Msg/UpdateGroupPolicyMetadata request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyMetadata { + /// admin is the account address of the group admin. + #[prost(string, tag = "1")] + pub admin: ::prost::alloc::string::String, + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "2")] + pub group_policy_address: ::prost::alloc::string::String, + /// metadata is the updated group policy metadata. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, +} +/// MsgUpdateGroupPolicyMetadataResponse is the Msg/UpdateGroupPolicyMetadata response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateGroupPolicyMetadataResponse {} +/// MsgSubmitProposal is the Msg/SubmitProposal request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposal { + /// group_policy_address is the account address of group policy. + #[prost(string, tag = "1")] + pub group_policy_address: ::prost::alloc::string::String, + /// proposers are the account addresses of the proposers. + /// Proposers signatures will be counted as yes votes. + #[prost(string, repeated, tag = "2")] + pub proposers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// metadata is any arbitrary metadata to attached to the proposal. + #[prost(string, tag = "3")] + pub metadata: ::prost::alloc::string::String, + /// messages is a list of `sdk.Msg`s that will be executed if the proposal passes. + #[prost(message, repeated, tag = "4")] + pub messages: ::prost::alloc::vec::Vec<::prost_types::Any>, + /// exec defines the mode of execution of the proposal, + /// whether it should be executed immediately on creation or not. + /// If so, proposers signatures are considered as Yes votes. + #[prost(enumeration = "Exec", tag = "5")] + pub exec: i32, +} +/// MsgSubmitProposalResponse is the Msg/SubmitProposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSubmitProposalResponse { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, +} +/// MsgWithdrawProposal is the Msg/WithdrawProposal request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawProposal { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// address is the admin of the group policy or one of the proposer of the proposal. + #[prost(string, tag = "2")] + pub address: ::prost::alloc::string::String, +} +/// MsgWithdrawProposalResponse is the Msg/WithdrawProposal response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgWithdrawProposalResponse {} +/// MsgVote is the Msg/Vote request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVote { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// voter is the voter account address. + #[prost(string, tag = "2")] + pub voter: ::prost::alloc::string::String, + /// option is the voter's choice on the proposal. + #[prost(enumeration = "VoteOption", tag = "3")] + pub option: i32, + /// metadata is any arbitrary metadata to attached to the vote. + #[prost(string, tag = "4")] + pub metadata: ::prost::alloc::string::String, + /// exec defines whether the proposal should be executed + /// immediately after voting or not. + #[prost(enumeration = "Exec", tag = "5")] + pub exec: i32, +} +/// MsgVoteResponse is the Msg/Vote response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgVoteResponse {} +/// MsgExec is the Msg/Exec request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgExec { + /// proposal is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// executor is the account address used to execute the proposal. + #[prost(string, tag = "2")] + pub executor: ::prost::alloc::string::String, +} +/// MsgExecResponse is the Msg/Exec request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgExecResponse { + /// result is the final result of the proposal execution. + #[prost(enumeration = "ProposalExecutorResult", tag = "2")] + pub result: i32, +} +/// MsgLeaveGroup is the Msg/LeaveGroup request type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgLeaveGroup { + /// address is the account address of the group member. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// group_id is the unique ID of the group. + #[prost(uint64, tag = "2")] + pub group_id: u64, +} +/// MsgLeaveGroupResponse is the Msg/LeaveGroup response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgLeaveGroupResponse {} +// +// Proposals and Voting +// + +/// Exec defines modes of execution of a proposal on creation or on new vote. +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum Exec { + /// An empty value means that there should be a separate + /// MsgExec request for the proposal to execute. + Unspecified = 0, + /// Try to execute the proposal immediately. + /// If the proposal is not allowed per the DecisionPolicy, + /// the proposal will still be open and could + /// be executed at a later point. + Try = 1, +} +impl Exec { + /// 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 { + Exec::Unspecified => "EXEC_UNSPECIFIED", + Exec::Try => "EXEC_TRY", + } + } +} +include!("cosmos.group.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs new file mode 100644 index 00000000..a5d54bca --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.tonic.rs @@ -0,0 +1,1782 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn group_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupInfo"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn group_policy_info( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupPolicyInfo"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn group_members( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupMembers"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn groups_by_admin( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupsByAdmin"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn group_policies_by_group( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupPoliciesByGroup"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn group_policies_by_admin( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupPoliciesByAdmin"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/Proposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn proposals_by_group_policy( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.group.v1.Query/ProposalsByGroupPolicy", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn vote_by_proposal_voter( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/VoteByProposalVoter"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn votes_by_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/VotesByProposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn votes_by_voter( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/VotesByVoter"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn groups_by_member( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/GroupsByMember"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn tally_result( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/TallyResult"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn groups( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Query/Groups"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn group_info( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn group_policy_info( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn group_members( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn groups_by_admin( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn group_policies_by_group( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn group_policies_by_admin( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn proposals_by_group_policy( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn vote_by_proposal_voter( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn votes_by_proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn votes_by_voter( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn groups_by_member( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn tally_result( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn groups( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.group.v1.Query/GroupInfo" => { + #[allow(non_camel_case_types)] + struct GroupInfoSvc(pub Arc); + impl tonic::server::UnaryService for GroupInfoSvc { + type Response = super::QueryGroupInfoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).group_info(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupPolicyInfo" => { + #[allow(non_camel_case_types)] + struct GroupPolicyInfoSvc(pub Arc); + impl tonic::server::UnaryService + for GroupPolicyInfoSvc + { + type Response = super::QueryGroupPolicyInfoResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).group_policy_info(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupPolicyInfoSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupMembers" => { + #[allow(non_camel_case_types)] + struct GroupMembersSvc(pub Arc); + impl tonic::server::UnaryService for GroupMembersSvc { + type Response = super::QueryGroupMembersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).group_members(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupMembersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupsByAdmin" => { + #[allow(non_camel_case_types)] + struct GroupsByAdminSvc(pub Arc); + impl tonic::server::UnaryService + for GroupsByAdminSvc + { + type Response = super::QueryGroupsByAdminResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).groups_by_admin(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupsByAdminSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupPoliciesByGroup" => { + #[allow(non_camel_case_types)] + struct GroupPoliciesByGroupSvc(pub Arc); + impl + tonic::server::UnaryService + for GroupPoliciesByGroupSvc + { + type Response = super::QueryGroupPoliciesByGroupResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).group_policies_by_group(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupPoliciesByGroupSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupPoliciesByAdmin" => { + #[allow(non_camel_case_types)] + struct GroupPoliciesByAdminSvc(pub Arc); + impl + tonic::server::UnaryService + for GroupPoliciesByAdminSvc + { + type Response = super::QueryGroupPoliciesByAdminResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).group_policies_by_admin(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupPoliciesByAdminSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/Proposal" => { + #[allow(non_camel_case_types)] + struct ProposalSvc(pub Arc); + impl tonic::server::UnaryService for ProposalSvc { + type Response = super::QueryProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/ProposalsByGroupPolicy" => { + #[allow(non_camel_case_types)] + struct ProposalsByGroupPolicySvc(pub Arc); + impl + tonic::server::UnaryService + for ProposalsByGroupPolicySvc + { + type Response = super::QueryProposalsByGroupPolicyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).proposals_by_group_policy(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ProposalsByGroupPolicySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/VoteByProposalVoter" => { + #[allow(non_camel_case_types)] + struct VoteByProposalVoterSvc(pub Arc); + impl + tonic::server::UnaryService + for VoteByProposalVoterSvc + { + type Response = super::QueryVoteByProposalVoterResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote_by_proposal_voter(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VoteByProposalVoterSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/VotesByProposal" => { + #[allow(non_camel_case_types)] + struct VotesByProposalSvc(pub Arc); + impl tonic::server::UnaryService + for VotesByProposalSvc + { + type Response = super::QueryVotesByProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).votes_by_proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VotesByProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/VotesByVoter" => { + #[allow(non_camel_case_types)] + struct VotesByVoterSvc(pub Arc); + impl tonic::server::UnaryService for VotesByVoterSvc { + type Response = super::QueryVotesByVoterResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).votes_by_voter(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = VotesByVoterSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/GroupsByMember" => { + #[allow(non_camel_case_types)] + struct GroupsByMemberSvc(pub Arc); + impl tonic::server::UnaryService + for GroupsByMemberSvc + { + type Response = super::QueryGroupsByMemberResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).groups_by_member(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupsByMemberSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/TallyResult" => { + #[allow(non_camel_case_types)] + struct TallyResultSvc(pub Arc); + impl tonic::server::UnaryService for TallyResultSvc { + type Response = super::QueryTallyResultResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).tally_result(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Query/Groups" => { + #[allow(non_camel_case_types)] + struct GroupsSvc(pub Arc); + impl tonic::server::UnaryService for GroupsSvc { + type Response = super::QueryGroupsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).groups(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GroupsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.group.v1.Query"; + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn create_group( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/CreateGroup"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_members( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/UpdateGroupMembers"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_admin( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/UpdateGroupAdmin"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/UpdateGroupMetadata"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn create_group_policy( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/CreateGroupPolicy"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn create_group_with_policy( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/CreateGroupWithPolicy"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_policy_admin( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/UpdateGroupPolicyAdmin"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_policy_decision_policy( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.group.v1.Msg/UpdateGroupPolicyDecisionPolicy", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn update_group_policy_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.group.v1.Msg/UpdateGroupPolicyMetadata", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn submit_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/SubmitProposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn withdraw_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/WithdrawProposal"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn vote( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/Vote"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn exec( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/Exec"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn leave_group( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.group.v1.Msg/LeaveGroup"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn create_group( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_members( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_admin( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_metadata( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn create_group_policy( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn create_group_with_policy( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_policy_admin( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_policy_decision_policy( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn update_group_policy_metadata( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn submit_proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn withdraw_proposal( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn vote( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn exec( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn leave_group( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.group.v1.Msg/CreateGroup" => { + #[allow(non_camel_case_types)] + struct CreateGroupSvc(pub Arc); + impl tonic::server::UnaryService for CreateGroupSvc { + type Response = super::MsgCreateGroupResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).create_group(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateGroupSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupMembers" => { + #[allow(non_camel_case_types)] + struct UpdateGroupMembersSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateGroupMembersSvc + { + type Response = super::MsgUpdateGroupMembersResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).update_group_members(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupMembersSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupAdmin" => { + #[allow(non_camel_case_types)] + struct UpdateGroupAdminSvc(pub Arc); + impl tonic::server::UnaryService for UpdateGroupAdminSvc { + type Response = super::MsgUpdateGroupAdminResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).update_group_admin(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupAdminSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupMetadata" => { + #[allow(non_camel_case_types)] + struct UpdateGroupMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateGroupMetadataSvc + { + type Response = super::MsgUpdateGroupMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).update_group_metadata(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/CreateGroupPolicy" => { + #[allow(non_camel_case_types)] + struct CreateGroupPolicySvc(pub Arc); + impl tonic::server::UnaryService for CreateGroupPolicySvc { + type Response = super::MsgCreateGroupPolicyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).create_group_policy(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateGroupPolicySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/CreateGroupWithPolicy" => { + #[allow(non_camel_case_types)] + struct CreateGroupWithPolicySvc(pub Arc); + impl tonic::server::UnaryService + for CreateGroupWithPolicySvc + { + type Response = super::MsgCreateGroupWithPolicyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).create_group_with_policy(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateGroupWithPolicySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupPolicyAdmin" => { + #[allow(non_camel_case_types)] + struct UpdateGroupPolicyAdminSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateGroupPolicyAdminSvc + { + type Response = super::MsgUpdateGroupPolicyAdminResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).update_group_policy_admin(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupPolicyAdminSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupPolicyDecisionPolicy" => { + #[allow(non_camel_case_types)] + struct UpdateGroupPolicyDecisionPolicySvc(pub Arc); + impl + tonic::server::UnaryService + for UpdateGroupPolicyDecisionPolicySvc + { + type Response = super::MsgUpdateGroupPolicyDecisionPolicyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).update_group_policy_decision_policy(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupPolicyDecisionPolicySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/UpdateGroupPolicyMetadata" => { + #[allow(non_camel_case_types)] + struct UpdateGroupPolicyMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateGroupPolicyMetadataSvc + { + type Response = super::MsgUpdateGroupPolicyMetadataResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).update_group_policy_metadata(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateGroupPolicyMetadataSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/SubmitProposal" => { + #[allow(non_camel_case_types)] + struct SubmitProposalSvc(pub Arc); + impl tonic::server::UnaryService for SubmitProposalSvc { + type Response = super::MsgSubmitProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).submit_proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SubmitProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/WithdrawProposal" => { + #[allow(non_camel_case_types)] + struct WithdrawProposalSvc(pub Arc); + impl tonic::server::UnaryService for WithdrawProposalSvc { + type Response = super::MsgWithdrawProposalResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).withdraw_proposal(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = WithdrawProposalSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/Vote" => { + #[allow(non_camel_case_types)] + struct VoteSvc(pub Arc); + impl tonic::server::UnaryService for VoteSvc { + type Response = super::MsgVoteResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).vote(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/Exec" => { + #[allow(non_camel_case_types)] + struct ExecSvc(pub Arc); + impl tonic::server::UnaryService for ExecSvc { + type Response = super::MsgExecResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).exec(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ExecSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.group.v1.Msg/LeaveGroup" => { + #[allow(non_camel_case_types)] + struct LeaveGroupSvc(pub Arc); + impl tonic::server::UnaryService for LeaveGroupSvc { + type Response = super::MsgLeaveGroupResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).leave_group(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = LeaveGroupSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.group.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs new file mode 100644 index 00000000..9c48b679 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.rs @@ -0,0 +1,216 @@ +// @generated +/// EventSend is emitted on Msg/Send +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventSend { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, +} +/// EventMint is emitted on Mint +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventMint { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub owner: ::prost::alloc::string::String, +} +/// EventBurn is emitted on Burn +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventBurn { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub owner: ::prost::alloc::string::String, +} +/// Class defines the class of the nft type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Class { + /// id defines the unique identifier of the NFT classification, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub id: ::prost::alloc::string::String, + /// name defines the human-readable name of the NFT classification. Optional + #[prost(string, tag = "2")] + pub name: ::prost::alloc::string::String, + /// symbol is an abbreviated name for nft classification. Optional + #[prost(string, tag = "3")] + pub symbol: ::prost::alloc::string::String, + /// description is a brief description of nft classification. Optional + #[prost(string, tag = "4")] + pub description: ::prost::alloc::string::String, + /// uri for the class metadata stored off chain. It can define schema for Class and NFT `Data` attributes. Optional + #[prost(string, tag = "5")] + pub uri: ::prost::alloc::string::String, + /// uri_hash is a hash of the document pointed by uri. Optional + #[prost(string, tag = "6")] + pub uri_hash: ::prost::alloc::string::String, + /// data is the app specific metadata of the NFT class. Optional + #[prost(message, optional, tag = "7")] + pub data: ::core::option::Option<::prost_types::Any>, +} +/// NFT defines the NFT. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Nft { + /// class_id associated with the NFT, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id is a unique identifier of the NFT + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// uri for the NFT metadata stored off chain + #[prost(string, tag = "3")] + pub uri: ::prost::alloc::string::String, + /// uri_hash is a hash of the document pointed by uri + #[prost(string, tag = "4")] + pub uri_hash: ::prost::alloc::string::String, + /// data is an app specific data of the NFT. Optional + #[prost(message, optional, tag = "10")] + pub data: ::core::option::Option<::prost_types::Any>, +} +/// GenesisState defines the nft module's genesis state. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// class defines the class of the nft type. + #[prost(message, repeated, tag = "1")] + pub classes: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub entries: ::prost::alloc::vec::Vec, +} +/// Entry Defines all nft owned by a person +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Entry { + /// owner is the owner address of the following nft + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, + /// nfts is a group of nfts of the same owner + #[prost(message, repeated, tag = "2")] + pub nfts: ::prost::alloc::vec::Vec, +} +/// QueryBalanceRequest is the request type for the Query/Balance RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBalanceRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, +} +/// QueryBalanceResponse is the response type for the Query/Balance RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBalanceResponse { + #[prost(uint64, tag = "1")] + pub amount: u64, +} +/// QueryOwnerRequest is the request type for the Query/Owner RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryOwnerRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, +} +/// QueryOwnerResponse is the response type for the Query/Owner RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryOwnerResponse { + #[prost(string, tag = "1")] + pub owner: ::prost::alloc::string::String, +} +/// QuerySupplyRequest is the request type for the Query/Supply RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySupplyRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, +} +/// QuerySupplyResponse is the response type for the Query/Supply RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySupplyResponse { + #[prost(uint64, tag = "1")] + pub amount: u64, +} +/// QueryNFTstRequest is the request type for the Query/NFTs RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNfTsRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub owner: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub pagination: ::core::option::Option, +} +/// QueryNFTsResponse is the response type for the Query/NFTs RPC methods +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNfTsResponse { + #[prost(message, repeated, tag = "1")] + pub nfts: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryNFTRequest is the request type for the Query/NFT RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNftRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, +} +/// QueryNFTResponse is the response type for the Query/NFT RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNftResponse { + #[prost(message, optional, tag = "1")] + pub nft: ::core::option::Option, +} +/// QueryClassRequest is the request type for the Query/Class RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassRequest { + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, +} +/// QueryClassResponse is the response type for the Query/Class RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassResponse { + #[prost(message, optional, tag = "1")] + pub class: ::core::option::Option, +} +/// QueryClassesRequest is the request type for the Query/Classes RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassesRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// QueryClassesResponse is the response type for the Query/Classes RPC method +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryClassesResponse { + #[prost(message, repeated, tag = "1")] + pub classes: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// MsgSend represents a message to send a nft from one account to another account. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSend { + /// class_id defines the unique identifier of the nft classification, similar to the contract address of ERC721 + #[prost(string, tag = "1")] + pub class_id: ::prost::alloc::string::String, + /// id defines the unique identification of nft + #[prost(string, tag = "2")] + pub id: ::prost::alloc::string::String, + /// sender is the address of the owner of nft + #[prost(string, tag = "3")] + pub sender: ::prost::alloc::string::String, + /// receiver is the receiver address of nft + #[prost(string, tag = "4")] + pub receiver: ::prost::alloc::string::String, +} +/// MsgSendResponse defines the Msg/Send response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSendResponse {} +include!("cosmos.nft.v1beta1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.tonic.rs new file mode 100644 index 00000000..cfbe0906 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.nft.v1beta1.tonic.rs @@ -0,0 +1,734 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct QueryClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn balance( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/Balance"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn owner( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/Owner"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn supply( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/Supply"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn nf_ts( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/NFTs"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn nft( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/NFT"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn class( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/Class"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn classes( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Query/Classes"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod query_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with QueryServer. + #[async_trait] + pub trait Query: Send + Sync + 'static { + async fn balance( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn owner( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn supply( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn nf_ts( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn nft( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn class( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn classes( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.nft.v1beta1.Query/Balance" => { + #[allow(non_camel_case_types)] + struct BalanceSvc(pub Arc); + impl tonic::server::UnaryService for BalanceSvc { + type Response = super::QueryBalanceResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).balance(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = BalanceSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/Owner" => { + #[allow(non_camel_case_types)] + struct OwnerSvc(pub Arc); + impl tonic::server::UnaryService for OwnerSvc { + type Response = super::QueryOwnerResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).owner(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = OwnerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/Supply" => { + #[allow(non_camel_case_types)] + struct SupplySvc(pub Arc); + impl tonic::server::UnaryService for SupplySvc { + type Response = super::QuerySupplyResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).supply(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SupplySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/NFTs" => { + #[allow(non_camel_case_types)] + struct NFTsSvc(pub Arc); + impl tonic::server::UnaryService for NFTsSvc { + type Response = super::QueryNfTsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).nf_ts(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = NFTsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/NFT" => { + #[allow(non_camel_case_types)] + struct NFTSvc(pub Arc); + impl tonic::server::UnaryService for NFTSvc { + type Response = super::QueryNftResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).nft(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = NFTSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/Class" => { + #[allow(non_camel_case_types)] + struct ClassSvc(pub Arc); + impl tonic::server::UnaryService for ClassSvc { + type Response = super::QueryClassResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).class(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClassSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.nft.v1beta1.Query/Classes" => { + #[allow(non_camel_case_types)] + struct ClassesSvc(pub Arc); + impl tonic::server::UnaryService for ClassesSvc { + type Response = super::QueryClassesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).classes(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ClassesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.nft.v1beta1.Query"; + } +} +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn send( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.nft.v1beta1.Msg/Send"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn send( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.nft.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::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).send(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.nft.v1beta1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs new file mode 100644 index 00000000..f73da631 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs @@ -0,0 +1,7 @@ +// @generated +/// Module defines the ORM module which adds providers to the app container for +/// module-scoped DB's. In the future it may provide gRPC services for interacting +/// with ORM data. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs new file mode 100644 index 00000000..8f1615c5 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs @@ -0,0 +1,90 @@ +// @generated +/// TableDescriptor describes an ORM table. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TableDescriptor { + /// primary_key defines the primary key for the table. + #[prost(message, optional, tag = "1")] + pub primary_key: ::core::option::Option, + /// index defines one or more secondary indexes. + #[prost(message, repeated, tag = "2")] + pub index: ::prost::alloc::vec::Vec, + /// id is a non-zero integer ID that must be unique within the + /// tables and singletons in this file. It may be deprecated in the future when this + /// can be auto-generated. + #[prost(uint32, tag = "3")] + pub id: u32, +} +/// PrimaryKeyDescriptor describes a table primary key. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct PrimaryKeyDescriptor { + /// fields is a comma-separated list of fields in the primary key. Spaces are + /// not allowed. Supported field types, their encodings, and any applicable constraints + /// are described below. + /// - uint32 are encoded as 2,3,4 or 5 bytes using a compact encoding that + /// is suitable for sorted iteration (not varint encoding). This type is + /// well-suited for small integers. + /// - uint64 are encoded as 2,4,6 or 9 bytes using a compact encoding that + /// is suitable for sorted iteration (not varint encoding). This type is + /// well-suited for small integers such as auto-incrementing sequences. + /// - fixed32, fixed64 are encoded as big-endian fixed width bytes and support + /// sorted iteration. These types are well-suited for encoding fixed with + /// decimals as integers. + /// - string's are encoded as raw bytes in terminal key segments and null-terminated + /// in non-terminal segments. Null characters are thus forbidden in strings. + /// string fields support sorted iteration. + /// - bytes are encoded as raw bytes in terminal segments and length-prefixed + /// with a 32-bit unsigned varint in non-terminal segments. + /// - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with + /// an encoding that enables sorted iteration. + /// - google.protobuf.Timestamp and google.protobuf.Duration are encoded + /// as 12 bytes using an encoding that enables sorted iteration. + /// - enum fields are encoded using varint encoding and do not support sorted + /// iteration. + /// - bool fields are encoded as a single byte 0 or 1. + /// + /// All other fields types are unsupported in keys including repeated and + /// oneof fields. + /// + /// Primary keys are prefixed by the varint encoded table id and the byte 0x0 + /// plus any additional prefix specified by the schema. + #[prost(string, tag = "1")] + pub fields: ::prost::alloc::string::String, + /// auto_increment specifies that the primary key is generated by an + /// auto-incrementing integer. If this is set to true fields must only + /// contain one field of that is of type uint64. + #[prost(bool, tag = "2")] + pub auto_increment: bool, +} +/// PrimaryKeyDescriptor describes a table secondary index. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SecondaryIndexDescriptor { + /// fields is a comma-separated list of fields in the index. The supported + /// field types are the same as those for PrimaryKeyDescriptor.fields. + /// Index keys are prefixed by the varint encoded table id and the varint + /// encoded index id plus any additional prefix specified by the schema. + /// + /// In addition the field segments, non-unique index keys are suffixed with + /// any additional primary key fields not present in the index fields so that the + /// primary key can be reconstructed. Unique indexes instead of being suffixed + /// store the remaining primary key fields in the value.. + #[prost(string, tag = "1")] + pub fields: ::prost::alloc::string::String, + /// id is a non-zero integer ID that must be unique within the indexes for this + /// table and less than 32768. It may be deprecated in the future when this can + /// be auto-generated. + #[prost(uint32, tag = "2")] + pub id: u32, + /// unique specifies that this an unique index. + #[prost(bool, tag = "3")] + pub unique: bool, +} +/// TableDescriptor describes an ORM singleton table which has at most one instance. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SingletonDescriptor { + /// id is a non-zero integer ID that must be unique within the + /// tables and singletons in this file. It may be deprecated in the future when this + /// can be auto-generated. + #[prost(uint32, tag = "1")] + pub id: u32, +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs new file mode 100644 index 00000000..9122e8ad --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs @@ -0,0 +1,82 @@ +// @generated +/// ModuleSchemaDescriptor describe's a module's ORM schema. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleSchemaDescriptor { + #[prost(message, repeated, tag = "1")] + pub schema_file: ::prost::alloc::vec::Vec, + /// prefix is an optional prefix that precedes all keys in this module's + /// store. + #[prost(bytes = "vec", tag = "2")] + pub prefix: ::prost::alloc::vec::Vec, +} +/// Nested message and enum types in `ModuleSchemaDescriptor`. +pub mod module_schema_descriptor { + /// FileEntry describes an ORM file used in a module. + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct FileEntry { + /// id is a prefix that will be varint encoded and prepended to all the + /// table keys specified in the file's tables. + #[prost(uint32, tag = "1")] + pub id: u32, + /// proto_file_name is the name of a file .proto in that contains + /// table definitions. The .proto file must be in a package that the + /// module has referenced using cosmos.app.v1.ModuleDescriptor.use_package. + #[prost(string, tag = "2")] + pub proto_file_name: ::prost::alloc::string::String, + /// storage_type optionally indicates the type of storage this file's + /// tables should used. If it is left unspecified, the default KV-storage + /// of the app will be used. + #[prost(enumeration = "super::StorageType", tag = "3")] + pub storage_type: i32, + } +} +/// StorageType +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum StorageType { + /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent + /// KV-storage where primary key entries are stored in merkle-tree + /// backed commitment storage and indexes and seqs are stored in + /// fast index storage. Note that the Cosmos SDK before store/v2alpha1 + /// does not support this. + DefaultUnspecified = 0, + /// STORAGE_TYPE_MEMORY indicates in-memory storage that will be + /// reloaded every time an app restarts. Tables with this type of storage + /// will by default be ignored when importing and exporting a module's + /// state from JSON. + Memory = 1, + /// STORAGE_TYPE_TRANSIENT indicates transient storage that is reset + /// at the end of every block. Tables with this type of storage + /// will by default be ignored when importing and exporting a module's + /// state from JSON. + Transient = 2, + /// STORAGE_TYPE_INDEX indicates persistent storage which is not backed + /// by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK + /// before store/v2alpha1 does not support this. + Index = 3, + /// STORAGE_TYPE_INDEX indicates persistent storage which is backed by + /// a merkle-tree. With this type of storage, both primary and index keys + /// will affect the app hash and this is generally less efficient + /// than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index + /// keys into index storage. Note that modules built with the + /// Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT + /// instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX + /// because this is the only type of persistent storage available. + Commitment = 4, +} +impl StorageType { + /// 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 { + StorageType::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", + StorageType::Memory => "STORAGE_TYPE_MEMORY", + StorageType::Transient => "STORAGE_TYPE_TRANSIENT", + StorageType::Index => "STORAGE_TYPE_INDEX", + StorageType::Commitment => "STORAGE_TYPE_COMMITMENT", + } + } +} +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs index a402e84c..59c20e5d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.rs @@ -37,5 +37,31 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub param: ::core::option::Option, } +/// QuerySubspacesRequest defines a request type for querying for all registered +/// subspaces and all keys for a subspace. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySubspacesRequest {} +/// QuerySubspacesResponse defines the response types for querying for all +/// registered subspaces and all keys for a subspace. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QuerySubspacesResponse { + #[prost(message, repeated, tag = "1")] + pub subspaces: ::prost::alloc::vec::Vec, +} +/// Subspace defines a parameter subspace name and all the keys that exist for +/// the subspace. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Subspace { + #[prost(string, tag = "1")] + pub subspace: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "2")] + pub keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} include!("cosmos.params.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.tonic.rs index 8abe9640..3ffebbc4 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.params.v1beta1.tonic.rs @@ -85,6 +85,21 @@ pub mod query_client { let path = http::uri::PathAndQuery::from_static("/cosmos.params.v1beta1.Query/Params"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn subspaces( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.params.v1beta1.Query/Subspaces"); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -100,6 +115,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn subspaces( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -185,6 +204,37 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.params.v1beta1.Query/Subspaces" => { + #[allow(non_camel_case_types)] + struct SubspacesSvc(pub Arc); + impl tonic::server::UnaryService for SubspacesSvc { + type Response = super::QuerySubspacesResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).subspaces(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SubspacesSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index 75ecfaf6..a74fc9ac 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs @@ -159,6 +159,8 @@ pub struct Validator { #[prost(message, optional, tag = "10")] pub commission: ::core::option::Option, /// min_self_delegation is the validator's self declared minimum self delegation. + /// + /// Since: cosmos-sdk 0.46 #[prost(string, tag = "11")] pub min_self_delegation: ::prost::alloc::string::String, } @@ -303,6 +305,9 @@ pub struct Params { /// bond_denom defines the bondable coin denomination. #[prost(string, tag = "5")] pub bond_denom: ::prost::alloc::string::String, + /// min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators + #[prost(string, tag = "6")] + pub min_commission_rate: ::prost::alloc::string::String, } /// DelegationResponse is equivalent to Delegation except that it contains a /// balance in addition to shares which is more suitable for client responses. @@ -438,7 +443,7 @@ pub struct QueryValidatorRequest { /// QueryValidatorResponse is response type for the Query/Validator RPC method #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryValidatorResponse { - /// validator defines the the validator info. + /// validator defines the validator info. #[prost(message, optional, tag = "1")] pub validator: ::core::option::Option, } @@ -605,7 +610,7 @@ pub struct QueryDelegatorValidatorsRequest { /// Query/DelegatorValidators RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorsResponse { - /// validators defines the the validators' info of a delegator. + /// 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. @@ -627,7 +632,7 @@ pub struct QueryDelegatorValidatorRequest { /// Query/DelegatorValidator RPC method. #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDelegatorValidatorResponse { - /// validator defines the the validator info. + /// validator defines the validator info. #[prost(message, optional, tag = "1")] pub validator: ::core::option::Option, } @@ -757,5 +762,26 @@ pub struct MsgUndelegateResponse { #[prost(message, optional, tag = "1")] pub completion_time: ::core::option::Option<::prost_types::Timestamp>, } +/// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator +/// +/// Since: cosmos-sdk 0.46 +#[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, +} +/// MsgCancelUnbondingDelegationResponse +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelUnbondingDelegationResponse {} include!("cosmos.staking.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs index 1558029f..cc803d79 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.tonic.rs @@ -1062,6 +1062,23 @@ pub mod msg_client { http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Undelegate"); self.inner.unary(request.into_request(), path, codec).await } + pub async fn cancel_unbonding_delegation( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation", + ); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -1093,6 +1110,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn cancel_unbonding_delegation( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1302,6 +1323,40 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.staking.v1beta1.Msg/CancelUnbondingDelegation" => { + #[allow(non_camel_case_types)] + struct CancelUnbondingDelegationSvc(pub Arc); + impl tonic::server::UnaryService + for CancelUnbondingDelegationSvc + { + type Response = super::MsgCancelUnbondingDelegationResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = + async move { (*inner).cancel_unbonding_delegation(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelUnbondingDelegationSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs index ea9f06bd..ef809f20 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs @@ -69,21 +69,35 @@ pub mod signature_descriptor { } } /// SignMode represents a signing mode with its own security guarantees. +/// +/// This enum should be considered a registry of all known sign modes +/// in the Cosmos ecosystem. Apps are not expected to support all known +/// sign modes. Apps that would like to support custom sign modes are +/// encouraged to open a small PR against this file to add a new case +/// to this SignMode enum describing their sign mode so that different +/// apps have a consistent version of this enum. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum SignMode { /// SIGN_MODE_UNSPECIFIED specifies an unknown signing mode and will be - /// rejected + /// rejected. Unspecified = 0, /// SIGN_MODE_DIRECT specifies a signing mode which uses SignDoc and is - /// verified with raw bytes from Tx + /// verified with raw bytes from Tx. 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 + /// from SIGN_MODE_DIRECT. It is currently not supported. 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. + /// + /// Since: cosmos-sdk 0.46 + DirectAux = 3, /// SIGN_MODE_LEGACY_AMINO_JSON is a backwards compatibility mode which uses - /// Amino JSON and will be removed in the future + /// Amino JSON and will be removed in the future. LegacyAminoJson = 127, /// SIGN_MODE_EIP_191 specifies the sign mode for EIP 191 signing on the Cosmos /// SDK. Ref: @@ -107,6 +121,7 @@ impl SignMode { SignMode::Unspecified => "SIGN_MODE_UNSPECIFIED", SignMode::Direct => "SIGN_MODE_DIRECT", SignMode::Textual => "SIGN_MODE_TEXTUAL", + SignMode::DirectAux => "SIGN_MODE_DIRECT_AUX", SignMode::LegacyAminoJson => "SIGN_MODE_LEGACY_AMINO_JSON", SignMode::Eip191 => "SIGN_MODE_EIP_191", } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs index 880013ea..da14606a 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs @@ -56,6 +56,39 @@ pub struct SignDoc { #[prost(uint64, tag = "4")] pub account_number: u64, } +/// SignDocDirectAux is the type used for generating sign bytes for +/// SIGN_MODE_DIRECT_AUX. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SignDocDirectAux { + /// body_bytes is protobuf serialization of a TxBody that matches the + /// representation in TxRaw. + #[prost(bytes = "vec", tag = "1")] + pub body_bytes: ::prost::alloc::vec::Vec, + /// public_key is the public key of the signing account. + #[prost(message, optional, tag = "2")] + pub public_key: ::core::option::Option<::prost_types::Any>, + /// chain_id is the identifier of the chain this transaction targets. + /// It prevents signed transactions from being used on another chain by an + /// attacker. + #[prost(string, tag = "3")] + pub chain_id: ::prost::alloc::string::String, + /// account_number is the account number of the account in state. + #[prost(uint64, tag = "4")] + pub account_number: u64, + /// 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. + #[prost(message, optional, tag = "6")] + pub tip: ::core::option::Option, +} /// TxBody is the body of a transaction that all signers sign over. #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxBody { @@ -104,6 +137,14 @@ pub struct AuthInfo { /// of the signers. This can be estimated via simulation. #[prost(message, optional, tag = "2")] pub fee: ::core::option::Option, + /// Tip is the optional tip used for transactions fees paid in another denom. + /// + /// This field is ignored if the chain didn't enable tips, i.e. didn't add the + /// `TipDecorator` in its posthandler. + /// + /// Since: cosmos-sdk 0.46 + #[prost(message, optional, tag = "3")] + pub tip: ::core::option::Option, } /// SignerInfo describes the public key and signing mode of a single top-level /// signer. @@ -190,6 +231,43 @@ pub struct Fee { #[prost(string, tag = "4")] pub granter: ::prost::alloc::string::String, } +/// Tip is the tip used for meta-transactions. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Tip { + /// amount is the amount of the tip + #[prost(message, repeated, tag = "1")] + pub amount: ::prost::alloc::vec::Vec, + /// tipper is the address of the account paying for the tip + #[prost(string, tag = "2")] + pub tipper: ::prost::alloc::string::String, +} +/// AuxSignerData is the intermediary format that an auxiliary signer (e.g. a +/// tipper) builds and sends to the fee payer (who will build and broadcast the +/// actual tx). AuxSignerData is not a valid tx in itself, and will be rejected +/// by the node if sent directly as-is. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AuxSignerData { + /// address is the bech32-encoded address of the auxiliary signer. If using + /// AuxSignerData across different chains, the bech32 prefix of the target + /// chain (where the final transaction is broadcasted) should be used. + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + /// sign_doc is the SIGN_MODE_DIRECT_AUX sign doc that the auxiliary signer + /// signs. Note: we use the same sign doc even if we're signing with + /// LEGACY_AMINO_JSON. + #[prost(message, optional, tag = "2")] + pub sign_doc: ::core::option::Option, + /// mode is the signing mode of the single signer. + #[prost(enumeration = "super::signing::v1beta1::SignMode", tag = "3")] + pub mode: i32, + /// sig is the signature of the sign doc. + #[prost(bytes = "vec", tag = "4")] + pub sig: ::prost::alloc::vec::Vec, +} /// GetTxsEventRequest is the request type for the Service.TxsByEvents /// RPC method. #[derive(Clone, PartialEq, ::prost::Message)] @@ -198,10 +276,19 @@ pub struct GetTxsEventRequest { #[prost(string, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// pagination defines a pagination for the request. + /// Deprecated post v0.46.x: use page and limit instead. + #[deprecated] #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, #[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. + #[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, } /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. @@ -214,8 +301,13 @@ pub struct GetTxsEventResponse { #[prost(message, repeated, tag = "2")] pub tx_responses: ::prost::alloc::vec::Vec, /// pagination defines a pagination for the response. + /// Deprecated post v0.46.x: use total instead. + #[deprecated] #[prost(message, optional, tag = "3")] pub pagination: ::core::option::Option, + /// total is total number of results available + #[prost(uint64, tag = "4")] + pub total: u64, } /// BroadcastTxRequest is the request type for the Service.BroadcastTxRequest /// RPC method. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs index a2241a31..cd3ad7d9 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.rs @@ -34,6 +34,8 @@ pub struct Plan { } /// SoftwareUpgradeProposal is a gov Content type for initiating a software /// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgSoftwareUpgrade. #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { #[prost(string, tag = "1")] @@ -45,6 +47,8 @@ pub struct SoftwareUpgradeProposal { } /// CancelSoftwareUpgradeProposal is a gov Content type for cancelling a software /// upgrade. +/// Deprecated: This legacy proposal is deprecated in favor of Msg-based gov +/// proposals, see MsgCancelUpgrade. #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { #[prost(string, tag = "1")] @@ -131,5 +135,49 @@ pub struct QueryModuleVersionsResponse { #[prost(message, repeated, tag = "1")] pub module_versions: ::prost::alloc::vec::Vec, } +/// QueryAuthorityRequest is the request type for Query/Authority +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAuthorityRequest {} +/// QueryAuthorityResponse is the response type for Query/Authority +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAuthorityResponse { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSoftwareUpgrade { + /// authority is the address of the governance account. + #[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, +} +/// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgSoftwareUpgradeResponse {} +/// MsgCancelUpgrade is the Msg/CancelUpgrade request type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelUpgrade { + /// authority is the address of the governance account. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +/// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelUpgradeResponse {} include!("cosmos.upgrade.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.tonic.rs index 25bb3d62..1f7b3c9c 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.upgrade.v1beta1.tonic.rs @@ -134,6 +134,21 @@ pub mod query_client { ); self.inner.unary(request.into_request(), path, codec).await } + pub async fn authority( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.upgrade.v1beta1.Query/Authority"); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -161,6 +176,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn authority( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -345,6 +364,37 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.upgrade.v1beta1.Query/Authority" => { + #[allow(non_camel_case_types)] + struct AuthoritySvc(pub Arc); + impl tonic::server::UnaryService for AuthoritySvc { + type Response = super::QueryAuthorityResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).authority(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) @@ -380,3 +430,272 @@ pub mod query_server { const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; } } +/// Generated client implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + #[cfg_attr(docsrs, doc(cfg(feature = "grpc-transport")))] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: std::convert::TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + pub async fn software_upgrade( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade"); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn cancel_upgrade( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.upgrade.v1beta1.Msg/CancelUpgrade"); + self.inner.unary(request.into_request(), path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +#[cfg_attr(docsrs, doc(cfg(feature = "grpc")))] +pub mod msg_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + ///Generated trait containing gRPC methods that should be implemented for use with MsgServer. + #[async_trait] + pub trait Msg: Send + Sync + 'static { + async fn software_upgrade( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn cancel_upgrade( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready(&mut self, _cx: &mut Context<'_>) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.upgrade.v1beta1.Msg/SoftwareUpgrade" => { + #[allow(non_camel_case_types)] + struct SoftwareUpgradeSvc(pub Arc); + impl tonic::server::UnaryService for SoftwareUpgradeSvc { + type Response = super::MsgSoftwareUpgradeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).software_upgrade(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = SoftwareUpgradeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.upgrade.v1beta1.Msg/CancelUpgrade" => { + #[allow(non_camel_case_types)] + struct CancelUpgradeSvc(pub Arc); + impl tonic::server::UnaryService for CancelUpgradeSvc { + type Response = super::MsgCancelUpgradeResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { (*inner).cancel_upgrade(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelUpgradeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(self.0.clone()) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.upgrade.v1beta1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs index e5ca9832..63a56aeb 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.rs @@ -1,22 +1,4 @@ // @generated -/// MsgCreateVestingAccount defines a message that enables creating a vesting -/// account. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateVestingAccount { - #[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, - #[prost(int64, tag = "4")] - pub end_time: i64, - #[prost(bool, tag = "5")] - pub delayed: bool, -} -/// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgCreateVestingAccountResponse {} /// BaseVestingAccount implements the VestingAccount interface. It contains all /// the necessary fields needed for any vesting account implementation. #[derive(Clone, PartialEq, ::prost::Message)] @@ -29,6 +11,7 @@ pub struct BaseVestingAccount { pub delegated_free: ::prost::alloc::vec::Vec, #[prost(message, repeated, tag = "4")] pub delegated_vesting: ::prost::alloc::vec::Vec, + /// Vesting end time, as unix timestamp (in seconds). #[prost(int64, tag = "5")] pub end_time: i64, } @@ -38,6 +21,7 @@ pub struct BaseVestingAccount { pub struct ContinuousVestingAccount { #[prost(message, optional, tag = "1")] pub base_vesting_account: ::core::option::Option, + /// Vesting start time, as unix timestamp (in seconds). #[prost(int64, tag = "2")] pub start_time: i64, } @@ -52,6 +36,7 @@ pub struct DelayedVestingAccount { /// Period defines a length of time and amount of coins that will vest. #[derive(Clone, PartialEq, ::prost::Message)] pub struct Period { + /// Period duration in seconds. #[prost(int64, tag = "1")] pub length: i64, #[prost(message, repeated, tag = "2")] @@ -78,5 +63,64 @@ pub struct PermanentLockedAccount { #[prost(message, optional, tag = "1")] pub base_vesting_account: ::core::option::Option, } +/// MsgCreateVestingAccount defines a message that enables creating a vesting +/// account. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateVestingAccount { + #[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, + /// end of vesting as unix time (in seconds). + #[prost(int64, tag = "4")] + pub end_time: i64, + #[prost(bool, tag = "5")] + pub delayed: bool, +} +/// MsgCreateVestingAccountResponse defines the Msg/CreateVestingAccount response type. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateVestingAccountResponse {} +/// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent +/// locked account. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreatePermanentLockedAccount { + #[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, +} +/// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreatePermanentLockedAccountResponse {} +/// MsgCreateVestingAccount defines a message that enables creating a vesting +/// account. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreatePeriodicVestingAccount { + #[prost(string, tag = "1")] + pub from_address: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub to_address: ::prost::alloc::string::String, + /// start of vesting as unix time (in seconds). + #[prost(int64, tag = "3")] + pub start_time: i64, + #[prost(message, repeated, tag = "4")] + pub vesting_periods: ::prost::alloc::vec::Vec, +} +/// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount +/// response type. +/// +/// Since: cosmos-sdk 0.46 +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreatePeriodicVestingAccountResponse {} include!("cosmos.vesting.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.tonic.rs index f97307d6..05394ce6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.vesting.v1beta1.tonic.rs @@ -85,6 +85,40 @@ pub mod msg_client { ); self.inner.unary(request.into_request(), path, codec).await } + pub async fn create_permanent_locked_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount", + ); + self.inner.unary(request.into_request(), path, codec).await + } + pub async fn create_periodic_vesting_account( + &mut self, + request: impl tonic::IntoRequest, + ) -> Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount", + ); + self.inner.unary(request.into_request(), path, codec).await + } } } /// Generated server implementations. @@ -100,6 +134,14 @@ pub mod msg_server { &self, request: tonic::Request, ) -> Result, tonic::Status>; + async fn create_permanent_locked_account( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; + async fn create_periodic_vesting_account( + &self, + request: tonic::Request, + ) -> Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -187,6 +229,76 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.vesting.v1beta1.Msg/CreatePermanentLockedAccount" => { + #[allow(non_camel_case_types)] + struct CreatePermanentLockedAccountSvc(pub Arc); + impl tonic::server::UnaryService + for CreatePermanentLockedAccountSvc + { + type Response = super::MsgCreatePermanentLockedAccountResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).create_permanent_locked_account(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreatePermanentLockedAccountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.vesting.v1beta1.Msg/CreatePeriodicVestingAccount" => { + #[allow(non_camel_case_types)] + struct CreatePeriodicVestingAccountSvc(pub Arc); + impl tonic::server::UnaryService + for CreatePeriodicVestingAccountSvc + { + type Response = super::MsgCreatePeriodicVestingAccountResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = self.0.clone(); + let fut = async move { + (*inner).create_periodic_vesting_account(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreatePeriodicVestingAccountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec).apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs index 8e2ac1be..a74f2b1e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos_proto.rs @@ -1,2 +1,64 @@ // @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// 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 { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } +} // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/ics23.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/ics23.rs deleted file mode 100644 index bca92d52..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/ics23.rs +++ /dev/null @@ -1,322 +0,0 @@ -// @generated -/// * -/// ExistenceProof takes a key and a value and a set of steps to perform on it. -/// The result of peforming all these steps will provide a "root hash", which can -/// be compared to the value in a header. -/// -/// Since it is computationally infeasible to produce a hash collission for any of the used -/// cryptographic hash functions, if someone can provide a series of operations to transform -/// a given key and value into a root hash that matches some trusted root, these key and values -/// must be in the referenced merkle tree. -/// -/// The only possible issue is maliablity in LeafOp, such as providing extra prefix data, -/// which should be controlled by a spec. Eg. with lengthOp as NONE, -/// prefix = FOO, key = BAR, value = CHOICE -/// and -/// prefix = F, key = OOBAR, value = CHOICE -/// would produce the same value. -/// -/// With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field -/// in the ProofSpec is valuable to prevent this mutability. And why all trees should -/// length-prefix the data before hashing it. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - #[prost(message, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -/// -/// NonExistenceProof takes a proof of two neighbors, one left of the desired key, -/// one right of the desired key. If both proofs are valid AND they are neighbors, -/// then there is no valid proof for the given key. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -/// -/// CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CommitmentProof { - #[prost(oneof = "commitment_proof::Proof", tags = "1, 2, 3, 4")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CommitmentProof`. -pub mod commitment_proof { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - #[prost(message, tag = "3")] - Batch(super::BatchProof), - #[prost(message, tag = "4")] - Compressed(super::CompressedBatchProof), - } -} -/// * -/// LeafOp represents the raw key-value data we wish to prove, and -/// must be flexible to represent the internal transformation from -/// the original key-value pairs into the basis hash, for many existing -/// merkle trees. -/// -/// key and value are passed in. So that the signature of this operation is: -/// leafOp(key, value) -> output -/// -/// To process this, first prehash the keys and values if needed (ANY means no hash in this case): -/// hkey = prehashKey(key) -/// hvalue = prehashValue(value) -/// -/// Then combine the bytes, and hash it -/// output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue) -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct LeafOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(enumeration = "HashOp", tag = "2")] - pub prehash_key: i32, - #[prost(enumeration = "HashOp", tag = "3")] - pub prehash_value: i32, - #[prost(enumeration = "LengthOp", tag = "4")] - pub length: i32, - /// prefix is a fixed bytes that may optionally be included at the beginning to differentiate - /// a leaf node from an inner node. - #[prost(bytes = "vec", tag = "5")] - pub prefix: ::prost::alloc::vec::Vec, -} -/// * -/// InnerOp represents a merkle-proof step that is not a leaf. -/// It represents concatenating two children and hashing them to provide the next result. -/// -/// The result of the previous step is passed in, so the signature of this op is: -/// innerOp(child) -> output -/// -/// The result of applying InnerOp should be: -/// output = op.hash(op.prefix || child || op.suffix) -/// -/// where the || operator is concatenation of binary data, -/// and child is the result of hashing all the tree below this step. -/// -/// Any special data, like prepending child with the length, or prepending the entire operation with -/// some value to differentiate from leaf nodes, should be included in prefix and suffix. -/// If either of prefix or suffix is empty, we just treat it as an empty string -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerOp { - #[prost(enumeration = "HashOp", tag = "1")] - pub hash: i32, - #[prost(bytes = "vec", tag = "2")] - pub prefix: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "3")] - pub suffix: ::prost::alloc::vec::Vec, -} -/// * -/// ProofSpec defines what the expected parameters are for a given proof type. -/// This can be stored in the client and used to validate any incoming proofs. -/// -/// verify(ProofSpec, Proof) -> Proof | Error -/// -/// As demonstrated in tests, if we don't fix the algorithm used to calculate the -/// LeafHash for a given tree, there are many possible key-value pairs that can -/// generate a given hash (by interpretting the preimage differently). -/// We need this for proper security, requires client knows a priori what -/// tree format server uses. But not in code, rather a configuration object. -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ProofSpec { - /// any field in the ExistenceProof must be the same as in this spec. - /// except Prefix, which is just the first bytes of prefix (spec can be longer) - #[prost(message, optional, tag = "1")] - pub leaf_spec: ::core::option::Option, - #[prost(message, optional, tag = "2")] - pub inner_spec: ::core::option::Option, - /// max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "3")] - pub max_depth: i32, - /// min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) - #[prost(int32, tag = "4")] - pub min_depth: i32, -} -/// -/// InnerSpec contains all store-specific structure info to determine if two proofs from a -/// given store are neighbors. -/// -/// This enables: -/// -/// isLeftMost(spec: InnerSpec, op: InnerOp) -/// isRightMost(spec: InnerSpec, op: InnerOp) -/// isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp) -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct InnerSpec { - /// Child order is the ordering of the children node, must count from 0 - /// iavl tree is [0, 1] (left then right) - /// merk is [0, 2, 1] (left, right, here) - #[prost(int32, repeated, tag = "1")] - pub child_order: ::prost::alloc::vec::Vec, - #[prost(int32, tag = "2")] - pub child_size: i32, - #[prost(int32, tag = "3")] - pub min_prefix_length: i32, - #[prost(int32, tag = "4")] - pub max_prefix_length: i32, - /// empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) - #[prost(bytes = "vec", tag = "5")] - pub empty_child: ::prost::alloc::vec::Vec, - /// hash is the algorithm that must be used for each InnerOp - #[prost(enumeration = "HashOp", tag = "6")] - pub hash: i32, -} -/// -/// BatchProof is a group of multiple proof types than can be compressed -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BatchEntry { - #[prost(oneof = "batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `BatchEntry`. -pub mod batch_entry { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::ExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::NonExistenceProof), - } -} -// ***** all items here are compressed forms ****** - -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchProof { - #[prost(message, repeated, tag = "1")] - pub entries: ::prost::alloc::vec::Vec, - #[prost(message, repeated, tag = "2")] - pub lookup_inners: ::prost::alloc::vec::Vec, -} -/// Use BatchEntry not CommitmentProof, to avoid recursion -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedBatchEntry { - #[prost(oneof = "compressed_batch_entry::Proof", tags = "1, 2")] - pub proof: ::core::option::Option, -} -/// Nested message and enum types in `CompressedBatchEntry`. -pub mod compressed_batch_entry { - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Proof { - #[prost(message, tag = "1")] - Exist(super::CompressedExistenceProof), - #[prost(message, tag = "2")] - Nonexist(super::CompressedNonExistenceProof), - } -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedExistenceProof { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "3")] - pub leaf: ::core::option::Option, - /// these are indexes into the lookup_inners table in CompressedBatchProof - #[prost(int32, repeated, tag = "4")] - pub path: ::prost::alloc::vec::Vec, -} -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CompressedNonExistenceProof { - /// TODO: remove this as unnecessary??? we prove a range - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub left: ::core::option::Option, - #[prost(message, optional, tag = "3")] - pub right: ::core::option::Option, -} -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum HashOp { - /// NO_HASH is the default if no data passed. Note this is an illegal argument some places. - NoHash = 0, - Sha256 = 1, - Sha512 = 2, - Keccak = 3, - Ripemd160 = 4, - /// ripemd160(sha256(x)) - Bitcoin = 5, -} -impl HashOp { - /// 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 { - HashOp::NoHash => "NO_HASH", - HashOp::Sha256 => "SHA256", - HashOp::Sha512 => "SHA512", - HashOp::Keccak => "KECCAK", - HashOp::Ripemd160 => "RIPEMD160", - HashOp::Bitcoin => "BITCOIN", - } - } -} -/// * -/// LengthOp defines how to process the key and value of the LeafOp -/// to include length information. After encoding the length with the given -/// algorithm, the length will be prepended to the key and value bytes. -/// (Each one with it's own encoded length) -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum LengthOp { - /// NO_PREFIX don't include any length info - NoPrefix = 0, - /// VAR_PROTO uses protobuf (and go-amino) varint encoding of the length - VarProto = 1, - /// VAR_RLP uses rlp int encoding of the length - VarRlp = 2, - /// FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer - Fixed32Big = 3, - /// FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer - Fixed32Little = 4, - /// FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer - Fixed64Big = 5, - /// FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer - Fixed64Little = 6, - /// REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) - Require32Bytes = 7, - /// REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) - Require64Bytes = 8, -} -impl LengthOp { - /// 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 { - LengthOp::NoPrefix => "NO_PREFIX", - LengthOp::VarProto => "VAR_PROTO", - LengthOp::VarRlp => "VAR_RLP", - LengthOp::Fixed32Big => "FIXED32_BIG", - LengthOp::Fixed32Little => "FIXED32_LITTLE", - LengthOp::Fixed64Big => "FIXED64_BIG", - LengthOp::Fixed64Little => "FIXED64_LITTLE", - LengthOp::Require32Bytes => "REQUIRE_32_BYTES", - LengthOp::Require64Bytes => "REQUIRE_64_BYTES", - } - } -} -// @@protoc_insertion_point(module) diff --git a/cosmrs/src/abci/msg_data.rs b/cosmrs/src/abci/msg_data.rs index 05c6d705..22706546 100644 --- a/cosmrs/src/abci/msg_data.rs +++ b/cosmrs/src/abci/msg_data.rs @@ -4,6 +4,7 @@ use crate::{ tx::Msg, ErrorReport, Result, }; +use eyre::eyre; /// MsgData defines the data returned in a Result object during message execution. #[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] @@ -73,7 +74,13 @@ impl Msg for TxMsgData { impl TryFrom for TxMsgData { type Error = ErrorReport; + #[allow(deprecated)] fn try_from(proto: proto::cosmos::base::abci::v1beta1::TxMsgData) -> Result { + // TODO(tarcieri): parse `msg_responses` + if !proto.msg_responses.is_empty() { + return Err(eyre!("TxMsgData::msg_responses unsupported")); + } + Ok(TxMsgData { data: proto .data @@ -85,9 +92,11 @@ impl TryFrom for TxMsgData { } impl From for proto::cosmos::base::abci::v1beta1::TxMsgData { + #[allow(deprecated)] fn from(tx_msg_data: TxMsgData) -> Self { proto::cosmos::base::abci::v1beta1::TxMsgData { data: tx_msg_data.data.into_iter().map(Into::into).collect(), + msg_responses: vec![], // TODO(tarcieri): serialize responses } } } diff --git a/cosmrs/src/tx/auth_info.rs b/cosmrs/src/tx/auth_info.rs index f20c5aa8..b91a2402 100644 --- a/cosmrs/src/tx/auth_info.rs +++ b/cosmrs/src/tx/auth_info.rs @@ -7,6 +7,7 @@ use crate::{ }; /// [`AuthInfo`] describes the fee and signer modes that are used to sign a transaction. +// TODO(tarcieri): support for the `tip` field #[derive(Clone, Debug, Eq, PartialEq)] pub struct AuthInfo { /// Defines the signing modes for the required signers. @@ -40,6 +41,7 @@ impl TryFrom for AuthInfo { type Error = ErrorReport; fn try_from(proto: proto::cosmos::tx::v1beta1::AuthInfo) -> Result { + // TODO(tarcieri): parse tip Ok(AuthInfo { signer_infos: proto .signer_infos @@ -59,6 +61,7 @@ impl From for proto::cosmos::tx::v1beta1::AuthInfo { proto::cosmos::tx::v1beta1::AuthInfo { signer_infos: auth_info.signer_infos.into_iter().map(Into::into).collect(), fee: Some(auth_info.fee.into()), + tip: None, } } } diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index b2bcfbf6..084c573d 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -20,7 +20,7 @@ use walkdir::WalkDir; static QUIET: AtomicBool = AtomicBool::new(false); /// The Cosmos SDK commit or tag to be cloned and used to build the proto files -const COSMOS_SDK_REV: &str = "v0.45.4"; +const COSMOS_SDK_REV: &str = "v0.46.12"; /// The Cosmos ibc-go commit or tag to be cloned and used to build the proto files const IBC_REV: &str = "v3.0.0"; @@ -140,11 +140,10 @@ fn run_cmd(cmd: impl AsRef, args: impl IntoIterator panic!("{:?} exited with error code: {:?}", cmd.as_ref(), code), + None => panic!("{:?} exited without error code", cmd.as_ref()), + } } } @@ -225,7 +224,8 @@ fn compile_sdk_protos_and_services(out_dir: &Path) { // Compile all of the proto files, along with grpc service clients info!("Compiling proto definitions and clients for GRPC services!"); - run_buf("buf.sdk.gen.yaml", COSMOS_SDK_DIR, out_dir); + let proto_path = Path::new(COSMOS_SDK_DIR).join("proto"); + run_buf("buf.sdk.gen.yaml", &proto_path, out_dir); info!("=> Done!"); }