diff --git a/cosmos-sdk-go b/cosmos-sdk-go index 8bfcf554..bcaf7378 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit 8bfcf554275c1efbb42666cc8510d2da139b67fa +Subproject commit bcaf7378adfb1235032ecc43925cc83c077e225a diff --git a/cosmos-sdk-proto/src/lib.rs b/cosmos-sdk-proto/src/lib.rs index e78b8d6f..e5d190c2 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -95,6 +95,20 @@ pub mod cosmos { } } + /// Benchmarking + pub mod benchmark { + pub mod v1 { + include!("prost/cosmos-sdk/cosmos.benchmark.v1.rs"); + } + } + + /// counter + pub mod counter { + pub mod v1 { + include!("prost/cosmos-sdk/cosmos.counter.v1.rs"); + } + } + /// Crisis handling pub mod crisis { pub mod v1beta1 { @@ -129,6 +143,13 @@ pub mod cosmos { } } + /// Messages and services handling evidence + pub mod epochs { + pub mod v1beta1 { + include!("prost/cosmos-sdk/cosmos.epochs.v1beta1.rs"); + } + } + /// Messages and services handling evidence pub mod evidence { pub mod v1beta1 { @@ -174,6 +195,13 @@ pub mod cosmos { } } + /// Messages and services handling chain parameters + pub mod protocolpool { + pub mod v1 { + include!("prost/cosmos-sdk/cosmos.protocolpool.v1.rs"); + } + } + /// Handling slashing parameters and unjailing pub mod slashing { pub mod v1beta1 { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs index 39921396..f599f5a1 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.rs @@ -30,9 +30,14 @@ pub struct Module { /// to be used in keeper construction. #[prost(message, repeated, tag = "6")] pub override_store_keys: ::prost::alloc::vec::Vec, + /// skip_store_keys is an optional list of store keys to skip when constructing the + /// module's keeper. This is useful when a module does not have a store key. + /// NOTE: the provided environment variable will have a fake store service. + #[prost(string, repeated, tag = "11")] + pub skip_store_keys: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// order_migrations defines the order in which module migrations are performed. /// If this is left empty, it uses the default migration order. - /// + /// #[prost(string, repeated, tag = "7")] pub order_migrations: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// precommiters specifies the module names of the precommiters @@ -45,6 +50,11 @@ pub struct Module { /// no preparecheckstate function will be registered. #[prost(string, repeated, tag = "9")] pub prepare_check_staters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pre_blockers specifies the module names of pre blockers + /// to call in the order in which they should be called. If this is left empty + /// no pre blocker will be registered. + #[prost(string, repeated, tag = "10")] + pub pre_blockers: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } impl ::prost::Name for Module { const NAME: &'static str = "Module"; diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs index 1c0a1c1f..aefa3648 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.runtime.v1alpha1.serde.rs @@ -26,6 +26,9 @@ impl serde::Serialize for Module { if !self.override_store_keys.is_empty() { len += 1; } + if !self.skip_store_keys.is_empty() { + len += 1; + } if !self.order_migrations.is_empty() { len += 1; } @@ -35,6 +38,9 @@ impl serde::Serialize for Module { if !self.prepare_check_staters.is_empty() { len += 1; } + if !self.pre_blockers.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.app.runtime.v1alpha1.Module", len)?; if !self.app_name.is_empty() { @@ -55,6 +61,9 @@ impl serde::Serialize for Module { if !self.override_store_keys.is_empty() { struct_ser.serialize_field("overrideStoreKeys", &self.override_store_keys)?; } + if !self.skip_store_keys.is_empty() { + struct_ser.serialize_field("skipStoreKeys", &self.skip_store_keys)?; + } if !self.order_migrations.is_empty() { struct_ser.serialize_field("orderMigrations", &self.order_migrations)?; } @@ -64,6 +73,9 @@ impl serde::Serialize for Module { if !self.prepare_check_staters.is_empty() { struct_ser.serialize_field("prepareCheckStaters", &self.prepare_check_staters)?; } + if !self.pre_blockers.is_empty() { + struct_ser.serialize_field("preBlockers", &self.pre_blockers)?; + } struct_ser.end() } } @@ -87,11 +99,15 @@ impl<'de> serde::Deserialize<'de> for Module { "exportGenesis", "override_store_keys", "overrideStoreKeys", + "skip_store_keys", + "skipStoreKeys", "order_migrations", "orderMigrations", "precommiters", "prepare_check_staters", "prepareCheckStaters", + "pre_blockers", + "preBlockers", ]; #[allow(clippy::enum_variant_names)] @@ -102,9 +118,11 @@ impl<'de> serde::Deserialize<'de> for Module { InitGenesis, ExportGenesis, OverrideStoreKeys, + SkipStoreKeys, OrderMigrations, Precommiters, PrepareCheckStaters, + PreBlockers, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -138,6 +156,9 @@ impl<'de> serde::Deserialize<'de> for Module { "overrideStoreKeys" | "override_store_keys" => { Ok(GeneratedField::OverrideStoreKeys) } + "skipStoreKeys" | "skip_store_keys" => { + Ok(GeneratedField::SkipStoreKeys) + } "orderMigrations" | "order_migrations" => { Ok(GeneratedField::OrderMigrations) } @@ -145,6 +166,7 @@ impl<'de> serde::Deserialize<'de> for Module { "prepareCheckStaters" | "prepare_check_staters" => { Ok(GeneratedField::PrepareCheckStaters) } + "preBlockers" | "pre_blockers" => Ok(GeneratedField::PreBlockers), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -170,9 +192,11 @@ impl<'de> serde::Deserialize<'de> for Module { let mut init_genesis__ = None; let mut export_genesis__ = None; let mut override_store_keys__ = None; + let mut skip_store_keys__ = None; let mut order_migrations__ = None; let mut precommiters__ = None; let mut prepare_check_staters__ = None; + let mut pre_blockers__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AppName => { @@ -211,6 +235,12 @@ impl<'de> serde::Deserialize<'de> for Module { } override_store_keys__ = Some(map_.next_value()?); } + GeneratedField::SkipStoreKeys => { + if skip_store_keys__.is_some() { + return Err(serde::de::Error::duplicate_field("skipStoreKeys")); + } + skip_store_keys__ = Some(map_.next_value()?); + } GeneratedField::OrderMigrations => { if order_migrations__.is_some() { return Err(serde::de::Error::duplicate_field("orderMigrations")); @@ -231,6 +261,12 @@ impl<'de> serde::Deserialize<'de> for Module { } prepare_check_staters__ = Some(map_.next_value()?); } + GeneratedField::PreBlockers => { + if pre_blockers__.is_some() { + return Err(serde::de::Error::duplicate_field("preBlockers")); + } + pre_blockers__ = Some(map_.next_value()?); + } } } Ok(Module { @@ -240,9 +276,11 @@ impl<'de> serde::Deserialize<'de> for Module { init_genesis: init_genesis__.unwrap_or_default(), export_genesis: export_genesis__.unwrap_or_default(), override_store_keys: override_store_keys__.unwrap_or_default(), + skip_store_keys: skip_store_keys__.unwrap_or_default(), order_migrations: order_migrations__.unwrap_or_default(), precommiters: precommiters__.unwrap_or_default(), prepare_check_staters: prepare_check_staters__.unwrap_or_default(), + pre_blockers: pre_blockers__.unwrap_or_default(), }) } } 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 index 4f5ab4e2..fede72cb 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.app.v1alpha1.rs @@ -188,7 +188,7 @@ impl ::prost::Name for QueryConfigRequest { ::prost::alloc::format!("cosmos.app.v1alpha1.{}", Self::NAME) } } -/// QueryConfigRequest is the Query/Config response type. +/// QueryConfigResponse is the Query/Config response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryConfigResponse { 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 index 20b005e7..c39a1a59 100644 --- 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 @@ -2,17 +2,9 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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, @@ -31,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -52,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -93,15 +85,16 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - /** Config returns the current app config. - */ pub async fn config( &mut self, request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -115,39 +108,31 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { - /** Config returns the current app config. - */ + pub trait Query: Send + Sync + 'static { async fn config( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } - /** Query is the app module query service. - */ #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -194,10 +179,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -207,6 +192,7 @@ pub mod query_server { 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)] @@ -219,7 +205,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::config(&inner, request).await }; + let fut = async move { (*inner).config(request).await }; Box::pin(fut) } } @@ -229,6 +215,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ConfigSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -246,22 +233,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -273,9 +255,17 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.app.v1alpha1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs index ab932046..0800c520 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.rs @@ -12,6 +12,11 @@ pub struct Module { /// authority defines the custom module authority. If not set, defaults to the governance module. #[prost(string, tag = "3")] pub authority: ::prost::alloc::string::String, + /// enable_unordered_transactions determines whether unordered transactions should be supported or not. + /// When true, unordered transactions will be validated and processed. + /// When false, unordered transactions will be rejected. + #[prost(bool, tag = "4")] + pub enable_unordered_transactions: bool, } impl ::prost::Name for Module { const NAME: &'static str = "Module"; diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs index 1a92d347..9e950482 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.auth.module.v1.serde.rs @@ -17,6 +17,9 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { len += 1; } + if self.enable_unordered_transactions { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.auth.module.v1.Module", len)?; if !self.bech32_prefix.is_empty() { struct_ser.serialize_field("bech32Prefix", &self.bech32_prefix)?; @@ -28,6 +31,12 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { struct_ser.serialize_field("authority", &self.authority)?; } + if self.enable_unordered_transactions { + struct_ser.serialize_field( + "enableUnorderedTransactions", + &self.enable_unordered_transactions, + )?; + } struct_ser.end() } } @@ -44,6 +53,8 @@ impl<'de> serde::Deserialize<'de> for Module { "module_account_permissions", "moduleAccountPermissions", "authority", + "enable_unordered_transactions", + "enableUnorderedTransactions", ]; #[allow(clippy::enum_variant_names)] @@ -51,6 +62,7 @@ impl<'de> serde::Deserialize<'de> for Module { Bech32Prefix, ModuleAccountPermissions, Authority, + EnableUnorderedTransactions, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -81,6 +93,9 @@ impl<'de> serde::Deserialize<'de> for Module { Ok(GeneratedField::ModuleAccountPermissions) } "authority" => Ok(GeneratedField::Authority), + "enableUnorderedTransactions" | "enable_unordered_transactions" => { + Ok(GeneratedField::EnableUnorderedTransactions) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -103,6 +118,7 @@ impl<'de> serde::Deserialize<'de> for Module { let mut bech32_prefix__ = None; let mut module_account_permissions__ = None; let mut authority__ = None; + let mut enable_unordered_transactions__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Bech32Prefix => { @@ -125,12 +141,22 @@ impl<'de> serde::Deserialize<'de> for Module { } authority__ = Some(map_.next_value()?); } + GeneratedField::EnableUnorderedTransactions => { + if enable_unordered_transactions__.is_some() { + return Err(serde::de::Error::duplicate_field( + "enableUnorderedTransactions", + )); + } + enable_unordered_transactions__ = Some(map_.next_value()?); + } } } Ok(Module { bech32_prefix: bech32_prefix__.unwrap_or_default(), module_account_permissions: module_account_permissions__.unwrap_or_default(), authority: authority__.unwrap_or_default(), + enable_unordered_transactions: enable_unordered_transactions__ + .unwrap_or_default(), }) } } 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 ca727b05..52293953 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 @@ -40,8 +40,6 @@ impl ::prost::Name for ModuleAccount { } } /// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleCredential { @@ -101,8 +99,6 @@ impl ::prost::Name for GenesisState { } } /// QueryAccountsRequest is the request type for the Query/Accounts RPC method. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsRequest { @@ -118,8 +114,6 @@ impl ::prost::Name for QueryAccountsRequest { } } /// QueryAccountsResponse is the response type for the Query/Accounts RPC method. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountsResponse { @@ -194,8 +188,6 @@ impl ::prost::Name for QueryParamsResponse { } } /// QueryModuleAccountsRequest is the request type for the Query/ModuleAccounts RPC method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsRequest {} @@ -207,8 +199,6 @@ impl ::prost::Name for QueryModuleAccountsRequest { } } /// QueryModuleAccountsResponse is the response type for the Query/ModuleAccounts RPC method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleAccountsResponse { @@ -251,8 +241,6 @@ impl ::prost::Name for QueryModuleAccountByNameResponse { } } /// Bech32PrefixRequest is the request type for Bech32Prefix rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixRequest {} @@ -264,8 +252,6 @@ impl ::prost::Name for Bech32PrefixRequest { } } /// Bech32PrefixResponse is the response type for Bech32Prefix rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Bech32PrefixResponse { @@ -280,8 +266,6 @@ impl ::prost::Name for Bech32PrefixResponse { } } /// AddressBytesToStringRequest is the request type for AddressString rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringRequest { @@ -296,8 +280,6 @@ impl ::prost::Name for AddressBytesToStringRequest { } } /// AddressBytesToStringResponse is the response type for AddressString rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressBytesToStringResponse { @@ -312,8 +294,6 @@ impl ::prost::Name for AddressBytesToStringResponse { } } /// AddressStringToBytesRequest is the request type for AccountBytes rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesRequest { @@ -328,8 +308,6 @@ impl ::prost::Name for AddressStringToBytesRequest { } } /// AddressStringToBytesResponse is the response type for AddressBytes rpc method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AddressStringToBytesResponse { @@ -344,8 +322,6 @@ impl ::prost::Name for AddressStringToBytesResponse { } } /// QueryAccountAddressByIDRequest is the request type for AccountAddressByID rpc method -/// -/// Since: cosmos-sdk 0.46.2 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdRequest { @@ -358,8 +334,6 @@ pub struct QueryAccountAddressByIdRequest { #[prost(int64, tag = "1")] pub id: i64, /// account_id is the account number of the address to be queried. - /// - /// Since: cosmos-sdk 0.47 #[prost(uint64, tag = "2")] pub account_id: u64, } @@ -371,8 +345,6 @@ impl ::prost::Name for QueryAccountAddressByIdRequest { } } /// QueryAccountAddressByIDResponse is the response type for AccountAddressByID rpc method -/// -/// Since: cosmos-sdk 0.46.2 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountAddressByIdResponse { @@ -387,8 +359,6 @@ impl ::prost::Name for QueryAccountAddressByIdResponse { } } /// QueryAccountInfoRequest is the Query/AccountInfo request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoRequest { @@ -404,8 +374,6 @@ impl ::prost::Name for QueryAccountInfoRequest { } } /// QueryAccountInfoResponse is the Query/AccountInfo response type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAccountInfoResponse { @@ -421,8 +389,6 @@ impl ::prost::Name for QueryAccountInfoResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -444,8 +410,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} 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 2f134e3d..1c0ba419 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Accounts"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Account"); @@ -129,7 +129,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -148,7 +151,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.auth.v1beta1.Query/Params"); @@ -163,7 +169,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -183,7 +192,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -202,7 +214,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -218,7 +233,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -237,7 +255,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -256,7 +277,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -271,17 +295,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn accounts( &self, request: tonic::Request, @@ -330,18 +348,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -388,10 +408,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -401,6 +421,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.auth.v1beta1.Query/Accounts" => { #[allow(non_camel_case_types)] @@ -413,7 +434,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::accounts(&inner, request).await }; + let fut = async move { (*inner).accounts(request).await }; Box::pin(fut) } } @@ -423,6 +444,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -450,7 +472,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::account(&inner, request).await }; + let fut = async move { (*inner).account(request).await }; Box::pin(fut) } } @@ -460,6 +482,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -490,9 +513,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::account_address_by_id(&inner, request).await - }; + let fut = async move { (*inner).account_address_by_id(request).await }; Box::pin(fut) } } @@ -502,6 +523,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountAddressByIDSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -529,7 +551,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -539,6 +561,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -568,8 +591,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::module_accounts(&inner, request).await }; + let fut = async move { (*inner).module_accounts(request).await }; Box::pin(fut) } } @@ -579,6 +601,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ModuleAccountsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -609,9 +632,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::module_account_by_name(&inner, request).await - }; + let fut = async move { (*inner).module_account_by_name(request).await }; Box::pin(fut) } } @@ -621,6 +642,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ModuleAccountByNameSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -648,8 +670,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::bech32_prefix(&inner, request).await }; + let fut = async move { (*inner).bech32_prefix(request).await }; Box::pin(fut) } } @@ -659,6 +680,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = Bech32PrefixSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -688,9 +710,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::address_bytes_to_string(&inner, request).await - }; + let fut = + async move { (*inner).address_bytes_to_string(request).await }; Box::pin(fut) } } @@ -700,6 +721,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AddressBytesToStringSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -729,9 +751,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::address_string_to_bytes(&inner, request).await - }; + let fut = + async move { (*inner).address_string_to_bytes(request).await }; Box::pin(fut) } } @@ -741,6 +762,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AddressStringToBytesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -768,8 +790,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::account_info(&inner, request).await }; + let fut = async move { (*inner).account_info(request).await }; Box::pin(fut) } } @@ -779,6 +800,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -796,22 +818,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -823,22 +840,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.auth.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.auth.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -859,10 +878,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -877,13 +896,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -924,7 +943,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -939,35 +961,31 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn update_params( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1014,10 +1032,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1027,6 +1045,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.auth.v1beta1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] @@ -1039,8 +1058,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -1050,6 +1068,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1067,22 +1086,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1094,9 +1108,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.auth.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.auth.v1beta1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.tonic.rs index 4bd4701e..ab75f68b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.authz.v1beta1.Query/Grants"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -130,7 +130,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -147,17 +150,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn grants( &self, request: tonic::Request, @@ -172,18 +169,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -230,10 +229,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -243,6 +242,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.authz.v1beta1.Query/Grants" => { #[allow(non_camel_case_types)] @@ -255,7 +255,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::grants(&inner, request).await }; + let fut = async move { (*inner).grants(request).await }; Box::pin(fut) } } @@ -265,6 +265,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GrantsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -294,8 +295,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::granter_grants(&inner, request).await }; + let fut = async move { (*inner).granter_grants(request).await }; Box::pin(fut) } } @@ -305,6 +305,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GranterGrantsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -334,8 +335,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::grantee_grants(&inner, request).await }; + let fut = async move { (*inner).grantee_grants(request).await }; Box::pin(fut) } } @@ -345,6 +345,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GranteeGrantsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -362,22 +363,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -389,22 +385,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.authz.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.authz.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -425,10 +423,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -443,13 +441,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -489,7 +487,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.authz.v1beta1.Msg/Grant"); @@ -503,7 +504,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.authz.v1beta1.Msg/Exec"); @@ -518,7 +522,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.authz.v1beta1.Msg/Revoke"); @@ -532,17 +539,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn grant( &self, request: tonic::Request, @@ -557,18 +558,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -615,10 +618,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -628,6 +631,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.authz.v1beta1.Msg/Grant" => { #[allow(non_camel_case_types)] @@ -640,7 +644,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::grant(&inner, request).await }; + let fut = async move { (*inner).grant(request).await }; Box::pin(fut) } } @@ -650,6 +654,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GrantSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -677,7 +682,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::exec(&inner, request).await }; + let fut = async move { (*inner).exec(request).await }; Box::pin(fut) } } @@ -687,6 +692,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ExecSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -714,7 +720,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::revoke(&inner, request).await }; + let fut = async move { (*inner).revoke(request).await }; Box::pin(fut) } } @@ -724,6 +730,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = RevokeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -741,22 +748,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -768,9 +770,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.authz.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.authz.v1beta1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs index 75a1fa3b..920a0d4e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.rs @@ -37,6 +37,14 @@ pub struct ServiceCommandDescriptor { #[prost(map = "string, message", tag = "3")] pub sub_commands: ::std::collections::HashMap<::prost::alloc::string::String, ServiceCommandDescriptor>, + /// enhance_custom_commands specifies whether to skip the service when generating commands, if a custom command already + /// exists, or enhance the existing command. If set to true, the custom command will be enhanced with the services from + /// gRPC. otherwise when a custom command exists, no commands will be generated for the service. + #[prost(bool, tag = "4")] + pub enhance_custom_command: bool, + /// short is an optional parameter used to override the short description of the auto generated command. + #[prost(string, tag = "5")] + pub short: ::prost::alloc::string::String, } impl ::prost::Name for ServiceCommandDescriptor { const NAME: &'static str = "ServiceCommandDescriptor"; @@ -97,6 +105,12 @@ pub struct RpcCommandOptions { /// skip specifies whether to skip this rpc method when generating commands. #[prost(bool, tag = "12")] pub skip: bool, + /// gov_proposal specifies whether autocli should generate a gov proposal transaction for this rpc method. + /// Normally autocli generates a transaction containing the message and broadcast it. + /// However, when true, autocli generates a proposal transaction containing the message and broadcast it. + /// This option is ineffective for query commands. + #[prost(bool, tag = "13")] + pub gov_proposal: bool, } impl ::prost::Name for RpcCommandOptions { const NAME: &'static str = "RpcCommandOptions"; @@ -151,9 +165,13 @@ pub struct PositionalArgDescriptor { pub proto_field: ::prost::alloc::string::String, /// varargs makes a positional parameter a varargs parameter. This can only be /// applied to last positional parameter and the proto_field must a repeated - /// field. + /// field. Note: It is mutually exclusive with optional. #[prost(bool, tag = "2")] pub varargs: bool, + /// optional makes the last positional parameter optional. + /// Note: It is mutually exclusive with varargs. + #[prost(bool, tag = "3")] + pub optional: bool, } impl ::prost::Name for PositionalArgDescriptor { const NAME: &'static str = "PositionalArgDescriptor"; diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs index 93081b32..470fc66e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.serde.rs @@ -509,6 +509,9 @@ impl serde::Serialize for PositionalArgDescriptor { if self.varargs { len += 1; } + if self.optional { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.PositionalArgDescriptor", len)?; if !self.proto_field.is_empty() { @@ -517,6 +520,9 @@ impl serde::Serialize for PositionalArgDescriptor { if self.varargs { struct_ser.serialize_field("varargs", &self.varargs)?; } + if self.optional { + struct_ser.serialize_field("optional", &self.optional)?; + } struct_ser.end() } } @@ -527,12 +533,13 @@ impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["proto_field", "protoField", "varargs"]; + const FIELDS: &[&str] = &["proto_field", "protoField", "varargs", "optional"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { ProtoField, Varargs, + Optional, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -560,6 +567,7 @@ impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { match value { "protoField" | "proto_field" => Ok(GeneratedField::ProtoField), "varargs" => Ok(GeneratedField::Varargs), + "optional" => Ok(GeneratedField::Optional), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -584,6 +592,7 @@ impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { { let mut proto_field__ = None; let mut varargs__ = None; + let mut optional__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ProtoField => { @@ -598,11 +607,18 @@ impl<'de> serde::Deserialize<'de> for PositionalArgDescriptor { } varargs__ = Some(map_.next_value()?); } + GeneratedField::Optional => { + if optional__.is_some() { + return Err(serde::de::Error::duplicate_field("optional")); + } + optional__ = Some(map_.next_value()?); + } } } Ok(PositionalArgDescriptor { proto_field: proto_field__.unwrap_or_default(), varargs: varargs__.unwrap_or_default(), + optional: optional__.unwrap_or_default(), }) } } @@ -658,6 +674,9 @@ impl serde::Serialize for RpcCommandOptions { if self.skip { len += 1; } + if self.gov_proposal { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.RpcCommandOptions", len)?; if !self.rpc_method.is_empty() { @@ -696,6 +715,9 @@ impl serde::Serialize for RpcCommandOptions { if self.skip { struct_ser.serialize_field("skip", &self.skip)?; } + if self.gov_proposal { + struct_ser.serialize_field("govProposal", &self.gov_proposal)?; + } struct_ser.end() } } @@ -723,6 +745,8 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { "positional_args", "positionalArgs", "skip", + "gov_proposal", + "govProposal", ]; #[allow(clippy::enum_variant_names)] @@ -739,6 +763,7 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { FlagOptions, PositionalArgs, Skip, + GovProposal, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -778,6 +803,7 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { Ok(GeneratedField::PositionalArgs) } "skip" => Ok(GeneratedField::Skip), + "govProposal" | "gov_proposal" => Ok(GeneratedField::GovProposal), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -809,6 +835,7 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { let mut flag_options__ = None; let mut positional_args__ = None; let mut skip__ = None; + let mut gov_proposal__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::RpcMethod => { @@ -884,6 +911,12 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { } skip__ = Some(map_.next_value()?); } + GeneratedField::GovProposal => { + if gov_proposal__.is_some() { + return Err(serde::de::Error::duplicate_field("govProposal")); + } + gov_proposal__ = Some(map_.next_value()?); + } } } Ok(RpcCommandOptions { @@ -899,6 +932,7 @@ impl<'de> serde::Deserialize<'de> for RpcCommandOptions { flag_options: flag_options__.unwrap_or_default(), positional_args: positional_args__.unwrap_or_default(), skip: skip__.unwrap_or_default(), + gov_proposal: gov_proposal__.unwrap_or_default(), }) } } @@ -927,6 +961,12 @@ impl serde::Serialize for ServiceCommandDescriptor { if !self.sub_commands.is_empty() { len += 1; } + if self.enhance_custom_command { + len += 1; + } + if !self.short.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.autocli.v1.ServiceCommandDescriptor", len)?; if !self.service.is_empty() { @@ -938,6 +978,12 @@ impl serde::Serialize for ServiceCommandDescriptor { if !self.sub_commands.is_empty() { struct_ser.serialize_field("subCommands", &self.sub_commands)?; } + if self.enhance_custom_command { + struct_ser.serialize_field("enhanceCustomCommand", &self.enhance_custom_command)?; + } + if !self.short.is_empty() { + struct_ser.serialize_field("short", &self.short)?; + } struct_ser.end() } } @@ -954,6 +1000,9 @@ impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { "rpcCommandOptions", "sub_commands", "subCommands", + "enhance_custom_command", + "enhanceCustomCommand", + "short", ]; #[allow(clippy::enum_variant_names)] @@ -961,6 +1010,8 @@ impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { Service, RpcCommandOptions, SubCommands, + EnhanceCustomCommand, + Short, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -991,6 +1042,10 @@ impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { Ok(GeneratedField::RpcCommandOptions) } "subCommands" | "sub_commands" => Ok(GeneratedField::SubCommands), + "enhanceCustomCommand" | "enhance_custom_command" => { + Ok(GeneratedField::EnhanceCustomCommand) + } + "short" => Ok(GeneratedField::Short), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1016,6 +1071,8 @@ impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { let mut service__ = None; let mut rpc_command_options__ = None; let mut sub_commands__ = None; + let mut enhance_custom_command__ = None; + let mut short__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Service => { @@ -1037,12 +1094,28 @@ impl<'de> serde::Deserialize<'de> for ServiceCommandDescriptor { sub_commands__ = Some(map_.next_value::>()?); } + GeneratedField::EnhanceCustomCommand => { + if enhance_custom_command__.is_some() { + return Err(serde::de::Error::duplicate_field( + "enhanceCustomCommand", + )); + } + enhance_custom_command__ = Some(map_.next_value()?); + } + GeneratedField::Short => { + if short__.is_some() { + return Err(serde::de::Error::duplicate_field("short")); + } + short__ = Some(map_.next_value()?); + } } } Ok(ServiceCommandDescriptor { service: service__.unwrap_or_default(), rpc_command_options: rpc_command_options__.unwrap_or_default(), sub_commands: sub_commands__.unwrap_or_default(), + enhance_custom_command: enhance_custom_command__.unwrap_or_default(), + short: short__.unwrap_or_default(), }) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs index 89aac263..5038f502 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.autocli.v1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.autocli.v1.Query/AppOptions"); @@ -111,35 +108,31 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn app_options( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -186,10 +179,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -199,6 +192,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.autocli.v1.Query/AppOptions" => { #[allow(non_camel_case_types)] @@ -211,8 +205,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::app_options(&inner, request).await }; + let fut = async move { (*inner).app_options(request).await }; Box::pin(fut) } } @@ -222,6 +215,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AppOptionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -239,22 +233,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -266,9 +255,17 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.autocli.v1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.autocli.v1.Query"; } } 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 2ca1f4e1..c041783b 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 @@ -1,8 +1,6 @@ // @generated /// SendAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SendAuthorization { @@ -10,8 +8,6 @@ pub struct SendAuthorization { pub spend_limit: ::prost::alloc::vec::Vec, /// allow_list specifies an optional list of addresses to whom the grantee can send tokens on behalf of the /// granter. If omitted, any recipient is allowed. - /// - /// Since: cosmos-sdk 0.47 #[prost(string, repeated, tag = "2")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } @@ -153,25 +149,17 @@ pub struct Metadata { #[prost(string, tag = "4")] pub display: ::prost::alloc::string::String, /// name defines the name of the token (eg: Cosmos Atom) - /// - /// Since: cosmos-sdk 0.43 #[prost(string, tag = "5")] pub name: ::prost::alloc::string::String, /// symbol is the token symbol usually shown on exchanges (eg: ATOM). This can /// be the same as the display. - /// - /// 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, } @@ -200,8 +188,6 @@ pub struct GenesisState { #[prost(message, repeated, tag = "4")] pub denom_metadata: ::prost::alloc::vec::Vec, /// send_enabled defines the denoms where send is enabled or disabled. - /// - /// Since: cosmos-sdk 0.47 #[prost(message, repeated, tag = "5")] pub send_enabled: ::prost::alloc::vec::Vec, } @@ -275,8 +261,6 @@ pub struct QueryAllBalancesRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, /// resolve_denom is the flag to resolve the denom into a human-readable form from the metadata. - /// - /// Since: cosmos-sdk 0.50 #[prost(bool, tag = "3")] pub resolve_denom: bool, } @@ -308,8 +292,6 @@ impl ::prost::Name for QueryAllBalancesResponse { } /// QuerySpendableBalancesRequest defines the gRPC request structure for querying /// an account's spendable balances. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesRequest { @@ -329,8 +311,6 @@ impl ::prost::Name for QuerySpendableBalancesRequest { } /// QuerySpendableBalancesResponse defines the gRPC response structure for querying /// an account's spendable balances. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalancesResponse { @@ -350,8 +330,6 @@ impl ::prost::Name for QuerySpendableBalancesResponse { } /// QuerySpendableBalanceByDenomRequest defines the gRPC request structure for /// querying an account's spendable balance for a specific denom. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomRequest { @@ -371,8 +349,6 @@ impl ::prost::Name for QuerySpendableBalanceByDenomRequest { } /// QuerySpendableBalanceByDenomResponse defines the gRPC response structure for /// querying an account's spendable balance for a specific denom. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySpendableBalanceByDenomResponse { @@ -393,8 +369,6 @@ impl ::prost::Name for QuerySpendableBalanceByDenomResponse { #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryTotalSupplyRequest { /// pagination defines an optional pagination for the request. - /// - /// Since: cosmos-sdk 0.43 #[prost(message, optional, tag = "1")] pub pagination: ::core::option::Option, } @@ -414,8 +388,6 @@ pub struct QueryTotalSupplyResponse { #[prost(message, repeated, tag = "1")] pub supply: ::prost::alloc::vec::Vec, /// pagination defines the pagination in the response. - /// - /// Since: cosmos-sdk 0.43 #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } @@ -602,8 +574,6 @@ impl ::prost::Name for QueryDenomOwnersRequest { /// DenomOwner defines structure representing an account that owns or holds a /// particular denominated token. It contains the account address and account /// balance of the denominated token. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DenomOwner { @@ -622,8 +592,6 @@ impl ::prost::Name for DenomOwner { } } /// QueryDenomOwnersResponse defines the RPC response of a DenomOwners RPC query. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersResponse { @@ -643,8 +611,6 @@ impl ::prost::Name for QueryDenomOwnersResponse { /// QueryDenomOwnersByQueryRequest defines the request type for the DenomOwnersByQuery RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. -/// -/// Since: cosmos-sdk 0.50.3 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersByQueryRequest { @@ -663,8 +629,6 @@ impl ::prost::Name for QueryDenomOwnersByQueryRequest { } } /// QueryDenomOwnersByQueryResponse defines the RPC response of a DenomOwnersByQuery RPC query. -/// -/// Since: cosmos-sdk 0.50.3 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryDenomOwnersByQueryResponse { @@ -682,8 +646,6 @@ impl ::prost::Name for QueryDenomOwnersByQueryResponse { } } /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledRequest { @@ -703,8 +665,6 @@ impl ::prost::Name for QuerySendEnabledRequest { } } /// QuerySendEnabledResponse defines the RPC response of a SendEnable query. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySendEnabledResponse { @@ -781,8 +741,6 @@ impl ::prost::Name for MsgMultiSendResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -804,8 +762,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -821,8 +777,6 @@ impl ::prost::Name for MsgUpdateParamsResponse { /// Only entries to add/update/delete need to be included. /// Existing SendEnabled entries that are not included in this /// message are left unchanged. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabled { @@ -847,8 +801,6 @@ impl ::prost::Name for MsgSetSendEnabled { } } /// MsgSetSendEnabledResponse defines the Msg/SetSendEnabled response type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabledResponse {} 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 367e655f..8c095be6 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/Balance"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -130,7 +130,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -151,7 +154,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -170,7 +176,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -186,7 +195,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/SupplyOf"); @@ -201,7 +213,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/Params"); @@ -210,13 +225,37 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "Params")); self.inner.unary(req, path, codec).await } + pub async fn denoms_metadata( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomsMetadata"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.bank.v1beta1.Query", + "DenomsMetadata", + )); + self.inner.unary(req, path, codec).await + } pub async fn denom_metadata( &mut self, request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -236,7 +275,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -249,31 +291,16 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } - pub async fn denoms_metadata( - &mut self, - request: impl tonic::IntoRequest, - ) -> core::result::Result, tonic::Status> - { - self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) - })?; - let codec = tonic::codec::ProstCodec::default(); - let path = - http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Query/DenomsMetadata"); - let mut req = request.into_request(); - req.extensions_mut().insert(GrpcMethod::new( - "cosmos.bank.v1beta1.Query", - "DenomsMetadata", - )); - self.inner.unary(req, path, codec).await - } pub async fn denom_owners( &mut self, request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -291,7 +318,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -310,7 +340,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -325,17 +358,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn balance( &self, request: tonic::Request, @@ -370,6 +397,10 @@ pub mod query_server { &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; + async fn denoms_metadata( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; async fn denom_metadata( &self, request: tonic::Request, @@ -381,10 +412,6 @@ pub mod query_server { tonic::Response, tonic::Status, >; - async fn denoms_metadata( - &self, - request: tonic::Request, - ) -> core::result::Result, tonic::Status>; async fn denom_owners( &self, request: tonic::Request, @@ -402,18 +429,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -460,10 +489,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -473,6 +502,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.bank.v1beta1.Query/Balance" => { #[allow(non_camel_case_types)] @@ -485,7 +515,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::balance(&inner, request).await }; + let fut = async move { (*inner).balance(request).await }; Box::pin(fut) } } @@ -495,6 +525,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = BalanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -522,8 +553,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::all_balances(&inner, request).await }; + let fut = async move { (*inner).all_balances(request).await }; Box::pin(fut) } } @@ -533,6 +563,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AllBalancesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -562,9 +593,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::spendable_balances(&inner, request).await - }; + let fut = async move { (*inner).spendable_balances(request).await }; Box::pin(fut) } } @@ -574,6 +603,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SpendableBalancesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -604,9 +634,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::spendable_balance_by_denom(&inner, request).await - }; + let fut = + async move { (*inner).spendable_balance_by_denom(request).await }; Box::pin(fut) } } @@ -616,6 +645,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SpendableBalanceByDenomSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -643,8 +673,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::total_supply(&inner, request).await }; + let fut = async move { (*inner).total_supply(request).await }; Box::pin(fut) } } @@ -654,6 +683,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TotalSupplySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -681,7 +711,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::supply_of(&inner, request).await }; + let fut = async move { (*inner).supply_of(request).await }; Box::pin(fut) } } @@ -691,6 +721,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SupplyOfSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -718,7 +749,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -728,6 +759,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -744,21 +776,20 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/DenomMetadata" => { + "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { #[allow(non_camel_case_types)] - struct DenomMetadataSvc(pub Arc); - impl tonic::server::UnaryService - for DenomMetadataSvc + struct DenomsMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for DenomsMetadataSvc { - type Response = super::QueryDenomMetadataResponse; + type Response = super::QueryDenomsMetadataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::denom_metadata(&inner, request).await }; + let fut = async move { (*inner).denoms_metadata(request).await }; Box::pin(fut) } } @@ -768,7 +799,8 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = DenomMetadataSvc(inner); + let inner = inner.0; + let method = DenomsMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -784,23 +816,20 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString" => { + "/cosmos.bank.v1beta1.Query/DenomMetadata" => { #[allow(non_camel_case_types)] - struct DenomMetadataByQueryStringSvc(pub Arc); - impl - tonic::server::UnaryService - for DenomMetadataByQueryStringSvc + struct DenomMetadataSvc(pub Arc); + impl tonic::server::UnaryService + for DenomMetadataSvc { - type Response = super::QueryDenomMetadataByQueryStringResponse; + type Response = super::QueryDenomMetadataResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::denom_metadata_by_query_string(&inner, request).await - }; + let fut = async move { (*inner).denom_metadata(request).await }; Box::pin(fut) } } @@ -810,7 +839,8 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = DenomMetadataByQueryStringSvc(inner); + let inner = inner.0; + let method = DenomMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -826,21 +856,23 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString" => { #[allow(non_camel_case_types)] - struct DenomsMetadataSvc(pub Arc); - impl tonic::server::UnaryService - for DenomsMetadataSvc + struct DenomMetadataByQueryStringSvc(pub Arc); + impl + tonic::server::UnaryService + for DenomMetadataByQueryStringSvc { - type Response = super::QueryDenomsMetadataResponse; + type Response = super::QueryDenomMetadataByQueryStringResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::denoms_metadata(&inner, request).await }; + let fut = async move { + (*inner).denom_metadata_by_query_string(request).await + }; Box::pin(fut) } } @@ -850,7 +882,8 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = DenomsMetadataSvc(inner); + let inner = inner.0; + let method = DenomMetadataByQueryStringSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -877,8 +910,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::denom_owners(&inner, request).await }; + let fut = async move { (*inner).denom_owners(request).await }; Box::pin(fut) } } @@ -888,6 +920,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DenomOwnersSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -918,9 +951,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::denom_owners_by_query(&inner, request).await - }; + let fut = async move { (*inner).denom_owners_by_query(request).await }; Box::pin(fut) } } @@ -930,6 +961,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DenomOwnersByQuerySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -957,8 +989,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::send_enabled(&inner, request).await }; + let fut = async move { (*inner).send_enabled(request).await }; Box::pin(fut) } } @@ -968,6 +999,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SendEnabledSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -985,22 +1017,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1012,22 +1039,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.bank.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.bank.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -1048,10 +1077,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1066,13 +1095,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -1112,7 +1141,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/Send"); @@ -1127,7 +1159,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.bank.v1beta1.Msg/MultiSend"); @@ -1142,7 +1177,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1158,7 +1196,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1173,17 +1214,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn send( &self, request: tonic::Request, @@ -1202,18 +1237,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1260,10 +1297,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1273,6 +1310,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.bank.v1beta1.Msg/Send" => { #[allow(non_camel_case_types)] @@ -1285,7 +1323,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::send(&inner, request).await }; + let fut = async move { (*inner).send(request).await }; Box::pin(fut) } } @@ -1295,6 +1333,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1322,7 +1361,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::multi_send(&inner, request).await }; + let fut = async move { (*inner).multi_send(request).await }; Box::pin(fut) } } @@ -1332,6 +1371,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = MultiSendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1359,8 +1399,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -1370,6 +1409,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1397,8 +1437,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::set_send_enabled(&inner, request).await }; + let fut = async move { (*inner).set_send_enabled(request).await }; Box::pin(fut) } } @@ -1408,6 +1447,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SetSendEnabledSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1425,22 +1465,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1452,9 +1487,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.bank.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.bank.v1beta1.Msg"; } } 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 a88950e2..3dabd47b 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 @@ -47,8 +47,6 @@ pub struct TxResponse { /// these events include those emitted by processing all the messages and those /// 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 #[prost(message, repeated, tag = "13")] pub events: ::prost::alloc::vec::Vec<::tendermint_proto::abci::Event>, } @@ -150,8 +148,6 @@ pub struct Result { #[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<::tendermint_proto::google::protobuf::Any>, } @@ -206,8 +202,6 @@ pub struct TxMsgData { #[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<::tendermint_proto::google::protobuf::Any>, } 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 index 033ea743..d28c3880 100644 --- 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod service_client { } impl ServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -96,7 +90,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -113,7 +110,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -130,17 +130,11 @@ pub mod service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Service: Send + Sync + 'static { async fn config( &self, request: tonic::Request, @@ -151,18 +145,20 @@ pub mod service_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, + pub struct ServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ServiceServer { + 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(), @@ -209,10 +205,10 @@ pub mod service_server { impl tonic::codegen::Service> for ServiceServer where T: Service, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -222,6 +218,7 @@ pub mod service_server { 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)] @@ -234,7 +231,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::config(&inner, request).await }; + let fut = async move { (*inner).config(request).await }; Box::pin(fut) } } @@ -244,6 +241,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ConfigSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -271,7 +269,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::status(&inner, request).await }; + let fut = async move { (*inner).status(request).await }; Box::pin(fut) } } @@ -281,6 +279,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = StatusSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -298,22 +297,17 @@ pub mod service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ServiceServer { + impl Clone for ServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -325,9 +319,17 @@ pub mod service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.base.node.v1beta1.Service"; - impl tonic::server::NamedService for ServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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 004e7218..d3c6922a 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 @@ -30,8 +30,6 @@ pub struct PageRequest { #[prost(bool, tag = "4")] pub count_total: bool, /// reverse is set to true if results are to be returned in the descending order. - /// - /// Since: cosmos-sdk 0.43 #[prost(bool, tag = "5")] pub reverse: bool, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.tonic.rs index ef42cde7..cc80ad7d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod reflection_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod reflection_service_client { } impl ReflectionServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod reflection_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ReflectionServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -116,7 +113,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -134,17 +134,11 @@ pub mod reflection_service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod reflection_service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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 ReflectionServiceServer. #[async_trait] - pub trait ReflectionService: std::marker::Send + std::marker::Sync + 'static { + pub trait ReflectionService: Send + Sync + 'static { async fn list_all_interfaces( &self, request: tonic::Request, @@ -155,18 +149,20 @@ pub mod reflection_service_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct ReflectionServiceServer { - inner: Arc, + pub struct ReflectionServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ReflectionServiceServer { + struct _Inner(Arc); + impl ReflectionServiceServer { 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(), @@ -213,10 +209,10 @@ pub mod reflection_service_server { impl tonic::codegen::Service> for ReflectionServiceServer where T: ReflectionService, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -226,6 +222,7 @@ pub mod reflection_service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.base.reflection.v1beta1.ReflectionService/ListAllInterfaces" => { #[allow(non_camel_case_types)] @@ -241,9 +238,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::list_all_interfaces(&inner, request).await - }; + let fut = async move { (*inner).list_all_interfaces(request).await }; Box::pin(fut) } } @@ -253,6 +248,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ListAllInterfacesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -283,10 +279,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::list_implementations(&inner, request) - .await - }; + let fut = async move { (*inner).list_implementations(request).await }; Box::pin(fut) } } @@ -296,6 +289,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ListImplementationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -313,22 +307,17 @@ pub mod reflection_service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ReflectionServiceServer { + impl Clone for ReflectionServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -340,9 +329,17 @@ pub mod reflection_service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.base.reflection.v1beta1.ReflectionService"; - impl tonic::server::NamedService for ReflectionServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ReflectionServiceServer { + const NAME: &'static str = "cosmos.base.reflection.v1beta1.ReflectionService"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.tonic.rs index 3b961ef4..b149cc0b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.reflection.v2alpha1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod reflection_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod reflection_service_client { } impl ReflectionServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod reflection_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ReflectionServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -116,7 +113,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -135,7 +135,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -156,7 +159,10 @@ pub mod reflection_service_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -177,7 +183,10 @@ pub mod reflection_service_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -196,7 +205,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -214,17 +226,11 @@ pub mod reflection_service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod reflection_service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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 ReflectionServiceServer. #[async_trait] - pub trait ReflectionService: std::marker::Send + std::marker::Sync + 'static { + pub trait ReflectionService: Send + Sync + 'static { async fn get_authn_descriptor( &self, request: tonic::Request, @@ -257,18 +263,20 @@ pub mod reflection_service_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct ReflectionServiceServer { - inner: Arc, + pub struct ReflectionServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ReflectionServiceServer { + struct _Inner(Arc); + impl ReflectionServiceServer { 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(), @@ -315,10 +323,10 @@ pub mod reflection_service_server { impl tonic::codegen::Service> for ReflectionServiceServer where T: ReflectionService, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -328,6 +336,7 @@ pub mod reflection_service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.base.reflection.v2alpha1.ReflectionService/GetAuthnDescriptor" => { #[allow(non_camel_case_types)] @@ -343,10 +352,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_authn_descriptor(&inner, request) - .await - }; + let fut = async move { (*inner).get_authn_descriptor(request).await }; Box::pin(fut) } } @@ -356,6 +362,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetAuthnDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -386,10 +393,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_chain_descriptor(&inner, request) - .await - }; + let fut = async move { (*inner).get_chain_descriptor(request).await }; Box::pin(fut) } } @@ -399,6 +403,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetChainDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -429,10 +434,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_codec_descriptor(&inner, request) - .await - }; + let fut = async move { (*inner).get_codec_descriptor(request).await }; Box::pin(fut) } } @@ -442,6 +444,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetCodecDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -472,12 +475,8 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_configuration_descriptor( - &inner, request, - ) - .await - }; + let fut = + async move { (*inner).get_configuration_descriptor(request).await }; Box::pin(fut) } } @@ -487,6 +486,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetConfigurationDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -518,10 +518,7 @@ pub mod reflection_service_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::get_query_services_descriptor( - &inner, request, - ) - .await + (*inner).get_query_services_descriptor(request).await }; Box::pin(fut) } @@ -532,6 +529,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetQueryServicesDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -562,9 +560,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_tx_descriptor(&inner, request).await - }; + let fut = async move { (*inner).get_tx_descriptor(request).await }; Box::pin(fut) } } @@ -574,6 +570,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetTxDescriptorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -591,22 +588,17 @@ pub mod reflection_service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ReflectionServiceServer { + impl Clone for ReflectionServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -618,9 +610,17 @@ pub mod reflection_service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.base.reflection.v2alpha1.ReflectionService"; - impl tonic::server::NamedService for ReflectionServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ReflectionServiceServer { + const NAME: &'static str = "cosmos.base.reflection.v2alpha1.ReflectionService"; } } 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 0a0e046d..edd16f0f 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 @@ -194,7 +194,6 @@ pub struct GetBlockByHeightResponse { /// 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, } @@ -225,7 +224,6 @@ pub struct GetLatestBlockResponse { /// 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, } @@ -306,7 +304,6 @@ pub struct VersionInfo { pub go_version: ::prost::alloc::string::String, #[prost(message, repeated, tag = "7")] pub build_deps: ::prost::alloc::vec::Vec, - /// Since: cosmos-sdk 0.43 #[prost(string, tag = "8")] pub cosmos_sdk_version: ::prost::alloc::string::String, } 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 e28bba5e..34cd0d6c 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod service_client { } impl ServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -116,7 +113,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -135,7 +135,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -154,7 +157,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -175,7 +181,10 @@ pub mod service_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -196,7 +205,10 @@ pub mod service_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -215,7 +227,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -233,17 +248,11 @@ pub mod service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Service: Send + Sync + 'static { async fn get_node_info( &self, request: tonic::Request, @@ -280,18 +289,20 @@ pub mod service_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, + pub struct ServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ServiceServer { + 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(), @@ -338,10 +349,10 @@ pub mod service_server { impl tonic::codegen::Service> for ServiceServer where T: Service, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -351,6 +362,7 @@ pub mod service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.base.tendermint.v1beta1.Service/GetNodeInfo" => { #[allow(non_camel_case_types)] @@ -363,8 +375,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_node_info(&inner, request).await }; + let fut = async move { (*inner).get_node_info(request).await }; Box::pin(fut) } } @@ -374,6 +385,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetNodeInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -401,8 +413,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_syncing(&inner, request).await }; + let fut = async move { (*inner).get_syncing(request).await }; Box::pin(fut) } } @@ -412,6 +423,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetSyncingSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -441,9 +453,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_latest_block(&inner, request).await - }; + let fut = async move { (*inner).get_latest_block(request).await }; Box::pin(fut) } } @@ -453,6 +463,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetLatestBlockSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -482,9 +493,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_block_by_height(&inner, request).await - }; + let fut = async move { (*inner).get_block_by_height(request).await }; Box::pin(fut) } } @@ -494,6 +503,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetBlockByHeightSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -524,9 +534,8 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_latest_validator_set(&inner, request).await - }; + let fut = + async move { (*inner).get_latest_validator_set(request).await }; Box::pin(fut) } } @@ -536,6 +545,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetLatestValidatorSetSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -566,9 +576,8 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_validator_set_by_height(&inner, request).await - }; + let fut = + async move { (*inner).get_validator_set_by_height(request).await }; Box::pin(fut) } } @@ -578,6 +587,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetValidatorSetByHeightSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -605,8 +615,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::abci_query(&inner, request).await }; + let fut = async move { (*inner).abci_query(request).await }; Box::pin(fut) } } @@ -616,6 +625,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ABCIQuerySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -633,22 +643,17 @@ pub mod service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ServiceServer { + impl Clone for ServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -660,9 +665,17 @@ pub mod service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.base.tendermint.v1beta1.Service"; - impl tonic::server::NamedService for ServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ServiceServer { + const NAME: &'static str = "cosmos.base.tendermint.v1beta1.Service"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.rs new file mode 100644 index 00000000..0b18c6c8 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.rs @@ -0,0 +1,62 @@ +// @generated +/// Module is the config object of the benchmark module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + #[prost(message, optional, tag = "1")] + pub genesis_params: ::core::option::Option, +} +impl ::prost::Name for Module { + const NAME: &'static str = "Module"; + const PACKAGE: &'static str = "cosmos.benchmark.module.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.benchmark.module.v1.{}", Self::NAME) + } +} +/// GenesisParams defines the genesis parameters for the benchmark module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GeneratorParams { + /// seed is the seed for the random number generator. + #[prost(uint64, tag = "1")] + pub seed: u64, + /// bucket_count is the number of store keys to uniformly distribute genesis_count keys across. + #[prost(uint64, tag = "2")] + pub bucket_count: u64, + /// key_mean is the mean size (in normal distribution) of keys in each bucket. + #[prost(uint64, tag = "3")] + pub key_mean: u64, + /// key_std_dev is the standard deviation of key sizes in each bucket. + #[prost(uint64, tag = "4")] + pub key_std_dev: u64, + /// value_mean is the mean size (in normal distribution) of values in each bucket. + #[prost(uint64, tag = "6")] + pub value_mean: u64, + /// value_std_dev is the standard deviation of value sizes in each bucket. + #[prost(uint64, tag = "7")] + pub value_std_dev: u64, + /// genesis_count is the number of keys to insert in the store, distributed across all buckets. + #[prost(uint64, tag = "8")] + pub genesis_count: u64, + /// insert_weight is the weight of insert operations. + #[prost(float, tag = "9")] + pub insert_weight: f32, + /// update_weight is the weight of update operations. + #[prost(float, tag = "10")] + pub update_weight: f32, + /// get_weight is the weight of get operations. + #[prost(float, tag = "12")] + pub get_weight: f32, + /// delete_weight is the weight of delete operations. + #[prost(float, tag = "11")] + pub delete_weight: f32, +} +impl ::prost::Name for GeneratorParams { + const NAME: &'static str = "GeneratorParams"; + const PACKAGE: &'static str = "cosmos.benchmark.module.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.benchmark.module.v1.{}", Self::NAME) + } +} +include!("cosmos.benchmark.module.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.serde.rs new file mode 100644 index 00000000..3ee59b2a --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.module.v1.serde.rs @@ -0,0 +1,444 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for GeneratorParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.seed != 0 { + len += 1; + } + if self.bucket_count != 0 { + len += 1; + } + if self.key_mean != 0 { + len += 1; + } + if self.key_std_dev != 0 { + len += 1; + } + if self.value_mean != 0 { + len += 1; + } + if self.value_std_dev != 0 { + len += 1; + } + if self.genesis_count != 0 { + len += 1; + } + if self.insert_weight != 0. { + len += 1; + } + if self.update_weight != 0. { + len += 1; + } + if self.get_weight != 0. { + len += 1; + } + if self.delete_weight != 0. { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.benchmark.module.v1.GeneratorParams", len)?; + if self.seed != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "seed", + alloc::string::ToString::to_string(&self.seed).as_str(), + )?; + } + if self.bucket_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "bucketCount", + alloc::string::ToString::to_string(&self.bucket_count).as_str(), + )?; + } + if self.key_mean != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "keyMean", + alloc::string::ToString::to_string(&self.key_mean).as_str(), + )?; + } + if self.key_std_dev != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "keyStdDev", + alloc::string::ToString::to_string(&self.key_std_dev).as_str(), + )?; + } + if self.value_mean != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "valueMean", + alloc::string::ToString::to_string(&self.value_mean).as_str(), + )?; + } + if self.value_std_dev != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "valueStdDev", + alloc::string::ToString::to_string(&self.value_std_dev).as_str(), + )?; + } + if self.genesis_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "genesisCount", + alloc::string::ToString::to_string(&self.genesis_count).as_str(), + )?; + } + if self.insert_weight != 0. { + struct_ser.serialize_field("insertWeight", &self.insert_weight)?; + } + if self.update_weight != 0. { + struct_ser.serialize_field("updateWeight", &self.update_weight)?; + } + if self.get_weight != 0. { + struct_ser.serialize_field("getWeight", &self.get_weight)?; + } + if self.delete_weight != 0. { + struct_ser.serialize_field("deleteWeight", &self.delete_weight)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GeneratorParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "seed", + "bucket_count", + "bucketCount", + "key_mean", + "keyMean", + "key_std_dev", + "keyStdDev", + "value_mean", + "valueMean", + "value_std_dev", + "valueStdDev", + "genesis_count", + "genesisCount", + "insert_weight", + "insertWeight", + "update_weight", + "updateWeight", + "get_weight", + "getWeight", + "delete_weight", + "deleteWeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Seed, + BucketCount, + KeyMean, + KeyStdDev, + ValueMean, + ValueStdDev, + GenesisCount, + InsertWeight, + UpdateWeight, + GetWeight, + DeleteWeight, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "seed" => Ok(GeneratedField::Seed), + "bucketCount" | "bucket_count" => Ok(GeneratedField::BucketCount), + "keyMean" | "key_mean" => Ok(GeneratedField::KeyMean), + "keyStdDev" | "key_std_dev" => Ok(GeneratedField::KeyStdDev), + "valueMean" | "value_mean" => Ok(GeneratedField::ValueMean), + "valueStdDev" | "value_std_dev" => Ok(GeneratedField::ValueStdDev), + "genesisCount" | "genesis_count" => Ok(GeneratedField::GenesisCount), + "insertWeight" | "insert_weight" => Ok(GeneratedField::InsertWeight), + "updateWeight" | "update_weight" => Ok(GeneratedField::UpdateWeight), + "getWeight" | "get_weight" => Ok(GeneratedField::GetWeight), + "deleteWeight" | "delete_weight" => Ok(GeneratedField::DeleteWeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratorParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.benchmark.module.v1.GeneratorParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut seed__ = None; + let mut bucket_count__ = None; + let mut key_mean__ = None; + let mut key_std_dev__ = None; + let mut value_mean__ = None; + let mut value_std_dev__ = None; + let mut genesis_count__ = None; + let mut insert_weight__ = None; + let mut update_weight__ = None; + let mut get_weight__ = None; + let mut delete_weight__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Seed => { + if seed__.is_some() { + return Err(serde::de::Error::duplicate_field("seed")); + } + seed__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::BucketCount => { + if bucket_count__.is_some() { + return Err(serde::de::Error::duplicate_field("bucketCount")); + } + bucket_count__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::KeyMean => { + if key_mean__.is_some() { + return Err(serde::de::Error::duplicate_field("keyMean")); + } + key_mean__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::KeyStdDev => { + if key_std_dev__.is_some() { + return Err(serde::de::Error::duplicate_field("keyStdDev")); + } + key_std_dev__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::ValueMean => { + if value_mean__.is_some() { + return Err(serde::de::Error::duplicate_field("valueMean")); + } + value_mean__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::ValueStdDev => { + if value_std_dev__.is_some() { + return Err(serde::de::Error::duplicate_field("valueStdDev")); + } + value_std_dev__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::GenesisCount => { + if genesis_count__.is_some() { + return Err(serde::de::Error::duplicate_field("genesisCount")); + } + genesis_count__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::InsertWeight => { + if insert_weight__.is_some() { + return Err(serde::de::Error::duplicate_field("insertWeight")); + } + insert_weight__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::UpdateWeight => { + if update_weight__.is_some() { + return Err(serde::de::Error::duplicate_field("updateWeight")); + } + update_weight__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::GetWeight => { + if get_weight__.is_some() { + return Err(serde::de::Error::duplicate_field("getWeight")); + } + get_weight__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::DeleteWeight => { + if delete_weight__.is_some() { + return Err(serde::de::Error::duplicate_field("deleteWeight")); + } + delete_weight__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(GeneratorParams { + seed: seed__.unwrap_or_default(), + bucket_count: bucket_count__.unwrap_or_default(), + key_mean: key_mean__.unwrap_or_default(), + key_std_dev: key_std_dev__.unwrap_or_default(), + value_mean: value_mean__.unwrap_or_default(), + value_std_dev: value_std_dev__.unwrap_or_default(), + genesis_count: genesis_count__.unwrap_or_default(), + insert_weight: insert_weight__.unwrap_or_default(), + update_weight: update_weight__.unwrap_or_default(), + get_weight: get_weight__.unwrap_or_default(), + delete_weight: delete_weight__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.benchmark.module.v1.GeneratorParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.genesis_params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.benchmark.module.v1.Module", len)?; + if let Some(v) = self.genesis_params.as_ref() { + struct_ser.serialize_field("genesisParams", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["genesis_params", "genesisParams"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + GenesisParams, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "genesisParams" | "genesis_params" => Ok(GeneratedField::GenesisParams), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.benchmark.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut genesis_params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::GenesisParams => { + if genesis_params__.is_some() { + return Err(serde::de::Error::duplicate_field("genesisParams")); + } + genesis_params__ = map_.next_value()?; + } + } + } + Ok(Module { + genesis_params: genesis_params__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.benchmark.module.v1.Module", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.rs new file mode 100644 index 00000000..b73419dc --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.rs @@ -0,0 +1,62 @@ +// @generated +/// Op is a message describing a benchmark operation. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Op { + #[prost(uint64, tag = "1")] + pub seed: u64, + #[prost(string, tag = "2")] + pub actor: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub key_length: u64, + #[prost(uint64, tag = "4")] + pub value_length: u64, + #[prost(uint32, tag = "5")] + pub iterations: u32, + #[prost(bool, tag = "6")] + pub delete: bool, + #[prost(bool, tag = "7")] + pub exists: bool, +} +impl ::prost::Name for Op { + const NAME: &'static str = "Op"; + const PACKAGE: &'static str = "cosmos.benchmark.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.benchmark.v1.{}", Self::NAME) + } +} +/// MsgLoadTestOps defines a message containing a sequence of load test operations. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgLoadTest { + #[prost(bytes = "vec", tag = "1")] + pub caller: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "2")] + pub ops: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgLoadTest { + const NAME: &'static str = "MsgLoadTest"; + const PACKAGE: &'static str = "cosmos.benchmark.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.benchmark.v1.{}", Self::NAME) + } +} +/// MsgLoadTestResponse defines a message containing the results of a load test operation. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgLoadTestResponse { + #[prost(uint64, tag = "1")] + pub total_time: u64, + #[prost(uint64, tag = "2")] + pub total_errors: u64, +} +impl ::prost::Name for MsgLoadTestResponse { + const NAME: &'static str = "MsgLoadTestResponse"; + const PACKAGE: &'static str = "cosmos.benchmark.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.benchmark.v1.{}", Self::NAME) + } +} +include!("cosmos.benchmark.v1.serde.rs"); +include!("cosmos.benchmark.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.serde.rs new file mode 100644 index 00000000..a71471d2 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.serde.rs @@ -0,0 +1,477 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for MsgLoadTest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.caller.is_empty() { + len += 1; + } + if !self.ops.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.benchmark.v1.MsgLoadTest", len)?; + if !self.caller.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "caller", + pbjson::private::base64::encode(&self.caller).as_str(), + )?; + } + if !self.ops.is_empty() { + struct_ser.serialize_field("ops", &self.ops)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgLoadTest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["caller", "ops"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Caller, + Ops, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "caller" => Ok(GeneratedField::Caller), + "ops" => Ok(GeneratedField::Ops), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgLoadTest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.benchmark.v1.MsgLoadTest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut caller__ = None; + let mut ops__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Caller => { + if caller__.is_some() { + return Err(serde::de::Error::duplicate_field("caller")); + } + caller__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Ops => { + if ops__.is_some() { + return Err(serde::de::Error::duplicate_field("ops")); + } + ops__ = Some(map_.next_value()?); + } + } + } + Ok(MsgLoadTest { + caller: caller__.unwrap_or_default(), + ops: ops__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.benchmark.v1.MsgLoadTest", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgLoadTestResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.total_time != 0 { + len += 1; + } + if self.total_errors != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.benchmark.v1.MsgLoadTestResponse", len)?; + if self.total_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "totalTime", + alloc::string::ToString::to_string(&self.total_time).as_str(), + )?; + } + if self.total_errors != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "totalErrors", + alloc::string::ToString::to_string(&self.total_errors).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgLoadTestResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["total_time", "totalTime", "total_errors", "totalErrors"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TotalTime, + TotalErrors, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "totalTime" | "total_time" => Ok(GeneratedField::TotalTime), + "totalErrors" | "total_errors" => Ok(GeneratedField::TotalErrors), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgLoadTestResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.benchmark.v1.MsgLoadTestResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut total_time__ = None; + let mut total_errors__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TotalTime => { + if total_time__.is_some() { + return Err(serde::de::Error::duplicate_field("totalTime")); + } + total_time__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::TotalErrors => { + if total_errors__.is_some() { + return Err(serde::de::Error::duplicate_field("totalErrors")); + } + total_errors__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MsgLoadTestResponse { + total_time: total_time__.unwrap_or_default(), + total_errors: total_errors__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.benchmark.v1.MsgLoadTestResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Op { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.seed != 0 { + len += 1; + } + if !self.actor.is_empty() { + len += 1; + } + if self.key_length != 0 { + len += 1; + } + if self.value_length != 0 { + len += 1; + } + if self.iterations != 0 { + len += 1; + } + if self.delete { + len += 1; + } + if self.exists { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.benchmark.v1.Op", len)?; + if self.seed != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "seed", + alloc::string::ToString::to_string(&self.seed).as_str(), + )?; + } + if !self.actor.is_empty() { + struct_ser.serialize_field("actor", &self.actor)?; + } + if self.key_length != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "keyLength", + alloc::string::ToString::to_string(&self.key_length).as_str(), + )?; + } + if self.value_length != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "valueLength", + alloc::string::ToString::to_string(&self.value_length).as_str(), + )?; + } + if self.iterations != 0 { + struct_ser.serialize_field("iterations", &self.iterations)?; + } + if self.delete { + struct_ser.serialize_field("delete", &self.delete)?; + } + if self.exists { + struct_ser.serialize_field("exists", &self.exists)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Op { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "seed", + "actor", + "key_length", + "keyLength", + "value_length", + "valueLength", + "iterations", + "delete", + "exists", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Seed, + Actor, + KeyLength, + ValueLength, + Iterations, + Delete, + Exists, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "seed" => Ok(GeneratedField::Seed), + "actor" => Ok(GeneratedField::Actor), + "keyLength" | "key_length" => Ok(GeneratedField::KeyLength), + "valueLength" | "value_length" => Ok(GeneratedField::ValueLength), + "iterations" => Ok(GeneratedField::Iterations), + "delete" => Ok(GeneratedField::Delete), + "exists" => Ok(GeneratedField::Exists), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Op; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.benchmark.v1.Op") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut seed__ = None; + let mut actor__ = None; + let mut key_length__ = None; + let mut value_length__ = None; + let mut iterations__ = None; + let mut delete__ = None; + let mut exists__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Seed => { + if seed__.is_some() { + return Err(serde::de::Error::duplicate_field("seed")); + } + seed__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Actor => { + if actor__.is_some() { + return Err(serde::de::Error::duplicate_field("actor")); + } + actor__ = Some(map_.next_value()?); + } + GeneratedField::KeyLength => { + if key_length__.is_some() { + return Err(serde::de::Error::duplicate_field("keyLength")); + } + key_length__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::ValueLength => { + if value_length__.is_some() { + return Err(serde::de::Error::duplicate_field("valueLength")); + } + value_length__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Iterations => { + if iterations__.is_some() { + return Err(serde::de::Error::duplicate_field("iterations")); + } + iterations__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Delete => { + if delete__.is_some() { + return Err(serde::de::Error::duplicate_field("delete")); + } + delete__ = Some(map_.next_value()?); + } + GeneratedField::Exists => { + if exists__.is_some() { + return Err(serde::de::Error::duplicate_field("exists")); + } + exists__ = Some(map_.next_value()?); + } + } + } + Ok(Op { + seed: seed__.unwrap_or_default(), + actor: actor__.unwrap_or_default(), + key_length: key_length__.unwrap_or_default(), + value_length: value_length__.unwrap_or_default(), + iterations: iterations__.unwrap_or_default(), + delete: delete__.unwrap_or_default(), + exists: exists__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.benchmark.v1.Op", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.tonic.rs new file mode 100644 index 00000000..654e604e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.benchmark.v1.tonic.rs @@ -0,0 +1,272 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod msg_client { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::http::Uri; + use tonic::codegen::*; + /** Msg defines the benchmark Msg service. + */ + #[derive(Debug, Clone)] + pub struct MsgClient { + inner: tonic::client::Grpc, + } + #[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: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn load_test( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.benchmark.v1.Msg/LoadTest"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.benchmark.v1.Msg", "LoadTest")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[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 load_test( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + } + /** Msg defines the benchmark Msg service. + */ + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.benchmark.v1.Msg/LoadTest" => { + #[allow(non_camel_case_types)] + struct LoadTestSvc(pub Arc); + impl tonic::server::UnaryService for LoadTestSvc { + type Response = super::MsgLoadTestResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).load_test(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = LoadTestSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.benchmark.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.tonic.rs index 062fca9f..8dc15581 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -96,7 +90,10 @@ pub mod query_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Query/Account"); @@ -110,7 +107,10 @@ pub mod query_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Query/Accounts"); @@ -125,7 +125,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -140,17 +143,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn account( &self, request: tonic::Request, @@ -165,18 +162,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -223,10 +222,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -236,6 +235,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.circuit.v1.Query/Account" => { #[allow(non_camel_case_types)] @@ -248,7 +248,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::account(&inner, request).await }; + let fut = async move { (*inner).account(request).await }; Box::pin(fut) } } @@ -258,6 +258,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -285,7 +286,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::accounts(&inner, request).await }; + let fut = async move { (*inner).accounts(request).await }; Box::pin(fut) } } @@ -295,6 +296,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AccountsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -322,8 +324,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::disabled_list(&inner, request).await }; + let fut = async move { (*inner).disabled_list(request).await }; Box::pin(fut) } } @@ -333,6 +334,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DisabledListSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -350,22 +352,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -377,22 +374,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.circuit.v1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.circuit.v1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -413,10 +412,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -431,13 +430,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -480,7 +479,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -501,7 +503,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -521,7 +526,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -538,17 +546,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn authorize_circuit_breaker( &self, request: tonic::Request, @@ -572,18 +574,20 @@ pub mod msg_server { >; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -630,10 +634,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -643,6 +647,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.circuit.v1.Msg/AuthorizeCircuitBreaker" => { #[allow(non_camel_case_types)] @@ -657,9 +662,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::authorize_circuit_breaker(&inner, request).await - }; + let fut = + async move { (*inner).authorize_circuit_breaker(request).await }; Box::pin(fut) } } @@ -669,6 +673,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AuthorizeCircuitBreakerSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -698,9 +703,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::trip_circuit_breaker(&inner, request).await - }; + let fut = async move { (*inner).trip_circuit_breaker(request).await }; Box::pin(fut) } } @@ -710,6 +713,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TripCircuitBreakerSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -739,9 +743,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::reset_circuit_breaker(&inner, request).await - }; + let fut = async move { (*inner).reset_circuit_breaker(request).await }; Box::pin(fut) } } @@ -751,6 +753,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ResetCircuitBreakerSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -768,22 +771,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -795,9 +793,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.circuit.v1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.circuit.v1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs index 378b8e0b..ecad6d49 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.rs @@ -45,7 +45,6 @@ pub struct MsgUpdateParams { pub evidence: ::core::option::Option<::tendermint_proto::types::EvidenceParams>, #[prost(message, optional, tag = "4")] pub validator: ::core::option::Option<::tendermint_proto::types::ValidatorParams>, - /// Since: cosmos-sdk 0.50 #[prost(message, optional, tag = "5")] pub abci: ::core::option::Option<::tendermint_proto::types::AbciParams>, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs index acede2ca..ccb7db77 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.consensus.v1.Query/Params"); @@ -111,35 +108,31 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn params( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -186,10 +179,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -199,6 +192,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.consensus.v1.Query/Params" => { #[allow(non_camel_case_types)] @@ -211,7 +205,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -221,6 +215,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -238,22 +233,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -265,22 +255,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.consensus.v1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.consensus.v1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -301,10 +293,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -319,13 +311,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -366,7 +358,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -381,35 +376,31 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn update_params( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -456,10 +447,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -469,6 +460,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.consensus.v1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] @@ -481,8 +473,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -492,6 +483,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -509,22 +501,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -536,9 +523,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.consensus.v1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.consensus.v1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.rs new file mode 100644 index 00000000..ba019369 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.rs @@ -0,0 +1,18 @@ +// @generated +/// Module is the config object of the counter module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +impl ::prost::Name for Module { + const NAME: &'static str = "Module"; + const PACKAGE: &'static str = "cosmos.counter.module.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.counter.module.v1.{}", Self::NAME) + } +} +include!("cosmos.counter.module.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.serde.rs new file mode 100644 index 00000000..b1be090f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.module.v1.serde.rs @@ -0,0 +1,96 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.counter.module.v1.Module", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.counter.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.counter.module.v1.Module", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.rs new file mode 100644 index 00000000..afabb5ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.rs @@ -0,0 +1,62 @@ +// @generated +/// QueryGetCountRequest defines the request type for querying x/mock count. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetCountRequest {} +impl ::prost::Name for QueryGetCountRequest { + const NAME: &'static str = "QueryGetCountRequest"; + const PACKAGE: &'static str = "cosmos.counter.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.counter.v1.{}", Self::NAME) + } +} +/// QueryGetCountResponse defines the response type for querying x/mock count. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryGetCountResponse { + #[prost(int64, tag = "1")] + pub total_count: i64, +} +impl ::prost::Name for QueryGetCountResponse { + const NAME: &'static str = "QueryGetCountResponse"; + const PACKAGE: &'static str = "cosmos.counter.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.counter.v1.{}", Self::NAME) + } +} +/// MsgIncreaseCounter defines a count Msg service counter. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgIncreaseCounter { + /// signer is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// count is the number of times to increment the counter. + #[prost(int64, tag = "2")] + pub count: i64, +} +impl ::prost::Name for MsgIncreaseCounter { + const NAME: &'static str = "MsgIncreaseCounter"; + const PACKAGE: &'static str = "cosmos.counter.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.counter.v1.{}", Self::NAME) + } +} +/// MsgIncreaseCountResponse is the Msg/Counter response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgIncreaseCountResponse { + /// new_count is the number of times the counter was incremented. + #[prost(int64, tag = "1")] + pub new_count: i64, +} +impl ::prost::Name for MsgIncreaseCountResponse { + const NAME: &'static str = "MsgIncreaseCountResponse"; + const PACKAGE: &'static str = "cosmos.counter.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.counter.v1.{}", Self::NAME) + } +} +include!("cosmos.counter.v1.serde.rs"); +include!("cosmos.counter.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.serde.rs similarity index 57% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.serde.rs index 0ff506d6..557c2794 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.serde.rs @@ -1,6 +1,6 @@ // @generated #[cfg(feature = "serde")] -impl serde::Serialize for PrimaryKeyDescriptor { +impl serde::Serialize for MsgIncreaseCountResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -8,36 +8,33 @@ impl serde::Serialize for PrimaryKeyDescriptor { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.fields.is_empty() { - len += 1; - } - if self.auto_increment { + if self.new_count != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.v1.PrimaryKeyDescriptor", len)?; - if !self.fields.is_empty() { - struct_ser.serialize_field("fields", &self.fields)?; - } - if self.auto_increment { - struct_ser.serialize_field("autoIncrement", &self.auto_increment)?; + serializer.serialize_struct("cosmos.counter.v1.MsgIncreaseCountResponse", len)?; + if self.new_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "newCount", + alloc::string::ToString::to_string(&self.new_count).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PrimaryKeyDescriptor { +impl<'de> serde::Deserialize<'de> for MsgIncreaseCountResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["fields", "auto_increment", "autoIncrement"]; + const FIELDS: &[&str] = &["new_count", "newCount"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Fields, - AutoIncrement, + NewCount, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -63,8 +60,7 @@ impl<'de> serde::Deserialize<'de> for PrimaryKeyDescriptor { E: serde::de::Error, { match value { - "fields" => Ok(GeneratedField::Fields), - "autoIncrement" | "auto_increment" => Ok(GeneratedField::AutoIncrement), + "newCount" | "new_count" => Ok(GeneratedField::NewCount), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -74,52 +70,47 @@ impl<'de> serde::Deserialize<'de> for PrimaryKeyDescriptor { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PrimaryKeyDescriptor; + type Value = MsgIncreaseCountResponse; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1.PrimaryKeyDescriptor") + formatter.write_str("struct cosmos.counter.v1.MsgIncreaseCountResponse") } fn visit_map( self, mut map_: V, - ) -> core::result::Result + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut fields__ = None; - let mut auto_increment__ = None; + let mut new_count__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Fields => { - if fields__.is_some() { - return Err(serde::de::Error::duplicate_field("fields")); + GeneratedField::NewCount => { + if new_count__.is_some() { + return Err(serde::de::Error::duplicate_field("newCount")); } - fields__ = Some(map_.next_value()?); - } - GeneratedField::AutoIncrement => { - if auto_increment__.is_some() { - return Err(serde::de::Error::duplicate_field("autoIncrement")); - } - auto_increment__ = Some(map_.next_value()?); + new_count__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(PrimaryKeyDescriptor { - fields: fields__.unwrap_or_default(), - auto_increment: auto_increment__.unwrap_or_default(), + Ok(MsgIncreaseCountResponse { + new_count: new_count__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.v1.PrimaryKeyDescriptor", + "cosmos.counter.v1.MsgIncreaseCountResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for SecondaryIndexDescriptor { +impl serde::Serialize for MsgIncreaseCounter { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -127,43 +118,40 @@ impl serde::Serialize for SecondaryIndexDescriptor { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.fields.is_empty() { - len += 1; - } - if self.id != 0 { + if !self.signer.is_empty() { len += 1; } - if self.unique { + if self.count != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.v1.SecondaryIndexDescriptor", len)?; - if !self.fields.is_empty() { - struct_ser.serialize_field("fields", &self.fields)?; - } - if self.id != 0 { - struct_ser.serialize_field("id", &self.id)?; + serializer.serialize_struct("cosmos.counter.v1.MsgIncreaseCounter", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } - if self.unique { - struct_ser.serialize_field("unique", &self.unique)?; + if self.count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "count", + alloc::string::ToString::to_string(&self.count).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for SecondaryIndexDescriptor { +impl<'de> serde::Deserialize<'de> for MsgIncreaseCounter { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["fields", "id", "unique"]; + const FIELDS: &[&str] = &["signer", "count"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Fields, - Id, - Unique, + Signer, + Count, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -189,9 +177,8 @@ impl<'de> serde::Deserialize<'de> for SecondaryIndexDescriptor { E: serde::de::Error, { match value { - "fields" => Ok(GeneratedField::Fields), - "id" => Ok(GeneratedField::Id), - "unique" => Ok(GeneratedField::Unique), + "signer" => Ok(GeneratedField::Signer), + "count" => Ok(GeneratedField::Count), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -201,94 +188,75 @@ impl<'de> serde::Deserialize<'de> for SecondaryIndexDescriptor { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SecondaryIndexDescriptor; + type Value = MsgIncreaseCounter; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1.SecondaryIndexDescriptor") + formatter.write_str("struct cosmos.counter.v1.MsgIncreaseCounter") } - fn visit_map( - self, - mut map_: V, - ) -> core::result::Result + fn visit_map(self, mut map_: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut fields__ = None; - let mut id__ = None; - let mut unique__ = None; + let mut signer__ = None; + let mut count__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Fields => { - if fields__.is_some() { - return Err(serde::de::Error::duplicate_field("fields")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - fields__ = Some(map_.next_value()?); + signer__ = Some(map_.next_value()?); } - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); + GeneratedField::Count => { + if count__.is_some() { + return Err(serde::de::Error::duplicate_field("count")); } - id__ = Some( + count__ = Some( map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } - GeneratedField::Unique => { - if unique__.is_some() { - return Err(serde::de::Error::duplicate_field("unique")); - } - unique__ = Some(map_.next_value()?); - } } } - Ok(SecondaryIndexDescriptor { - fields: fields__.unwrap_or_default(), - id: id__.unwrap_or_default(), - unique: unique__.unwrap_or_default(), + Ok(MsgIncreaseCounter { + signer: signer__.unwrap_or_default(), + count: count__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.v1.SecondaryIndexDescriptor", + "cosmos.counter.v1.MsgIncreaseCounter", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for SingletonDescriptor { +impl serde::Serialize for QueryGetCountRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if self.id != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.v1.SingletonDescriptor", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", &self.id)?; - } + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.counter.v1.QueryGetCountRequest", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for SingletonDescriptor { +impl<'de> serde::Deserialize<'de> for QueryGetCountRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["id"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> core::result::Result @@ -312,10 +280,7 @@ impl<'de> serde::Deserialize<'de> for SingletonDescriptor { where E: serde::de::Error, { - match value { - "id" => Ok(GeneratedField::Id), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -323,47 +288,34 @@ impl<'de> serde::Deserialize<'de> for SingletonDescriptor { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SingletonDescriptor; + type Value = QueryGetCountRequest; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1.SingletonDescriptor") + formatter.write_str("struct cosmos.counter.v1.QueryGetCountRequest") } fn visit_map( self, mut map_: V, - ) -> core::result::Result + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(SingletonDescriptor { - id: id__.unwrap_or_default(), - }) + Ok(QueryGetCountRequest {}) } } deserializer.deserialize_struct( - "cosmos.orm.v1.SingletonDescriptor", + "cosmos.counter.v1.QueryGetCountRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for TableDescriptor { +impl serde::Serialize for QueryGetCountResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -371,42 +323,33 @@ impl serde::Serialize for TableDescriptor { { use serde::ser::SerializeStruct; let mut len = 0; - if self.primary_key.is_some() { - len += 1; - } - if !self.index.is_empty() { + if self.total_count != 0 { len += 1; } - if self.id != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.orm.v1.TableDescriptor", len)?; - if let Some(v) = self.primary_key.as_ref() { - struct_ser.serialize_field("primaryKey", v)?; - } - if !self.index.is_empty() { - struct_ser.serialize_field("index", &self.index)?; - } - if self.id != 0 { - struct_ser.serialize_field("id", &self.id)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.counter.v1.QueryGetCountResponse", len)?; + if self.total_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "totalCount", + alloc::string::ToString::to_string(&self.total_count).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for TableDescriptor { +impl<'de> serde::Deserialize<'de> for QueryGetCountResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["primary_key", "primaryKey", "index", "id"]; + const FIELDS: &[&str] = &["total_count", "totalCount"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PrimaryKey, - Index, - Id, + TotalCount, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -432,9 +375,7 @@ impl<'de> serde::Deserialize<'de> for TableDescriptor { E: serde::de::Error, { match value { - "primaryKey" | "primary_key" => Ok(GeneratedField::PrimaryKey), - "index" => Ok(GeneratedField::Index), - "id" => Ok(GeneratedField::Id), + "totalCount" | "total_count" => Ok(GeneratedField::TotalCount), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -444,51 +385,42 @@ impl<'de> serde::Deserialize<'de> for TableDescriptor { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TableDescriptor; + type Value = QueryGetCountResponse; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1.TableDescriptor") + formatter.write_str("struct cosmos.counter.v1.QueryGetCountResponse") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut primary_key__ = None; - let mut index__ = None; - let mut id__ = None; + let mut total_count__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PrimaryKey => { - if primary_key__.is_some() { - return Err(serde::de::Error::duplicate_field("primaryKey")); - } - primary_key__ = map_.next_value()?; - } - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); + GeneratedField::TotalCount => { + if total_count__.is_some() { + return Err(serde::de::Error::duplicate_field("totalCount")); } - index__ = Some(map_.next_value()?); - } - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( + total_count__ = Some( map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } } } - Ok(TableDescriptor { - primary_key: primary_key__, - index: index__.unwrap_or_default(), - id: id__.unwrap_or_default(), + Ok(QueryGetCountResponse { + total_count: total_count__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("cosmos.orm.v1.TableDescriptor", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.counter.v1.QueryGetCountResponse", + FIELDS, + GeneratedVisitor, + ) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.tonic.rs new file mode 100644 index 00000000..9cc5d0c6 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.counter.v1.tonic.rs @@ -0,0 +1,538 @@ +// @generated +/// Generated client implementations. +#[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")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn get_count( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.counter.v1.Query/GetCount"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.counter.v1.Query", "GetCount")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[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 get_count( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.counter.v1.Query/GetCount" => { + #[allow(non_camel_case_types)] + struct GetCountSvc(pub Arc); + impl tonic::server::UnaryService for GetCountSvc { + type Response = super::QueryGetCountResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).get_count(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = GetCountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.counter.v1.Query"; + } +} +/// Generated client implementations. +#[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")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn increase_count( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.counter.v1.Msg/IncreaseCount"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.counter.v1.Msg", "IncreaseCount")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[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 increase_count( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.counter.v1.Msg/IncreaseCount" => { + #[allow(non_camel_case_types)] + struct IncreaseCountSvc(pub Arc); + impl tonic::server::UnaryService for IncreaseCountSvc { + type Response = super::MsgIncreaseCountResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).increase_count(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = IncreaseCountSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.counter.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs index 9940468b..60e07ef5 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.rs @@ -48,8 +48,6 @@ impl ::prost::Name for MsgVerifyInvariantResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -69,8 +67,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs index d04a12d2..ccd83694 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crisis.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -47,13 +41,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -94,7 +88,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -112,7 +109,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -127,17 +127,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn verify_invariant( &self, request: tonic::Request, @@ -148,18 +142,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -206,10 +202,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -219,6 +215,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.crisis.v1beta1.Msg/VerifyInvariant" => { #[allow(non_camel_case_types)] @@ -231,8 +228,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::verify_invariant(&inner, request).await }; + let fut = async move { (*inner).verify_invariant(request).await }; Box::pin(fut) } } @@ -242,6 +238,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VerifyInvariantSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -269,8 +266,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -280,6 +276,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -297,22 +294,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -324,9 +316,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.crisis.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.crisis.v1beta1.Msg"; } } 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 ad36ee5e..118e7bc9 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 @@ -804,7 +804,6 @@ impl ::prost::Name for MsgWithdrawDelegatorReward { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawDelegatorRewardResponse { - /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, } @@ -835,7 +834,6 @@ impl ::prost::Name for MsgWithdrawValidatorCommission { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgWithdrawValidatorCommissionResponse { - /// Since: cosmos-sdk 0.46 #[prost(message, repeated, tag = "1")] pub amount: ::prost::alloc::vec::Vec, } @@ -875,8 +873,6 @@ impl ::prost::Name for MsgFundCommunityPoolResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -898,8 +894,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -913,8 +907,6 @@ impl ::prost::Name for MsgUpdateParamsResponse { /// MsgCommunityPoolSpend defines a message for sending tokens from the community /// pool to another account. This message is typically executed via a governance /// proposal with the governance module being the executing authority. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpend { @@ -935,8 +927,6 @@ impl ::prost::Name for MsgCommunityPoolSpend { } /// MsgCommunityPoolSpendResponse defines the response to executing a /// MsgCommunityPoolSpend message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCommunityPoolSpendResponse {} @@ -949,8 +939,6 @@ impl ::prost::Name for MsgCommunityPoolSpendResponse { } /// DepositValidatorRewardsPool defines the request structure to provide /// additional rewards to delegators from a specific validator. -/// -/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositValidatorRewardsPool { @@ -970,8 +958,6 @@ impl ::prost::Name for MsgDepositValidatorRewardsPool { } /// MsgDepositValidatorRewardsPoolResponse defines the response to executing a /// MsgDepositValidatorRewardsPool message. -/// -/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgDepositValidatorRewardsPoolResponse {} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs index 3d04ebbb..9d463bc1 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -117,7 +114,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -138,7 +138,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -159,7 +162,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -180,7 +186,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -201,7 +210,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -222,7 +234,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -243,7 +258,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -264,7 +282,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -283,7 +304,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -301,17 +325,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn params( &self, request: tonic::Request, @@ -378,18 +396,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -436,10 +456,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -449,6 +469,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.distribution.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] @@ -461,7 +482,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -471,6 +492,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -501,9 +523,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_distribution_info(&inner, request).await - }; + let fut = + async move { (*inner).validator_distribution_info(request).await }; Box::pin(fut) } } @@ -513,6 +534,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorDistributionInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -544,7 +566,7 @@ pub mod query_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::validator_outstanding_rewards(&inner, request).await + (*inner).validator_outstanding_rewards(request).await }; Box::pin(fut) } @@ -555,6 +577,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorOutstandingRewardsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -585,9 +608,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_commission(&inner, request).await - }; + let fut = async move { (*inner).validator_commission(request).await }; Box::pin(fut) } } @@ -597,6 +618,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorCommissionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -626,9 +648,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_slashes(&inner, request).await - }; + let fut = async move { (*inner).validator_slashes(request).await }; Box::pin(fut) } } @@ -638,6 +658,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorSlashesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -667,9 +688,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegation_rewards(&inner, request).await - }; + let fut = async move { (*inner).delegation_rewards(request).await }; Box::pin(fut) } } @@ -679,6 +698,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegationRewardsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -709,9 +729,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegation_total_rewards(&inner, request).await - }; + let fut = + async move { (*inner).delegation_total_rewards(request).await }; Box::pin(fut) } } @@ -721,6 +740,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegationTotalRewardsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -751,9 +771,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_validators(&inner, request).await - }; + let fut = async move { (*inner).delegator_validators(request).await }; Box::pin(fut) } } @@ -763,6 +781,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorValidatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -793,9 +812,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_withdraw_address(&inner, request).await - }; + let fut = + async move { (*inner).delegator_withdraw_address(request).await }; Box::pin(fut) } } @@ -805,6 +823,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorWithdrawAddressSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -834,8 +853,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::community_pool(&inner, request).await }; + let fut = async move { (*inner).community_pool(request).await }; Box::pin(fut) } } @@ -845,6 +863,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CommunityPoolSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -862,22 +881,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -889,22 +903,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.distribution.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.distribution.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -925,10 +941,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -943,13 +959,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -992,7 +1008,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1013,7 +1032,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1034,7 +1056,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1053,7 +1078,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1072,7 +1100,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1093,7 +1124,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1114,7 +1148,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1132,17 +1169,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn set_withdraw_address( &self, request: tonic::Request, @@ -1188,18 +1219,20 @@ pub mod msg_server { >; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1246,10 +1279,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1259,6 +1292,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.distribution.v1beta1.Msg/SetWithdrawAddress" => { #[allow(non_camel_case_types)] @@ -1273,9 +1307,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::set_withdraw_address(&inner, request).await - }; + let fut = async move { (*inner).set_withdraw_address(request).await }; Box::pin(fut) } } @@ -1285,6 +1317,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SetWithdrawAddressSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1314,9 +1347,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::withdraw_delegator_reward(&inner, request).await - }; + let fut = + async move { (*inner).withdraw_delegator_reward(request).await }; Box::pin(fut) } } @@ -1326,6 +1358,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = WithdrawDelegatorRewardSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1356,7 +1389,7 @@ pub mod msg_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::withdraw_validator_commission(&inner, request).await + (*inner).withdraw_validator_commission(request).await }; Box::pin(fut) } @@ -1367,6 +1400,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = WithdrawValidatorCommissionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1394,9 +1428,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::fund_community_pool(&inner, request).await - }; + let fut = async move { (*inner).fund_community_pool(request).await }; Box::pin(fut) } } @@ -1406,6 +1438,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = FundCommunityPoolSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1433,8 +1466,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -1444,6 +1476,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1473,9 +1506,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::community_pool_spend(&inner, request).await - }; + let fut = async move { (*inner).community_pool_spend(request).await }; Box::pin(fut) } } @@ -1485,6 +1516,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CommunityPoolSpendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1515,7 +1547,7 @@ pub mod msg_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::deposit_validator_rewards_pool(&inner, request).await + (*inner).deposit_validator_rewards_pool(request).await }; Box::pin(fut) } @@ -1526,6 +1558,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositValidatorRewardsPoolSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1543,22 +1576,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1570,9 +1598,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.distribution.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.distribution.v1beta1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.rs new file mode 100644 index 00000000..6359327f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.rs @@ -0,0 +1,14 @@ +// @generated +/// Module is the config object of the epochs module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module {} +impl ::prost::Name for Module { + const NAME: &'static str = "Module"; + const PACKAGE: &'static str = "cosmos.epochs.module.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.module.v1.{}", Self::NAME) + } +} +include!("cosmos.epochs.module.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.serde.rs similarity index 88% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.serde.rs index dfe09f40..dc81cb7d 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.module.v1.serde.rs @@ -8,7 +8,7 @@ impl serde::Serialize for Module { { use serde::ser::SerializeStruct; let len = 0; - let struct_ser = serializer.serialize_struct("cosmos.orm.module.v1alpha1.Module", len)?; + let struct_ser = serializer.serialize_struct("cosmos.epochs.module.v1.Module", len)?; struct_ser.end() } } @@ -57,7 +57,7 @@ impl<'de> serde::Deserialize<'de> for Module { type Value = Module; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.module.v1alpha1.Module") + formatter.write_str("struct cosmos.epochs.module.v1.Module") } fn visit_map(self, mut map_: V) -> core::result::Result @@ -70,10 +70,6 @@ impl<'de> serde::Deserialize<'de> for Module { Ok(Module {}) } } - deserializer.deserialize_struct( - "cosmos.orm.module.v1alpha1.Module", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.epochs.module.v1.Module", FIELDS, GeneratedVisitor) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.rs new file mode 100644 index 00000000..50326dc0 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.rs @@ -0,0 +1,166 @@ +// @generated +/// EventEpochEnd is an event emitted when an epoch end. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventEpochEnd { + #[prost(int64, tag = "1")] + pub epoch_number: i64, +} +impl ::prost::Name for EventEpochEnd { + const NAME: &'static str = "EventEpochEnd"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// EventEpochStart is an event emitted when an epoch start. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventEpochStart { + #[prost(int64, tag = "1")] + pub epoch_number: i64, + #[prost(int64, tag = "2")] + pub epoch_start_time: i64, +} +impl ::prost::Name for EventEpochStart { + const NAME: &'static str = "EventEpochStart"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// EpochInfo is a struct that describes the data going into +/// a timer defined by the x/epochs module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EpochInfo { + /// identifier is a unique reference to this particular timer. + #[prost(string, tag = "1")] + pub identifier: ::prost::alloc::string::String, + /// start_time is the time at which the timer first ever ticks. + /// If start_time is in the future, the epoch will not begin until the start + /// time. + #[prost(message, optional, tag = "2")] + pub start_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, + /// duration is the time in between epoch ticks. + /// In order for intended behavior to be met, duration should + /// be greater than the chains expected block time. + /// Duration must be non-zero. + #[prost(message, optional, tag = "3")] + pub duration: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, + /// current_epoch is the current epoch number, or in other words, + /// how many times has the timer 'ticked'. + /// The first tick (current_epoch=1) is defined as + /// the first block whose blocktime is greater than the EpochInfo start_time. + #[prost(int64, tag = "4")] + pub current_epoch: i64, + /// current_epoch_start_time describes the start time of the current timer + /// interval. The interval is (current_epoch_start_time, + /// current_epoch_start_time + duration] When the timer ticks, this is set to + /// current_epoch_start_time = last_epoch_start_time + duration only one timer + /// tick for a given identifier can occur per block. + /// + /// NOTE! The current_epoch_start_time may diverge significantly from the + /// wall-clock time the epoch began at. Wall-clock time of epoch start may be + /// >> current_epoch_start_time. Suppose current_epoch_start_time = 10, + /// duration = 5. Suppose the chain goes offline at t=14, and comes back online + /// at t=30, and produces blocks at every successive time. (t=31, 32, etc.) + /// * The t=30 block will start the epoch for (10, 15] + /// * The t=31 block will start the epoch for (15, 20] + /// * The t=32 block will start the epoch for (20, 25] + /// * The t=33 block will start the epoch for (25, 30] + /// * The t=34 block will start the epoch for (30, 35] + /// * The **t=36** block will start the epoch for (35, 40] + #[prost(message, optional, tag = "5")] + pub current_epoch_start_time: + ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, + /// epoch_counting_started is a boolean, that indicates whether this + /// epoch timer has began yet. + #[prost(bool, tag = "6")] + pub epoch_counting_started: bool, + /// current_epoch_start_height is the block height at which the current epoch + /// started. (The block height at which the timer last ticked) + #[prost(int64, tag = "8")] + pub current_epoch_start_height: i64, +} +impl ::prost::Name for EpochInfo { + const NAME: &'static str = "EpochInfo"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// GenesisState defines the epochs module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub epochs: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// QueryEpochInfosRequest defines the gRPC request structure for +/// querying all epoch info. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEpochInfosRequest {} +impl ::prost::Name for QueryEpochInfosRequest { + const NAME: &'static str = "QueryEpochInfosRequest"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// QueryEpochInfosRequest defines the gRPC response structure for +/// querying all epoch info. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryEpochInfosResponse { + #[prost(message, repeated, tag = "1")] + pub epochs: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryEpochInfosResponse { + const NAME: &'static str = "QueryEpochInfosResponse"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// QueryCurrentEpochRequest defines the gRPC request structure for +/// querying an epoch by its identifier. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentEpochRequest { + #[prost(string, tag = "1")] + pub identifier: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryCurrentEpochRequest { + const NAME: &'static str = "QueryCurrentEpochRequest"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +/// QueryCurrentEpochResponse defines the gRPC response structure for +/// querying an epoch by its identifier. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCurrentEpochResponse { + #[prost(int64, tag = "1")] + pub current_epoch: i64, +} +impl ::prost::Name for QueryCurrentEpochResponse { + const NAME: &'static str = "QueryCurrentEpochResponse"; + const PACKAGE: &'static str = "cosmos.epochs.v1beta1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.epochs.v1beta1.{}", Self::NAME) + } +} +include!("cosmos.epochs.v1beta1.serde.rs"); +include!("cosmos.epochs.v1beta1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.serde.rs similarity index 53% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.serde.rs index f95a3605..4c22de18 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.serde.rs @@ -1,6 +1,6 @@ // @generated #[cfg(feature = "serde")] -impl serde::Serialize for GetRequest { +impl serde::Serialize for EpochInfo { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -8,43 +8,91 @@ impl serde::Serialize for GetRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.message_name.is_empty() { + if !self.identifier.is_empty() { len += 1; } - if !self.index.is_empty() { + if self.start_time.is_some() { len += 1; } - if !self.values.is_empty() { + if self.duration.is_some() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.GetRequest", len)?; - if !self.message_name.is_empty() { - struct_ser.serialize_field("messageName", &self.message_name)?; + if self.current_epoch != 0 { + len += 1; + } + if self.current_epoch_start_time.is_some() { + len += 1; + } + if self.epoch_counting_started { + len += 1; + } + if self.current_epoch_start_height != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.epochs.v1beta1.EpochInfo", len)?; + if !self.identifier.is_empty() { + struct_ser.serialize_field("identifier", &self.identifier)?; + } + if let Some(v) = self.start_time.as_ref() { + struct_ser.serialize_field("startTime", v)?; + } + if let Some(v) = self.duration.as_ref() { + struct_ser.serialize_field("duration", v)?; } - if !self.index.is_empty() { - struct_ser.serialize_field("index", &self.index)?; + if self.current_epoch != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "currentEpoch", + alloc::string::ToString::to_string(&self.current_epoch).as_str(), + )?; } - if !self.values.is_empty() { - struct_ser.serialize_field("values", &self.values)?; + if let Some(v) = self.current_epoch_start_time.as_ref() { + struct_ser.serialize_field("currentEpochStartTime", v)?; + } + if self.epoch_counting_started { + struct_ser.serialize_field("epochCountingStarted", &self.epoch_counting_started)?; + } + if self.current_epoch_start_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "currentEpochStartHeight", + alloc::string::ToString::to_string(&self.current_epoch_start_height).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for GetRequest { +impl<'de> serde::Deserialize<'de> for EpochInfo { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["message_name", "messageName", "index", "values"]; + const FIELDS: &[&str] = &[ + "identifier", + "start_time", + "startTime", + "duration", + "current_epoch", + "currentEpoch", + "current_epoch_start_time", + "currentEpochStartTime", + "epoch_counting_started", + "epochCountingStarted", + "current_epoch_start_height", + "currentEpochStartHeight", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - MessageName, - Index, - Values, + Identifier, + StartTime, + Duration, + CurrentEpoch, + CurrentEpochStartTime, + EpochCountingStarted, + CurrentEpochStartHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -70,9 +118,19 @@ impl<'de> serde::Deserialize<'de> for GetRequest { E: serde::de::Error, { match value { - "messageName" | "message_name" => Ok(GeneratedField::MessageName), - "index" => Ok(GeneratedField::Index), - "values" => Ok(GeneratedField::Values), + "identifier" => Ok(GeneratedField::Identifier), + "startTime" | "start_time" => Ok(GeneratedField::StartTime), + "duration" => Ok(GeneratedField::Duration), + "currentEpoch" | "current_epoch" => Ok(GeneratedField::CurrentEpoch), + "currentEpochStartTime" | "current_epoch_start_time" => { + Ok(GeneratedField::CurrentEpochStartTime) + } + "epochCountingStarted" | "epoch_counting_started" => { + Ok(GeneratedField::EpochCountingStarted) + } + "currentEpochStartHeight" | "current_epoch_start_height" => { + Ok(GeneratedField::CurrentEpochStartHeight) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -82,57 +140,97 @@ impl<'de> serde::Deserialize<'de> for GetRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetRequest; + type Value = EpochInfo; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.GetRequest") + formatter.write_str("struct cosmos.epochs.v1beta1.EpochInfo") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map(self, mut map_: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut message_name__ = None; - let mut index__ = None; - let mut values__ = None; + let mut identifier__ = None; + let mut start_time__ = None; + let mut duration__ = None; + let mut current_epoch__ = None; + let mut current_epoch_start_time__ = None; + let mut epoch_counting_started__ = None; + let mut current_epoch_start_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::MessageName => { - if message_name__.is_some() { - return Err(serde::de::Error::duplicate_field("messageName")); + GeneratedField::Identifier => { + if identifier__.is_some() { + return Err(serde::de::Error::duplicate_field("identifier")); } - message_name__ = Some(map_.next_value()?); + identifier__ = Some(map_.next_value()?); } - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); + GeneratedField::StartTime => { + if start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("startTime")); } - index__ = Some(map_.next_value()?); + start_time__ = map_.next_value()?; } - GeneratedField::Values => { - if values__.is_some() { - return Err(serde::de::Error::duplicate_field("values")); + GeneratedField::Duration => { + if duration__.is_some() { + return Err(serde::de::Error::duplicate_field("duration")); + } + duration__ = map_.next_value()?; + } + GeneratedField::CurrentEpoch => { + if current_epoch__.is_some() { + return Err(serde::de::Error::duplicate_field("currentEpoch")); + } + current_epoch__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::CurrentEpochStartTime => { + if current_epoch_start_time__.is_some() { + return Err(serde::de::Error::duplicate_field( + "currentEpochStartTime", + )); } - values__ = Some(map_.next_value()?); + current_epoch_start_time__ = map_.next_value()?; + } + GeneratedField::EpochCountingStarted => { + if epoch_counting_started__.is_some() { + return Err(serde::de::Error::duplicate_field( + "epochCountingStarted", + )); + } + epoch_counting_started__ = Some(map_.next_value()?); + } + GeneratedField::CurrentEpochStartHeight => { + if current_epoch_start_height__.is_some() { + return Err(serde::de::Error::duplicate_field( + "currentEpochStartHeight", + )); + } + current_epoch_start_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(GetRequest { - message_name: message_name__.unwrap_or_default(), - index: index__.unwrap_or_default(), - values: values__.unwrap_or_default(), + Ok(EpochInfo { + identifier: identifier__.unwrap_or_default(), + start_time: start_time__, + duration: duration__, + current_epoch: current_epoch__.unwrap_or_default(), + current_epoch_start_time: current_epoch_start_time__, + epoch_counting_started: epoch_counting_started__.unwrap_or_default(), + current_epoch_start_height: current_epoch_start_height__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.GetRequest", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.epochs.v1beta1.EpochInfo", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for GetResponse { +impl serde::Serialize for EventEpochEnd { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -140,29 +238,33 @@ impl serde::Serialize for GetResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.result.is_some() { + if self.epoch_number != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.GetResponse", len)?; - if let Some(v) = self.result.as_ref() { - struct_ser.serialize_field("result", v)?; + serializer.serialize_struct("cosmos.epochs.v1beta1.EventEpochEnd", len)?; + if self.epoch_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "epochNumber", + alloc::string::ToString::to_string(&self.epoch_number).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for GetResponse { +impl<'de> serde::Deserialize<'de> for EventEpochEnd { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["result"]; + const FIELDS: &[&str] = &["epoch_number", "epochNumber"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Result, + EpochNumber, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -188,7 +290,7 @@ impl<'de> serde::Deserialize<'de> for GetResponse { E: serde::de::Error, { match value { - "result" => Ok(GeneratedField::Result), + "epochNumber" | "epoch_number" => Ok(GeneratedField::EpochNumber), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -198,39 +300,44 @@ impl<'de> serde::Deserialize<'de> for GetResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GetResponse; + type Value = EventEpochEnd; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.GetResponse") + formatter.write_str("struct cosmos.epochs.v1beta1.EventEpochEnd") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map(self, mut map_: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut result__ = None; + let mut epoch_number__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Result => { - if result__.is_some() { - return Err(serde::de::Error::duplicate_field("result")); + GeneratedField::EpochNumber => { + if epoch_number__.is_some() { + return Err(serde::de::Error::duplicate_field("epochNumber")); } - result__ = map_.next_value()?; + epoch_number__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(GetResponse { result: result__ }) + Ok(EventEpochEnd { + epoch_number: epoch_number__.unwrap_or_default(), + }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.GetResponse", + "cosmos.epochs.v1beta1.EventEpochEnd", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for IndexValue { +impl serde::Serialize for EventEpochStart { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -238,76 +345,49 @@ impl serde::Serialize for IndexValue { { use serde::ser::SerializeStruct; let mut len = 0; - if self.value.is_some() { + if self.epoch_number != 0 { + len += 1; + } + if self.epoch_start_time != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.IndexValue", len)?; - if let Some(v) = self.value.as_ref() { - match v { - index_value::Value::Uint(v) => { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("uint", alloc::string::ToString::to_string(&v).as_str())?; - } - index_value::Value::Int(v) => { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("int", alloc::string::ToString::to_string(&v).as_str())?; - } - index_value::Value::Str(v) => { - struct_ser.serialize_field("str", v)?; - } - index_value::Value::Bytes(v) => { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("bytes", pbjson::private::base64::encode(&v).as_str())?; - } - index_value::Value::Enum(v) => { - struct_ser.serialize_field("enum", v)?; - } - index_value::Value::Bool(v) => { - struct_ser.serialize_field("bool", v)?; - } - index_value::Value::Timestamp(v) => { - struct_ser.serialize_field("timestamp", v)?; - } - index_value::Value::Duration(v) => { - struct_ser.serialize_field("duration", v)?; - } - } + serializer.serialize_struct("cosmos.epochs.v1beta1.EventEpochStart", len)?; + if self.epoch_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "epochNumber", + alloc::string::ToString::to_string(&self.epoch_number).as_str(), + )?; + } + if self.epoch_start_time != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "epochStartTime", + alloc::string::ToString::to_string(&self.epoch_start_time).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for IndexValue { +impl<'de> serde::Deserialize<'de> for EventEpochStart { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "uint", - "int", - "str", - "bytes", - "enum", - "bool", - "timestamp", - "duration", + "epoch_number", + "epochNumber", + "epoch_start_time", + "epochStartTime", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Uint, - Int, - Str, - Bytes, - Enum, - Bool, - Timestamp, - Duration, + EpochNumber, + EpochStartTime, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -333,14 +413,10 @@ impl<'de> serde::Deserialize<'de> for IndexValue { E: serde::de::Error, { match value { - "uint" => Ok(GeneratedField::Uint), - "int" => Ok(GeneratedField::Int), - "str" => Ok(GeneratedField::Str), - "bytes" => Ok(GeneratedField::Bytes), - "enum" => Ok(GeneratedField::Enum), - "bool" => Ok(GeneratedField::Bool), - "timestamp" => Ok(GeneratedField::Timestamp), - "duration" => Ok(GeneratedField::Duration), + "epochNumber" | "epoch_number" => Ok(GeneratedField::EpochNumber), + "epochStartTime" | "epoch_start_time" => { + Ok(GeneratedField::EpochStartTime) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -350,99 +426,55 @@ impl<'de> serde::Deserialize<'de> for IndexValue { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IndexValue; + type Value = EventEpochStart; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.IndexValue") + formatter.write_str("struct cosmos.epochs.v1beta1.EventEpochStart") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map(self, mut map_: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut value__ = None; + let mut epoch_number__ = None; + let mut epoch_start_time__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Uint => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("uint")); - } - value__ = - map_.next_value::<::core::option::Option< - ::pbjson::private::NumberDeserialize<_>, - >>()? - .map(|x| index_value::Value::Uint(x.0)); - } - GeneratedField::Int => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("int")); - } - value__ = - map_.next_value::<::core::option::Option< - ::pbjson::private::NumberDeserialize<_>, - >>()? - .map(|x| index_value::Value::Int(x.0)); - } - GeneratedField::Str => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("str")); - } - value__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(index_value::Value::Str); - } - GeneratedField::Bytes => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("bytes")); - } - value__ =map_.next_value::<::core::option::Option<::pbjson::private::BytesDeserialize<_>>>()?.map(|x| index_value::Value::Bytes(x.0)); - } - GeneratedField::Enum => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("enum")); - } - value__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(index_value::Value::Enum); - } - GeneratedField::Bool => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("bool")); - } - value__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(index_value::Value::Bool); - } - GeneratedField::Timestamp => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); + GeneratedField::EpochNumber => { + if epoch_number__.is_some() { + return Err(serde::de::Error::duplicate_field("epochNumber")); } - value__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(index_value::Value::Timestamp); + epoch_number__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } - GeneratedField::Duration => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("duration")); + GeneratedField::EpochStartTime => { + if epoch_start_time__.is_some() { + return Err(serde::de::Error::duplicate_field("epochStartTime")); } - value__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(index_value::Value::Duration); + epoch_start_time__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(IndexValue { value: value__ }) + Ok(EventEpochStart { + epoch_number: epoch_number__.unwrap_or_default(), + epoch_start_time: epoch_start_time__.unwrap_or_default(), + }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.IndexValue", + "cosmos.epochs.v1beta1.EventEpochStart", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ListRequest { +impl serde::Serialize for GenesisState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -450,65 +482,29 @@ impl serde::Serialize for ListRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.message_name.is_empty() { - len += 1; - } - if !self.index.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.query.is_some() { + if !self.epochs.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest", len)?; - if !self.message_name.is_empty() { - struct_ser.serialize_field("messageName", &self.message_name)?; - } - if !self.index.is_empty() { - struct_ser.serialize_field("index", &self.index)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.query.as_ref() { - match v { - list_request::Query::Prefix(v) => { - struct_ser.serialize_field("prefix", v)?; - } - list_request::Query::Range(v) => { - struct_ser.serialize_field("range", v)?; - } - } + serializer.serialize_struct("cosmos.epochs.v1beta1.GenesisState", len)?; + if !self.epochs.is_empty() { + struct_ser.serialize_field("epochs", &self.epochs)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ListRequest { +impl<'de> serde::Deserialize<'de> for GenesisState { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "message_name", - "messageName", - "index", - "pagination", - "prefix", - "range", - ]; + const FIELDS: &[&str] = &["epochs"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - MessageName, - Index, - Pagination, - Prefix, - Range, + Epochs, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -534,11 +530,7 @@ impl<'de> serde::Deserialize<'de> for ListRequest { E: serde::de::Error, { match value { - "messageName" | "message_name" => Ok(GeneratedField::MessageName), - "index" => Ok(GeneratedField::Index), - "pagination" => Ok(GeneratedField::Pagination), - "prefix" => Ok(GeneratedField::Prefix), - "range" => Ok(GeneratedField::Range), + "epochs" => Ok(GeneratedField::Epochs), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -548,75 +540,41 @@ impl<'de> serde::Deserialize<'de> for ListRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListRequest; + type Value = GenesisState; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest") + formatter.write_str("struct cosmos.epochs.v1beta1.GenesisState") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map(self, mut map_: V) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut message_name__ = None; - let mut index__ = None; - let mut pagination__ = None; - let mut query__ = None; + let mut epochs__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::MessageName => { - if message_name__.is_some() { - return Err(serde::de::Error::duplicate_field("messageName")); - } - message_name__ = Some(map_.next_value()?); - } - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::Epochs => { + if epochs__.is_some() { + return Err(serde::de::Error::duplicate_field("epochs")); } - pagination__ = map_.next_value()?; - } - GeneratedField::Prefix => { - if query__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - query__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(list_request::Query::Prefix); - } - GeneratedField::Range => { - if query__.is_some() { - return Err(serde::de::Error::duplicate_field("range")); - } - query__ = map_ - .next_value::<::core::option::Option<_>>()? - .map(list_request::Query::Range); + epochs__ = Some(map_.next_value()?); } } } - Ok(ListRequest { - message_name: message_name__.unwrap_or_default(), - index: index__.unwrap_or_default(), - pagination: pagination__, - query: query__, + Ok(GenesisState { + epochs: epochs__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest", + "cosmos.epochs.v1beta1.GenesisState", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for list_request::Prefix { +impl serde::Serialize for QueryCurrentEpochRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -624,29 +582,29 @@ impl serde::Serialize for list_request::Prefix { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.values.is_empty() { + if !self.identifier.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Prefix", len)?; - if !self.values.is_empty() { - struct_ser.serialize_field("values", &self.values)?; + serializer.serialize_struct("cosmos.epochs.v1beta1.QueryCurrentEpochRequest", len)?; + if !self.identifier.is_empty() { + struct_ser.serialize_field("identifier", &self.identifier)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for list_request::Prefix { +impl<'de> serde::Deserialize<'de> for QueryCurrentEpochRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["values"]; + const FIELDS: &[&str] = &["identifier"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Values, + Identifier, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -672,7 +630,7 @@ impl<'de> serde::Deserialize<'de> for list_request::Prefix { E: serde::de::Error, { match value { - "values" => Ok(GeneratedField::Values), + "identifier" => Ok(GeneratedField::Identifier), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -682,44 +640,44 @@ impl<'de> serde::Deserialize<'de> for list_request::Prefix { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = list_request::Prefix; + type Value = QueryCurrentEpochRequest; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Prefix") + formatter.write_str("struct cosmos.epochs.v1beta1.QueryCurrentEpochRequest") } fn visit_map( self, mut map_: V, - ) -> core::result::Result + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut values__ = None; + let mut identifier__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Values => { - if values__.is_some() { - return Err(serde::de::Error::duplicate_field("values")); + GeneratedField::Identifier => { + if identifier__.is_some() { + return Err(serde::de::Error::duplicate_field("identifier")); } - values__ = Some(map_.next_value()?); + identifier__ = Some(map_.next_value()?); } } } - Ok(list_request::Prefix { - values: values__.unwrap_or_default(), + Ok(QueryCurrentEpochRequest { + identifier: identifier__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest.Prefix", + "cosmos.epochs.v1beta1.QueryCurrentEpochRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for list_request::Range { +impl serde::Serialize for QueryCurrentEpochResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where @@ -727,36 +685,33 @@ impl serde::Serialize for list_request::Range { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.start.is_empty() { - len += 1; - } - if !self.end.is_empty() { + if self.current_epoch != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListRequest.Range", len)?; - if !self.start.is_empty() { - struct_ser.serialize_field("start", &self.start)?; - } - if !self.end.is_empty() { - struct_ser.serialize_field("end", &self.end)?; + serializer.serialize_struct("cosmos.epochs.v1beta1.QueryCurrentEpochResponse", len)?; + if self.current_epoch != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "currentEpoch", + alloc::string::ToString::to_string(&self.current_epoch).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for list_request::Range { +impl<'de> serde::Deserialize<'de> for QueryCurrentEpochResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["start", "end"]; + const FIELDS: &[&str] = &["current_epoch", "currentEpoch"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Start, - End, + CurrentEpoch, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -782,8 +737,7 @@ impl<'de> serde::Deserialize<'de> for list_request::Range { E: serde::de::Error, { match value { - "start" => Ok(GeneratedField::Start), - "end" => Ok(GeneratedField::End), + "currentEpoch" | "current_epoch" => Ok(GeneratedField::CurrentEpoch), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -793,89 +747,159 @@ impl<'de> serde::Deserialize<'de> for list_request::Range { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = list_request::Range; + type Value = QueryCurrentEpochResponse; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListRequest.Range") + formatter.write_str("struct cosmos.epochs.v1beta1.QueryCurrentEpochResponse") } fn visit_map( self, mut map_: V, - ) -> core::result::Result + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut start__ = None; - let mut end__ = None; + let mut current_epoch__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Start => { - if start__.is_some() { - return Err(serde::de::Error::duplicate_field("start")); - } - start__ = Some(map_.next_value()?); - } - GeneratedField::End => { - if end__.is_some() { - return Err(serde::de::Error::duplicate_field("end")); + GeneratedField::CurrentEpoch => { + if current_epoch__.is_some() { + return Err(serde::de::Error::duplicate_field("currentEpoch")); } - end__ = Some(map_.next_value()?); + current_epoch__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(list_request::Range { - start: start__.unwrap_or_default(), - end: end__.unwrap_or_default(), + Ok(QueryCurrentEpochResponse { + current_epoch: current_epoch__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListRequest.Range", + "cosmos.epochs.v1beta1.QueryCurrentEpochResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ListResponse { +impl serde::Serialize for QueryEpochInfosRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.results.is_empty() { - len += 1; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.epochs.v1beta1.QueryEpochInfosRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryEpochInfosRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryEpochInfosRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.epochs.v1beta1.QueryEpochInfosRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryEpochInfosRequest {}) + } } - if self.pagination.is_some() { + deserializer.deserialize_struct( + "cosmos.epochs.v1beta1.QueryEpochInfosRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryEpochInfosResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.epochs.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.orm.query.v1alpha1.ListResponse", len)?; - if !self.results.is_empty() { - struct_ser.serialize_field("results", &self.results)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + serializer.serialize_struct("cosmos.epochs.v1beta1.QueryEpochInfosResponse", len)?; + if !self.epochs.is_empty() { + struct_ser.serialize_field("epochs", &self.epochs)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ListResponse { +impl<'de> serde::Deserialize<'de> for QueryEpochInfosResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> core::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["results", "pagination"]; + const FIELDS: &[&str] = &["epochs"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Results, - Pagination, + Epochs, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -901,8 +925,7 @@ impl<'de> serde::Deserialize<'de> for ListResponse { E: serde::de::Error, { match value { - "results" => Ok(GeneratedField::Results), - "pagination" => Ok(GeneratedField::Pagination), + "epochs" => Ok(GeneratedField::Epochs), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -912,42 +935,37 @@ impl<'de> serde::Deserialize<'de> for ListResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ListResponse; + type Value = QueryEpochInfosResponse; fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.query.v1alpha1.ListResponse") + formatter.write_str("struct cosmos.epochs.v1beta1.QueryEpochInfosResponse") } - fn visit_map(self, mut map_: V) -> core::result::Result + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result where V: serde::de::MapAccess<'de>, { - let mut results__ = None; - let mut pagination__ = None; + let mut epochs__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Results => { - if results__.is_some() { - return Err(serde::de::Error::duplicate_field("results")); - } - results__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::Epochs => { + if epochs__.is_some() { + return Err(serde::de::Error::duplicate_field("epochs")); } - pagination__ = map_.next_value()?; + epochs__ = Some(map_.next_value()?); } } } - Ok(ListResponse { - results: results__.unwrap_or_default(), - pagination: pagination__, + Ok(QueryEpochInfosResponse { + epochs: epochs__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "cosmos.orm.query.v1alpha1.ListResponse", + "cosmos.epochs.v1beta1.QueryEpochInfosResponse", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.tonic.rs similarity index 67% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.tonic.rs index f1496e85..826c8469 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.epochs.v1beta1.tonic.rs @@ -2,15 +2,11 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; + /** Query defines the gRPC querier service. + */ #[derive(Debug, Clone)] pub struct QueryClient { inner: tonic::client::Grpc, @@ -29,10 +25,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +46,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -91,33 +87,48 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } - pub async fn get( + /** EpochInfos provide running epochInfos + */ + pub async fn epoch_infos( &mut self, - request: impl tonic::IntoRequest, - ) -> core::result::Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); - let path = http::uri::PathAndQuery::from_static("/cosmos.orm.query.v1alpha1.Query/Get"); + let path = + http::uri::PathAndQuery::from_static("/cosmos.epochs.v1beta1.Query/EpochInfos"); let mut req = request.into_request(); req.extensions_mut() - .insert(GrpcMethod::new("cosmos.orm.query.v1alpha1.Query", "Get")); + .insert(GrpcMethod::new("cosmos.epochs.v1beta1.Query", "EpochInfos")); self.inner.unary(req, path, codec).await } - pub async fn list( + /** CurrentEpoch provide current epoch of specified identifier + */ + pub async fn current_epoch( &mut self, - request: impl tonic::IntoRequest, - ) -> core::result::Result, tonic::Status> { + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = - http::uri::PathAndQuery::from_static("/cosmos.orm.query.v1alpha1.Query/List"); + http::uri::PathAndQuery::from_static("/cosmos.epochs.v1beta1.Query/CurrentEpoch"); let mut req = request.into_request(); - req.extensions_mut() - .insert(GrpcMethod::new("cosmos.orm.query.v1alpha1.Query", "List")); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.epochs.v1beta1.Query", + "CurrentEpoch", + )); self.inner.unary(req, path, codec).await } } @@ -125,39 +136,41 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { - async fn get( + pub trait Query: Send + Sync + 'static { + /** EpochInfos provide running epochInfos + */ + async fn epoch_infos( &self, - request: tonic::Request, - ) -> core::result::Result, tonic::Status>; - async fn list( + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + /** CurrentEpoch provide current epoch of specified identifier + */ + async fn current_epoch( &self, - request: tonic::Request, - ) -> core::result::Result, tonic::Status>; + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; } + /** Query defines the gRPC querier service. + */ #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -204,10 +217,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -217,19 +230,20 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { - "/cosmos.orm.query.v1alpha1.Query/Get" => { + "/cosmos.epochs.v1beta1.Query/EpochInfos" => { #[allow(non_camel_case_types)] - struct GetSvc(pub Arc); - impl tonic::server::UnaryService for GetSvc { - type Response = super::GetResponse; + struct EpochInfosSvc(pub Arc); + impl tonic::server::UnaryService for EpochInfosSvc { + type Response = super::QueryEpochInfosResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::get(&inner, request).await }; + let fut = async move { (*inner).epoch_infos(request).await }; Box::pin(fut) } } @@ -239,7 +253,8 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = GetSvc(inner); + let inner = inner.0; + let method = EpochInfosSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -255,18 +270,18 @@ pub mod query_server { }; Box::pin(fut) } - "/cosmos.orm.query.v1alpha1.Query/List" => { + "/cosmos.epochs.v1beta1.Query/CurrentEpoch" => { #[allow(non_camel_case_types)] - struct ListSvc(pub Arc); - impl tonic::server::UnaryService for ListSvc { - type Response = super::ListResponse; + struct CurrentEpochSvc(pub Arc); + impl tonic::server::UnaryService for CurrentEpochSvc { + type Response = super::QueryCurrentEpochResponse; type Future = BoxFuture, tonic::Status>; fn call( &mut self, - request: tonic::Request, + request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::list(&inner, request).await }; + let fut = async move { (*inner).current_epoch(request).await }; Box::pin(fut) } } @@ -276,7 +291,8 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { - let method = ListSvc(inner); + let inner = inner.0; + let method = CurrentEpochSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) .apply_compression_config( @@ -293,22 +309,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -320,9 +331,17 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.orm.query.v1alpha1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.epochs.v1beta1.Query"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs index fbda7a5f..1a2a349b 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.rs @@ -49,8 +49,6 @@ pub struct QueryEvidenceRequest { #[prost(bytes = "vec", tag = "1")] pub evidence_hash: ::prost::alloc::vec::Vec, /// hash defines the evidence hash of the requested evidence. - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "2")] pub hash: ::prost::alloc::string::String, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.tonic.rs index e25a7f13..dfd30c98 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.evidence.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -113,7 +110,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -130,17 +130,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn evidence( &self, request: tonic::Request, @@ -151,18 +145,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -209,10 +205,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -222,6 +218,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.evidence.v1beta1.Query/Evidence" => { #[allow(non_camel_case_types)] @@ -234,7 +231,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::evidence(&inner, request).await }; + let fut = async move { (*inner).evidence(request).await }; Box::pin(fut) } } @@ -244,6 +241,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = EvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -271,8 +269,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::all_evidence(&inner, request).await }; + let fut = async move { (*inner).all_evidence(request).await }; Box::pin(fut) } } @@ -282,6 +279,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AllEvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -299,22 +297,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -326,22 +319,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.evidence.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.evidence.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -362,10 +357,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -380,13 +375,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -427,7 +422,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -444,35 +442,31 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn submit_evidence( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -519,10 +513,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -532,6 +526,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.evidence.v1beta1.Msg/SubmitEvidence" => { #[allow(non_camel_case_types)] @@ -544,8 +539,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::submit_evidence(&inner, request).await }; + let fut = async move { (*inner).submit_evidence(request).await }; Box::pin(fut) } } @@ -555,6 +549,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SubmitEvidenceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -572,22 +567,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -599,9 +589,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.evidence.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.evidence.v1beta1.Msg"; } } 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 45a57024..c9b8368b 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 @@ -174,8 +174,6 @@ impl ::prost::Name for QueryAllowancesResponse { } } /// QueryAllowancesByGranterRequest is the request type for the Query/AllowancesByGranter RPC method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterRequest { @@ -193,8 +191,6 @@ impl ::prost::Name for QueryAllowancesByGranterRequest { } } /// QueryAllowancesByGranterResponse is the response type for the Query/AllowancesByGranter RPC method. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAllowancesByGranterResponse { @@ -275,8 +271,6 @@ impl ::prost::Name for MsgRevokeAllowanceResponse { } } /// MsgPruneAllowances prunes expired fee allowances. -/// -/// Since cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPruneAllowances { @@ -292,8 +286,6 @@ impl ::prost::Name for MsgPruneAllowances { } } /// MsgPruneAllowancesResponse defines the Msg/PruneAllowancesResponse response type. -/// -/// Since cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgPruneAllowancesResponse {} 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 ee362dcb..636ad34c 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -115,7 +112,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -135,7 +135,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -153,17 +156,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn allowance( &self, request: tonic::Request, @@ -181,18 +178,20 @@ pub mod query_server { >; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -239,10 +238,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -252,6 +251,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.feegrant.v1beta1.Query/Allowance" => { #[allow(non_camel_case_types)] @@ -264,7 +264,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::allowance(&inner, request).await }; + let fut = async move { (*inner).allowance(request).await }; Box::pin(fut) } } @@ -274,6 +274,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AllowanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -301,8 +302,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::allowances(&inner, request).await }; + let fut = async move { (*inner).allowances(request).await }; Box::pin(fut) } } @@ -312,6 +312,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AllowancesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -342,9 +343,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::allowances_by_granter(&inner, request).await - }; + let fut = async move { (*inner).allowances_by_granter(request).await }; Box::pin(fut) } } @@ -354,6 +353,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AllowancesByGranterSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -371,22 +371,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -398,22 +393,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.feegrant.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.feegrant.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -434,10 +431,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -452,13 +449,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -499,7 +496,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -517,7 +517,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -536,7 +539,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -554,17 +560,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn grant_allowance( &self, request: tonic::Request, @@ -579,18 +579,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -637,10 +639,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -650,6 +652,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.feegrant.v1beta1.Msg/GrantAllowance" => { #[allow(non_camel_case_types)] @@ -662,8 +665,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::grant_allowance(&inner, request).await }; + let fut = async move { (*inner).grant_allowance(request).await }; Box::pin(fut) } } @@ -673,6 +675,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GrantAllowanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -700,8 +703,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::revoke_allowance(&inner, request).await }; + let fut = async move { (*inner).revoke_allowance(request).await }; Box::pin(fut) } } @@ -711,6 +713,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = RevokeAllowanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -738,8 +741,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::prune_allowances(&inner, request).await }; + let fut = async move { (*inner).prune_allowances(request).await }; Box::pin(fut) } } @@ -749,6 +751,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = PruneAllowancesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -766,22 +769,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -793,9 +791,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.feegrant.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.feegrant.v1beta1.Msg"; } } 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 index 84d094f4..21b2fc3f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.rs @@ -78,28 +78,18 @@ pub struct Proposal { #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "11")] pub title: ::prost::alloc::string::String, /// summary is a short summary of the proposal - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "12")] pub summary: ::prost::alloc::string::String, /// proposer is the address of the proposal sumbitter - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "13")] pub proposer: ::prost::alloc::string::String, /// expedited defines if the proposal is expedited - /// - /// Since: cosmos-sdk 0.50 #[prost(bool, tag = "14")] pub expedited: bool, /// failed_reason defines the reason why the proposal failed - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "15")] pub failed_reason: ::prost::alloc::string::String, } @@ -218,8 +208,6 @@ impl ::prost::Name for TallyParams { } } /// Params defines the parameters for the x/gov module. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Params { @@ -248,25 +236,17 @@ pub struct Params { #[prost(string, tag = "7")] pub min_initial_deposit_ratio: ::prost::alloc::string::String, /// The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "8")] pub proposal_cancel_ratio: ::prost::alloc::string::String, /// The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. /// If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "9")] pub proposal_cancel_dest: ::prost::alloc::string::String, /// Duration of the voting period of an expedited proposal. - /// - /// Since: cosmos-sdk 0.50 #[prost(message, optional, tag = "10")] pub expedited_voting_period: ::core::option::Option<::tendermint_proto::google::protobuf::Duration>, /// Minimum proportion of Yes votes for proposal to pass. Default value: 0.67. - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "11")] pub expedited_threshold: ::prost::alloc::string::String, /// Minimum expedited deposit for a proposal to enter voting period. @@ -284,8 +264,6 @@ pub struct Params { /// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. /// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be /// required. - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "16")] pub min_deposit_ratio: ::prost::alloc::string::String, } @@ -419,16 +397,12 @@ pub struct GenesisState { #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "8")] pub params: ::core::option::Option, /// The constitution allows builders to lay a foundation and define purpose. /// This is an immutable string set in genesis. /// There are no amendments, to go outside of scope, just fork. /// constitution is an immutable string in genesis for a chain builder to lay out their vision, ideas and ideals. - /// - /// Since: cosmos-sdk 0.50 #[prost(string, tag = "9")] pub constitution: ::prost::alloc::string::String, } @@ -642,8 +616,6 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "3")] pub tally_params: ::core::option::Option, /// params defines all the paramaters of x/gov module. - /// - /// Since: cosmos-sdk 0.47 #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, } @@ -771,18 +743,12 @@ pub struct MsgSubmitProposal { #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal. - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "5")] pub title: ::prost::alloc::string::String, /// summary is the summary of the proposal - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "6")] pub summary: ::prost::alloc::string::String, /// expedited defines if the proposal is expedited or not - /// - /// Since: cosmos-sdk 0.50 #[prost(bool, tag = "7")] pub expedited: bool, } @@ -941,8 +907,6 @@ impl ::prost::Name for MsgDepositResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -964,8 +928,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} @@ -977,8 +939,6 @@ impl ::prost::Name for MsgUpdateParamsResponse { } } /// MsgCancelProposal is the Msg/CancelProposal request type. -/// -/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelProposal { @@ -998,8 +958,6 @@ impl ::prost::Name for MsgCancelProposal { } /// MsgCancelProposalResponse defines the response structure for executing a /// MsgCancelProposal message. -/// -/// Since: cosmos-sdk 0.50 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelProposalResponse { 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 index a04466eb..3e6b8a76 100644 --- 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Constitution"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -127,7 +127,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -142,7 +145,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -157,7 +163,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -172,7 +181,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -187,7 +199,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -202,7 +217,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -217,7 +235,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -231,17 +252,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn constitution( &self, request: tonic::Request, @@ -280,18 +295,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -338,10 +355,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -351,6 +368,7 @@ pub mod query_server { 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/Constitution" => { #[allow(non_camel_case_types)] @@ -363,8 +381,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::constitution(&inner, request).await }; + let fut = async move { (*inner).constitution(request).await }; Box::pin(fut) } } @@ -374,6 +391,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ConstitutionSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -401,7 +419,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::proposal(&inner, request).await }; + let fut = async move { (*inner).proposal(request).await }; Box::pin(fut) } } @@ -411,6 +429,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -438,7 +457,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::proposals(&inner, request).await }; + let fut = async move { (*inner).proposals(request).await }; Box::pin(fut) } } @@ -448,6 +467,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -475,7 +495,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::vote(&inner, request).await }; + let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } @@ -485,6 +505,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -512,7 +533,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::votes(&inner, request).await }; + let fut = async move { (*inner).votes(request).await }; Box::pin(fut) } } @@ -522,6 +543,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VotesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -549,7 +571,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -559,6 +581,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -586,7 +609,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposit(&inner, request).await }; + let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } @@ -596,6 +619,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -623,7 +647,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposits(&inner, request).await }; + let fut = async move { (*inner).deposits(request).await }; Box::pin(fut) } } @@ -633,6 +657,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -660,8 +685,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::tally_result(&inner, request).await }; + let fut = async move { (*inner).tally_result(request).await }; Box::pin(fut) } } @@ -671,6 +695,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -688,22 +713,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -715,22 +735,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.gov.v1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -751,10 +773,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -769,13 +791,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -816,7 +838,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -831,7 +856,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -845,7 +873,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -860,7 +891,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -875,7 +909,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -890,7 +927,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/UpdateParams"); @@ -905,7 +945,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/CancelProposal"); @@ -919,17 +962,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn submit_proposal( &self, request: tonic::Request, @@ -960,18 +997,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1018,10 +1057,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1031,6 +1070,7 @@ pub mod msg_server { 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)] @@ -1043,8 +1083,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::submit_proposal(&inner, request).await }; + let fut = async move { (*inner).submit_proposal(request).await }; Box::pin(fut) } } @@ -1054,6 +1093,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1081,9 +1121,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::exec_legacy_content(&inner, request).await - }; + let fut = async move { (*inner).exec_legacy_content(request).await }; Box::pin(fut) } } @@ -1093,6 +1131,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ExecLegacyContentSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1120,7 +1159,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::vote(&inner, request).await }; + let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } @@ -1130,6 +1169,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1157,8 +1197,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::vote_weighted(&inner, request).await }; + let fut = async move { (*inner).vote_weighted(request).await }; Box::pin(fut) } } @@ -1168,6 +1207,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteWeightedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1195,7 +1235,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposit(&inner, request).await }; + let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } @@ -1205,6 +1245,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1232,8 +1273,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -1243,6 +1283,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1270,8 +1311,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::cancel_proposal(&inner, request).await }; + let fut = async move { (*inner).cancel_proposal(request).await }; Box::pin(fut) } } @@ -1281,6 +1321,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CancelProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1298,22 +1339,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1325,9 +1361,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.gov.v1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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 eb8e59ec..52cb7c67 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 @@ -1,7 +1,5 @@ // @generated /// WeightedVoteOption defines a unit of vote for vote split. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct WeightedVoteOption { @@ -143,8 +141,6 @@ pub struct Vote { #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, /// options is the weighted vote options. - /// - /// Since: cosmos-sdk 0.43 #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, } @@ -683,8 +679,6 @@ impl ::prost::Name for MsgVoteResponse { } } /// MsgVoteWeighted defines a message to cast a vote. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeighted { @@ -706,8 +700,6 @@ impl ::prost::Name for MsgVoteWeighted { } } /// MsgVoteWeightedResponse defines the Msg/VoteWeighted response type. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgVoteWeightedResponse {} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.tonic.rs index 0be301c4..5b4b5dfe 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Proposal"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Proposals"); @@ -127,7 +127,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Vote"); @@ -142,7 +145,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Votes"); @@ -157,7 +163,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Params"); @@ -172,7 +181,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Deposit"); @@ -187,7 +199,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Query/Deposits"); @@ -202,7 +217,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -217,17 +235,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn proposal( &self, request: tonic::Request, @@ -262,18 +274,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -320,10 +334,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -333,6 +347,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.gov.v1beta1.Query/Proposal" => { #[allow(non_camel_case_types)] @@ -345,7 +360,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::proposal(&inner, request).await }; + let fut = async move { (*inner).proposal(request).await }; Box::pin(fut) } } @@ -355,6 +370,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -382,7 +398,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::proposals(&inner, request).await }; + let fut = async move { (*inner).proposals(request).await }; Box::pin(fut) } } @@ -392,6 +408,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -419,7 +436,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::vote(&inner, request).await }; + let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } @@ -429,6 +446,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -456,7 +474,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::votes(&inner, request).await }; + let fut = async move { (*inner).votes(request).await }; Box::pin(fut) } } @@ -466,6 +484,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VotesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -493,7 +512,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -503,6 +522,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -530,7 +550,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposit(&inner, request).await }; + let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } @@ -540,6 +560,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -567,7 +588,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposits(&inner, request).await }; + let fut = async move { (*inner).deposits(request).await }; Box::pin(fut) } } @@ -577,6 +598,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -604,8 +626,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::tally_result(&inner, request).await }; + let fut = async move { (*inner).tally_result(request).await }; Box::pin(fut) } } @@ -615,6 +636,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -632,22 +654,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -659,22 +676,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.gov.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -695,10 +714,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -713,13 +732,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -760,7 +779,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -775,7 +797,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/Vote"); @@ -790,7 +815,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/VoteWeighted"); @@ -805,7 +833,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1beta1.Msg/Deposit"); @@ -819,17 +850,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn submit_proposal( &self, request: tonic::Request, @@ -848,18 +873,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -906,10 +933,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -919,6 +946,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.gov.v1beta1.Msg/SubmitProposal" => { #[allow(non_camel_case_types)] @@ -931,8 +959,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::submit_proposal(&inner, request).await }; + let fut = async move { (*inner).submit_proposal(request).await }; Box::pin(fut) } } @@ -942,6 +969,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -969,7 +997,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::vote(&inner, request).await }; + let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } @@ -979,6 +1007,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1006,8 +1035,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::vote_weighted(&inner, request).await }; + let fut = async move { (*inner).vote_weighted(request).await }; Box::pin(fut) } } @@ -1017,6 +1045,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteWeightedSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1044,7 +1073,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::deposit(&inner, request).await }; + let fut = async move { (*inner).deposit(request).await }; Box::pin(fut) } } @@ -1054,6 +1083,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DepositSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1071,22 +1101,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1098,9 +1123,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.gov.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.gov.v1beta1.Msg"; } } 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 index 763eae93..7eda33dc 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.rs @@ -274,13 +274,9 @@ pub struct Proposal { #[prost(message, repeated, tag = "12")] pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, /// title is the title of the proposal - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "13")] pub title: ::prost::alloc::string::String, /// summary is a short summary of the proposal - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "14")] pub summary: ::prost::alloc::string::String, } @@ -636,6 +632,24 @@ impl ::prost::Name for EventProposalPruned { ::prost::alloc::format!("cosmos.group.v1.{}", Self::NAME) } } +/// EventTallyError is an event emitted when a proposal tally failed with an error. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct EventTallyError { + /// proposal_id is the unique ID of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// error_message is the raw error output + #[prost(string, tag = "2")] + pub error_message: ::prost::alloc::string::String, +} +impl ::prost::Name for EventTallyError { + const NAME: &'static str = "EventTallyError"; + const PACKAGE: &'static str = "cosmos.group.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.group.v1.{}", Self::NAME) + } +} /// GenesisState defines the group module's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1117,8 +1131,6 @@ impl ::prost::Name for QueryTallyResultResponse { } } /// QueryGroupsRequest is the Query/Groups request type. -/// -/// Since: cosmos-sdk 0.47.1 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsRequest { @@ -1134,8 +1146,6 @@ impl ::prost::Name for QueryGroupsRequest { } } /// QueryGroupsResponse is the Query/Groups response type. -/// -/// Since: cosmos-sdk 0.47.1 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGroupsResponse { @@ -1501,13 +1511,9 @@ pub struct MsgSubmitProposal { #[prost(enumeration = "Exec", tag = "5")] pub exec: i32, /// title is the title of the proposal. - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "6")] pub title: ::prost::alloc::string::String, /// summary is the summary of the proposal. - /// - /// Since: cosmos-sdk 0.47 #[prost(string, tag = "7")] pub summary: ::prost::alloc::string::String, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs index 2c2984df..5c7baeee 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.group.v1.serde.rs @@ -854,6 +854,124 @@ impl<'de> serde::Deserialize<'de> for EventSubmitProposal { } } #[cfg(feature = "serde")] +impl serde::Serialize for EventTallyError { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.error_message.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.group.v1.EventTallyError", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + alloc::string::ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.error_message.is_empty() { + struct_ser.serialize_field("errorMessage", &self.error_message)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for EventTallyError { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "error_message", "errorMessage"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + ErrorMessage, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "errorMessage" | "error_message" => Ok(GeneratedField::ErrorMessage), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = EventTallyError; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.group.v1.EventTallyError") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut error_message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::ErrorMessage => { + if error_message__.is_some() { + return Err(serde::de::Error::duplicate_field("errorMessage")); + } + error_message__ = Some(map_.next_value()?); + } + } + } + Ok(EventTallyError { + proposal_id: proposal_id__.unwrap_or_default(), + error_message: error_message__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.group.v1.EventTallyError", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for EventUpdateGroup { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result 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 index 25807808..8b0824fd 100644 --- 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -128,7 +128,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -143,7 +146,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -160,7 +166,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -180,7 +189,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -198,7 +210,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -215,7 +230,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -236,7 +254,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -254,7 +275,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -270,7 +294,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -285,7 +312,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -301,7 +331,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -316,7 +349,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -330,17 +366,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn group_info( &self, request: tonic::Request, @@ -411,18 +441,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -469,10 +501,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -482,6 +514,7 @@ pub mod query_server { 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)] @@ -494,8 +527,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::group_info(&inner, request).await }; + let fut = async move { (*inner).group_info(request).await }; Box::pin(fut) } } @@ -505,6 +537,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -534,9 +567,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::group_policy_info(&inner, request).await - }; + let fut = async move { (*inner).group_policy_info(request).await }; Box::pin(fut) } } @@ -546,6 +577,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupPolicyInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -573,8 +605,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::group_members(&inner, request).await }; + let fut = async move { (*inner).group_members(request).await }; Box::pin(fut) } } @@ -584,6 +615,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupMembersSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -613,8 +645,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::groups_by_admin(&inner, request).await }; + let fut = async move { (*inner).groups_by_admin(request).await }; Box::pin(fut) } } @@ -624,6 +655,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupsByAdminSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -654,9 +686,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::group_policies_by_group(&inner, request).await - }; + let fut = + async move { (*inner).group_policies_by_group(request).await }; Box::pin(fut) } } @@ -666,6 +697,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupPoliciesByGroupSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -696,9 +728,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::group_policies_by_admin(&inner, request).await - }; + let fut = + async move { (*inner).group_policies_by_admin(request).await }; Box::pin(fut) } } @@ -708,6 +739,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupPoliciesByAdminSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -735,7 +767,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::proposal(&inner, request).await }; + let fut = async move { (*inner).proposal(request).await }; Box::pin(fut) } } @@ -745,6 +777,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -775,9 +808,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::proposals_by_group_policy(&inner, request).await - }; + let fut = + async move { (*inner).proposals_by_group_policy(request).await }; Box::pin(fut) } } @@ -787,6 +819,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ProposalsByGroupPolicySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -817,9 +850,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::vote_by_proposal_voter(&inner, request).await - }; + let fut = async move { (*inner).vote_by_proposal_voter(request).await }; Box::pin(fut) } } @@ -829,6 +860,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteByProposalVoterSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -858,9 +890,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::votes_by_proposal(&inner, request).await - }; + let fut = async move { (*inner).votes_by_proposal(request).await }; Box::pin(fut) } } @@ -870,6 +900,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VotesByProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -897,8 +928,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::votes_by_voter(&inner, request).await }; + let fut = async move { (*inner).votes_by_voter(request).await }; Box::pin(fut) } } @@ -908,6 +938,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VotesByVoterSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -937,9 +968,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::groups_by_member(&inner, request).await - }; + let fut = async move { (*inner).groups_by_member(request).await }; Box::pin(fut) } } @@ -949,6 +978,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupsByMemberSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -976,8 +1006,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::tally_result(&inner, request).await }; + let fut = async move { (*inner).tally_result(request).await }; Box::pin(fut) } } @@ -987,6 +1016,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TallyResultSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1014,7 +1044,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::groups(&inner, request).await }; + let fut = async move { (*inner).groups(request).await }; Box::pin(fut) } } @@ -1024,6 +1054,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GroupsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1041,22 +1072,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1068,22 +1094,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.group.v1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -1104,10 +1132,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1122,13 +1150,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -1169,7 +1197,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -1186,7 +1217,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1202,7 +1236,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1220,7 +1257,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1238,7 +1278,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1256,7 +1299,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1276,7 +1322,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1296,7 +1345,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1317,7 +1369,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1336,7 +1391,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -1351,7 +1409,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1366,7 +1427,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -1380,7 +1444,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -1395,7 +1462,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -1409,17 +1479,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn create_group( &self, request: tonic::Request, @@ -1496,18 +1560,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1554,10 +1620,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1567,6 +1633,7 @@ pub mod msg_server { 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)] @@ -1579,8 +1646,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::create_group(&inner, request).await }; + let fut = async move { (*inner).create_group(request).await }; Box::pin(fut) } } @@ -1590,6 +1656,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreateGroupSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1619,9 +1686,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::update_group_members(&inner, request).await - }; + let fut = async move { (*inner).update_group_members(request).await }; Box::pin(fut) } } @@ -1631,6 +1696,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupMembersSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1658,9 +1724,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::update_group_admin(&inner, request).await - }; + let fut = async move { (*inner).update_group_admin(request).await }; Box::pin(fut) } } @@ -1670,6 +1734,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupAdminSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1699,9 +1764,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::update_group_metadata(&inner, request).await - }; + let fut = async move { (*inner).update_group_metadata(request).await }; Box::pin(fut) } } @@ -1711,6 +1774,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1738,9 +1802,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::create_group_policy(&inner, request).await - }; + let fut = async move { (*inner).create_group_policy(request).await }; Box::pin(fut) } } @@ -1750,6 +1812,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreateGroupPolicySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1779,9 +1842,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::create_group_with_policy(&inner, request).await - }; + let fut = + async move { (*inner).create_group_with_policy(request).await }; Box::pin(fut) } } @@ -1791,6 +1853,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreateGroupWithPolicySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1820,9 +1883,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::update_group_policy_admin(&inner, request).await - }; + let fut = + async move { (*inner).update_group_policy_admin(request).await }; Box::pin(fut) } } @@ -1832,6 +1894,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupPolicyAdminSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1863,8 +1926,7 @@ pub mod msg_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::update_group_policy_decision_policy(&inner, request) - .await + (*inner).update_group_policy_decision_policy(request).await }; Box::pin(fut) } @@ -1875,6 +1937,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupPolicyDecisionPolicySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1904,9 +1967,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::update_group_policy_metadata(&inner, request).await - }; + let fut = + async move { (*inner).update_group_policy_metadata(request).await }; Box::pin(fut) } } @@ -1916,6 +1978,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateGroupPolicyMetadataSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1943,8 +2006,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::submit_proposal(&inner, request).await }; + let fut = async move { (*inner).submit_proposal(request).await }; Box::pin(fut) } } @@ -1954,6 +2016,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SubmitProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1981,8 +2044,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::withdraw_proposal(&inner, request).await }; + let fut = async move { (*inner).withdraw_proposal(request).await }; Box::pin(fut) } } @@ -1992,6 +2054,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = WithdrawProposalSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -2019,7 +2082,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::vote(&inner, request).await }; + let fut = async move { (*inner).vote(request).await }; Box::pin(fut) } } @@ -2029,6 +2092,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = VoteSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -2056,7 +2120,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::exec(&inner, request).await }; + let fut = async move { (*inner).exec(request).await }; Box::pin(fut) } } @@ -2066,6 +2130,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ExecSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -2093,7 +2158,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::leave_group(&inner, request).await }; + let fut = async move { (*inner).leave_group(request).await }; Box::pin(fut) } } @@ -2103,6 +2168,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = LeaveGroupSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -2120,22 +2186,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -2147,9 +2208,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.group.v1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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.mint.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs index b4f1a017..7812e404 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.rs @@ -147,8 +147,6 @@ impl ::prost::Name for QueryAnnualProvisionsResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -170,8 +168,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs index 1f822a52..6b974943 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.mint.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Query/Params"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.mint.v1beta1.Query/Inflation"); @@ -129,7 +129,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -146,17 +149,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn params( &self, request: tonic::Request, @@ -174,18 +171,20 @@ pub mod query_server { >; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -232,10 +231,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -245,6 +244,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.mint.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] @@ -257,7 +257,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -267,6 +267,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -294,7 +295,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::inflation(&inner, request).await }; + let fut = async move { (*inner).inflation(request).await }; Box::pin(fut) } } @@ -304,6 +305,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = InflationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -333,9 +335,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::annual_provisions(&inner, request).await - }; + let fut = async move { (*inner).annual_provisions(request).await }; Box::pin(fut) } } @@ -345,6 +345,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AnnualProvisionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -362,22 +363,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -389,22 +385,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.mint.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.mint.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -425,10 +423,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -443,13 +441,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -490,7 +488,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -505,35 +506,31 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn update_params( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -580,10 +577,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -593,6 +590,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.mint.v1beta1.Msg/UpdateParams" => { #[allow(non_camel_case_types)] @@ -605,8 +603,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -616,6 +613,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -633,22 +631,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -660,9 +653,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.mint.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.mint.v1beta1.Msg"; } } 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 index c9587048..bf50a4c0 100644 --- 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -127,7 +127,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -142,7 +145,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -156,7 +162,10 @@ pub mod query_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -171,7 +180,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -186,7 +198,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -200,17 +215,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn balance( &self, request: tonic::Request, @@ -241,18 +250,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -299,10 +310,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -312,6 +323,7 @@ pub mod query_server { 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)] @@ -324,7 +336,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::balance(&inner, request).await }; + let fut = async move { (*inner).balance(request).await }; Box::pin(fut) } } @@ -334,6 +346,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = BalanceSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -361,7 +374,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::owner(&inner, request).await }; + let fut = async move { (*inner).owner(request).await }; Box::pin(fut) } } @@ -371,6 +384,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = OwnerSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -398,7 +412,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::supply(&inner, request).await }; + let fut = async move { (*inner).supply(request).await }; Box::pin(fut) } } @@ -408,6 +422,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SupplySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -435,7 +450,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::nf_ts(&inner, request).await }; + let fut = async move { (*inner).nf_ts(request).await }; Box::pin(fut) } } @@ -445,6 +460,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = NFTsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -472,7 +488,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::nft(&inner, request).await }; + let fut = async move { (*inner).nft(request).await }; Box::pin(fut) } } @@ -482,6 +498,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = NFTSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -509,7 +526,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::class(&inner, request).await }; + let fut = async move { (*inner).class(request).await }; Box::pin(fut) } } @@ -519,6 +536,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ClassSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -546,7 +564,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::classes(&inner, request).await }; + let fut = async move { (*inner).classes(request).await }; Box::pin(fut) } } @@ -556,6 +574,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ClassesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -573,22 +592,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -600,22 +614,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.nft.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -636,10 +652,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -654,13 +670,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -700,7 +716,10 @@ pub mod msg_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::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"); @@ -714,35 +733,31 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn send( &self, request: tonic::Request, ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -789,10 +804,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -802,6 +817,7 @@ pub mod msg_server { 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)] @@ -814,7 +830,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::send(&inner, request).await }; + let fut = async move { (*inner).send(request).await }; Box::pin(fut) } } @@ -824,6 +840,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SendSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -841,22 +858,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -868,9 +880,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.nft.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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 deleted file mode 100644 index eb94ec55..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.module.v1alpha1.rs +++ /dev/null @@ -1,16 +0,0 @@ -// @generated -/// Module defines the ORM module which adds providers to the app container for -/// ORM ModuleDB's and in the future will automatically register query -/// services for modules that use the ORM. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module {} -impl ::prost::Name for Module { - const NAME: &'static str = "Module"; - const PACKAGE: &'static str = "cosmos.orm.module.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.module.v1alpha1.{}", Self::NAME) - } -} -include!("cosmos.orm.module.v1alpha1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs deleted file mode 100644 index 8e76a8df..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.query.v1alpha1.rs +++ /dev/null @@ -1,194 +0,0 @@ -// @generated -/// GetRequest is the Query/Get request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetRequest { - /// message_name is the fully-qualified message name of the ORM table being queried. - #[prost(string, tag = "1")] - pub message_name: ::prost::alloc::string::String, - /// index is the index fields expression used in orm definitions. If it - /// is empty, the table's primary key is assumed. If it is non-empty, it must - /// refer to an unique index. - #[prost(string, tag = "2")] - pub index: ::prost::alloc::string::String, - /// values are the values of the fields corresponding to the requested index. - /// There must be as many values provided as there are fields in the index and - /// these values must correspond to the index field types. - #[prost(message, repeated, tag = "3")] - pub values: ::prost::alloc::vec::Vec, -} -impl ::prost::Name for GetRequest { - const NAME: &'static str = "GetRequest"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.{}", Self::NAME) - } -} -/// GetResponse is the Query/Get response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GetResponse { - /// result is the result of the get query. If no value is found, the gRPC - /// status code NOT_FOUND will be returned. - #[prost(message, optional, tag = "1")] - pub result: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, -} -impl ::prost::Name for GetResponse { - const NAME: &'static str = "GetResponse"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.{}", Self::NAME) - } -} -/// ListRequest is the Query/List request type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListRequest { - /// message_name is the fully-qualified message name of the ORM table being queried. - #[prost(string, tag = "1")] - pub message_name: ::prost::alloc::string::String, - /// index is the index fields expression used in orm definitions. If it - /// is empty, the table's primary key is assumed. - #[prost(string, tag = "2")] - pub index: ::prost::alloc::string::String, - /// pagination is the pagination request. - #[prost(message, optional, tag = "5")] - pub pagination: ::core::option::Option, - /// query is the query expression corresponding to the provided index. If - /// neither prefix nor range is specified, the query will list all the fields - /// in the index. - #[prost(oneof = "list_request::Query", tags = "3, 4")] - pub query: ::core::option::Option, -} -/// Nested message and enum types in `ListRequest`. -pub mod list_request { - /// Prefix specifies the arguments to a prefix query. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Prefix { - /// values specifies the index values for the prefix query. - /// It is valid to special a partial prefix with fewer values than - /// the number of fields in the index. - #[prost(message, repeated, tag = "1")] - pub values: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Prefix { - const NAME: &'static str = "Prefix"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.ListRequest.{}", Self::NAME) - } - } - /// Range specifies the arguments to a range query. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct Range { - /// start specifies the starting index values for the range query. - /// It is valid to provide fewer values than the number of fields in the - /// index. - #[prost(message, repeated, tag = "1")] - pub start: ::prost::alloc::vec::Vec, - /// end specifies the inclusive ending index values for the range query. - /// It is valid to provide fewer values than the number of fields in the - /// index. - #[prost(message, repeated, tag = "2")] - pub end: ::prost::alloc::vec::Vec, - } - impl ::prost::Name for Range { - const NAME: &'static str = "Range"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.ListRequest.{}", Self::NAME) - } - } - /// query is the query expression corresponding to the provided index. If - /// neither prefix nor range is specified, the query will list all the fields - /// in the index. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Query { - /// prefix defines a prefix query. - #[prost(message, tag = "3")] - Prefix(Prefix), - /// range defines a range query. - #[prost(message, tag = "4")] - Range(Range), - } -} -impl ::prost::Name for ListRequest { - const NAME: &'static str = "ListRequest"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.{}", Self::NAME) - } -} -/// ListResponse is the Query/List response type. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ListResponse { - /// results are the results of the query. - #[prost(message, repeated, tag = "1")] - pub results: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, - /// pagination is the pagination response. - #[prost(message, optional, tag = "5")] - pub pagination: ::core::option::Option, -} -impl ::prost::Name for ListResponse { - const NAME: &'static str = "ListResponse"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.{}", Self::NAME) - } -} -/// IndexValue represents the value of a field in an ORM index expression. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IndexValue { - /// value specifies the index value - #[prost(oneof = "index_value::Value", tags = "1, 2, 3, 4, 5, 6, 7, 8")] - pub value: ::core::option::Option, -} -/// Nested message and enum types in `IndexValue`. -pub mod index_value { - /// value specifies the index value - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Oneof)] - pub enum Value { - /// uint specifies a value for an uint32, fixed32, uint64, or fixed64 - /// index field. - #[prost(uint64, tag = "1")] - Uint(u64), - /// int64 specifies a value for an int32, sfixed32, int64, or sfixed64 - /// index field. - #[prost(int64, tag = "2")] - Int(i64), - /// str specifies a value for a string index field. - #[prost(string, tag = "3")] - Str(::prost::alloc::string::String), - /// bytes specifies a value for a bytes index field. - #[prost(bytes, tag = "4")] - Bytes(::prost::alloc::vec::Vec), - /// enum specifies a value for an enum index field. - #[prost(string, tag = "5")] - Enum(::prost::alloc::string::String), - /// bool specifies a value for a bool index field. - #[prost(bool, tag = "6")] - Bool(bool), - /// timestamp specifies a value for a timestamp index field. - #[prost(message, tag = "7")] - Timestamp(::tendermint_proto::google::protobuf::Timestamp), - /// duration specifies a value for a duration index field. - #[prost(message, tag = "8")] - Duration(::tendermint_proto::google::protobuf::Duration), - } -} -impl ::prost::Name for IndexValue { - const NAME: &'static str = "IndexValue"; - const PACKAGE: &'static str = "cosmos.orm.query.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.query.v1alpha1.{}", Self::NAME) - } -} -include!("cosmos.orm.query.v1alpha1.serde.rs"); -include!("cosmos.orm.query.v1alpha1.tonic.rs"); -// @@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 deleted file mode 100644 index 7c2fa479..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs +++ /dev/null @@ -1,126 +0,0 @@ -// @generated -/// TableDescriptor describes an ORM table. -#[allow(clippy::derive_partial_eq_without_eq)] -#[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, -} -impl ::prost::Name for TableDescriptor { - const NAME: &'static str = "TableDescriptor"; - const PACKAGE: &'static str = "cosmos.orm.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1.{}", Self::NAME) - } -} -/// PrimaryKeyDescriptor describes a table primary key. -#[allow(clippy::derive_partial_eq_without_eq)] -#[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 is encoded such that values with only seconds occupy 6 bytes, - /// values including nanos occupy 9 bytes, and nil values occupy 1 byte. When iterating, nil - /// values will always be ordered last. Seconds and nanos values must conform to the officially - /// specified ranges of 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z and 0 to 999,999,999 respectively. - /// - google.protobuf.Duration is 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, -} -impl ::prost::Name for PrimaryKeyDescriptor { - const NAME: &'static str = "PrimaryKeyDescriptor"; - const PACKAGE: &'static str = "cosmos.orm.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1.{}", Self::NAME) - } -} -/// PrimaryKeyDescriptor describes a table secondary index. -#[allow(clippy::derive_partial_eq_without_eq)] -#[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, -} -impl ::prost::Name for SecondaryIndexDescriptor { - const NAME: &'static str = "SecondaryIndexDescriptor"; - const PACKAGE: &'static str = "cosmos.orm.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1.{}", Self::NAME) - } -} -/// TableDescriptor describes an ORM singleton table which has at most one instance. -#[allow(clippy::derive_partial_eq_without_eq)] -#[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, -} -impl ::prost::Name for SingletonDescriptor { - const NAME: &'static str = "SingletonDescriptor"; - const PACKAGE: &'static str = "cosmos.orm.v1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1.{}", Self::NAME) - } -} -include!("cosmos.orm.v1.serde.rs"); -// @@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 deleted file mode 100644 index b6730a8f..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs +++ /dev/null @@ -1,90 +0,0 @@ -// @generated -/// ModuleSchemaDescriptor describe's a module's ORM schema. -#[allow(clippy::derive_partial_eq_without_eq)] -#[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. - #[allow(clippy::derive_partial_eq_without_eq)] - #[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, - } - impl ::prost::Name for FileEntry { - const NAME: &'static str = "FileEntry"; - const PACKAGE: &'static str = "cosmos.orm.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1alpha1.ModuleSchemaDescriptor.{}", Self::NAME) - } - } -} -impl ::prost::Name for ModuleSchemaDescriptor { - const NAME: &'static str = "ModuleSchemaDescriptor"; - const PACKAGE: &'static str = "cosmos.orm.v1alpha1"; - fn full_name() -> ::prost::alloc::string::String { - ::prost::alloc::format!("cosmos.orm.v1alpha1.{}", Self::NAME) - } -} -/// StorageType -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum StorageType { - /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent storage where all - /// data is stored in the regular Merkle-tree backed KV-store. - 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, -} -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", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Some(Self::DefaultUnspecified), - "STORAGE_TYPE_MEMORY" => Some(Self::Memory), - "STORAGE_TYPE_TRANSIENT" => Some(Self::Transient), - _ => None, - } - } -} -include!("cosmos.orm.v1alpha1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs deleted file mode 100644 index 3ae72e03..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.serde.rs +++ /dev/null @@ -1,352 +0,0 @@ -// @generated -#[cfg(feature = "serde")] -impl serde::Serialize for ModuleSchemaDescriptor { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.schema_file.is_empty() { - len += 1; - } - if !self.prefix.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor", len)?; - if !self.schema_file.is_empty() { - struct_ser.serialize_field("schemaFile", &self.schema_file)?; - } - if !self.prefix.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "prefix", - pbjson::private::base64::encode(&self.prefix).as_str(), - )?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ModuleSchemaDescriptor { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["schema_file", "schemaFile", "prefix"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - SchemaFile, - Prefix, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut core::fmt::Formatter<'_>, - ) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "schemaFile" | "schema_file" => Ok(GeneratedField::SchemaFile), - "prefix" => Ok(GeneratedField::Prefix), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ModuleSchemaDescriptor; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor") - } - - fn visit_map( - self, - mut map_: V, - ) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut schema_file__ = None; - let mut prefix__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::SchemaFile => { - if schema_file__.is_some() { - return Err(serde::de::Error::duplicate_field("schemaFile")); - } - schema_file__ = Some(map_.next_value()?); - } - GeneratedField::Prefix => { - if prefix__.is_some() { - return Err(serde::de::Error::duplicate_field("prefix")); - } - prefix__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(ModuleSchemaDescriptor { - schema_file: schema_file__.unwrap_or_default(), - prefix: prefix__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.v1alpha1.ModuleSchemaDescriptor", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for module_schema_descriptor::FileEntry { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.id != 0 { - len += 1; - } - if !self.proto_file_name.is_empty() { - len += 1; - } - if self.storage_type != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", len)?; - if self.id != 0 { - struct_ser.serialize_field("id", &self.id)?; - } - if !self.proto_file_name.is_empty() { - struct_ser.serialize_field("protoFileName", &self.proto_file_name)?; - } - if self.storage_type != 0 { - let v = StorageType::try_from(self.storage_type).map_err(|_| { - serde::ser::Error::custom(alloc::format!("Invalid variant {}", self.storage_type)) - })?; - struct_ser.serialize_field("storageType", &v)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for module_schema_descriptor::FileEntry { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "id", - "proto_file_name", - "protoFileName", - "storage_type", - "storageType", - ]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Id, - ProtoFileName, - StorageType, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; - - fn expecting( - &self, - formatter: &mut core::fmt::Formatter<'_>, - ) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "id" => Ok(GeneratedField::Id), - "protoFileName" | "proto_file_name" => { - Ok(GeneratedField::ProtoFileName) - } - "storageType" | "storage_type" => Ok(GeneratedField::StorageType), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = module_schema_descriptor::FileEntry; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - formatter.write_str("struct cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry") - } - - fn visit_map( - self, - mut map_: V, - ) -> core::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut id__ = None; - let mut proto_file_name__ = None; - let mut storage_type__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Id => { - if id__.is_some() { - return Err(serde::de::Error::duplicate_field("id")); - } - id__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProtoFileName => { - if proto_file_name__.is_some() { - return Err(serde::de::Error::duplicate_field("protoFileName")); - } - proto_file_name__ = Some(map_.next_value()?); - } - GeneratedField::StorageType => { - if storage_type__.is_some() { - return Err(serde::de::Error::duplicate_field("storageType")); - } - storage_type__ = Some(map_.next_value::()? as i32); - } - } - } - Ok(module_schema_descriptor::FileEntry { - id: id__.unwrap_or_default(), - proto_file_name: proto_file_name__.unwrap_or_default(), - storage_type: storage_type__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.orm.v1alpha1.ModuleSchemaDescriptor.FileEntry", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for StorageType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> core::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", - Self::Memory => "STORAGE_TYPE_MEMORY", - Self::Transient => "STORAGE_TYPE_TRANSIENT", - }; - serializer.serialize_str(variant) - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for StorageType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> core::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "STORAGE_TYPE_DEFAULT_UNSPECIFIED", - "STORAGE_TYPE_MEMORY", - "STORAGE_TYPE_TRANSIENT", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = StorageType; - - fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - fn visit_i64(self, v: i64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Signed(v), &self) - }) - } - - fn visit_u64(self, v: u64) -> core::result::Result - where - E: serde::de::Error, - { - i32::try_from(v) - .ok() - .and_then(|x| x.try_into().ok()) - .ok_or_else(|| { - serde::de::Error::invalid_value(serde::de::Unexpected::Unsigned(v), &self) - }) - } - - fn visit_str(self, value: &str) -> core::result::Result - where - E: serde::de::Error, - { - match value { - "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Ok(StorageType::DefaultUnspecified), - "STORAGE_TYPE_MEMORY" => Ok(StorageType::Memory), - "STORAGE_TYPE_TRANSIENT" => Ok(StorageType::Transient), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} 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 748e0e4d..58068bbd 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 @@ -71,8 +71,6 @@ impl ::prost::Name for QueryParamsResponse { } /// QuerySubspacesRequest defines a request type for querying for all registered /// subspaces and all keys for a subspace. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesRequest {} @@ -85,8 +83,6 @@ impl ::prost::Name for QuerySubspacesRequest { } /// QuerySubspacesResponse defines the response types for querying for all /// registered subspaces and all keys for a subspace. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QuerySubspacesResponse { @@ -102,8 +98,6 @@ impl ::prost::Name for QuerySubspacesResponse { } /// Subspace defines a parameter subspace name and all the keys that exist for /// the subspace. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Subspace { 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 87cb0971..15c8edfd 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.params.v1beta1.Query/Params"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -127,17 +127,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn params( &self, request: tonic::Request, @@ -148,18 +142,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -206,10 +202,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -219,6 +215,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.params.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] @@ -231,7 +228,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -241,6 +238,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -268,7 +266,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::subspaces(&inner, request).await }; + let fut = async move { (*inner).subspaces(request).await }; Box::pin(fut) } } @@ -278,6 +276,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SubspacesSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -295,22 +294,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -322,9 +316,17 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.params.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.params.v1beta1.Query"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.rs new file mode 100644 index 00000000..552e2f7c --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.rs @@ -0,0 +1,18 @@ +// @generated +/// Module is the config object of the consensus module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Module { + /// authority defines the custom module authority. If not set, defaults to the governance module. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, +} +impl ::prost::Name for Module { + const NAME: &'static str = "Module"; + const PACKAGE: &'static str = "cosmos.protocolpool.module.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.module.v1.{}", Self::NAME) + } +} +include!("cosmos.protocolpool.module.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.serde.rs new file mode 100644 index 00000000..1fcb8473 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.module.v1.serde.rs @@ -0,0 +1,101 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for Module { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.module.v1.Module", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Module { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Module; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.module.v1.Module") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + } + } + Ok(Module { + authority: authority__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.module.v1.Module", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.rs new file mode 100644 index 00000000..81cb57ea --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.rs @@ -0,0 +1,346 @@ +// @generated +/// ContinuousFund defines the fields of continuous fund proposal. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ContinuousFund { + /// Recipient is the address string of the account receiving funds. + #[prost(string, tag = "1")] + pub recipient: ::prost::alloc::string::String, + /// Percentage is the percentage of funds to be allocated from Community pool. + #[prost(string, tag = "2")] + pub percentage: ::prost::alloc::string::String, + /// Optional, if expiry is set, removes the state object when expired. + #[prost(message, optional, tag = "3")] + pub expiry: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, +} +impl ::prost::Name for ContinuousFund { + const NAME: &'static str = "ContinuousFund"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// Params defines the parameters for the protocolpool module. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// EnabledDistributionDenoms lists the denoms that are allowed to be distributed. + /// This is to avoid spending time distributing undesired tokens to continuous funds and budgets. + #[prost(string, repeated, tag = "1")] + pub enabled_distribution_denoms: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// DistributionFrequency is the frequency (in terms of blocks) that funds are distributed out from the + /// x/protocolpool module. + #[prost(uint64, tag = "2")] + pub distribution_frequency: u64, +} +impl ::prost::Name for Params { + const NAME: &'static str = "Params"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// GenesisState defines the protocolpool module's genesis state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// ContinuousFunds defines the continuous funds at genesis. + #[prost(message, repeated, tag = "1")] + pub continuous_funds: ::prost::alloc::vec::Vec, + /// Params defines the parameters of this module, currently only contains the + /// denoms that will be used for continuous fund distributions. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for GenesisState { + const NAME: &'static str = "GenesisState"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryCommunityPoolRequest is the request type for the Query/CommunityPool RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCommunityPoolRequest {} +impl ::prost::Name for QueryCommunityPoolRequest { + const NAME: &'static str = "QueryCommunityPoolRequest"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryCommunityPoolResponse is the response type for the Query/CommunityPool +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCommunityPoolResponse { + /// pool defines community pool's coins. + #[prost(message, repeated, tag = "1")] + pub pool: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryCommunityPoolResponse { + const NAME: &'static str = "QueryCommunityPoolResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryContinuousFundRequest is the request type for the Query/ContinuousFund +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryContinuousFundRequest { + /// recipient is the recipient address to query unclaimed budget amount for. + #[prost(string, tag = "1")] + pub recipient: ::prost::alloc::string::String, +} +impl ::prost::Name for QueryContinuousFundRequest { + const NAME: &'static str = "QueryContinuousFundRequest"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFund +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryContinuousFundResponse { + /// ContinuousFunds is the given continuous fund returned in the query. + #[prost(message, optional, tag = "1")] + pub continuous_fund: ::core::option::Option, +} +impl ::prost::Name for QueryContinuousFundResponse { + const NAME: &'static str = "QueryContinuousFundResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryContinuousFundRequest is the request type for the Query/ContinuousFunds +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryContinuousFundsRequest {} +impl ::prost::Name for QueryContinuousFundsRequest { + const NAME: &'static str = "QueryContinuousFundsRequest"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryUnclaimedBudgetResponse is the response type for the Query/ContinuousFunds +/// RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryContinuousFundsResponse { + /// ContinuousFunds defines all continuous funds in state. + #[prost(message, repeated, tag = "1")] + pub continuous_funds: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for QueryContinuousFundsResponse { + const NAME: &'static str = "QueryContinuousFundsResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryParamsRequest is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsRequest {} +impl ::prost::Name for QueryParamsRequest { + const NAME: &'static str = "QueryParamsRequest"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// QueryParamsResponse is the response type for the Query/Params RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryParamsResponse { + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} +impl ::prost::Name for QueryParamsResponse { + const NAME: &'static str = "QueryParamsResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgFundCommunityPool allows an account to directly +/// fund the community pool. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgFundCommunityPool { + #[prost(string, tag = "1")] + pub depositor: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "2")] + pub amount: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgFundCommunityPool { + const NAME: &'static str = "MsgFundCommunityPool"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgFundCommunityPoolResponse defines the Msg/FundCommunityPool response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgFundCommunityPoolResponse {} +impl ::prost::Name for MsgFundCommunityPoolResponse { + const NAME: &'static str = "MsgFundCommunityPoolResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCommunityPoolSpend defines a message for sending tokens from the community +/// pool to another account. This message is typically executed via a governance +/// proposal with the governance module being the executing authority. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCommunityPoolSpend { + /// Authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub recipient: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgCommunityPoolSpend { + const NAME: &'static str = "MsgCommunityPoolSpend"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCommunityPoolSpendResponse defines the response to executing a +/// MsgCommunityPoolSpend message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCommunityPoolSpendResponse {} +impl ::prost::Name for MsgCommunityPoolSpendResponse { + const NAME: &'static str = "MsgCommunityPoolSpendResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCreateContinuousFund defines a message for adding continuous funds. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateContinuousFund { + /// Authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Recipient address of the account receiving funds. + #[prost(string, tag = "2")] + pub recipient: ::prost::alloc::string::String, + /// Percentage is the percentage of funds to be allocated from Community pool. + #[prost(string, tag = "3")] + pub percentage: ::prost::alloc::string::String, + /// Optional, if expiry is set, removes the state object when expired. + #[prost(message, optional, tag = "4")] + pub expiry: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, +} +impl ::prost::Name for MsgCreateContinuousFund { + const NAME: &'static str = "MsgCreateContinuousFund"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCreateContinuousFundResponse defines the response to executing a +/// MsgCreateContinuousFund message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCreateContinuousFundResponse {} +impl ::prost::Name for MsgCreateContinuousFundResponse { + const NAME: &'static str = "MsgCreateContinuousFundResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCancelContinuousFund defines a message to cancel continuous funds for a specific recipient. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelContinuousFund { + /// Authority is the account address of authority. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// Recipient is the account address string of the recipient whose funds are to be cancelled. + #[prost(string, tag = "2")] + pub recipient: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgCancelContinuousFund { + const NAME: &'static str = "MsgCancelContinuousFund"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgCancelContinuousFundResponse defines the response to executing a +/// MsgCancelContinuousFund message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgCancelContinuousFundResponse { + /// CanceledTime is the canceled time. + #[prost(message, optional, tag = "1")] + pub canceled_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, + /// CanceledHeight defines the canceled block height. + #[prost(uint64, tag = "2")] + pub canceled_height: u64, + /// Recipient is the account address string of the recipient whose funds are cancelled. + #[prost(string, tag = "3")] + pub recipient: ::prost::alloc::string::String, +} +impl ::prost::Name for MsgCancelContinuousFundResponse { + const NAME: &'static str = "MsgCancelContinuousFundResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgUpdateParams is the Msg/UpdateParams request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the x/protocolpool parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +impl ::prost::Name for MsgUpdateParams { + const NAME: &'static str = "MsgUpdateParams"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +impl ::prost::Name for MsgUpdateParamsResponse { + const NAME: &'static str = "MsgUpdateParamsResponse"; + const PACKAGE: &'static str = "cosmos.protocolpool.v1"; + fn full_name() -> ::prost::alloc::string::String { + ::prost::alloc::format!("cosmos.protocolpool.v1.{}", Self::NAME) + } +} +include!("cosmos.protocolpool.v1.serde.rs"); +include!("cosmos.protocolpool.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.serde.rs new file mode 100644 index 00000000..f69ee138 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.serde.rs @@ -0,0 +1,2267 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ContinuousFund { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.recipient.is_empty() { + len += 1; + } + if !self.percentage.is_empty() { + len += 1; + } + if self.expiry.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.ContinuousFund", len)?; + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if !self.percentage.is_empty() { + struct_ser.serialize_field("percentage", &self.percentage)?; + } + if let Some(v) = self.expiry.as_ref() { + struct_ser.serialize_field("expiry", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ContinuousFund { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["recipient", "percentage", "expiry"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Recipient, + Percentage, + Expiry, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "recipient" => Ok(GeneratedField::Recipient), + "percentage" => Ok(GeneratedField::Percentage), + "expiry" => Ok(GeneratedField::Expiry), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ContinuousFund; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.ContinuousFund") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut recipient__ = None; + let mut percentage__ = None; + let mut expiry__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Percentage => { + if percentage__.is_some() { + return Err(serde::de::Error::duplicate_field("percentage")); + } + percentage__ = Some(map_.next_value()?); + } + GeneratedField::Expiry => { + if expiry__.is_some() { + return Err(serde::de::Error::duplicate_field("expiry")); + } + expiry__ = map_.next_value()?; + } + } + } + Ok(ContinuousFund { + recipient: recipient__.unwrap_or_default(), + percentage: percentage__.unwrap_or_default(), + expiry: expiry__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.ContinuousFund", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.continuous_funds.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.GenesisState", len)?; + if !self.continuous_funds.is_empty() { + struct_ser.serialize_field("continuousFunds", &self.continuous_funds)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["continuous_funds", "continuousFunds", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ContinuousFunds, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "continuousFunds" | "continuous_funds" => { + Ok(GeneratedField::ContinuousFunds) + } + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisState; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut continuous_funds__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ContinuousFunds => { + if continuous_funds__.is_some() { + return Err(serde::de::Error::duplicate_field("continuousFunds")); + } + continuous_funds__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(GenesisState { + continuous_funds: continuous_funds__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.GenesisState", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelContinuousFund { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgCancelContinuousFund", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelContinuousFund { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "recipient"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Recipient, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "recipient" => Ok(GeneratedField::Recipient), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelContinuousFund; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCancelContinuousFund") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut recipient__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCancelContinuousFund { + authority: authority__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCancelContinuousFund", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelContinuousFundResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.canceled_time.is_some() { + len += 1; + } + if self.canceled_height != 0 { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse", + len, + )?; + if let Some(v) = self.canceled_time.as_ref() { + struct_ser.serialize_field("canceledTime", v)?; + } + if self.canceled_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "canceledHeight", + alloc::string::ToString::to_string(&self.canceled_height).as_str(), + )?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelContinuousFundResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "canceled_time", + "canceledTime", + "canceled_height", + "canceledHeight", + "recipient", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CanceledTime, + CanceledHeight, + Recipient, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "canceledTime" | "canceled_time" => Ok(GeneratedField::CanceledTime), + "canceledHeight" | "canceled_height" => { + Ok(GeneratedField::CanceledHeight) + } + "recipient" => Ok(GeneratedField::Recipient), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelContinuousFundResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCancelContinuousFundResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut canceled_time__ = None; + let mut canceled_height__ = None; + let mut recipient__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CanceledTime => { + if canceled_time__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledTime")); + } + canceled_time__ = map_.next_value()?; + } + GeneratedField::CanceledHeight => { + if canceled_height__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledHeight")); + } + canceled_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCancelContinuousFundResponse { + canceled_time: canceled_time__, + canceled_height: canceled_height__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCancelContinuousFundResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCommunityPoolSpend { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgCommunityPoolSpend", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpend { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "recipient", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Recipient, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "recipient" => Ok(GeneratedField::Recipient), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCommunityPoolSpend; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCommunityPoolSpend") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut recipient__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCommunityPoolSpend { + authority: authority__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCommunityPoolSpend", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCommunityPoolSpendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCommunityPoolSpendResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCommunityPoolSpendResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCommunityPoolSpendResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateContinuousFund { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if !self.recipient.is_empty() { + len += 1; + } + if !self.percentage.is_empty() { + len += 1; + } + if self.expiry.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgCreateContinuousFund", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + if !self.percentage.is_empty() { + struct_ser.serialize_field("percentage", &self.percentage)?; + } + if let Some(v) = self.expiry.as_ref() { + struct_ser.serialize_field("expiry", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateContinuousFund { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "recipient", "percentage", "expiry"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Recipient, + Percentage, + Expiry, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "recipient" => Ok(GeneratedField::Recipient), + "percentage" => Ok(GeneratedField::Percentage), + "expiry" => Ok(GeneratedField::Expiry), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateContinuousFund; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCreateContinuousFund") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut recipient__ = None; + let mut percentage__ = None; + let mut expiry__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + GeneratedField::Percentage => { + if percentage__.is_some() { + return Err(serde::de::Error::duplicate_field("percentage")); + } + percentage__ = Some(map_.next_value()?); + } + GeneratedField::Expiry => { + if expiry__.is_some() { + return Err(serde::de::Error::duplicate_field("expiry")); + } + expiry__ = map_.next_value()?; + } + } + } + Ok(MsgCreateContinuousFund { + authority: authority__.unwrap_or_default(), + recipient: recipient__.unwrap_or_default(), + percentage: percentage__.unwrap_or_default(), + expiry: expiry__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCreateContinuousFund", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCreateContinuousFundResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct( + "cosmos.protocolpool.v1.MsgCreateContinuousFundResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCreateContinuousFundResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCreateContinuousFundResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgCreateContinuousFundResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgCreateContinuousFundResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgCreateContinuousFundResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgFundCommunityPool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.depositor.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgFundCommunityPool", len)?; + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["depositor", "amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Depositor, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "depositor" => Ok(GeneratedField::Depositor), + "amount" => Ok(GeneratedField::Amount), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgFundCommunityPool; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgFundCommunityPool") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut depositor__ = None; + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Depositor => { + if depositor__.is_some() { + return Err(serde::de::Error::duplicate_field("depositor")); + } + depositor__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgFundCommunityPool { + depositor: depositor__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgFundCommunityPool", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgFundCommunityPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.MsgFundCommunityPoolResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgFundCommunityPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgFundCommunityPoolResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgFundCommunityPoolResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgFundCommunityPoolResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgFundCommunityPoolResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgUpdateParams", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); + } + authority__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.MsgUpdateParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.enabled_distribution_denoms.is_empty() { + len += 1; + } + if self.distribution_frequency != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.protocolpool.v1.Params", len)?; + if !self.enabled_distribution_denoms.is_empty() { + struct_ser.serialize_field( + "enabledDistributionDenoms", + &self.enabled_distribution_denoms, + )?; + } + if self.distribution_frequency != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "distributionFrequency", + alloc::string::ToString::to_string(&self.distribution_frequency).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "enabled_distribution_denoms", + "enabledDistributionDenoms", + "distribution_frequency", + "distributionFrequency", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EnabledDistributionDenoms, + DistributionFrequency, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "enabledDistributionDenoms" | "enabled_distribution_denoms" => { + Ok(GeneratedField::EnabledDistributionDenoms) + } + "distributionFrequency" | "distribution_frequency" => { + Ok(GeneratedField::DistributionFrequency) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Params; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.Params") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut enabled_distribution_denoms__ = None; + let mut distribution_frequency__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EnabledDistributionDenoms => { + if enabled_distribution_denoms__.is_some() { + return Err(serde::de::Error::duplicate_field( + "enabledDistributionDenoms", + )); + } + enabled_distribution_denoms__ = Some(map_.next_value()?); + } + GeneratedField::DistributionFrequency => { + if distribution_frequency__.is_some() { + return Err(serde::de::Error::duplicate_field( + "distributionFrequency", + )); + } + distribution_frequency__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Params { + enabled_distribution_denoms: enabled_distribution_denoms__.unwrap_or_default(), + distribution_frequency: distribution_frequency__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.protocolpool.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCommunityPoolRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.QueryCommunityPoolRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCommunityPoolRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryCommunityPoolRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryCommunityPoolRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryCommunityPoolRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryCommunityPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.pool.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.QueryCommunityPoolResponse", len)?; + if !self.pool.is_empty() { + struct_ser.serialize_field("pool", &self.pool)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryCommunityPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pool"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pool, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "pool" => Ok(GeneratedField::Pool), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryCommunityPoolResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryCommunityPoolResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pool__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pool => { + if pool__.is_some() { + return Err(serde::de::Error::duplicate_field("pool")); + } + pool__ = Some(map_.next_value()?); + } + } + } + Ok(QueryCommunityPoolResponse { + pool: pool__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryCommunityPoolResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContinuousFundRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.recipient.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.QueryContinuousFundRequest", len)?; + if !self.recipient.is_empty() { + struct_ser.serialize_field("recipient", &self.recipient)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContinuousFundRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["recipient"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Recipient, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "recipient" => Ok(GeneratedField::Recipient), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryContinuousFundRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryContinuousFundRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut recipient__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Recipient => { + if recipient__.is_some() { + return Err(serde::de::Error::duplicate_field("recipient")); + } + recipient__ = Some(map_.next_value()?); + } + } + } + Ok(QueryContinuousFundRequest { + recipient: recipient__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryContinuousFundRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContinuousFundResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.continuous_fund.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.QueryContinuousFundResponse", len)?; + if let Some(v) = self.continuous_fund.as_ref() { + struct_ser.serialize_field("continuousFund", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContinuousFundResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["continuous_fund", "continuousFund"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ContinuousFund, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "continuousFund" | "continuous_fund" => { + Ok(GeneratedField::ContinuousFund) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryContinuousFundResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryContinuousFundResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut continuous_fund__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ContinuousFund => { + if continuous_fund__.is_some() { + return Err(serde::de::Error::duplicate_field("continuousFund")); + } + continuous_fund__ = map_.next_value()?; + } + } + } + Ok(QueryContinuousFundResponse { + continuous_fund: continuous_fund__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryContinuousFundResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContinuousFundsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.QueryContinuousFundsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContinuousFundsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryContinuousFundsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryContinuousFundsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryContinuousFundsRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryContinuousFundsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryContinuousFundsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.continuous_funds.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.protocolpool.v1.QueryContinuousFundsResponse", len)?; + if !self.continuous_funds.is_empty() { + struct_ser.serialize_field("continuousFunds", &self.continuous_funds)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryContinuousFundsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["continuous_funds", "continuousFunds"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ContinuousFunds, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "continuousFunds" | "continuous_funds" => { + Ok(GeneratedField::ContinuousFunds) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryContinuousFundsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryContinuousFundsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut continuous_funds__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ContinuousFunds => { + if continuous_funds__.is_some() { + return Err(serde::de::Error::duplicate_field("continuousFunds")); + } + continuous_funds__ = Some(map_.next_value()?); + } + } + } + Ok(QueryContinuousFundsResponse { + continuous_funds: continuous_funds__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryContinuousFundsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.QueryParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField {} + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryParamsRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryParamsRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryParamsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.protocolpool.v1.QueryParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut core::fmt::Formatter<'_>, + ) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryParamsResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct cosmos.protocolpool.v1.QueryParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(QueryParamsResponse { params: params__ }) + } + } + deserializer.deserialize_struct( + "cosmos.protocolpool.v1.QueryParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.tonic.rs new file mode 100644 index 00000000..8fe22130 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.protocolpool.v1.tonic.rs @@ -0,0 +1,1015 @@ +// @generated +/// Generated client implementations. +#[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")] + impl QueryClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl QueryClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor( + inner: T, + interceptor: F, + ) -> QueryClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + QueryClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn community_pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.protocolpool.v1.Query/CommunityPool"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Query", + "CommunityPool", + )); + self.inner.unary(req, path, codec).await + } + pub async fn continuous_fund( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Query/ContinuousFund", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Query", + "ContinuousFund", + )); + self.inner.unary(req, path, codec).await + } + pub async fn continuous_funds( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Query/ContinuousFunds", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Query", + "ContinuousFunds", + )); + self.inner.unary(req, path, codec).await + } + pub async fn params( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.protocolpool.v1.Query/Params"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.protocolpool.v1.Query", "Params")); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[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 community_pool( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + async fn continuous_fund( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + async fn continuous_funds( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + async fn params( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct QueryServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl QueryServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for QueryServer + where + T: Query, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.protocolpool.v1.Query/CommunityPool" => { + #[allow(non_camel_case_types)] + struct CommunityPoolSvc(pub Arc); + impl tonic::server::UnaryService + for CommunityPoolSvc + { + type Response = super::QueryCommunityPoolResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).community_pool(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommunityPoolSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Query/ContinuousFund" => { + #[allow(non_camel_case_types)] + struct ContinuousFundSvc(pub Arc); + impl tonic::server::UnaryService + for ContinuousFundSvc + { + type Response = super::QueryContinuousFundResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).continuous_fund(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ContinuousFundSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Query/ContinuousFunds" => { + #[allow(non_camel_case_types)] + struct ContinuousFundsSvc(pub Arc); + impl tonic::server::UnaryService + for ContinuousFundsSvc + { + type Response = super::QueryContinuousFundsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).continuous_funds(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ContinuousFundsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.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 = Arc::clone(&self.0); + 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 max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.protocolpool.v1.Query"; + } +} +/// Generated client implementations. +#[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")] + impl MsgClient { + /// Attempt to create a new client by connecting to a given endpoint. + pub async fn connect(dst: D) -> Result + where + D: TryInto, + D::Error: Into, + { + let conn = tonic::transport::Endpoint::new(dst)?.connect().await?; + Ok(Self::new(conn)) + } + } + impl MsgClient + where + T: tonic::client::GrpcService, + T::Error: Into, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, + { + pub fn new(inner: T) -> Self { + let inner = tonic::client::Grpc::new(inner); + Self { inner } + } + pub fn with_origin(inner: T, origin: Uri) -> Self { + let inner = tonic::client::Grpc::with_origin(inner, origin); + Self { inner } + } + pub fn with_interceptor(inner: T, interceptor: F) -> MsgClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + MsgClient::new(InterceptedService::new(inner, interceptor)) + } + /// Compress requests with the given encoding. + /// + /// This requires the server to support it otherwise it might respond with an + /// error. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.send_compressed(encoding); + self + } + /// Enable decompressing responses. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.inner = self.inner.accept_compressed(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_decoding_message_size(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.inner = self.inner.max_encoding_message_size(limit); + self + } + pub async fn fund_community_pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Msg/FundCommunityPool", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Msg", + "FundCommunityPool", + )); + self.inner.unary(req, path, codec).await + } + pub async fn community_pool_spend( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Msg", + "CommunityPoolSpend", + )); + self.inner.unary(req, path, codec).await + } + pub async fn create_continuous_fund( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Msg/CreateContinuousFund", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Msg", + "CreateContinuousFund", + )); + self.inner.unary(req, path, codec).await + } + pub async fn cancel_continuous_fund( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.protocolpool.v1.Msg/CancelContinuousFund", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Msg", + "CancelContinuousFund", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> core::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.protocolpool.v1.Msg/UpdateParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.protocolpool.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[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 fund_community_pool( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + async fn community_pool_spend( + &self, + request: tonic::Request, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + >; + async fn create_continuous_fund( + &self, + request: tonic::Request, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + >; + async fn cancel_continuous_fund( + &self, + request: tonic::Request, + ) -> core::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_params( + &self, + request: tonic::Request, + ) -> core::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/cosmos.protocolpool.v1.Msg/FundCommunityPool" => { + #[allow(non_camel_case_types)] + struct FundCommunityPoolSvc(pub Arc); + impl tonic::server::UnaryService for FundCommunityPoolSvc { + type Response = super::MsgFundCommunityPoolResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).fund_community_pool(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = FundCommunityPoolSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Msg/CommunityPoolSpend" => { + #[allow(non_camel_case_types)] + struct CommunityPoolSpendSvc(pub Arc); + impl tonic::server::UnaryService + for CommunityPoolSpendSvc + { + type Response = super::MsgCommunityPoolSpendResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).community_pool_spend(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CommunityPoolSpendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Msg/CreateContinuousFund" => { + #[allow(non_camel_case_types)] + struct CreateContinuousFundSvc(pub Arc); + impl tonic::server::UnaryService + for CreateContinuousFundSvc + { + type Response = super::MsgCreateContinuousFundResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).create_continuous_fund(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CreateContinuousFundSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Msg/CancelContinuousFund" => { + #[allow(non_camel_case_types)] + struct CancelContinuousFundSvc(pub Arc); + impl tonic::server::UnaryService + for CancelContinuousFundSvc + { + type Response = super::MsgCancelContinuousFundResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).cancel_continuous_fund(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = CancelContinuousFundSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/cosmos.protocolpool.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.protocolpool.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs index e62c46bc..8e9523fb 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.reflection.v1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod reflection_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /** Package cosmos.reflection.v1 provides support for inspecting protobuf @@ -32,10 +26,10 @@ pub mod reflection_service_client { } impl ReflectionServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -53,13 +47,13 @@ pub mod reflection_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ReflectionServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -103,7 +97,10 @@ pub mod reflection_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -121,17 +118,11 @@ pub mod reflection_service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod reflection_service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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 ReflectionServiceServer. #[async_trait] - pub trait ReflectionService: std::marker::Send + std::marker::Sync + 'static { + pub trait ReflectionService: Send + Sync + 'static { /** FileDescriptors queries all the file descriptors in the app in order to enable easier generation of dynamic clients. */ @@ -144,18 +135,20 @@ pub mod reflection_service_server { file descriptors. */ #[derive(Debug)] - pub struct ReflectionServiceServer { - inner: Arc, + pub struct ReflectionServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ReflectionServiceServer { + struct _Inner(Arc); + impl ReflectionServiceServer { 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(), @@ -202,10 +195,10 @@ pub mod reflection_service_server { impl tonic::codegen::Service> for ReflectionServiceServer where T: ReflectionService, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -215,6 +208,7 @@ pub mod reflection_service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.reflection.v1.ReflectionService/FileDescriptors" => { #[allow(non_camel_case_types)] @@ -230,9 +224,7 @@ pub mod reflection_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::file_descriptors(&inner, request).await - }; + let fut = async move { (*inner).file_descriptors(request).await }; Box::pin(fut) } } @@ -242,6 +234,7 @@ pub mod reflection_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = FileDescriptorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -259,22 +252,17 @@ pub mod reflection_service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ReflectionServiceServer { + impl Clone for ReflectionServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -286,9 +274,17 @@ pub mod reflection_service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.reflection.v1.ReflectionService"; - impl tonic::server::NamedService for ReflectionServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ReflectionServiceServer { + const NAME: &'static str = "cosmos.reflection.v1.ReflectionService"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs index 8cb3cadc..ed0ec99f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.rs @@ -251,8 +251,6 @@ impl ::prost::Name for MsgUnjailResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -274,8 +272,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs index 5639b5ef..a394b4d6 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.slashing.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -113,7 +110,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -131,7 +131,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -148,17 +151,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn params( &self, request: tonic::Request, @@ -173,18 +170,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -231,10 +230,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -244,6 +243,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.slashing.v1beta1.Query/Params" => { #[allow(non_camel_case_types)] @@ -256,7 +256,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -266,6 +266,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -293,8 +294,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::signing_info(&inner, request).await }; + let fut = async move { (*inner).signing_info(request).await }; Box::pin(fut) } } @@ -304,6 +304,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SigningInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -331,8 +332,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::signing_infos(&inner, request).await }; + let fut = async move { (*inner).signing_infos(request).await }; Box::pin(fut) } } @@ -342,6 +342,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SigningInfosSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -359,22 +360,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -386,22 +382,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.slashing.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.slashing.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -422,10 +420,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -440,13 +438,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -487,7 +485,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.slashing.v1beta1.Msg/Unjail"); @@ -502,7 +503,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -519,17 +523,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn unjail( &self, request: tonic::Request, @@ -540,18 +538,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -598,10 +598,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -611,6 +611,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.slashing.v1beta1.Msg/Unjail" => { #[allow(non_camel_case_types)] @@ -623,7 +624,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::unjail(&inner, request).await }; + let fut = async move { (*inner).unjail(request).await }; Box::pin(fut) } } @@ -633,6 +634,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UnjailSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -660,8 +662,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -671,6 +672,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -688,22 +690,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -715,9 +712,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.slashing.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.slashing.v1beta1.Msg"; } } 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 2bf9c410..3ef5f765 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 @@ -1,7 +1,5 @@ // @generated /// StakeAuthorization defines authorization for delegate/undelegate/redelegate. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StakeAuthorization { @@ -53,8 +51,6 @@ impl ::prost::Name for StakeAuthorization { } } /// AuthorizationType defines the type of staking module authorization type -/// -/// Since: cosmos-sdk 0.43 #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum AuthorizationType { @@ -227,8 +223,6 @@ 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, /// strictly positive if this validator's unbonding has been stopped by external modules @@ -1351,8 +1345,6 @@ pub struct MsgUndelegateResponse { #[prost(message, optional, tag = "1")] pub completion_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// amount returns the amount of undelegated coins - /// - /// Since: cosmos-sdk 0.50 #[prost(message, optional, tag = "2")] pub amount: ::core::option::Option, } @@ -1364,8 +1356,6 @@ impl ::prost::Name for MsgUndelegateResponse { } } /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegation { @@ -1388,8 +1378,6 @@ impl ::prost::Name for MsgCancelUnbondingDelegation { } } /// MsgCancelUnbondingDelegationResponse -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUnbondingDelegationResponse {} @@ -1401,8 +1389,6 @@ impl ::prost::Name for MsgCancelUnbondingDelegationResponse { } } /// MsgUpdateParams is the Msg/UpdateParams request type. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParams { @@ -1424,8 +1410,6 @@ impl ::prost::Name for MsgUpdateParams { } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} 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 bb587853..6da899d8 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -115,7 +112,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -133,7 +133,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -154,7 +157,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -173,7 +179,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -193,7 +202,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -214,7 +226,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -235,7 +250,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -254,7 +272,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -274,7 +295,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -295,7 +319,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -314,7 +341,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -333,7 +363,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Pool"); @@ -348,7 +381,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Query/Params"); @@ -362,17 +398,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn validators( &self, request: tonic::Request, @@ -452,18 +482,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -510,10 +542,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -523,6 +555,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.staking.v1beta1.Query/Validators" => { #[allow(non_camel_case_types)] @@ -535,8 +568,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::validators(&inner, request).await }; + let fut = async move { (*inner).validators(request).await }; Box::pin(fut) } } @@ -546,6 +578,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -573,7 +606,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::validator(&inner, request).await }; + let fut = async move { (*inner).validator(request).await }; Box::pin(fut) } } @@ -583,6 +616,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -613,9 +647,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::validator_delegations(&inner, request).await - }; + let fut = async move { (*inner).validator_delegations(request).await }; Box::pin(fut) } } @@ -625,6 +657,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -659,7 +692,7 @@ pub mod query_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::validator_unbonding_delegations(&inner, request).await + (*inner).validator_unbonding_delegations(request).await }; Box::pin(fut) } @@ -670,6 +703,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ValidatorUnbondingDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -697,8 +731,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::delegation(&inner, request).await }; + let fut = async move { (*inner).delegation(request).await }; Box::pin(fut) } } @@ -708,6 +741,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -738,9 +772,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::unbonding_delegation(&inner, request).await - }; + let fut = async move { (*inner).unbonding_delegation(request).await }; Box::pin(fut) } } @@ -750,6 +782,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UnbondingDelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -780,9 +813,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_delegations(&inner, request).await - }; + let fut = async move { (*inner).delegator_delegations(request).await }; Box::pin(fut) } } @@ -792,6 +823,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -826,7 +858,7 @@ pub mod query_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::delegator_unbonding_delegations(&inner, request).await + (*inner).delegator_unbonding_delegations(request).await }; Box::pin(fut) } @@ -837,6 +869,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorUnbondingDelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -866,8 +899,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::redelegations(&inner, request).await }; + let fut = async move { (*inner).redelegations(request).await }; Box::pin(fut) } } @@ -877,6 +909,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = RedelegationsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -907,9 +940,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_validators(&inner, request).await - }; + let fut = async move { (*inner).delegator_validators(request).await }; Box::pin(fut) } } @@ -919,6 +950,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorValidatorsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -949,9 +981,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::delegator_validator(&inner, request).await - }; + let fut = async move { (*inner).delegator_validator(request).await }; Box::pin(fut) } } @@ -961,6 +991,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegatorValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -990,8 +1021,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::historical_info(&inner, request).await }; + let fut = async move { (*inner).historical_info(request).await }; Box::pin(fut) } } @@ -1001,6 +1031,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = HistoricalInfoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1028,7 +1059,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::pool(&inner, request).await }; + let fut = async move { (*inner).pool(request).await }; Box::pin(fut) } } @@ -1038,6 +1069,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = PoolSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1065,7 +1097,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::params(&inner, request).await }; + let fut = async move { (*inner).params(request).await }; Box::pin(fut) } } @@ -1075,6 +1107,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1092,22 +1125,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1119,22 +1147,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.staking.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.staking.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -1155,10 +1185,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -1173,13 +1203,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -1220,7 +1250,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1238,7 +1271,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1256,7 +1292,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.staking.v1beta1.Msg/Delegate"); @@ -1271,7 +1310,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1289,7 +1331,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1307,7 +1352,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -1326,7 +1374,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -1343,17 +1394,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn create_validator( &self, request: tonic::Request, @@ -1387,18 +1432,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -1445,10 +1492,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -1458,6 +1505,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.staking.v1beta1.Msg/CreateValidator" => { #[allow(non_camel_case_types)] @@ -1470,8 +1518,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::create_validator(&inner, request).await }; + let fut = async move { (*inner).create_validator(request).await }; Box::pin(fut) } } @@ -1481,6 +1528,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreateValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1508,8 +1556,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::edit_validator(&inner, request).await }; + let fut = async move { (*inner).edit_validator(request).await }; Box::pin(fut) } } @@ -1519,6 +1566,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = EditValidatorSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1546,7 +1594,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::delegate(&inner, request).await }; + let fut = async move { (*inner).delegate(request).await }; Box::pin(fut) } } @@ -1556,6 +1604,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = DelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1583,8 +1632,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::begin_redelegate(&inner, request).await }; + let fut = async move { (*inner).begin_redelegate(request).await }; Box::pin(fut) } } @@ -1594,6 +1642,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = BeginRedelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1621,7 +1670,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::undelegate(&inner, request).await }; + let fut = async move { (*inner).undelegate(request).await }; Box::pin(fut) } } @@ -1631,6 +1680,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UndelegateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1660,9 +1710,8 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::cancel_unbonding_delegation(&inner, request).await - }; + let fut = + async move { (*inner).cancel_unbonding_delegation(request).await }; Box::pin(fut) } } @@ -1672,6 +1721,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CancelUnbondingDelegationSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1699,8 +1749,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::update_params(&inner, request).await }; + let fut = async move { (*inner).update_params(request).await }; Box::pin(fut) } } @@ -1710,6 +1759,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpdateParamsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -1727,22 +1777,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -1754,9 +1799,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.staking.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.staking.v1beta1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs index 5ba535cd..f578dbec 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs @@ -37,8 +37,6 @@ impl ::prost::Name for Metadata { } } /// SnapshotItem is an item contained in a rootmulti.Store snapshot. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotItem { @@ -70,8 +68,6 @@ impl ::prost::Name for SnapshotItem { } } /// SnapshotStoreItem contains metadata about a snapshotted store. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotStoreItem { @@ -86,8 +82,6 @@ impl ::prost::Name for SnapshotStoreItem { } } /// SnapshotIAVLItem is an exported IAVL node. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotIavlItem { @@ -110,8 +104,6 @@ impl ::prost::Name for SnapshotIavlItem { } } /// SnapshotExtensionMeta contains metadata about an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionMeta { @@ -128,8 +120,6 @@ impl ::prost::Name for SnapshotExtensionMeta { } } /// SnapshotExtensionPayload contains payloads of an external snapshotter. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotExtensionPayload { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.tonic.rs index 13700844..8579f148 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod abci_listener_service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; /** ABCIListenerService is the service for the BaseApp ABCIListener interface @@ -31,10 +25,10 @@ pub mod abci_listener_service_client { } impl AbciListenerServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -52,13 +46,13 @@ pub mod abci_listener_service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { AbciListenerServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -101,7 +95,10 @@ pub mod abci_listener_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -122,7 +119,10 @@ pub mod abci_listener_service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -140,17 +140,11 @@ pub mod abci_listener_service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod abci_listener_service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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 AbciListenerServiceServer. #[async_trait] - pub trait AbciListenerService: std::marker::Send + std::marker::Sync + 'static { + pub trait AbciListenerService: Send + Sync + 'static { /** ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock */ async fn listen_finalize_block( @@ -167,18 +161,20 @@ pub mod abci_listener_service_server { /** ABCIListenerService is the service for the BaseApp ABCIListener interface */ #[derive(Debug)] - pub struct AbciListenerServiceServer { - inner: Arc, + pub struct AbciListenerServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl AbciListenerServiceServer { + struct _Inner(Arc); + impl AbciListenerServiceServer { 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(), @@ -225,10 +221,10 @@ pub mod abci_listener_service_server { impl tonic::codegen::Service> for AbciListenerServiceServer where T: AbciListenerService, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -238,6 +234,7 @@ pub mod abci_listener_service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock" => { #[allow(non_camel_case_types)] @@ -253,10 +250,7 @@ pub mod abci_listener_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::listen_finalize_block(&inner, request) - .await - }; + let fut = async move { (*inner).listen_finalize_block(request).await }; Box::pin(fut) } } @@ -266,6 +260,7 @@ pub mod abci_listener_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ListenFinalizeBlockSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -296,9 +291,7 @@ pub mod abci_listener_service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::listen_commit(&inner, request).await - }; + let fut = async move { (*inner).listen_commit(request).await }; Box::pin(fut) } } @@ -308,6 +301,7 @@ pub mod abci_listener_service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ListenCommitSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -325,22 +319,17 @@ pub mod abci_listener_service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for AbciListenerServiceServer { + impl Clone for AbciListenerServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -352,9 +341,17 @@ pub mod abci_listener_service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.store.streaming.abci.ABCIListenerService"; - impl tonic::server::NamedService for AbciListenerServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for AbciListenerServiceServer { + const NAME: &'static str = "cosmos.store.streaming.abci.ABCIListenerService"; } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs index 89b0a7e3..3d1fcf99 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs @@ -2,8 +2,6 @@ /// StoreKVPair is a KVStore KVPair used for listening to state changes (Sets and Deletes) /// It optionally includes the StoreKey for the originating KVStore and a Boolean flag to distinguish between Sets and /// Deletes -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct StoreKvPair { 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 f61d78d8..d3d56aa0 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 @@ -82,8 +82,6 @@ impl ::prost::Name for SignDoc { } /// SignDocDirectAux is the type used for generating sign bytes for /// SIGN_MODE_DIRECT_AUX. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SignDocDirectAux { @@ -132,13 +130,37 @@ pub struct TxBody { pub messages: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, /// memo is any arbitrary note/comment to be added to the transaction. /// WARNING: in clients, any publicly exposed text should not be called memo, - /// but should be called `note` instead (see ). + /// but should be called `note` instead (see + /// ). #[prost(string, tag = "2")] pub memo: ::prost::alloc::string::String, - /// timeout is the block height after which this transaction will not - /// be processed by the chain + /// timeout_height is the block height after which this transaction will not + /// be processed by the chain. #[prost(uint64, tag = "3")] pub timeout_height: u64, + /// unordered, when set to true, indicates that the transaction signer(s) + /// intend for the transaction to be evaluated and executed in an un-ordered + /// fashion. Specifically, the account's nonce will NOT be checked or + /// incremented, which allows for fire-and-forget as well as concurrent + /// transaction execution. + /// + /// Note, when set to true, the existing 'timeout_timestamp' value must + /// be set and will be used to correspond to a timestamp in which the transaction is deemed + /// valid. + /// + /// When true, the sequence value MUST be 0, and any transaction with unordered=true and a non-zero sequence value will + /// be rejected. + /// External services that make assumptions about sequence values may need to be updated because of this. + #[prost(bool, tag = "4")] + pub unordered: bool, + /// timeout_timestamp is the block time after which this transaction will not + /// be processed by the chain. + /// + /// Note, if unordered=true this value MUST be set + /// and will act as a short-lived TTL in which the transaction is deemed valid + /// and kept in memory to prevent duplicates. + #[prost(message, optional, tag = "5")] + pub timeout_timestamp: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// extension_options are arbitrary options that can be added by chains /// when the default options are not sufficient. If any of these are present /// and can't be handled, the transaction will be rejected @@ -179,8 +201,6 @@ pub struct AuthInfo { /// /// 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 #[deprecated] #[prost(message, optional, tag = "3")] pub tip: ::core::option::Option, @@ -300,14 +320,16 @@ pub struct Fee { /// before an out of gas error occurs #[prost(uint64, tag = "2")] pub gas_limit: u64, - /// if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. - /// the payer must be a tx signer (and thus have signed this field in AuthInfo). - /// setting this field does *not* change the ordering of required signers for the transaction. + /// if unset, the first signer is responsible for paying the fees. If set, the + /// specified account must pay the fees. the payer must be a tx signer (and + /// thus have signed this field in AuthInfo). setting this field does *not* + /// change the ordering of required signers for the transaction. #[prost(string, tag = "3")] pub payer: ::prost::alloc::string::String, - /// if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used - /// to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does - /// not support fee grants, this will fail + /// if set, the fee payer (either the first signer or the value of the payer + /// field) requests that a fee grant be used to pay fees instead of the fee + /// payer's own balance. If an appropriate fee grant does not exist or the + /// chain does not support fee grants, this will fail #[prost(string, tag = "4")] pub granter: ::prost::alloc::string::String, } @@ -319,8 +341,6 @@ impl ::prost::Name for Fee { } } /// Tip is the tip used for meta-transactions. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Tip { @@ -342,8 +362,6 @@ impl ::prost::Name for Tip { /// 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 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct AuxSignerData { @@ -399,8 +417,6 @@ pub struct GetTxsEventRequest { pub limit: u64, /// query defines the transaction event query that is proxied to Tendermint's /// TxSearch RPC method. The query must be valid. - /// - /// Since cosmos-sdk 0.50 #[prost(string, tag = "6")] pub query: ::prost::alloc::string::String, } @@ -483,8 +499,6 @@ pub struct SimulateRequest { #[prost(message, optional, tag = "1")] pub tx: ::core::option::Option, /// tx_bytes is the raw transaction. - /// - /// Since: cosmos-sdk 0.43 #[prost(bytes = "vec", tag = "2")] pub tx_bytes: ::prost::alloc::vec::Vec, } @@ -550,8 +564,6 @@ impl ::prost::Name for GetTxResponse { } /// GetBlockWithTxsRequest is the request type for the Service.GetBlockWithTxs /// RPC method. -/// -/// Since: cosmos-sdk 0.45.2 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsRequest { @@ -571,8 +583,6 @@ impl ::prost::Name for GetBlockWithTxsRequest { } /// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs /// method. -/// -/// Since: cosmos-sdk 0.45.2 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetBlockWithTxsResponse { @@ -596,8 +606,6 @@ impl ::prost::Name for GetBlockWithTxsResponse { } /// TxDecodeRequest is the request type for the Service.TxDecode /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeRequest { @@ -614,8 +622,6 @@ impl ::prost::Name for TxDecodeRequest { } /// TxDecodeResponse is the response type for the /// Service.TxDecode method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeResponse { @@ -632,8 +638,6 @@ impl ::prost::Name for TxDecodeResponse { } /// TxEncodeRequest is the request type for the Service.TxEncode /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeRequest { @@ -650,8 +654,6 @@ impl ::prost::Name for TxEncodeRequest { } /// TxEncodeResponse is the response type for the /// Service.TxEncode method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeResponse { @@ -668,8 +670,6 @@ impl ::prost::Name for TxEncodeResponse { } /// TxEncodeAminoRequest is the request type for the Service.TxEncodeAmino /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeAminoRequest { @@ -685,8 +685,6 @@ impl ::prost::Name for TxEncodeAminoRequest { } /// TxEncodeAminoResponse is the response type for the Service.TxEncodeAmino /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxEncodeAminoResponse { @@ -702,8 +700,6 @@ impl ::prost::Name for TxEncodeAminoResponse { } /// TxDecodeAminoRequest is the request type for the Service.TxDecodeAmino /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeAminoRequest { @@ -719,8 +715,6 @@ impl ::prost::Name for TxDecodeAminoRequest { } /// TxDecodeAminoResponse is the response type for the Service.TxDecodeAmino /// RPC method. -/// -/// Since: cosmos-sdk 0.47 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct TxDecodeAminoResponse { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs index b5389faa..2248be50 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.serde.rs @@ -3020,6 +3020,12 @@ impl serde::Serialize for TxBody { if self.timeout_height != 0 { len += 1; } + if self.unordered { + len += 1; + } + if self.timeout_timestamp.is_some() { + len += 1; + } if !self.extension_options.is_empty() { len += 1; } @@ -3040,6 +3046,12 @@ impl serde::Serialize for TxBody { alloc::string::ToString::to_string(&self.timeout_height).as_str(), )?; } + if self.unordered { + struct_ser.serialize_field("unordered", &self.unordered)?; + } + if let Some(v) = self.timeout_timestamp.as_ref() { + struct_ser.serialize_field("timeoutTimestamp", v)?; + } if !self.extension_options.is_empty() { struct_ser.serialize_field("extensionOptions", &self.extension_options)?; } @@ -3064,6 +3076,9 @@ impl<'de> serde::Deserialize<'de> for TxBody { "memo", "timeout_height", "timeoutHeight", + "unordered", + "timeout_timestamp", + "timeoutTimestamp", "extension_options", "extensionOptions", "non_critical_extension_options", @@ -3075,6 +3090,8 @@ impl<'de> serde::Deserialize<'de> for TxBody { Messages, Memo, TimeoutHeight, + Unordered, + TimeoutTimestamp, ExtensionOptions, NonCriticalExtensionOptions, } @@ -3105,6 +3122,10 @@ impl<'de> serde::Deserialize<'de> for TxBody { "messages" => Ok(GeneratedField::Messages), "memo" => Ok(GeneratedField::Memo), "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "unordered" => Ok(GeneratedField::Unordered), + "timeoutTimestamp" | "timeout_timestamp" => { + Ok(GeneratedField::TimeoutTimestamp) + } "extensionOptions" | "extension_options" => { Ok(GeneratedField::ExtensionOptions) } @@ -3133,6 +3154,8 @@ impl<'de> serde::Deserialize<'de> for TxBody { let mut messages__ = None; let mut memo__ = None; let mut timeout_height__ = None; + let mut unordered__ = None; + let mut timeout_timestamp__ = None; let mut extension_options__ = None; let mut non_critical_extension_options__ = None; while let Some(k) = map_.next_key()? { @@ -3158,6 +3181,18 @@ impl<'de> serde::Deserialize<'de> for TxBody { .0, ); } + GeneratedField::Unordered => { + if unordered__.is_some() { + return Err(serde::de::Error::duplicate_field("unordered")); + } + unordered__ = Some(map_.next_value()?); + } + GeneratedField::TimeoutTimestamp => { + if timeout_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + } + timeout_timestamp__ = map_.next_value()?; + } GeneratedField::ExtensionOptions => { if extension_options__.is_some() { return Err(serde::de::Error::duplicate_field("extensionOptions")); @@ -3178,6 +3213,8 @@ impl<'de> serde::Deserialize<'de> for TxBody { messages: messages__.unwrap_or_default(), memo: memo__.unwrap_or_default(), timeout_height: timeout_height__.unwrap_or_default(), + unordered: unordered__.unwrap_or_default(), + timeout_timestamp: timeout_timestamp__, extension_options: extension_options__.unwrap_or_default(), non_critical_extension_options: non_critical_extension_options__ .unwrap_or_default(), diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs index 885067d7..066a8dab 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod service_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod service_client { } impl ServiceClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod service_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { ServiceClient::new(InterceptedService::new(inner, interceptor)) } @@ -96,7 +90,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/Simulate"); @@ -110,7 +107,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/GetTx"); @@ -125,7 +125,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -141,7 +144,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -157,7 +163,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -174,7 +183,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxDecode"); @@ -188,7 +200,10 @@ pub mod service_client { request: impl tonic::IntoRequest, ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmos.tx.v1beta1.Service/TxEncode"); @@ -203,7 +218,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -221,7 +239,10 @@ pub mod service_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -238,17 +259,11 @@ pub mod service_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod service_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Service: Send + Sync + 'static { async fn simulate( &self, request: tonic::Request, @@ -287,18 +302,20 @@ pub mod service_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct ServiceServer { - inner: Arc, + pub struct ServiceServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl ServiceServer { + 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(), @@ -345,10 +362,10 @@ pub mod service_server { impl tonic::codegen::Service> for ServiceServer where T: Service, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -358,6 +375,7 @@ pub mod service_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.tx.v1beta1.Service/Simulate" => { #[allow(non_camel_case_types)] @@ -370,8 +388,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::simulate(&inner, request).await }; + let fut = async move { (*inner).simulate(request).await }; Box::pin(fut) } } @@ -381,6 +398,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SimulateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -408,7 +426,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::get_tx(&inner, request).await }; + let fut = async move { (*inner).get_tx(request).await }; Box::pin(fut) } } @@ -418,6 +436,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetTxSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -445,8 +464,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::broadcast_tx(&inner, request).await }; + let fut = async move { (*inner).broadcast_tx(request).await }; Box::pin(fut) } } @@ -456,6 +474,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = BroadcastTxSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -483,8 +502,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::get_txs_event(&inner, request).await }; + let fut = async move { (*inner).get_txs_event(request).await }; Box::pin(fut) } } @@ -494,6 +512,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetTxsEventSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -523,9 +542,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::get_block_with_txs(&inner, request).await - }; + let fut = async move { (*inner).get_block_with_txs(request).await }; Box::pin(fut) } } @@ -535,6 +552,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = GetBlockWithTxsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -562,8 +580,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::tx_decode(&inner, request).await }; + let fut = async move { (*inner).tx_decode(request).await }; Box::pin(fut) } } @@ -573,6 +590,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TxDecodeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -600,8 +618,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::tx_encode(&inner, request).await }; + let fut = async move { (*inner).tx_encode(request).await }; Box::pin(fut) } } @@ -611,6 +628,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TxEncodeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -638,9 +656,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_encode_amino(&inner, request).await - }; + let fut = async move { (*inner).tx_encode_amino(request).await }; Box::pin(fut) } } @@ -650,6 +666,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TxEncodeAminoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -677,9 +694,7 @@ pub mod service_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::tx_decode_amino(&inner, request).await - }; + let fut = async move { (*inner).tx_decode_amino(request).await }; Box::pin(fut) } } @@ -689,6 +704,7 @@ pub mod service_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = TxDecodeAminoSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -706,22 +722,17 @@ pub mod service_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for ServiceServer { + impl Clone for ServiceServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -733,9 +744,17 @@ pub mod service_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.tx.v1beta1.Service"; - impl tonic::server::NamedService for ServiceServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for ServiceServer { + const NAME: &'static str = "cosmos.tx.v1beta1.Service"; } } 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 f45d62e1..b33325dc 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 @@ -85,8 +85,6 @@ impl ::prost::Name for CancelSoftwareUpgradeProposal { } } /// ModuleVersion specifies a module and its consensus version. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleVersion { @@ -186,7 +184,6 @@ impl ::prost::Name for QueryUpgradedConsensusStateRequest { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryUpgradedConsensusStateResponse { - /// Since: cosmos-sdk 0.43 #[prost(bytes = "vec", tag = "2")] pub upgraded_consensus_state: ::prost::alloc::vec::Vec, } @@ -199,8 +196,6 @@ impl ::prost::Name for QueryUpgradedConsensusStateResponse { } /// QueryModuleVersionsRequest is the request type for the Query/ModuleVersions /// RPC method. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsRequest { @@ -219,8 +214,6 @@ impl ::prost::Name for QueryModuleVersionsRequest { } /// QueryModuleVersionsResponse is the response type for the Query/ModuleVersions /// RPC method. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryModuleVersionsResponse { @@ -236,8 +229,6 @@ impl ::prost::Name for QueryModuleVersionsResponse { } } /// QueryAuthorityRequest is the request type for Query/Authority -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityRequest {} @@ -249,8 +240,6 @@ impl ::prost::Name for QueryAuthorityRequest { } } /// QueryAuthorityResponse is the response type for Query/Authority -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryAuthorityResponse { @@ -265,8 +254,6 @@ impl ::prost::Name for QueryAuthorityResponse { } } /// MsgSoftwareUpgrade is the Msg/SoftwareUpgrade request type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgrade { @@ -285,8 +272,6 @@ impl ::prost::Name for MsgSoftwareUpgrade { } } /// MsgSoftwareUpgradeResponse is the Msg/SoftwareUpgrade response type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSoftwareUpgradeResponse {} @@ -298,8 +283,6 @@ impl ::prost::Name for MsgSoftwareUpgradeResponse { } } /// MsgCancelUpgrade is the Msg/CancelUpgrade request type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgrade { @@ -315,8 +298,6 @@ impl ::prost::Name for MsgCancelUpgrade { } } /// MsgCancelUpgradeResponse is the Msg/CancelUpgrade response type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCancelUpgradeResponse {} 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 eb69ad23..35af8ca5 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -115,7 +112,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -135,7 +135,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -154,7 +157,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -173,7 +179,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -188,17 +197,11 @@ pub mod query_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod query_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Query: Send + Sync + 'static { async fn current_plan( &self, request: tonic::Request, @@ -224,18 +227,20 @@ pub mod query_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct QueryServer { - inner: Arc, + pub struct QueryServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl QueryServer { + 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(), @@ -282,10 +287,10 @@ pub mod query_server { impl tonic::codegen::Service> for QueryServer where T: Query, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -295,6 +300,7 @@ pub mod query_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.upgrade.v1beta1.Query/CurrentPlan" => { #[allow(non_camel_case_types)] @@ -307,8 +313,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::current_plan(&inner, request).await }; + let fut = async move { (*inner).current_plan(request).await }; Box::pin(fut) } } @@ -318,6 +323,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CurrentPlanSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -345,8 +351,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::applied_plan(&inner, request).await }; + let fut = async move { (*inner).applied_plan(request).await }; Box::pin(fut) } } @@ -356,6 +361,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AppliedPlanSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -386,9 +392,8 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::upgraded_consensus_state(&inner, request).await - }; + let fut = + async move { (*inner).upgraded_consensus_state(request).await }; Box::pin(fut) } } @@ -398,6 +403,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = UpgradedConsensusStateSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -427,8 +433,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::module_versions(&inner, request).await }; + let fut = async move { (*inner).module_versions(request).await }; Box::pin(fut) } } @@ -438,6 +443,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = ModuleVersionsSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -465,7 +471,7 @@ pub mod query_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { ::authority(&inner, request).await }; + let fut = async move { (*inner).authority(request).await }; Box::pin(fut) } } @@ -475,6 +481,7 @@ pub mod query_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = AuthoritySvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -492,22 +499,17 @@ pub mod query_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for QueryServer { + impl Clone for QueryServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -519,22 +521,24 @@ pub mod query_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.upgrade.v1beta1.Query"; - impl tonic::server::NamedService for QueryServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.upgrade.v1beta1.Query"; } } /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -555,10 +559,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -573,13 +577,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -620,7 +624,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -638,7 +645,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -655,17 +665,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn software_upgrade( &self, request: tonic::Request, @@ -676,18 +680,20 @@ pub mod msg_server { ) -> core::result::Result, tonic::Status>; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -734,10 +740,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -747,6 +753,7 @@ pub mod msg_server { 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)] @@ -759,8 +766,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::software_upgrade(&inner, request).await }; + let fut = async move { (*inner).software_upgrade(request).await }; Box::pin(fut) } } @@ -770,6 +776,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = SoftwareUpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -797,8 +804,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = - async move { ::cancel_upgrade(&inner, request).await }; + let fut = async move { (*inner).cancel_upgrade(request).await }; Box::pin(fut) } } @@ -808,6 +814,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CancelUpgradeSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -825,22 +832,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -852,9 +854,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.upgrade.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::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 e3bd6458..fc9843bf 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 @@ -96,8 +96,6 @@ impl ::prost::Name for PeriodicVestingAccount { /// PermanentLockedAccount implements the VestingAccount interface. It does /// not ever release coins, locking them indefinitely. Coins in this account can /// still be used for delegating and for governance votes even while locked. -/// -/// Since: cosmos-sdk 0.43 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct PermanentLockedAccount { @@ -148,8 +146,6 @@ impl ::prost::Name for MsgCreateVestingAccountResponse { } /// MsgCreatePermanentLockedAccount defines a message that enables creating a permanent /// locked account. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccount { @@ -168,8 +164,6 @@ impl ::prost::Name for MsgCreatePermanentLockedAccount { } } /// MsgCreatePermanentLockedAccountResponse defines the Msg/CreatePermanentLockedAccount response type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePermanentLockedAccountResponse {} @@ -182,8 +176,6 @@ impl ::prost::Name for MsgCreatePermanentLockedAccountResponse { } /// MsgCreateVestingAccount defines a message that enables creating a vesting /// account. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccount { @@ -206,8 +198,6 @@ impl ::prost::Name for MsgCreatePeriodicVestingAccount { } /// MsgCreateVestingAccountResponse defines the Msg/CreatePeriodicVestingAccount /// response type. -/// -/// Since: cosmos-sdk 0.46 #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreatePeriodicVestingAccountResponse {} 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 d8b360a0..71c9bdac 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 @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -47,13 +41,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -96,7 +90,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -117,7 +114,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -138,7 +138,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -156,17 +159,11 @@ pub mod msg_client { /// Generated server implementations. #[cfg(feature = "grpc")] pub mod msg_server { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![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: std::marker::Send + std::marker::Sync + 'static { + pub trait Msg: Send + Sync + 'static { async fn create_vesting_account( &self, request: tonic::Request, @@ -190,18 +187,20 @@ pub mod msg_server { >; } #[derive(Debug)] - pub struct MsgServer { - inner: Arc, + pub struct MsgServer { + inner: _Inner, accept_compression_encodings: EnabledCompressionEncodings, send_compression_encodings: EnabledCompressionEncodings, max_decoding_message_size: Option, max_encoding_message_size: Option, } - impl MsgServer { + 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(), @@ -248,10 +247,10 @@ pub mod msg_server { impl tonic::codegen::Service> for MsgServer where T: Msg, - B: Body + std::marker::Send + 'static, - B::Error: Into + std::marker::Send + 'static, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, { - type Response = http::Response; + type Response = http::Response; type Error = std::convert::Infallible; type Future = BoxFuture; fn poll_ready( @@ -261,6 +260,7 @@ pub mod msg_server { Poll::Ready(Ok(())) } fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); match req.uri().path() { "/cosmos.vesting.v1beta1.Msg/CreateVestingAccount" => { #[allow(non_camel_case_types)] @@ -275,9 +275,7 @@ pub mod msg_server { request: tonic::Request, ) -> Self::Future { let inner = Arc::clone(&self.0); - let fut = async move { - ::create_vesting_account(&inner, request).await - }; + let fut = async move { (*inner).create_vesting_account(request).await }; Box::pin(fut) } } @@ -287,6 +285,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreateVestingAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -317,7 +316,7 @@ pub mod msg_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_permanent_locked_account(&inner, request).await + (*inner).create_permanent_locked_account(request).await }; Box::pin(fut) } @@ -328,6 +327,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreatePermanentLockedAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -358,7 +358,7 @@ pub mod msg_server { ) -> Self::Future { let inner = Arc::clone(&self.0); let fut = async move { - ::create_periodic_vesting_account(&inner, request).await + (*inner).create_periodic_vesting_account(request).await }; Box::pin(fut) } @@ -369,6 +369,7 @@ pub mod msg_server { let max_encoding_message_size = self.max_encoding_message_size; let inner = self.inner.clone(); let fut = async move { + let inner = inner.0; let method = CreatePeriodicVestingAccountSvc(inner); let codec = tonic::codec::ProstCodec::default(); let mut grpc = tonic::server::Grpc::new(codec) @@ -386,22 +387,17 @@ pub mod msg_server { Box::pin(fut) } _ => Box::pin(async move { - let mut response = http::Response::new(tonic::body::Body::default()); - let headers = response.headers_mut(); - headers.insert( - tonic::Status::GRPC_STATUS, - (tonic::Code::Unimplemented as i32).into(), - ); - headers.insert( - http::header::CONTENT_TYPE, - tonic::metadata::GRPC_CONTENT_TYPE, - ); - Ok(response) + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) }), } } } - impl Clone for MsgServer { + impl Clone for MsgServer { fn clone(&self) -> Self { let inner = self.inner.clone(); Self { @@ -413,9 +409,17 @@ pub mod msg_server { } } } - /// Generated gRPC service name - pub const SERVICE_NAME: &str = "cosmos.vesting.v1beta1.Msg"; - impl tonic::server::NamedService for MsgServer { - const NAME: &'static str = SERVICE_NAME; + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl core::fmt::Debug for _Inner { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.vesting.v1beta1.Msg"; } } diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs index 4e894d55..d086ee88 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs @@ -2,13 +2,7 @@ /// Generated client implementations. #[cfg(feature = "grpc")] pub mod query_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -29,10 +23,10 @@ pub mod query_client { } impl QueryClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -50,13 +44,13 @@ pub mod query_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { QueryClient::new(InterceptedService::new(inner, interceptor)) } @@ -97,7 +91,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/ContractInfo"); @@ -112,7 +109,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -128,7 +128,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -146,7 +149,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -166,7 +172,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -186,7 +195,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -204,7 +216,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/Code"); @@ -219,7 +234,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/Codes"); @@ -234,7 +252,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/PinnedCodes"); @@ -249,7 +270,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/Params"); @@ -266,7 +290,10 @@ pub mod query_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -284,7 +311,10 @@ pub mod query_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Query/BuildAddress"); @@ -298,13 +328,7 @@ pub mod query_client { /// Generated client implementations. #[cfg(feature = "grpc")] pub mod msg_client { - #![allow( - unused_variables, - dead_code, - missing_docs, - clippy::wildcard_imports, - clippy::let_unit_value - )] + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] use tonic::codegen::http::Uri; use tonic::codegen::*; #[derive(Debug, Clone)] @@ -325,10 +349,10 @@ pub mod msg_client { } impl MsgClient where - T: tonic::client::GrpcService, + T: tonic::client::GrpcService, T::Error: Into, - T::ResponseBody: Body + std::marker::Send + 'static, - ::Error: Into + std::marker::Send, + T::ResponseBody: Body + Send + 'static, + ::Error: Into + Send, { pub fn new(inner: T) -> Self { let inner = tonic::client::Grpc::new(inner); @@ -343,13 +367,13 @@ pub mod msg_client { F: tonic::service::Interceptor, T::ResponseBody: Default, T: tonic::codegen::Service< - http::Request, + http::Request, Response = http::Response< - >::ResponseBody, + >::ResponseBody, >, >, - >>::Error: - Into + std::marker::Send + std::marker::Sync, + >>::Error: + Into + Send + Sync, { MsgClient::new(InterceptedService::new(inner, interceptor)) } @@ -390,7 +414,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/StoreCode"); @@ -407,7 +434,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -427,7 +457,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -445,7 +478,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -461,7 +497,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = @@ -477,7 +516,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/UpdateAdmin"); @@ -492,7 +534,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/ClearAdmin"); @@ -509,7 +554,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -528,7 +576,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/UpdateParams"); @@ -543,7 +594,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/SudoContract"); @@ -558,7 +612,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/PinCodes"); @@ -573,7 +630,10 @@ pub mod msg_client { ) -> core::result::Result, tonic::Status> { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static("/cosmwasm.wasm.v1.Msg/UnpinCodes"); @@ -590,7 +650,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -611,7 +674,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -632,7 +698,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -653,7 +722,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = http::uri::PathAndQuery::from_static( @@ -674,7 +746,10 @@ pub mod msg_client { tonic::Status, > { self.inner.ready().await.map_err(|e| { - tonic::Status::unknown(alloc::format!("Service was not ready: {}", e.into())) + tonic::Status::new( + tonic::Code::Unknown, + alloc::format!("Service was not ready: {}", e.into()), + ) })?; let codec = tonic::codec::ProstCodec::default(); let path = diff --git a/cosmrs/src/lib.rs b/cosmrs/src/lib.rs index 7f232ae6..638ac76f 100644 --- a/cosmrs/src/lib.rs +++ b/cosmrs/src/lib.rs @@ -32,6 +32,7 @@ pub mod bank; pub mod crypto; pub mod distribution; pub mod feegrant; +pub mod protocolpool; pub mod slashing; pub mod staking; pub mod tx; diff --git a/cosmrs/src/protocolpool.rs b/cosmrs/src/protocolpool.rs new file mode 100644 index 00000000..b0324b32 --- /dev/null +++ b/cosmrs/src/protocolpool.rs @@ -0,0 +1,16 @@ +//! Distribution module support +//! +//! + +mod msg_cancel_continuous_fund; +mod msg_community_pool_spend; +mod msg_create_continuous_fund; +mod msg_fund_community_pool; +mod msg_update_params_proposal; + +pub use self::{ + msg_cancel_continuous_fund::MsgCancelContinuousFund, + msg_community_pool_spend::MsgCommunityPoolSpend, + msg_create_continuous_fund::MsgCreateContinuousFund, + msg_fund_community_pool::MsgFundCommunityPool, msg_update_params_proposal::MsgUpdateParams, +}; diff --git a/cosmrs/src/protocolpool/msg_cancel_continuous_fund.rs b/cosmrs/src/protocolpool/msg_cancel_continuous_fund.rs new file mode 100644 index 00000000..46073a86 --- /dev/null +++ b/cosmrs/src/protocolpool/msg_cancel_continuous_fund.rs @@ -0,0 +1,56 @@ +use crate::{proto, tx::Msg, AccountId, ErrorReport, Result}; + +/// MsgCancelContinuousFund represents a message to withdraw a delegator's reward from a validator. +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +pub struct MsgCancelContinuousFund { + pub authority: String, + pub recipient: String, +} + +impl Msg for MsgCancelContinuousFund { + type Proto = proto::cosmos::protocolpool::v1::MsgCancelContinuousFund; +} + +impl TryFrom for MsgCancelContinuousFund { + type Error = ErrorReport; + + fn try_from( + proto: proto::cosmos::protocolpool::v1::MsgCancelContinuousFund, + ) -> Result { + MsgCancelContinuousFund::try_from(&proto) + } +} + +impl TryFrom<&proto::cosmos::protocolpool::v1::MsgCancelContinuousFund> + for MsgCancelContinuousFund +{ + type Error = ErrorReport; + + fn try_from( + proto: &proto::cosmos::protocolpool::v1::MsgCancelContinuousFund, + ) -> Result { + Ok(MsgCancelContinuousFund { + authority: proto.authority.parse()?, + recipient: proto.recipient.parse()?, + }) + } +} + +impl From for proto::cosmos::protocolpool::v1::MsgCancelContinuousFund { + fn from( + coin: MsgCancelContinuousFund, + ) -> proto::cosmos::protocolpool::v1::MsgCancelContinuousFund { + proto::cosmos::protocolpool::v1::MsgCancelContinuousFund::from(&coin) + } +} + +impl From<&MsgCancelContinuousFund> for proto::cosmos::protocolpool::v1::MsgCancelContinuousFund { + fn from( + msg: &MsgCancelContinuousFund, + ) -> proto::cosmos::protocolpool::v1::MsgCancelContinuousFund { + proto::cosmos::protocolpool::v1::MsgCancelContinuousFund { + authority: msg.authority.to_string(), + recipient: msg.recipient.to_string(), + } + } +} diff --git a/cosmrs/src/protocolpool/msg_community_pool_spend.rs b/cosmrs/src/protocolpool/msg_community_pool_spend.rs new file mode 100644 index 00000000..2dc5ab9b --- /dev/null +++ b/cosmrs/src/protocolpool/msg_community_pool_spend.rs @@ -0,0 +1,55 @@ +use cosmos_sdk_proto::cosmos::base::v1beta1::Coin; + +use crate::{proto, tx::Msg, AccountId, ErrorReport, Result}; + +/// MsgCommunityPoolSpend represents a message to set a withdraw address for staking rewards. +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +pub struct MsgCommunityPoolSpend { + pub authority: String, + pub recipient: String, + pub amount: Coin, +} + +impl Msg for MsgCommunityPoolSpend { + type Proto = proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend; +} + +impl TryFrom for MsgCommunityPoolSpend { + type Error = ErrorReport; + + fn try_from( + proto: proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend, + ) -> Result { + MsgCommunityPoolSpend::try_from(&proto) + } +} + +impl TryFrom<&proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend> for MsgCommunityPoolSpend { + type Error = ErrorReport; + + fn try_from( + proto: &proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend, + ) -> Result { + Ok(MsgCommunityPoolSpend { + authority: proto.authority.parse()?, + recipient: proto.recipient.parse()?, + amount: proto.amount.parse()?, + }) + } +} + +impl From for proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend { + fn from(coin: MsgCommunityPoolSpend) -> proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend { + proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend::from(&coin) + } +} + +impl From<&MsgCommunityPoolSpend> for proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend { + fn from(msg: &MsgCommunityPoolSpend) -> proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend { + proto::cosmos::protocolpool::v1::MsgCommunityPoolSpend { + authority: msg.authority.to_string(), + recipient: msg.recipient.to_string(), + amount: msg.amount, + } + } +} diff --git a/cosmrs/src/protocolpool/msg_create_continuous_fund.rs b/cosmrs/src/protocolpool/msg_create_continuous_fund.rs new file mode 100644 index 00000000..202f34cd --- /dev/null +++ b/cosmrs/src/protocolpool/msg_create_continuous_fund.rs @@ -0,0 +1,68 @@ +use crate::{proto, tx::Msg, AccountId, ErrorReport, Result}; + +/// MsgCreateContinuousFund represents a message to withdraw a delegator's reward from a validator. +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +pub struct MsgCreateContinuousFund { + pub authority: String, + pub recipient: String, + pub percentage: String, + pub expiry: Option, +} + +impl Msg for MsgCreateContinuousFund { + type Proto = proto::cosmos::protocolpool::v1::MsgCreateContinuousFund; +} + +impl TryFrom + for MsgCreateContinuousFund +{ + type Error = ErrorReport; + + fn try_from( + proto: proto::cosmos::protocolpool::v1::MsgCreateContinuousFund, + ) -> Result { + MsgCreateContinuousFund::try_from(&proto) + } +} + +impl TryFrom<&proto::cosmos::protocolpool::v1::MsgCreateContinuousFund> + for MsgCreateContinuousFund +{ + type Error = ErrorReport; + + fn try_from( + proto: &proto::cosmos::protocolpool::v1::MsgCreateContinuousFund, + ) -> Result { + Ok(MsgCreateContinuousFund { + authority: proto.authority.parse()?, + recipient: proto.recipient.parse()?, + percentage: proto.percentage.parse()?, + expiry: proto.expiry.parse()?, + }) + } +} + +impl From + for proto::cosmos::protocolpool::v1::MsgCreateContinuousFund +{ + fn from( + coin: MsgCreateContinuousFund, + ) -> proto::cosmos::protocolpool::v1::MsgCreateContinuousFund { + proto::cosmos::protocolpool::v1::MsgCreateContinuousFund::from(&coin) + } +} + +impl From<&MsgCreateContinuousFund> + for proto::cosmos::protocolpool::v1::MsgCreateContinuousFund +{ + fn from( + msg: &MsgCreateContinuousFund, + ) -> proto::cosmos::protocolpool::v1::MsgCreateContinuousFund { + proto::cosmos::protocolpool::v1::MsgCreateContinuousFund { + authority: msg.authority.to_string(), + recipient: msg.recipient.to_string(), + percentage: msg.percentage.to_string(), + expiry: msg.expiry.to_string(), + } + } +} diff --git a/cosmrs/src/protocolpool/msg_fund_community_pool.rs b/cosmrs/src/protocolpool/msg_fund_community_pool.rs new file mode 100644 index 00000000..40738af1 --- /dev/null +++ b/cosmrs/src/protocolpool/msg_fund_community_pool.rs @@ -0,0 +1,71 @@ +use crate::{proto, tx::Msg, AccountId, Coin, ErrorReport, Result}; + +/// MsgFundCommunityPool represents a message to send coins from depositor to the community pool. +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +pub struct MsgFundCommunityPool { + /// Depositor's address. + pub depositor: AccountId, + + /// Amount to deposit. + pub amount: Vec, +} + +impl Msg for MsgFundCommunityPool { + type Proto = proto::cosmos::protocolpool::v1::MsgFundCommunityPool; +} + +impl TryFrom for MsgFundCommunityPool { + type Error = ErrorReport; + + fn try_from( + proto: proto::cosmos::protocolpool::v1::MsgFundCommunityPool, + ) -> Result { + MsgFundCommunityPool::try_from(&proto) + } +} + +impl TryFrom<&proto::cosmos::protocolpool::v1::MsgFundCommunityPool> for MsgFundCommunityPool { + type Error = ErrorReport; + + fn try_from( + proto: &proto::cosmos::protocolpool::v1::MsgFundCommunityPool, + ) -> Result { + let mut amounts = Vec::with_capacity(proto.amount.len()); + for amount in &proto.amount { + amounts.push(Coin { + denom: amount.denom.parse()?, + amount: amount.amount.parse()?, + }) + } + Ok(MsgFundCommunityPool { + depositor: proto.depositor.parse()?, + amount: amounts, + }) + } +} + +impl From for proto::cosmos::protocolpool::v1::MsgFundCommunityPool { + fn from( + coin: MsgFundCommunityPool, + ) -> proto::cosmos::protocolpool::v1::MsgFundCommunityPool { + proto::cosmos::protocolpool::v1::MsgFundCommunityPool::from(&coin) + } +} + +impl From<&MsgFundCommunityPool> for proto::cosmos::protocolpool::v1::MsgFundCommunityPool { + fn from( + msg: &MsgFundCommunityPool, + ) -> proto::cosmos::protocolpool::v1::MsgFundCommunityPool { + let mut amounts = Vec::with_capacity(msg.amount.len()); + for amount in &msg.amount { + amounts.push(proto::cosmos::base::v1beta1::Coin { + denom: amount.denom.to_string(), + amount: amount.amount.to_string(), + }) + } + proto::cosmos::protocolpool::v1::MsgFundCommunityPool { + depositor: "".to_string(), + amount: amounts, + } + } +} diff --git a/cosmrs/src/protocolpool/msg_update_params_proposal.rs b/cosmrs/src/protocolpool/msg_update_params_proposal.rs new file mode 100644 index 00000000..e536c6a1 --- /dev/null +++ b/cosmrs/src/protocolpool/msg_update_params_proposal.rs @@ -0,0 +1,52 @@ +use cosmos_sdk_proto::cosmos::protocolpool::v1::Params; + +use crate::{proto, tx::Msg, AccountId, ErrorReport, Result}; + +/// WithdrawValidatorCommission submits a proposal to update protocolpool module params. Note: the entire params must be provided. +#[derive(Clone, Debug, Eq, PartialEq, PartialOrd, Ord)] +pub struct MsgUpdateParams { + pub authority: String, + pub params: Option, +} + +impl Msg for MsgUpdateParams { + type Proto = proto::cosmos::protocolpool::v1::MsgUpdateParams; +} + +impl TryFrom for MsgUpdateParams { + type Error = ErrorReport; + + fn try_from( + proto: proto::cosmos::protocolpool::v1::MsgUpdateParams, + ) -> Result { + MsgUpdateParams::try_from(&proto) + } +} + +impl TryFrom<&proto::cosmos::protocolpool::v1::MsgUpdateParams> for MsgUpdateParams { + type Error = ErrorReport; + + fn try_from( + proto: &proto::cosmos::protocolpool::v1::MsgUpdateParams, + ) -> Result { + Ok(MsgUpdateParams { + authority: proto.authority.parse()?, + params: proto.params.parse()?, + }) + } +} + +impl From for proto::cosmos::protocolpool::v1::MsgUpdateParams { + fn from(coin: MsgUpdateParams) -> proto::cosmos::protocolpool::v1::MsgUpdateParams { + proto::cosmos::protocolpool::v1::MsgUpdateParams::from(&coin) + } +} + +impl From<&MsgUpdateParams> for proto::cosmos::protocolpool::v1::MsgUpdateParams { + fn from(msg: &MsgUpdateParams) -> proto::cosmos::protocolpool::v1::MsgUpdateParams { + proto::cosmos::protocolpool::v1::MsgUpdateParams { + authority: msg.authority.to_string(), + params: msg.params, + } + } +} diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 7476d1c4..0d3448a9 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -20,10 +20,10 @@ 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.50.9"; +const COSMOS_SDK_REV: &str = "v0.53.0"; /// The wasmd commit or tag to be cloned and used to build the proto files -const WASMD_REV: &str = "v0.52.0"; +const WASMD_REV: &str = "v0.60.1"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. diff --git a/rust-toolchain b/rust-toolchain index 7c7053aa..54227249 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.75.0 +1.78.0 diff --git a/wasmd b/wasmd index 1ff81880..111818aa 160000 --- a/wasmd +++ b/wasmd @@ -1 +1 @@ -Subproject commit 1ff818801d4aa5dd6f483571ac7a38660c59c671 +Subproject commit 111818aa257547b8c276a9957eb9595f65195c26