diff --git a/cosmos-sdk-go b/cosmos-sdk-go index d1b5b0c5..8bfcf554 160000 --- a/cosmos-sdk-go +++ b/cosmos-sdk-go @@ -1 +1 @@ -Subproject commit d1b5b0c5ae2c51206cc1849e09e4d59986742cc3 +Subproject commit 8bfcf554275c1efbb42666cc8510d2da139b67fa diff --git a/cosmos-sdk-proto/src/lib.rs b/cosmos-sdk-proto/src/lib.rs index 8b7ad2e7..3b2fc75b 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -59,10 +59,10 @@ pub mod cosmos { } } - /// Key-value pairs. - pub mod kv { + /// Node requests. + pub mod node { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.node.v1beta1.rs"); } } @@ -84,29 +84,16 @@ pub mod cosmos { } } - /// Snapshots containing Tendermint state sync info. - pub mod snapshots { - pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs"); - } - } - - /// Data structure that holds the state of the application. - pub mod store { + /// Tendermint support. + pub mod tendermint { pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.store.v1beta1.rs"); + include!("prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs"); } } pub mod v1beta1 { include!("prost/cosmos-sdk/cosmos.base.v1beta1.rs"); } - - pub mod tendermint { - pub mod v1beta1 { - include!("prost/cosmos-sdk/cosmos.base.tendermint.v1beta1.rs"); - } - } } /// Crisis handling diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT index ca133cff..65bd5e32 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/COSMOS_SDK_COMMIT @@ -1 +1 @@ -v0.47.10 \ No newline at end of file +v0.50.9 \ No newline at end of file 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 0b243b59..ebfd6e70 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,6 +30,21 @@ pub struct Module { /// to be used in keeper construction. #[prost(message, repeated, tag = "6")] pub override_store_keys: ::prost::alloc::vec::Vec, + /// 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 + /// to call in the order in which they should be called. If this is left empty + /// no precommit function will be registered. + #[prost(string, repeated, tag = "8")] + pub precommiters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// prepare_check_staters specifies the module names of the prepare_check_staters + /// to call in the order in which they should be called. If this is left empty + /// no preparecheckstate function will be registered. + #[prost(string, repeated, tag = "9")] + pub prepare_check_staters: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// StoreKeyConfig may be supplied to override the default module store key, which /// is the module name. 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 48c76ff2..359304d2 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,15 @@ impl serde::Serialize for Module { if !self.override_store_keys.is_empty() { len += 1; } + if !self.order_migrations.is_empty() { + len += 1; + } + if !self.precommiters.is_empty() { + len += 1; + } + if !self.prepare_check_staters.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.app.runtime.v1alpha1.Module", len)?; if !self.app_name.is_empty() { @@ -46,6 +55,15 @@ impl serde::Serialize for Module { if !self.override_store_keys.is_empty() { struct_ser.serialize_field("overrideStoreKeys", &self.override_store_keys)?; } + if !self.order_migrations.is_empty() { + struct_ser.serialize_field("orderMigrations", &self.order_migrations)?; + } + if !self.precommiters.is_empty() { + struct_ser.serialize_field("precommiters", &self.precommiters)?; + } + if !self.prepare_check_staters.is_empty() { + struct_ser.serialize_field("prepareCheckStaters", &self.prepare_check_staters)?; + } struct_ser.end() } } @@ -69,6 +87,11 @@ impl<'de> serde::Deserialize<'de> for Module { "exportGenesis", "override_store_keys", "overrideStoreKeys", + "order_migrations", + "orderMigrations", + "precommiters", + "prepare_check_staters", + "prepareCheckStaters", ]; #[allow(clippy::enum_variant_names)] @@ -79,6 +102,9 @@ impl<'de> serde::Deserialize<'de> for Module { InitGenesis, ExportGenesis, OverrideStoreKeys, + OrderMigrations, + Precommiters, + PrepareCheckStaters, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -112,6 +138,13 @@ impl<'de> serde::Deserialize<'de> for Module { "overrideStoreKeys" | "override_store_keys" => { Ok(GeneratedField::OverrideStoreKeys) } + "orderMigrations" | "order_migrations" => { + Ok(GeneratedField::OrderMigrations) + } + "precommiters" => Ok(GeneratedField::Precommiters), + "prepareCheckStaters" | "prepare_check_staters" => { + Ok(GeneratedField::PrepareCheckStaters) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -137,6 +170,9 @@ 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 order_migrations__ = None; + let mut precommiters__ = None; + let mut prepare_check_staters__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::AppName => { @@ -175,6 +211,26 @@ impl<'de> serde::Deserialize<'de> for Module { } override_store_keys__ = Some(map_.next_value()?); } + GeneratedField::OrderMigrations => { + if order_migrations__.is_some() { + return Err(serde::de::Error::duplicate_field("orderMigrations")); + } + order_migrations__ = Some(map_.next_value()?); + } + GeneratedField::Precommiters => { + if precommiters__.is_some() { + return Err(serde::de::Error::duplicate_field("precommiters")); + } + precommiters__ = Some(map_.next_value()?); + } + GeneratedField::PrepareCheckStaters => { + if prepare_check_staters__.is_some() { + return Err(serde::de::Error::duplicate_field( + "prepareCheckStaters", + )); + } + prepare_check_staters__ = Some(map_.next_value()?); + } } } Ok(Module { @@ -184,6 +240,9 @@ 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(), + order_migrations: order_migrations__.unwrap_or_default(), + precommiters: precommiters__.unwrap_or_default(), + prepare_check_staters: prepare_check_staters__.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 fc41c549..aa511c59 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 @@ -45,7 +45,7 @@ pub struct PackageReference { /// /// When a new version of a module is released and items are added to existing /// .proto files, these definitions should contain comments of the form - /// "Since Revision N" where N is an integer revision. + /// "Since: Revision N" where N is an integer revision. /// /// When the module runtime starts up, it will check the pinned proto /// image and panic if there are runtime protobuf definitions that are not diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs index 1d44c0b4..6cad93a0 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.authz.v1beta1.rs @@ -125,7 +125,7 @@ pub struct QueryGranterGrantsResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// QueryGranteeGrantsRequest is the request type for the Query/IssuedGrants RPC method. +/// QueryGranteeGrantsRequest is the request type for the Query/GranteeGrants RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryGranteeGrantsRequest { @@ -158,13 +158,10 @@ pub struct MsgGrant { #[prost(message, optional, tag = "3")] pub grant: ::core::option::Option, } -/// MsgExecResponse defines the Msg/MsgExecResponse response type. +/// MsgGrantResponse defines the Msg/MsgGrant response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgExecResponse { - #[prost(bytes = "vec", repeated, tag = "1")] - pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} +pub struct MsgGrantResponse {} /// MsgExec attempts to execute the provided messages using /// authorizations granted to the grantee. Each message should have only /// one signer corresponding to the granter of the authorization. @@ -179,10 +176,13 @@ pub struct MsgExec { #[prost(message, repeated, tag = "2")] pub msgs: ::prost::alloc::vec::Vec<::tendermint_proto::google::protobuf::Any>, } -/// MsgGrantResponse defines the Msg/MsgGrant response type. +/// MsgExecResponse defines the Msg/MsgExecResponse response type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgGrantResponse {} +pub struct MsgExecResponse { + #[prost(bytes = "vec", repeated, tag = "1")] + pub results: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} /// MsgRevoke revokes any authorization with the provided sdk.Msg type on the /// granter's account with that has been granted to the grantee. #[allow(clippy::derive_partial_eq_without_eq)] 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 5cc7441f..4a9fb871 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 @@ -3,10 +3,10 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ModuleOptions { - /// tx describes the tx command for the module. + /// tx describes the tx commands for the module. #[prost(message, optional, tag = "1")] pub tx: ::core::option::Option, - /// query describes the tx command for the module. + /// query describes the queries commands for the module. #[prost(message, optional, tag = "2")] pub query: ::core::option::Option, } @@ -103,9 +103,6 @@ pub struct FlagOptions { /// default_value is the default value as text. #[prost(string, tag = "4")] pub default_value: ::prost::alloc::string::String, - /// default value is the default value as text if the flag is used without any value. - #[prost(string, tag = "5")] - pub no_opt_default_value: ::prost::alloc::string::String, /// deprecated is the usage text to show if this flag is deprecated. #[prost(string, tag = "6")] pub deprecated: ::prost::alloc::string::String, 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 1b022144..206748d3 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 @@ -199,9 +199,6 @@ impl serde::Serialize for FlagOptions { if !self.default_value.is_empty() { len += 1; } - if !self.no_opt_default_value.is_empty() { - len += 1; - } if !self.deprecated.is_empty() { len += 1; } @@ -224,9 +221,6 @@ impl serde::Serialize for FlagOptions { if !self.default_value.is_empty() { struct_ser.serialize_field("defaultValue", &self.default_value)?; } - if !self.no_opt_default_value.is_empty() { - struct_ser.serialize_field("noOptDefaultValue", &self.no_opt_default_value)?; - } if !self.deprecated.is_empty() { struct_ser.serialize_field("deprecated", &self.deprecated)?; } @@ -252,8 +246,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { "usage", "default_value", "defaultValue", - "no_opt_default_value", - "noOptDefaultValue", "deprecated", "shorthand_deprecated", "shorthandDeprecated", @@ -266,7 +258,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { Shorthand, Usage, DefaultValue, - NoOptDefaultValue, Deprecated, ShorthandDeprecated, Hidden, @@ -299,9 +290,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { "shorthand" => Ok(GeneratedField::Shorthand), "usage" => Ok(GeneratedField::Usage), "defaultValue" | "default_value" => Ok(GeneratedField::DefaultValue), - "noOptDefaultValue" | "no_opt_default_value" => { - Ok(GeneratedField::NoOptDefaultValue) - } "deprecated" => Ok(GeneratedField::Deprecated), "shorthandDeprecated" | "shorthand_deprecated" => { Ok(GeneratedField::ShorthandDeprecated) @@ -330,7 +318,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { let mut shorthand__ = None; let mut usage__ = None; let mut default_value__ = None; - let mut no_opt_default_value__ = None; let mut deprecated__ = None; let mut shorthand_deprecated__ = None; let mut hidden__ = None; @@ -360,12 +347,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { } default_value__ = Some(map_.next_value()?); } - GeneratedField::NoOptDefaultValue => { - if no_opt_default_value__.is_some() { - return Err(serde::de::Error::duplicate_field("noOptDefaultValue")); - } - no_opt_default_value__ = Some(map_.next_value()?); - } GeneratedField::Deprecated => { if deprecated__.is_some() { return Err(serde::de::Error::duplicate_field("deprecated")); @@ -393,7 +374,6 @@ impl<'de> serde::Deserialize<'de> for FlagOptions { shorthand: shorthand__.unwrap_or_default(), usage: usage__.unwrap_or_default(), default_value: default_value__.unwrap_or_default(), - no_opt_default_value: no_opt_default_value__.unwrap_or_default(), deprecated: deprecated__.unwrap_or_default(), shorthand_deprecated: shorthand_deprecated__.unwrap_or_default(), hidden: hidden__.unwrap_or_default(), diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs index 3f6feabb..aad0294f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.rs @@ -3,14 +3,20 @@ #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Module { - /// blocked_module_accounts configures exceptional module accounts which should be blocked from receiving funds. - /// If left empty it defaults to the list of account names supplied in the auth module configuration as + /// blocked_module_accounts_override configures exceptional module accounts which should be blocked from receiving + /// funds. If left empty it defaults to the list of account names supplied in the auth module configuration as /// module_account_permissions #[prost(string, repeated, tag = "1")] pub blocked_module_accounts_override: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// authority defines the custom module authority. If not set, defaults to the governance module. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, + /// restrictions_order specifies the order of send restrictions and should be + /// a list of module names which provide a send restriction instance. If no + /// order is provided, then restrictions will be applied in alphabetical order + /// of module names. + #[prost(string, repeated, tag = "3")] + pub restrictions_order: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } include!("cosmos.bank.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs index 365c6c66..e5bb8310 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.module.v1.serde.rs @@ -14,6 +14,9 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { len += 1; } + if !self.restrictions_order.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.bank.module.v1.Module", len)?; if !self.blocked_module_accounts_override.is_empty() { struct_ser.serialize_field( @@ -24,6 +27,9 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { struct_ser.serialize_field("authority", &self.authority)?; } + if !self.restrictions_order.is_empty() { + struct_ser.serialize_field("restrictionsOrder", &self.restrictions_order)?; + } struct_ser.end() } } @@ -38,12 +44,15 @@ impl<'de> serde::Deserialize<'de> for Module { "blocked_module_accounts_override", "blockedModuleAccountsOverride", "authority", + "restrictions_order", + "restrictionsOrder", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { BlockedModuleAccountsOverride, Authority, + RestrictionsOrder, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -74,6 +83,9 @@ impl<'de> serde::Deserialize<'de> for Module { Ok(GeneratedField::BlockedModuleAccountsOverride) } "authority" => Ok(GeneratedField::Authority), + "restrictionsOrder" | "restrictions_order" => { + Ok(GeneratedField::RestrictionsOrder) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -95,6 +107,7 @@ impl<'de> serde::Deserialize<'de> for Module { { let mut blocked_module_accounts_override__ = None; let mut authority__ = None; + let mut restrictions_order__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::BlockedModuleAccountsOverride => { @@ -111,12 +124,19 @@ impl<'de> serde::Deserialize<'de> for Module { } authority__ = Some(map_.next_value()?); } + GeneratedField::RestrictionsOrder => { + if restrictions_order__.is_some() { + return Err(serde::de::Error::duplicate_field("restrictionsOrder")); + } + restrictions_order__ = Some(map_.next_value()?); + } } } Ok(Module { blocked_module_accounts_override: blocked_module_accounts_override__ .unwrap_or_default(), authority: authority__.unwrap_or_default(), + restrictions_order: restrictions_order__.unwrap_or_default(), }) } } 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 b4975aff..fb158cfb 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 @@ -190,6 +190,11 @@ pub struct QueryAllBalancesRequest { /// pagination defines an optional pagination for the request. #[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, } /// QueryAllBalancesResponse is the response type for the Query/AllBalances RPC /// method. @@ -305,6 +310,7 @@ pub struct QueryParamsRequest {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct QueryParamsResponse { + /// params provides the parameters of the bank module. #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } @@ -345,6 +351,24 @@ pub struct QueryDenomMetadataResponse { #[prost(message, optional, tag = "1")] pub metadata: ::core::option::Option, } +/// QueryDenomMetadataByQueryStringRequest is the request type for the Query/DenomMetadata RPC method. +/// Identical with QueryDenomMetadataRequest but receives denom as query string. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomMetadataByQueryStringRequest { + /// denom is the coin denom to query the metadata for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryDenomMetadataByQueryStringResponse is the response type for the Query/DenomMetadata RPC +/// method. Identical with QueryDenomMetadataResponse but receives denom as query string in request. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDenomMetadataByQueryStringResponse { + /// metadata describes and provides all the client information for the requested token. + #[prost(message, optional, tag = "1")] + pub metadata: ::core::option::Option, +} /// QueryDenomOwnersRequest defines the request type for the DenomOwners RPC query, /// which queries for a paginated set of all account holders of a particular /// denomination. @@ -385,6 +409,33 @@ pub struct QueryDenomOwnersResponse { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } +/// 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 { + /// denom defines the coin denomination to query all account holders for. + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// 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 { + #[prost(message, repeated, tag = "1")] + pub denom_owners: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} /// QuerySendEnabledRequest defines the RPC request for looking up SendEnabled entries. /// /// Since: cosmos-sdk 0.47 @@ -474,6 +525,7 @@ pub struct MsgUpdateParamsResponse {} #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSetSendEnabled { + /// authority is the address that controls the module. #[prost(string, tag = "1")] pub authority: ::prost::alloc::string::String, /// send_enabled is the list of entries to add or update. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs index 0095daf2..3058fc9c 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.bank.v1beta1.serde.rs @@ -1927,6 +1927,9 @@ impl serde::Serialize for QueryAllBalancesRequest { if self.pagination.is_some() { len += 1; } + if self.resolve_denom { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.bank.v1beta1.QueryAllBalancesRequest", len)?; if !self.address.is_empty() { @@ -1935,6 +1938,9 @@ impl serde::Serialize for QueryAllBalancesRequest { if let Some(v) = self.pagination.as_ref() { struct_ser.serialize_field("pagination", v)?; } + if self.resolve_denom { + struct_ser.serialize_field("resolveDenom", &self.resolve_denom)?; + } struct_ser.end() } } @@ -1945,12 +1951,13 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["address", "pagination"]; + const FIELDS: &[&str] = &["address", "pagination", "resolve_denom", "resolveDenom"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Address, Pagination, + ResolveDenom, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1978,6 +1985,7 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { match value { "address" => Ok(GeneratedField::Address), "pagination" => Ok(GeneratedField::Pagination), + "resolveDenom" | "resolve_denom" => Ok(GeneratedField::ResolveDenom), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2002,6 +2010,7 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { { let mut address__ = None; let mut pagination__ = None; + let mut resolve_denom__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Address => { @@ -2016,11 +2025,18 @@ impl<'de> serde::Deserialize<'de> for QueryAllBalancesRequest { } pagination__ = map_.next_value()?; } + GeneratedField::ResolveDenom => { + if resolve_denom__.is_some() { + return Err(serde::de::Error::duplicate_field("resolveDenom")); + } + resolve_denom__ = Some(map_.next_value()?); + } } } Ok(QueryAllBalancesRequest { address: address__.unwrap_or_default(), pagination: pagination__, + resolve_denom: resolve_denom__.unwrap_or_default(), }) } } @@ -2368,6 +2384,218 @@ impl<'de> serde::Deserialize<'de> for QueryBalanceResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomMetadataByQueryStringRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + len, + )?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataByQueryStringRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denom" => Ok(GeneratedField::Denom), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomMetadataByQueryStringRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Denom => { + if denom__.is_some() { + return Err(serde::de::Error::duplicate_field("denom")); + } + denom__ = Some(map_.next_value()?); + } + } + } + Ok(QueryDenomMetadataByQueryStringRequest { + denom: denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomMetadataByQueryStringResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.metadata.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + len, + )?; + if let Some(v) = self.metadata.as_ref() { + struct_ser.serialize_field("metadata", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomMetadataByQueryStringResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["metadata"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Metadata, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "metadata" => Ok(GeneratedField::Metadata), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomMetadataByQueryStringResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut metadata__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Metadata => { + if metadata__.is_some() { + return Err(serde::de::Error::duplicate_field("metadata")); + } + metadata__ = map_.next_value()?; + } + } + } + Ok(QueryDenomMetadataByQueryStringResponse { + metadata: metadata__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.QueryDenomMetadataByQueryStringResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for QueryDenomMetadataRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -2574,6 +2802,244 @@ impl<'de> serde::Deserialize<'de> for QueryDenomMetadataResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomOwnersByQueryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", len)?; + if !self.denom.is_empty() { + struct_ser.serialize_field("denom", &self.denom)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersByQueryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Denom, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denom" => Ok(GeneratedField::Denom), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomOwnersByQueryRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Denom => { + if denom__.is_some() { + return Err(serde::de::Error::duplicate_field("denom")); + } + denom__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDenomOwnersByQueryRequest { + denom: denom__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.QueryDenomOwnersByQueryRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDenomOwnersByQueryResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.denom_owners.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", len)?; + if !self.denom_owners.is_empty() { + struct_ser.serialize_field("denomOwners", &self.denom_owners)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDenomOwnersByQueryResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["denom_owners", "denomOwners", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DenomOwners, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "denomOwners" | "denom_owners" => Ok(GeneratedField::DenomOwners), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryDenomOwnersByQueryResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut denom_owners__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DenomOwners => { + if denom_owners__.is_some() { + return Err(serde::de::Error::duplicate_field("denomOwners")); + } + denom_owners__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryDenomOwnersByQueryResponse { + denom_owners: denom_owners__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.bank.v1beta1.QueryDenomOwnersByQueryResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for QueryDenomOwnersRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result 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 4eb8114a..e86d9985 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 @@ -246,6 +246,30 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn denom_metadata_by_query_string( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.bank.v1beta1.Query", + "DenomMetadataByQueryString", + )); + self.inner.unary(req, path, codec).await + } pub async fn denoms_metadata( &mut self, request: impl tonic::IntoRequest, @@ -286,6 +310,30 @@ pub mod query_client { .insert(GrpcMethod::new("cosmos.bank.v1beta1.Query", "DenomOwners")); self.inner.unary(req, path, codec).await } + pub async fn denom_owners_by_query( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.bank.v1beta1.Query", + "DenomOwnersByQuery", + )); + self.inner.unary(req, path, codec).await + } pub async fn send_enabled( &mut self, request: impl tonic::IntoRequest, @@ -353,6 +401,13 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn denom_metadata_by_query_string( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn denoms_metadata( &self, request: tonic::Request, @@ -361,6 +416,13 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn denom_owners_by_query( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; async fn send_enabled( &self, request: tonic::Request, @@ -754,6 +816,49 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Query/DenomMetadataByQueryString" => { + #[allow(non_camel_case_types)] + struct DenomMetadataByQueryStringSvc(pub Arc); + impl + tonic::server::UnaryService + for DenomMetadataByQueryStringSvc + { + type Response = super::QueryDenomMetadataByQueryStringResponse; + 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).denom_metadata_by_query_string(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DenomMetadataByQueryStringSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.bank.v1beta1.Query/DenomsMetadata" => { #[allow(non_camel_case_types)] struct DenomsMetadataSvc(pub Arc); @@ -832,6 +937,47 @@ pub mod query_server { }; Box::pin(fut) } + "/cosmos.bank.v1beta1.Query/DenomOwnersByQuery" => { + #[allow(non_camel_case_types)] + struct DenomOwnersByQuerySvc(pub Arc); + impl + tonic::server::UnaryService + for DenomOwnersByQuerySvc + { + type Response = super::QueryDenomOwnersByQueryResponse; + 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).denom_owners_by_query(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = DenomOwnersByQuerySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.bank.v1beta1.Query/SendEnabled" => { #[allow(non_camel_case_types)] struct SendEnabledSvc(pub Arc); 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 32cc85c9..f00aa3e7 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 @@ -178,5 +178,28 @@ pub struct SearchTxsResult { #[prost(message, repeated, tag = "6")] pub txs: ::prost::alloc::vec::Vec, } +/// SearchBlocksResult defines a structure for querying blocks pageable +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SearchBlocksResult { + /// Count of all blocks + #[prost(int64, tag = "1")] + pub total_count: i64, + /// Count of blocks in current page + #[prost(int64, tag = "2")] + pub count: i64, + /// Index of current page, start from 1 + #[prost(int64, tag = "3")] + pub page_number: i64, + /// Count of total pages + #[prost(int64, tag = "4")] + pub page_total: i64, + /// Max count blocks per page + #[prost(int64, tag = "5")] + pub limit: i64, + /// List of blocks in current page + #[prost(message, repeated, tag = "6")] + pub blocks: ::prost::alloc::vec::Vec<::tendermint_proto::v0_34::types::Block>, +} include!("cosmos.base.abci.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs index 83877efe..e88d6543 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.abci.v1beta1.serde.rs @@ -645,6 +645,223 @@ impl<'de> serde::Deserialize<'de> for Result { } } #[cfg(feature = "serde")] +impl serde::Serialize for SearchBlocksResult { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.total_count != 0 { + len += 1; + } + if self.count != 0 { + len += 1; + } + if self.page_number != 0 { + len += 1; + } + if self.page_total != 0 { + len += 1; + } + if self.limit != 0 { + len += 1; + } + if !self.blocks.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.abci.v1beta1.SearchBlocksResult", len)?; + if self.total_count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "totalCount", + ToString::to_string(&self.total_count).as_str(), + )?; + } + if self.count != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("count", ToString::to_string(&self.count).as_str())?; + } + if self.page_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "pageNumber", + ToString::to_string(&self.page_number).as_str(), + )?; + } + if self.page_total != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("pageTotal", ToString::to_string(&self.page_total).as_str())?; + } + if self.limit != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; + } + if !self.blocks.is_empty() { + struct_ser.serialize_field("blocks", &self.blocks)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SearchBlocksResult { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "total_count", + "totalCount", + "count", + "page_number", + "pageNumber", + "page_total", + "pageTotal", + "limit", + "blocks", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + TotalCount, + Count, + PageNumber, + PageTotal, + Limit, + Blocks, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "totalCount" | "total_count" => Ok(GeneratedField::TotalCount), + "count" => Ok(GeneratedField::Count), + "pageNumber" | "page_number" => Ok(GeneratedField::PageNumber), + "pageTotal" | "page_total" => Ok(GeneratedField::PageTotal), + "limit" => Ok(GeneratedField::Limit), + "blocks" => Ok(GeneratedField::Blocks), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SearchBlocksResult; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.abci.v1beta1.SearchBlocksResult") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut total_count__ = None; + let mut count__ = None; + let mut page_number__ = None; + let mut page_total__ = None; + let mut limit__ = None; + let mut blocks__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::TotalCount => { + if total_count__.is_some() { + return Err(serde::de::Error::duplicate_field("totalCount")); + } + total_count__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Count => { + if count__.is_some() { + return Err(serde::de::Error::duplicate_field("count")); + } + count__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::PageNumber => { + if page_number__.is_some() { + return Err(serde::de::Error::duplicate_field("pageNumber")); + } + page_number__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::PageTotal => { + if page_total__.is_some() { + return Err(serde::de::Error::duplicate_field("pageTotal")); + } + page_total__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Limit => { + if limit__.is_some() { + return Err(serde::de::Error::duplicate_field("limit")); + } + limit__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Blocks => { + if blocks__.is_some() { + return Err(serde::de::Error::duplicate_field("blocks")); + } + blocks__ = Some(map_.next_value()?); + } + } + } + Ok(SearchBlocksResult { + total_count: total_count__.unwrap_or_default(), + count: count__.unwrap_or_default(), + page_number: page_number__.unwrap_or_default(), + page_total: page_total__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + blocks: blocks__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.base.abci.v1beta1.SearchBlocksResult", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for SearchTxsResult { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs index 5b2fcbb4..31577657 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.rs @@ -9,6 +9,36 @@ pub struct ConfigRequest {} pub struct ConfigResponse { #[prost(string, tag = "1")] pub minimum_gas_price: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub pruning_keep_recent: ::prost::alloc::string::String, + #[prost(string, tag = "3")] + pub pruning_interval: ::prost::alloc::string::String, + #[prost(uint64, tag = "4")] + pub halt_height: u64, +} +/// StateRequest defines the request structure for the status of a node. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StatusRequest {} +/// StateResponse defines the response structure for the status of a node. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct StatusResponse { + /// earliest block height available in the store + #[prost(uint64, tag = "1")] + pub earliest_store_height: u64, + /// current block height + #[prost(uint64, tag = "2")] + pub height: u64, + /// block height timestamp + #[prost(message, optional, tag = "3")] + pub timestamp: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, + /// app hash of the current block + #[prost(bytes = "vec", tag = "4")] + pub app_hash: ::prost::alloc::vec::Vec, + /// validator hash provided by the consensus header + #[prost(bytes = "vec", tag = "5")] + pub validator_hash: ::prost::alloc::vec::Vec, } include!("cosmos.base.node.v1beta1.serde.rs"); include!("cosmos.base.node.v1beta1.tonic.rs"); diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs index 55dbf379..08fe7989 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.node.v1beta1.serde.rs @@ -90,11 +90,33 @@ impl serde::Serialize for ConfigResponse { if !self.minimum_gas_price.is_empty() { len += 1; } + if !self.pruning_keep_recent.is_empty() { + len += 1; + } + if !self.pruning_interval.is_empty() { + len += 1; + } + if self.halt_height != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.base.node.v1beta1.ConfigResponse", len)?; if !self.minimum_gas_price.is_empty() { struct_ser.serialize_field("minimumGasPrice", &self.minimum_gas_price)?; } + if !self.pruning_keep_recent.is_empty() { + struct_ser.serialize_field("pruningKeepRecent", &self.pruning_keep_recent)?; + } + if !self.pruning_interval.is_empty() { + struct_ser.serialize_field("pruningInterval", &self.pruning_interval)?; + } + if self.halt_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "haltHeight", + ToString::to_string(&self.halt_height).as_str(), + )?; + } struct_ser.end() } } @@ -105,11 +127,23 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["minimum_gas_price", "minimumGasPrice"]; + const FIELDS: &[&str] = &[ + "minimum_gas_price", + "minimumGasPrice", + "pruning_keep_recent", + "pruningKeepRecent", + "pruning_interval", + "pruningInterval", + "halt_height", + "haltHeight", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { MinimumGasPrice, + PruningKeepRecent, + PruningInterval, + HaltHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -138,6 +172,13 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { "minimumGasPrice" | "minimum_gas_price" => { Ok(GeneratedField::MinimumGasPrice) } + "pruningKeepRecent" | "pruning_keep_recent" => { + Ok(GeneratedField::PruningKeepRecent) + } + "pruningInterval" | "pruning_interval" => { + Ok(GeneratedField::PruningInterval) + } + "haltHeight" | "halt_height" => Ok(GeneratedField::HaltHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -158,6 +199,9 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { V: serde::de::MapAccess<'de>, { let mut minimum_gas_price__ = None; + let mut pruning_keep_recent__ = None; + let mut pruning_interval__ = None; + let mut halt_height__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::MinimumGasPrice => { @@ -166,10 +210,34 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { } minimum_gas_price__ = Some(map_.next_value()?); } + GeneratedField::PruningKeepRecent => { + if pruning_keep_recent__.is_some() { + return Err(serde::de::Error::duplicate_field("pruningKeepRecent")); + } + pruning_keep_recent__ = Some(map_.next_value()?); + } + GeneratedField::PruningInterval => { + if pruning_interval__.is_some() { + return Err(serde::de::Error::duplicate_field("pruningInterval")); + } + pruning_interval__ = Some(map_.next_value()?); + } + GeneratedField::HaltHeight => { + if halt_height__.is_some() { + return Err(serde::de::Error::duplicate_field("haltHeight")); + } + halt_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } } } Ok(ConfigResponse { minimum_gas_price: minimum_gas_price__.unwrap_or_default(), + pruning_keep_recent: pruning_keep_recent__.unwrap_or_default(), + pruning_interval: pruning_interval__.unwrap_or_default(), + halt_height: halt_height__.unwrap_or_default(), }) } } @@ -180,3 +248,284 @@ impl<'de> serde::Deserialize<'de> for ConfigResponse { ) } } +#[cfg(feature = "serde")] +impl serde::Serialize for StatusRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.base.node.v1beta1.StatusRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StatusRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StatusRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.StatusRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(StatusRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.base.node.v1beta1.StatusRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for StatusResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.earliest_store_height != 0 { + len += 1; + } + if self.height != 0 { + len += 1; + } + if self.timestamp.is_some() { + len += 1; + } + if !self.app_hash.is_empty() { + len += 1; + } + if !self.validator_hash.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.base.node.v1beta1.StatusResponse", len)?; + if self.earliest_store_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "earliestStoreHeight", + ToString::to_string(&self.earliest_store_height).as_str(), + )?; + } + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if let Some(v) = self.timestamp.as_ref() { + struct_ser.serialize_field("timestamp", v)?; + } + if !self.app_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "appHash", + pbjson::private::base64::encode(&self.app_hash).as_str(), + )?; + } + if !self.validator_hash.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "validatorHash", + pbjson::private::base64::encode(&self.validator_hash).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for StatusResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "earliest_store_height", + "earliestStoreHeight", + "height", + "timestamp", + "app_hash", + "appHash", + "validator_hash", + "validatorHash", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + EarliestStoreHeight, + Height, + Timestamp, + AppHash, + ValidatorHash, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "earliestStoreHeight" | "earliest_store_height" => { + Ok(GeneratedField::EarliestStoreHeight) + } + "height" => Ok(GeneratedField::Height), + "timestamp" => Ok(GeneratedField::Timestamp), + "appHash" | "app_hash" => Ok(GeneratedField::AppHash), + "validatorHash" | "validator_hash" => Ok(GeneratedField::ValidatorHash), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = StatusResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.base.node.v1beta1.StatusResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut earliest_store_height__ = None; + let mut height__ = None; + let mut timestamp__ = None; + let mut app_hash__ = None; + let mut validator_hash__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::EarliestStoreHeight => { + if earliest_store_height__.is_some() { + return Err(serde::de::Error::duplicate_field( + "earliestStoreHeight", + )); + } + earliest_store_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = map_.next_value()?; + } + GeneratedField::AppHash => { + if app_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("appHash")); + } + app_hash__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ValidatorHash => { + if validator_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorHash")); + } + validator_hash__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(StatusResponse { + earliest_store_height: earliest_store_height__.unwrap_or_default(), + height: height__.unwrap_or_default(), + timestamp: timestamp__, + app_hash: app_hash__.unwrap_or_default(), + validator_hash: validator_hash__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.base.node.v1beta1.StatusResponse", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/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 006e2c3d..f2833d8e 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 @@ -105,6 +105,26 @@ pub mod service_client { )); self.inner.unary(req, path, codec).await } + pub async fn status( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.base.node.v1beta1.Service/Status"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.base.node.v1beta1.Service", + "Status", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -119,6 +139,10 @@ pub mod service_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn status( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct ServiceServer { @@ -234,6 +258,44 @@ pub mod service_server { }; Box::pin(fut) } + "/cosmos.base.node.v1beta1.Service/Status" => { + #[allow(non_camel_case_types)] + struct StatusSvc(pub Arc); + impl tonic::server::UnaryService for StatusSvc { + type Response = super::StatusResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).status(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = StatusSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs index 8a02bbd7..3e853ec9 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.v1beta1.rs @@ -24,6 +24,7 @@ pub struct DecCoin { pub amount: ::prost::alloc::string::String, } /// IntProto defines a Protobuf wrapper around an Int object. +/// Deprecated: Prefer to use math.Int directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct IntProto { @@ -31,6 +32,7 @@ pub struct IntProto { pub int: ::prost::alloc::string::String, } /// DecProto defines a Protobuf wrapper around a Dec object. +/// Deprecated: Prefer to use math.LegacyDec directly. It supports binary Marshal and Unmarshal. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct DecProto { diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs deleted file mode 100644 index 406e1034..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.rs +++ /dev/null @@ -1,12 +0,0 @@ -// @generated -/// Module is the config object of the capability module. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Module { - /// seal_keeper defines if keeper.Seal() will run on BeginBlock() to prevent further modules from creating a scoped - /// keeper. For more details check x/capability/keeper.go. - #[prost(bool, tag = "1")] - pub seal_keeper: bool, -} -include!("cosmos.capability.module.v1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs deleted file mode 100644 index 2e2a7da7..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.rs +++ /dev/null @@ -1,52 +0,0 @@ -// @generated -/// Capability defines an implementation of an object capability. The index -/// provided to a Capability must be globally unique. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Capability { - #[prost(uint64, tag = "1")] - pub index: u64, -} -/// Owner defines a single capability owner. An owner is defined by the name of -/// capability and the module name. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Owner { - #[prost(string, tag = "1")] - pub module: ::prost::alloc::string::String, - #[prost(string, tag = "2")] - pub name: ::prost::alloc::string::String, -} -/// CapabilityOwners defines a set of owners of a single Capability. The set of -/// owners must be unique. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct CapabilityOwners { - #[prost(message, repeated, tag = "1")] - pub owners: ::prost::alloc::vec::Vec, -} -/// GenesisOwners defines the capability owners with their corresponding index. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisOwners { - /// index is the index of the capability owner. - #[prost(uint64, tag = "1")] - pub index: u64, - /// index_owners are the owners at the given index. - #[prost(message, optional, tag = "2")] - pub index_owners: ::core::option::Option, -} -/// GenesisState defines the capability module's genesis state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct GenesisState { - /// index is the capability global index. - #[prost(uint64, tag = "1")] - pub index: u64, - /// owners represents a map from index to owners of the capability index - /// index key is string to allow amino marshalling. - #[prost(message, repeated, tag = "2")] - pub owners: ::prost::alloc::vec::Vec, -} -include!("cosmos.capability.v1beta1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs deleted file mode 100644 index 0ee701e3..00000000 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.v1beta1.serde.rs +++ /dev/null @@ -1,556 +0,0 @@ -// @generated -#[cfg(feature = "serde")] -impl serde::Serialize for Capability { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.index != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.v1beta1.Capability", len)?; - if self.index != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Capability { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["index"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Index, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "index" => Ok(GeneratedField::Index), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Capability; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.v1beta1.Capability") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut index__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } - } - Ok(Capability { - index: index__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.capability.v1beta1.Capability", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for CapabilityOwners { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.owners.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.v1beta1.CapabilityOwners", len)?; - if !self.owners.is_empty() { - struct_ser.serialize_field("owners", &self.owners)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for CapabilityOwners { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["owners"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Owners, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "owners" => Ok(GeneratedField::Owners), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = CapabilityOwners; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.v1beta1.CapabilityOwners") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut owners__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Owners => { - if owners__.is_some() { - return Err(serde::de::Error::duplicate_field("owners")); - } - owners__ = Some(map_.next_value()?); - } - } - } - Ok(CapabilityOwners { - owners: owners__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.capability.v1beta1.CapabilityOwners", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for GenesisOwners { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.index != 0 { - len += 1; - } - if self.index_owners.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.v1beta1.GenesisOwners", len)?; - if self.index != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; - } - if let Some(v) = self.index_owners.as_ref() { - struct_ser.serialize_field("indexOwners", v)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for GenesisOwners { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["index", "index_owners", "indexOwners"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Index, - IndexOwners, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "index" => Ok(GeneratedField::Index), - "indexOwners" | "index_owners" => Ok(GeneratedField::IndexOwners), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GenesisOwners; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.v1beta1.GenesisOwners") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut index__ = None; - let mut index_owners__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::IndexOwners => { - if index_owners__.is_some() { - return Err(serde::de::Error::duplicate_field("indexOwners")); - } - index_owners__ = map_.next_value()?; - } - } - } - Ok(GenesisOwners { - index: index__.unwrap_or_default(), - index_owners: index_owners__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.capability.v1beta1.GenesisOwners", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for GenesisState { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.index != 0 { - len += 1; - } - if !self.owners.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.v1beta1.GenesisState", len)?; - if self.index != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("index", ToString::to_string(&self.index).as_str())?; - } - if !self.owners.is_empty() { - struct_ser.serialize_field("owners", &self.owners)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for GenesisState { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["index", "owners"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Index, - Owners, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "index" => Ok(GeneratedField::Index), - "owners" => Ok(GeneratedField::Owners), - _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.v1beta1.GenesisState") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut index__ = None; - let mut owners__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Index => { - if index__.is_some() { - return Err(serde::de::Error::duplicate_field("index")); - } - index__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Owners => { - if owners__.is_some() { - return Err(serde::de::Error::duplicate_field("owners")); - } - owners__ = Some(map_.next_value()?); - } - } - } - Ok(GenesisState { - index: index__.unwrap_or_default(), - owners: owners__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.capability.v1beta1.GenesisState", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for Owner { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.module.is_empty() { - len += 1; - } - if !self.name.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.capability.v1beta1.Owner", len)?; - if !self.module.is_empty() { - struct_ser.serialize_field("module", &self.module)?; - } - if !self.name.is_empty() { - struct_ser.serialize_field("name", &self.name)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Owner { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["module", "name"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Module, - Name, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "module" => Ok(GeneratedField::Module), - "name" => Ok(GeneratedField::Name), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Owner; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.v1beta1.Owner") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut module__ = None; - let mut name__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Module => { - if module__.is_some() { - return Err(serde::de::Error::duplicate_field("module")); - } - module__ = Some(map_.next_value()?); - } - GeneratedField::Name => { - if name__.is_some() { - return Err(serde::de::Error::duplicate_field("name")); - } - name__ = Some(map_.next_value()?); - } - } - } - Ok(Owner { - module: module__.unwrap_or_default(), - name: name__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.capability.v1beta1.Owner", FIELDS, GeneratedVisitor) - } -} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.rs new file mode 100644 index 00000000..9ab8a182 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.rs @@ -0,0 +1,11 @@ +// @generated +/// Module is the config object of the circuit 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, +} +include!("cosmos.circuit.module.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.serde.rs similarity index 72% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.serde.rs index a0a6caca..2c63e9f4 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.capability.module.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.module.v1.serde.rs @@ -8,13 +8,12 @@ impl serde::Serialize for Module { { use serde::ser::SerializeStruct; let mut len = 0; - if self.seal_keeper { + if !self.authority.is_empty() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("cosmos.capability.module.v1.Module", len)?; - if self.seal_keeper { - struct_ser.serialize_field("sealKeeper", &self.seal_keeper)?; + let mut struct_ser = serializer.serialize_struct("cosmos.circuit.module.v1.Module", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; } struct_ser.end() } @@ -26,11 +25,11 @@ impl<'de> serde::Deserialize<'de> for Module { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["seal_keeper", "sealKeeper"]; + const FIELDS: &[&str] = &["authority"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SealKeeper, + Authority, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -56,7 +55,7 @@ impl<'de> serde::Deserialize<'de> for Module { E: serde::de::Error, { match value { - "sealKeeper" | "seal_keeper" => Ok(GeneratedField::SealKeeper), + "authority" => Ok(GeneratedField::Authority), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -69,33 +68,29 @@ impl<'de> serde::Deserialize<'de> for Module { type Value = Module; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.capability.module.v1.Module") + formatter.write_str("struct cosmos.circuit.module.v1.Module") } fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut seal_keeper__ = None; + let mut authority__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SealKeeper => { - if seal_keeper__.is_some() { - return Err(serde::de::Error::duplicate_field("sealKeeper")); + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); } - seal_keeper__ = Some(map_.next_value()?); + authority__ = Some(map_.next_value()?); } } } Ok(Module { - seal_keeper: seal_keeper__.unwrap_or_default(), + authority: authority__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "cosmos.capability.module.v1.Module", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.circuit.module.v1.Module", FIELDS, GeneratedVisitor) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.rs new file mode 100644 index 00000000..81147990 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.rs @@ -0,0 +1,191 @@ +// @generated +/// Permissions are the permissions that an account has to trip +/// or reset the circuit breaker. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Permissions { + /// level is the level of permissions granted to this account. + #[prost(enumeration = "permissions::Level", tag = "1")] + pub level: i32, + /// limit_type_urls is used with LEVEL_SOME_MSGS to limit the lists of Msg type + /// URLs that the account can trip. It is an error to use limit_type_urls with + /// a level other than LEVEL_SOME_MSGS. + #[prost(string, repeated, tag = "2")] + pub limit_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// Nested message and enum types in `Permissions`. +pub mod permissions { + /// Level is the permission level. + #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] + #[repr(i32)] + pub enum Level { + /// LEVEL_NONE_UNSPECIFIED indicates that the account will have no circuit + /// breaker permissions. + NoneUnspecified = 0, + /// LEVEL_SOME_MSGS indicates that the account will have permission to + /// trip or reset the circuit breaker for some Msg type URLs. If this level + /// is chosen, a non-empty list of Msg type URLs must be provided in + /// limit_type_urls. + SomeMsgs = 1, + /// LEVEL_ALL_MSGS indicates that the account can trip or reset the circuit + /// breaker for Msg's of all type URLs. + AllMsgs = 2, + /// LEVEL_SUPER_ADMIN indicates that the account can take all circuit breaker + /// actions and can grant permissions to other accounts. + SuperAdmin = 3, + } + impl Level { + /// 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 { + Level::NoneUnspecified => "LEVEL_NONE_UNSPECIFIED", + Level::SomeMsgs => "LEVEL_SOME_MSGS", + Level::AllMsgs => "LEVEL_ALL_MSGS", + Level::SuperAdmin => "LEVEL_SUPER_ADMIN", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "LEVEL_NONE_UNSPECIFIED" => Some(Self::NoneUnspecified), + "LEVEL_SOME_MSGS" => Some(Self::SomeMsgs), + "LEVEL_ALL_MSGS" => Some(Self::AllMsgs), + "LEVEL_SUPER_ADMIN" => Some(Self::SuperAdmin), + _ => None, + } + } + } +} +/// GenesisAccountPermissions is the account permissions for the circuit breaker in genesis +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisAccountPermissions { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, + #[prost(message, optional, tag = "2")] + pub permissions: ::core::option::Option, +} +/// GenesisState is the state that must be provided at genesis. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + #[prost(message, repeated, tag = "1")] + pub account_permissions: ::prost::alloc::vec::Vec, + #[prost(string, repeated, tag = "2")] + pub disabled_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// QueryAccountRequest is the request type for the Query/Account RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountRequest { + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} +/// AccountResponse is the response type for the Query/Account RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountResponse { + #[prost(message, optional, tag = "1")] + pub permission: ::core::option::Option, +} +/// QueryAccountsRequest is the request type for the Query/Accounts RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryAccountsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option, +} +/// AccountsResponse is the response type for the Query/Accounts RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct AccountsResponse { + #[prost(message, repeated, tag = "1")] + pub accounts: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option, +} +/// QueryDisableListRequest is the request type for the Query/DisabledList RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryDisabledListRequest {} +/// DisabledListResponse is the response type for the Query/DisabledList RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct DisabledListResponse { + #[prost(string, repeated, tag = "1")] + pub disabled_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgAuthorizeCircuitBreaker defines the Msg/AuthorizeCircuitBreaker request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAuthorizeCircuitBreaker { + /// granter is the granter of the circuit breaker permissions and must have + /// LEVEL_SUPER_ADMIN. + #[prost(string, tag = "1")] + pub granter: ::prost::alloc::string::String, + /// grantee is the account authorized with the provided permissions. + #[prost(string, tag = "2")] + pub grantee: ::prost::alloc::string::String, + /// permissions are the circuit breaker permissions that the grantee receives. + /// These will overwrite any existing permissions. LEVEL_NONE_UNSPECIFIED can + /// be specified to revoke all permissions. + #[prost(message, optional, tag = "3")] + pub permissions: ::core::option::Option, +} +/// MsgAuthorizeCircuitBreakerResponse defines the Msg/AuthorizeCircuitBreaker response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgAuthorizeCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +/// MsgTripCircuitBreaker defines the Msg/TripCircuitBreaker request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTripCircuitBreaker { + /// authority is the account authorized to trip the circuit breaker. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// msg_type_urls specifies a list of type URLs to immediately stop processing. + /// IF IT IS LEFT EMPTY, ALL MSG PROCESSING WILL STOP IMMEDIATELY. + /// This value is validated against the authority's permissions and if the + /// authority does not have permissions to trip the specified msg type URLs + /// (or all URLs), the operation will fail. + #[prost(string, repeated, tag = "2")] + pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgTripCircuitBreakerResponse defines the Msg/TripCircuitBreaker response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgTripCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +/// MsgResetCircuitBreaker defines the Msg/ResetCircuitBreaker request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgResetCircuitBreaker { + /// authority is the account authorized to trip or reset the circuit breaker. + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// msg_type_urls specifies a list of Msg type URLs to resume processing. If + /// it is left empty all Msg processing for type URLs that the account is + /// authorized to trip will resume. + #[prost(string, repeated, tag = "3")] + pub msg_type_urls: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// MsgResetCircuitBreakerResponse defines the Msg/ResetCircuitBreaker response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgResetCircuitBreakerResponse { + #[prost(bool, tag = "1")] + pub success: bool, +} +include!("cosmos.circuit.v1.serde.rs"); +include!("cosmos.circuit.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.serde.rs new file mode 100644 index 00000000..5e263f53 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.serde.rs @@ -0,0 +1,1723 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for AccountResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.permission.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.AccountResponse", len)?; + if let Some(v) = self.permission.as_ref() { + struct_ser.serialize_field("permission", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccountResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["permission"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Permission, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "permission" => Ok(GeneratedField::Permission), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AccountResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.AccountResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut permission__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Permission => { + if permission__.is_some() { + return Err(serde::de::Error::duplicate_field("permission")); + } + permission__ = map_.next_value()?; + } + } + } + Ok(AccountResponse { + permission: permission__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.AccountResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for AccountsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.accounts.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.AccountsResponse", len)?; + if !self.accounts.is_empty() { + struct_ser.serialize_field("accounts", &self.accounts)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for AccountsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["accounts", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Accounts, + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "accounts" => Ok(GeneratedField::Accounts), + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = AccountsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.AccountsResponse") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut accounts__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Accounts => { + if accounts__.is_some() { + return Err(serde::de::Error::duplicate_field("accounts")); + } + accounts__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(AccountsResponse { + accounts: accounts__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.AccountsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for DisabledListResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.disabled_list.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.DisabledListResponse", len)?; + if !self.disabled_list.is_empty() { + struct_ser.serialize_field("disabledList", &self.disabled_list)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for DisabledListResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["disabled_list", "disabledList"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + DisabledList, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "disabledList" | "disabled_list" => Ok(GeneratedField::DisabledList), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = DisabledListResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.DisabledListResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut disabled_list__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::DisabledList => { + if disabled_list__.is_some() { + return Err(serde::de::Error::duplicate_field("disabledList")); + } + disabled_list__ = Some(map_.next_value()?); + } + } + } + Ok(DisabledListResponse { + disabled_list: disabled_list__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.DisabledListResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisAccountPermissions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + if self.permissions.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.GenesisAccountPermissions", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + if let Some(v) = self.permissions.as_ref() { + struct_ser.serialize_field("permissions", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisAccountPermissions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address", "permissions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + Permissions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + "permissions" => Ok(GeneratedField::Permissions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GenesisAccountPermissions; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.GenesisAccountPermissions") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + let mut permissions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + GeneratedField::Permissions => { + if permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("permissions")); + } + permissions__ = map_.next_value()?; + } + } + } + Ok(GenesisAccountPermissions { + address: address__.unwrap_or_default(), + permissions: permissions__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.GenesisAccountPermissions", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for GenesisState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.account_permissions.is_empty() { + len += 1; + } + if !self.disabled_type_urls.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.circuit.v1.GenesisState", len)?; + if !self.account_permissions.is_empty() { + struct_ser.serialize_field("accountPermissions", &self.account_permissions)?; + } + if !self.disabled_type_urls.is_empty() { + struct_ser.serialize_field("disabledTypeUrls", &self.disabled_type_urls)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for GenesisState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "account_permissions", + "accountPermissions", + "disabled_type_urls", + "disabledTypeUrls", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AccountPermissions, + DisabledTypeUrls, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "accountPermissions" | "account_permissions" => { + Ok(GeneratedField::AccountPermissions) + } + "disabledTypeUrls" | "disabled_type_urls" => { + Ok(GeneratedField::DisabledTypeUrls) + } + _ => 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 std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.GenesisState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut account_permissions__ = None; + let mut disabled_type_urls__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AccountPermissions => { + if account_permissions__.is_some() { + return Err(serde::de::Error::duplicate_field( + "accountPermissions", + )); + } + account_permissions__ = Some(map_.next_value()?); + } + GeneratedField::DisabledTypeUrls => { + if disabled_type_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("disabledTypeUrls")); + } + disabled_type_urls__ = Some(map_.next_value()?); + } + } + } + Ok(GenesisState { + account_permissions: account_permissions__.unwrap_or_default(), + disabled_type_urls: disabled_type_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.circuit.v1.GenesisState", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgAuthorizeCircuitBreaker { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.granter.is_empty() { + len += 1; + } + if !self.grantee.is_empty() { + len += 1; + } + if self.permissions.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", len)?; + if !self.granter.is_empty() { + struct_ser.serialize_field("granter", &self.granter)?; + } + if !self.grantee.is_empty() { + struct_ser.serialize_field("grantee", &self.grantee)?; + } + if let Some(v) = self.permissions.as_ref() { + struct_ser.serialize_field("permissions", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgAuthorizeCircuitBreaker { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["granter", "grantee", "permissions"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Granter, + Grantee, + Permissions, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "granter" => Ok(GeneratedField::Granter), + "grantee" => Ok(GeneratedField::Grantee), + "permissions" => Ok(GeneratedField::Permissions), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgAuthorizeCircuitBreaker; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgAuthorizeCircuitBreaker") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut granter__ = None; + let mut grantee__ = None; + let mut permissions__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Granter => { + if granter__.is_some() { + return Err(serde::de::Error::duplicate_field("granter")); + } + granter__ = Some(map_.next_value()?); + } + GeneratedField::Grantee => { + if grantee__.is_some() { + return Err(serde::de::Error::duplicate_field("grantee")); + } + grantee__ = Some(map_.next_value()?); + } + GeneratedField::Permissions => { + if permissions__.is_some() { + return Err(serde::de::Error::duplicate_field("permissions")); + } + permissions__ = map_.next_value()?; + } + } + } + Ok(MsgAuthorizeCircuitBreaker { + granter: granter__.unwrap_or_default(), + grantee: grantee__.unwrap_or_default(), + permissions: permissions__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgAuthorizeCircuitBreaker", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgAuthorizeCircuitBreakerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.success { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse", len)?; + if self.success { + struct_ser.serialize_field("success", &self.success)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgAuthorizeCircuitBreakerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["success"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Success, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "success" => Ok(GeneratedField::Success), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgAuthorizeCircuitBreakerResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut success__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Success => { + if success__.is_some() { + return Err(serde::de::Error::duplicate_field("success")); + } + success__ = Some(map_.next_value()?); + } + } + } + Ok(MsgAuthorizeCircuitBreakerResponse { + success: success__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgAuthorizeCircuitBreakerResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgResetCircuitBreaker { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if !self.msg_type_urls.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.MsgResetCircuitBreaker", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if !self.msg_type_urls.is_empty() { + struct_ser.serialize_field("msgTypeUrls", &self.msg_type_urls)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgResetCircuitBreaker { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "msg_type_urls", "msgTypeUrls"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + MsgTypeUrls, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "msgTypeUrls" | "msg_type_urls" => Ok(GeneratedField::MsgTypeUrls), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgResetCircuitBreaker; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgResetCircuitBreaker") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut msg_type_urls__ = 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::MsgTypeUrls => { + if msg_type_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("msgTypeUrls")); + } + msg_type_urls__ = Some(map_.next_value()?); + } + } + } + Ok(MsgResetCircuitBreaker { + authority: authority__.unwrap_or_default(), + msg_type_urls: msg_type_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgResetCircuitBreaker", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgResetCircuitBreakerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.success { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.MsgResetCircuitBreakerResponse", len)?; + if self.success { + struct_ser.serialize_field("success", &self.success)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgResetCircuitBreakerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["success"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Success, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "success" => Ok(GeneratedField::Success), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgResetCircuitBreakerResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgResetCircuitBreakerResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut success__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Success => { + if success__.is_some() { + return Err(serde::de::Error::duplicate_field("success")); + } + success__ = Some(map_.next_value()?); + } + } + } + Ok(MsgResetCircuitBreakerResponse { + success: success__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgResetCircuitBreakerResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgTripCircuitBreaker { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.authority.is_empty() { + len += 1; + } + if !self.msg_type_urls.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.MsgTripCircuitBreaker", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; + } + if !self.msg_type_urls.is_empty() { + struct_ser.serialize_field("msgTypeUrls", &self.msg_type_urls)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgTripCircuitBreaker { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["authority", "msg_type_urls", "msgTypeUrls"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Authority, + MsgTypeUrls, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "authority" => Ok(GeneratedField::Authority), + "msgTypeUrls" | "msg_type_urls" => Ok(GeneratedField::MsgTypeUrls), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTripCircuitBreaker; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgTripCircuitBreaker") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut authority__ = None; + let mut msg_type_urls__ = 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::MsgTypeUrls => { + if msg_type_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("msgTypeUrls")); + } + msg_type_urls__ = Some(map_.next_value()?); + } + } + } + Ok(MsgTripCircuitBreaker { + authority: authority__.unwrap_or_default(), + msg_type_urls: msg_type_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgTripCircuitBreaker", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgTripCircuitBreakerResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.success { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.MsgTripCircuitBreakerResponse", len)?; + if self.success { + struct_ser.serialize_field("success", &self.success)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgTripCircuitBreakerResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["success"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Success, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "success" => Ok(GeneratedField::Success), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgTripCircuitBreakerResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.MsgTripCircuitBreakerResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut success__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Success => { + if success__.is_some() { + return Err(serde::de::Error::duplicate_field("success")); + } + success__ = Some(map_.next_value()?); + } + } + } + Ok(MsgTripCircuitBreakerResponse { + success: success__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.MsgTripCircuitBreakerResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Permissions { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.level != 0 { + len += 1; + } + if !self.limit_type_urls.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.circuit.v1.Permissions", len)?; + if self.level != 0 { + let v = permissions::Level::try_from(self.level).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.level)) + })?; + struct_ser.serialize_field("level", &v)?; + } + if !self.limit_type_urls.is_empty() { + struct_ser.serialize_field("limitTypeUrls", &self.limit_type_urls)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Permissions { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["level", "limit_type_urls", "limitTypeUrls"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Level, + LimitTypeUrls, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "level" => Ok(GeneratedField::Level), + "limitTypeUrls" | "limit_type_urls" => { + Ok(GeneratedField::LimitTypeUrls) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Permissions; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.Permissions") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut level__ = None; + let mut limit_type_urls__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Level => { + if level__.is_some() { + return Err(serde::de::Error::duplicate_field("level")); + } + level__ = Some(map_.next_value::()? as i32); + } + GeneratedField::LimitTypeUrls => { + if limit_type_urls__.is_some() { + return Err(serde::de::Error::duplicate_field("limitTypeUrls")); + } + limit_type_urls__ = Some(map_.next_value()?); + } + } + } + Ok(Permissions { + level: level__.unwrap_or_default(), + limit_type_urls: limit_type_urls__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.circuit.v1.Permissions", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for permissions::Level { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::NoneUnspecified => "LEVEL_NONE_UNSPECIFIED", + Self::SomeMsgs => "LEVEL_SOME_MSGS", + Self::AllMsgs => "LEVEL_ALL_MSGS", + Self::SuperAdmin => "LEVEL_SUPER_ADMIN", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for permissions::Level { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "LEVEL_NONE_UNSPECIFIED", + "LEVEL_SOME_MSGS", + "LEVEL_ALL_MSGS", + "LEVEL_SUPER_ADMIN", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = permissions::Level; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + fn visit_i64(self, v: i64) -> std::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) -> std::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) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "LEVEL_NONE_UNSPECIFIED" => Ok(permissions::Level::NoneUnspecified), + "LEVEL_SOME_MSGS" => Ok(permissions::Level::SomeMsgs), + "LEVEL_ALL_MSGS" => Ok(permissions::Level::AllMsgs), + "LEVEL_SUPER_ADMIN" => Ok(permissions::Level::SuperAdmin), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.QueryAccountRequest", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.QueryAccountRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryAccountRequest { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.QueryAccountRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryAccountsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.QueryAccountsRequest", len)?; + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryAccountsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pagination, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "pagination" => Ok(GeneratedField::Pagination), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryAccountsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.QueryAccountsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryAccountsRequest { + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.QueryAccountsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryDisabledListRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.circuit.v1.QueryDisabledListRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryDisabledListRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = QueryDisabledListRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.circuit.v1.QueryDisabledListRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryDisabledListRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.circuit.v1.QueryDisabledListRequest", + FIELDS, + GeneratedVisitor, + ) + } +} 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 new file mode 100644 index 00000000..e2b8c77f --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.circuit.v1.tonic.rs @@ -0,0 +1,804 @@ +// @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 account( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Query/Account"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.circuit.v1.Query", "Account")); + self.inner.unary(req, path, codec).await + } + pub async fn accounts( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Query/Accounts"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.circuit.v1.Query", "Accounts")); + self.inner.unary(req, path, codec).await + } + pub async fn disabled_list( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Query/DisabledList"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.circuit.v1.Query", "DisabledList")); + 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 account( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn accounts( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn disabled_list( + &self, + request: tonic::Request, + ) -> std::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.circuit.v1.Query/Account" => { + #[allow(non_camel_case_types)] + struct AccountSvc(pub Arc); + impl tonic::server::UnaryService for AccountSvc { + type Response = super::AccountResponse; + 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).account(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 = AccountSvc(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.circuit.v1.Query/Accounts" => { + #[allow(non_camel_case_types)] + struct AccountsSvc(pub Arc); + impl tonic::server::UnaryService for AccountsSvc { + type Response = super::AccountsResponse; + 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).accounts(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 = AccountsSvc(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.circuit.v1.Query/DisabledList" => { + #[allow(non_camel_case_types)] + struct DisabledListSvc(pub Arc); + impl tonic::server::UnaryService for DisabledListSvc { + type Response = super::DisabledListResponse; + 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).disabled_list(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 = DisabledListSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "cosmos.circuit.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 authorize_circuit_breaker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.circuit.v1.Msg/AuthorizeCircuitBreaker", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.circuit.v1.Msg", + "AuthorizeCircuitBreaker", + )); + self.inner.unary(req, path, codec).await + } + pub async fn trip_circuit_breaker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Msg/TripCircuitBreaker"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.circuit.v1.Msg", + "TripCircuitBreaker", + )); + self.inner.unary(req, path, codec).await + } + pub async fn reset_circuit_breaker( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = + http::uri::PathAndQuery::from_static("/cosmos.circuit.v1.Msg/ResetCircuitBreaker"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.circuit.v1.Msg", + "ResetCircuitBreaker", + )); + 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 authorize_circuit_breaker( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn trip_circuit_breaker( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn reset_circuit_breaker( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + 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.circuit.v1.Msg/AuthorizeCircuitBreaker" => { + #[allow(non_camel_case_types)] + struct AuthorizeCircuitBreakerSvc(pub Arc); + impl tonic::server::UnaryService + for AuthorizeCircuitBreakerSvc + { + type Response = super::MsgAuthorizeCircuitBreakerResponse; + 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).authorize_circuit_breaker(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 = AuthorizeCircuitBreakerSvc(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.circuit.v1.Msg/TripCircuitBreaker" => { + #[allow(non_camel_case_types)] + struct TripCircuitBreakerSvc(pub Arc); + impl tonic::server::UnaryService + for TripCircuitBreakerSvc + { + type Response = super::MsgTripCircuitBreakerResponse; + 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).trip_circuit_breaker(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 = TripCircuitBreakerSvc(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.circuit.v1.Msg/ResetCircuitBreaker" => { + #[allow(non_camel_case_types)] + struct ResetCircuitBreakerSvc(pub Arc); + impl tonic::server::UnaryService + for ResetCircuitBreakerSvc + { + type Response = super::MsgResetCircuitBreakerResponse; + 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).reset_circuit_breaker(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 = ResetCircuitBreakerSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "cosmos.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 4a99dfb3..111f95c9 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 @@ -31,6 +31,9 @@ pub struct MsgUpdateParams { pub evidence: ::core::option::Option<::tendermint_proto::v0_34::types::EvidenceParams>, #[prost(message, optional, tag = "4")] pub validator: ::core::option::Option<::tendermint_proto::v0_34::types::ValidatorParams>, + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "5")] + pub abci: ::core::option::Option<::tendermint_proto::v0_34::types::AbciParams>, } /// MsgUpdateParamsResponse defines the response structure for executing a /// MsgUpdateParams message. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs index 98b8cf05..59cf207f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.consensus.v1.serde.rs @@ -20,6 +20,9 @@ impl serde::Serialize for MsgUpdateParams { if self.validator.is_some() { len += 1; } + if self.abci.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.consensus.v1.MsgUpdateParams", len)?; if !self.authority.is_empty() { @@ -34,6 +37,9 @@ impl serde::Serialize for MsgUpdateParams { if let Some(v) = self.validator.as_ref() { struct_ser.serialize_field("validator", v)?; } + if let Some(v) = self.abci.as_ref() { + struct_ser.serialize_field("abci", v)?; + } struct_ser.end() } } @@ -44,7 +50,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["authority", "block", "evidence", "validator"]; + const FIELDS: &[&str] = &["authority", "block", "evidence", "validator", "abci"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { @@ -52,6 +58,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { Block, Evidence, Validator, + Abci, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -81,6 +88,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { "block" => Ok(GeneratedField::Block), "evidence" => Ok(GeneratedField::Evidence), "validator" => Ok(GeneratedField::Validator), + "abci" => Ok(GeneratedField::Abci), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -104,6 +112,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { let mut block__ = None; let mut evidence__ = None; let mut validator__ = None; + let mut abci__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Authority => { @@ -130,6 +139,12 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { } validator__ = map_.next_value()?; } + GeneratedField::Abci => { + if abci__.is_some() { + return Err(serde::de::Error::duplicate_field("abci")); + } + abci__ = map_.next_value()?; + } } } Ok(MsgUpdateParams { @@ -137,6 +152,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParams { block: block__, evidence: evidence__, validator: validator__, + abci: abci__, }) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs index 833192d2..e30c1450 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.crypto.ed25519.rs @@ -10,7 +10,7 @@ pub struct PubKey { #[prost(bytes = "vec", tag = "1")] pub key: ::prost::alloc::vec::Vec, } -/// Deprecated: PrivKey defines a ed25519 private key. +/// PrivKey defines a ed25519 private key. /// NOTE: ed25519 keys must not be used in SDK apps except in a tendermint validator context. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.rs index 33d71bce..838e0095 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 @@ -583,6 +583,27 @@ pub struct MsgCommunityPoolSpend { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct 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 { + #[prost(string, tag = "1")] + pub depositor: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub validator_address: ::prost::alloc::string::String, + #[prost(message, repeated, tag = "3")] + pub amount: ::prost::alloc::vec::Vec, +} +/// 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 {} include!("cosmos.distribution.v1beta1.serde.rs"); include!("cosmos.distribution.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs index 622131d5..1d6bc243 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.distribution.v1beta1.serde.rs @@ -1494,6 +1494,237 @@ impl<'de> serde::Deserialize<'de> for MsgCommunityPoolSpendResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgDepositValidatorRewardsPool { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.depositor.is_empty() { + len += 1; + } + if !self.validator_address.is_empty() { + len += 1; + } + if !self.amount.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + len, + )?; + if !self.depositor.is_empty() { + struct_ser.serialize_field("depositor", &self.depositor)?; + } + if !self.validator_address.is_empty() { + struct_ser.serialize_field("validatorAddress", &self.validator_address)?; + } + if !self.amount.is_empty() { + struct_ser.serialize_field("amount", &self.amount)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDepositValidatorRewardsPool { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "depositor", + "validator_address", + "validatorAddress", + "amount", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Depositor, + ValidatorAddress, + Amount, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "depositor" => Ok(GeneratedField::Depositor), + "validatorAddress" | "validator_address" => { + Ok(GeneratedField::ValidatorAddress) + } + "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 = MsgDepositValidatorRewardsPool; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut depositor__ = None; + let mut validator_address__ = 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::ValidatorAddress => { + if validator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("validatorAddress")); + } + validator_address__ = Some(map_.next_value()?); + } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = Some(map_.next_value()?); + } + } + } + Ok(MsgDepositValidatorRewardsPool { + depositor: depositor__.unwrap_or_default(), + validator_address: validator_address__.unwrap_or_default(), + amount: amount__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPool", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgDepositValidatorRewardsPoolResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct( + "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgDepositValidatorRewardsPoolResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = MsgDepositValidatorRewardsPoolResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgDepositValidatorRewardsPoolResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.distribution.v1beta1.MsgDepositValidatorRewardsPoolResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for MsgFundCommunityPool { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result 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 88f8581b..f8c25a45 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 @@ -1131,6 +1131,30 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn deposit_validator_rewards_pool( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.distribution.v1beta1.Msg", + "DepositValidatorRewardsPool", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1171,6 +1195,13 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn deposit_validator_rewards_pool( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct MsgServer { @@ -1487,6 +1518,48 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.distribution.v1beta1.Msg/DepositValidatorRewardsPool" => { + #[allow(non_camel_case_types)] + struct DepositValidatorRewardsPoolSvc(pub Arc); + impl tonic::server::UnaryService + for DepositValidatorRewardsPoolSvc + { + type Response = super::MsgDepositValidatorRewardsPoolResponse; + 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).deposit_validator_rewards_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 = DepositValidatorRewardsPoolSvc(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) 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 900fb480..bd2ebda3 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 @@ -169,6 +169,22 @@ pub struct MsgRevokeAllowance { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct 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 { + /// pruner is the address of the user pruning expired allowances. + #[prost(string, tag = "1")] + pub pruner: ::prost::alloc::string::String, +} +/// 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 {} include!("cosmos.feegrant.v1beta1.serde.rs"); include!("cosmos.feegrant.v1beta1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs index 1d1bcf08..4865c151 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.feegrant.v1beta1.serde.rs @@ -675,6 +675,188 @@ impl<'de> serde::Deserialize<'de> for MsgGrantAllowanceResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgPruneAllowances { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.pruner.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.feegrant.v1beta1.MsgPruneAllowances", len)?; + if !self.pruner.is_empty() { + struct_ser.serialize_field("pruner", &self.pruner)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgPruneAllowances { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["pruner"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Pruner, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "pruner" => Ok(GeneratedField::Pruner), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgPruneAllowances; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgPruneAllowances") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut pruner__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Pruner => { + if pruner__.is_some() { + return Err(serde::de::Error::duplicate_field("pruner")); + } + pruner__ = Some(map_.next_value()?); + } + } + } + Ok(MsgPruneAllowances { + pruner: pruner__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.feegrant.v1beta1.MsgPruneAllowances", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgPruneAllowancesResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer + .serialize_struct("cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgPruneAllowancesResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = MsgPruneAllowancesResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgPruneAllowancesResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.feegrant.v1beta1.MsgPruneAllowancesResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for MsgRevokeAllowance { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result 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 b6e1c5e5..f0d3561a 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 @@ -533,6 +533,28 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn prune_allowances( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.feegrant.v1beta1.Msg/PruneAllowances", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.feegrant.v1beta1.Msg", + "PruneAllowances", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -551,6 +573,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn prune_allowances( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -704,6 +730,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.feegrant.v1beta1.Msg/PruneAllowances" => { + #[allow(non_camel_case_types)] + struct PruneAllowancesSvc(pub Arc); + impl tonic::server::UnaryService for PruneAllowancesSvc { + type Response = super::MsgPruneAllowancesResponse; + 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).prune_allowances(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 = PruneAllowancesSvc(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) 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 65813bda..b531b3b0 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 @@ -59,6 +59,8 @@ pub struct Proposal { #[prost(message, optional, tag = "9")] pub voting_end_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// metadata is any arbitrary metadata attached to the proposal. + /// the recommended format of the metadata is to be found here: + /// #[prost(string, tag = "10")] pub metadata: ::prost::alloc::string::String, /// title is the title of the proposal @@ -71,11 +73,21 @@ pub struct Proposal { /// Since: cosmos-sdk 0.47 #[prost(string, tag = "12")] pub summary: ::prost::alloc::string::String, - /// Proposer is the address of the proposal sumbitter + /// proposer is the address of the proposal sumbitter /// /// Since: cosmos-sdk 0.47 #[prost(string, tag = "13")] pub proposer: ::prost::alloc::string::String, + /// expedited defines if the proposal is expedited + /// + /// Since: cosmos-sdk 0.50 + #[prost(bool, tag = "14")] + pub expedited: bool, + /// failed_reason defines the reason why the proposal failed + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "15")] + pub failed_reason: ::prost::alloc::string::String, } /// TallyResult defines a standard tally for a governance proposal. #[allow(clippy::derive_partial_eq_without_eq)] @@ -108,7 +120,8 @@ pub struct Vote { /// options is the weighted vote options. #[prost(message, repeated, tag = "4")] pub options: ::prost::alloc::vec::Vec, - /// metadata is any arbitrary metadata to attached to the vote. + /// metadata is any arbitrary metadata attached to the vote. + /// the recommended format of the metadata is to be found here: #[prost(string, tag = "5")] pub metadata: ::prost::alloc::string::String, } @@ -178,6 +191,31 @@ pub struct Params { /// The ratio representing the proportion of the deposit value that must be paid at proposal submission. #[prost(string, tag = "7")] pub min_initial_deposit_ratio: ::prost::alloc::string::String, + /// The cancel ratio which will not be returned back to the depositors when a proposal is cancelled. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "8")] + pub proposal_cancel_ratio: ::prost::alloc::string::String, + /// The address which will receive (proposal_cancel_ratio * deposit) proposal deposits. + /// If empty, the (proposal_cancel_ratio * deposit) proposal deposits will be burned. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "9")] + pub proposal_cancel_dest: ::prost::alloc::string::String, + /// Duration of the voting period of an expedited proposal. + /// + /// Since: cosmos-sdk 0.50 + #[prost(message, optional, tag = "10")] + pub expedited_voting_period: + ::core::option::Option<::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. + #[prost(message, repeated, tag = "12")] + pub expedited_min_deposit: ::prost::alloc::vec::Vec, /// burn deposits if a proposal does not meet quorum #[prost(bool, tag = "13")] pub burn_vote_quorum: bool, @@ -187,6 +225,13 @@ pub struct Params { /// burn deposits if quorum with vote type no_veto is met #[prost(bool, tag = "15")] pub burn_vote_veto: bool, + /// The ratio representing the proportion of the deposit value minimum that must be met when making a deposit. + /// Default value: 0.01. Meaning that for a chain with a min_deposit of 100stake, a deposit of 1stake would be + /// required. + /// + /// Since: cosmos-sdk 0.50 + #[prost(string, tag = "16")] + pub min_deposit_ratio: ::prost::alloc::string::String, } /// VoteOption enumerates the valid vote options for a given governance proposal. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -315,6 +360,25 @@ pub struct GenesisState { /// 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, +} +/// QueryConstitutionRequest is the request type for the Query/Constitution RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConstitutionRequest {} +/// QueryConstitutionResponse is the response type for the Query/Constitution RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryConstitutionResponse { + #[prost(string, tag = "1")] + pub constitution: ::prost::alloc::string::String, } /// QueryProposalRequest is the request type for the Query/Proposal RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -520,6 +584,11 @@ pub struct MsgSubmitProposal { /// 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, } /// MsgSubmitProposalResponse defines the Msg/SubmitProposal response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -627,6 +696,36 @@ pub struct MsgUpdateParams { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct 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 { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// proposer is the account address of the proposer. + #[prost(string, tag = "2")] + pub proposer: ::prost::alloc::string::String, +} +/// 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 { + /// proposal_id defines the unique id of the proposal. + #[prost(uint64, tag = "1")] + pub proposal_id: u64, + /// canceled_time is the time when proposal is canceled. + #[prost(message, optional, tag = "2")] + pub canceled_time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, + /// canceled_height defines the block height at which the proposal is canceled. + #[prost(uint64, tag = "3")] + pub canceled_height: u64, +} include!("cosmos.gov.v1.serde.rs"); include!("cosmos.gov.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs index c2fb6592..1c4e99cf 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.gov.v1.serde.rs @@ -284,6 +284,9 @@ impl serde::Serialize for GenesisState { if self.params.is_some() { len += 1; } + if !self.constitution.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.GenesisState", len)?; if self.starting_proposal_id != 0 { #[allow(clippy::needless_borrow)] @@ -313,6 +316,9 @@ impl serde::Serialize for GenesisState { if let Some(v) = self.params.as_ref() { struct_ser.serialize_field("params", v)?; } + if !self.constitution.is_empty() { + struct_ser.serialize_field("constitution", &self.constitution)?; + } struct_ser.end() } } @@ -336,6 +342,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "tally_params", "tallyParams", "params", + "constitution", ]; #[allow(clippy::enum_variant_names)] @@ -348,6 +355,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { VotingParams, TallyParams, Params, + Constitution, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -383,6 +391,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "votingParams" | "voting_params" => Ok(GeneratedField::VotingParams), "tallyParams" | "tally_params" => Ok(GeneratedField::TallyParams), "params" => Ok(GeneratedField::Params), + "constitution" => Ok(GeneratedField::Constitution), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -410,6 +419,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { let mut voting_params__ = None; let mut tally_params__ = None; let mut params__ = None; + let mut constitution__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::StartingProposalId => { @@ -465,6 +475,12 @@ impl<'de> serde::Deserialize<'de> for GenesisState { } params__ = map_.next_value()?; } + GeneratedField::Constitution => { + if constitution__.is_some() { + return Err(serde::de::Error::duplicate_field("constitution")); + } + constitution__ = Some(map_.next_value()?); + } } } Ok(GenesisState { @@ -476,6 +492,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { voting_params: voting_params__, tally_params: tally_params__, params: params__, + constitution: constitution__.unwrap_or_default(), }) } } @@ -483,6 +500,282 @@ impl<'de> serde::Deserialize<'de> for GenesisState { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelProposal { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if !self.proposer.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgCancelProposal", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + if !self.proposer.is_empty() { + struct_ser.serialize_field("proposer", &self.proposer)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelProposal { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["proposal_id", "proposalId", "proposer"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + Proposer, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "proposer" => Ok(GeneratedField::Proposer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelProposal; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgCancelProposal") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut proposer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Proposer => { + if proposer__.is_some() { + return Err(serde::de::Error::duplicate_field("proposer")); + } + proposer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgCancelProposal { + proposal_id: proposal_id__.unwrap_or_default(), + proposer: proposer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos.gov.v1.MsgCancelProposal", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgCancelProposalResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.proposal_id != 0 { + len += 1; + } + if self.canceled_time.is_some() { + len += 1; + } + if self.canceled_height != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.MsgCancelProposalResponse", len)?; + if self.proposal_id != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proposalId", + ToString::to_string(&self.proposal_id).as_str(), + )?; + } + 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", + ToString::to_string(&self.canceled_height).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgCancelProposalResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proposal_id", + "proposalId", + "canceled_time", + "canceledTime", + "canceled_height", + "canceledHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ProposalId, + CanceledTime, + CanceledHeight, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "proposalId" | "proposal_id" => Ok(GeneratedField::ProposalId), + "canceledTime" | "canceled_time" => Ok(GeneratedField::CanceledTime), + "canceledHeight" | "canceled_height" => { + Ok(GeneratedField::CanceledHeight) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgCancelProposalResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.MsgCancelProposalResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proposal_id__ = None; + let mut canceled_time__ = None; + let mut canceled_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ProposalId => { + if proposal_id__.is_some() { + return Err(serde::de::Error::duplicate_field("proposalId")); + } + proposal_id__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::CanceledTime => { + if canceled_time__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledTime")); + } + canceled_time__ = map_.next_value()?; + } + GeneratedField::CanceledHeight => { + if canceled_height__.is_some() { + return Err(serde::de::Error::duplicate_field("canceledHeight")); + } + canceled_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(MsgCancelProposalResponse { + proposal_id: proposal_id__.unwrap_or_default(), + canceled_time: canceled_time__, + canceled_height: canceled_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.gov.v1.MsgCancelProposalResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for MsgDeposit { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -922,6 +1215,9 @@ impl serde::Serialize for MsgSubmitProposal { if !self.summary.is_empty() { len += 1; } + if self.expedited { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.MsgSubmitProposal", len)?; if !self.messages.is_empty() { struct_ser.serialize_field("messages", &self.messages)?; @@ -941,6 +1237,9 @@ impl serde::Serialize for MsgSubmitProposal { if !self.summary.is_empty() { struct_ser.serialize_field("summary", &self.summary)?; } + if self.expedited { + struct_ser.serialize_field("expedited", &self.expedited)?; + } struct_ser.end() } } @@ -959,6 +1258,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { "metadata", "title", "summary", + "expedited", ]; #[allow(clippy::enum_variant_names)] @@ -969,6 +1269,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { Metadata, Title, Summary, + Expedited, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1002,6 +1303,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { "metadata" => Ok(GeneratedField::Metadata), "title" => Ok(GeneratedField::Title), "summary" => Ok(GeneratedField::Summary), + "expedited" => Ok(GeneratedField::Expedited), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1027,6 +1329,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { let mut metadata__ = None; let mut title__ = None; let mut summary__ = None; + let mut expedited__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Messages => { @@ -1065,6 +1368,12 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { } summary__ = Some(map_.next_value()?); } + GeneratedField::Expedited => { + if expedited__.is_some() { + return Err(serde::de::Error::duplicate_field("expedited")); + } + expedited__ = Some(map_.next_value()?); + } } } Ok(MsgSubmitProposal { @@ -1074,6 +1383,7 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitProposal { metadata: metadata__.unwrap_or_default(), title: title__.unwrap_or_default(), summary: summary__.unwrap_or_default(), + expedited: expedited__.unwrap_or_default(), }) } } @@ -1872,6 +2182,21 @@ impl serde::Serialize for Params { if !self.min_initial_deposit_ratio.is_empty() { len += 1; } + if !self.proposal_cancel_ratio.is_empty() { + len += 1; + } + if !self.proposal_cancel_dest.is_empty() { + len += 1; + } + if self.expedited_voting_period.is_some() { + len += 1; + } + if !self.expedited_threshold.is_empty() { + len += 1; + } + if !self.expedited_min_deposit.is_empty() { + len += 1; + } if self.burn_vote_quorum { len += 1; } @@ -1881,6 +2206,9 @@ impl serde::Serialize for Params { if self.burn_vote_veto { len += 1; } + if !self.min_deposit_ratio.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Params", len)?; if !self.min_deposit.is_empty() { struct_ser.serialize_field("minDeposit", &self.min_deposit)?; @@ -1904,6 +2232,21 @@ impl serde::Serialize for Params { struct_ser .serialize_field("minInitialDepositRatio", &self.min_initial_deposit_ratio)?; } + if !self.proposal_cancel_ratio.is_empty() { + struct_ser.serialize_field("proposalCancelRatio", &self.proposal_cancel_ratio)?; + } + if !self.proposal_cancel_dest.is_empty() { + struct_ser.serialize_field("proposalCancelDest", &self.proposal_cancel_dest)?; + } + if let Some(v) = self.expedited_voting_period.as_ref() { + struct_ser.serialize_field("expeditedVotingPeriod", v)?; + } + if !self.expedited_threshold.is_empty() { + struct_ser.serialize_field("expeditedThreshold", &self.expedited_threshold)?; + } + if !self.expedited_min_deposit.is_empty() { + struct_ser.serialize_field("expeditedMinDeposit", &self.expedited_min_deposit)?; + } if self.burn_vote_quorum { struct_ser.serialize_field("burnVoteQuorum", &self.burn_vote_quorum)?; } @@ -1916,6 +2259,9 @@ impl serde::Serialize for Params { if self.burn_vote_veto { struct_ser.serialize_field("burnVoteVeto", &self.burn_vote_veto)?; } + if !self.min_deposit_ratio.is_empty() { + struct_ser.serialize_field("minDepositRatio", &self.min_deposit_ratio)?; + } struct_ser.end() } } @@ -1939,12 +2285,24 @@ impl<'de> serde::Deserialize<'de> for Params { "vetoThreshold", "min_initial_deposit_ratio", "minInitialDepositRatio", + "proposal_cancel_ratio", + "proposalCancelRatio", + "proposal_cancel_dest", + "proposalCancelDest", + "expedited_voting_period", + "expeditedVotingPeriod", + "expedited_threshold", + "expeditedThreshold", + "expedited_min_deposit", + "expeditedMinDeposit", "burn_vote_quorum", "burnVoteQuorum", "burn_proposal_deposit_prevote", "burnProposalDepositPrevote", "burn_vote_veto", "burnVoteVeto", + "min_deposit_ratio", + "minDepositRatio", ]; #[allow(clippy::enum_variant_names)] @@ -1956,9 +2314,15 @@ impl<'de> serde::Deserialize<'de> for Params { Threshold, VetoThreshold, MinInitialDepositRatio, + ProposalCancelRatio, + ProposalCancelDest, + ExpeditedVotingPeriod, + ExpeditedThreshold, + ExpeditedMinDeposit, BurnVoteQuorum, BurnProposalDepositPrevote, BurnVoteVeto, + MinDepositRatio, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1995,6 +2359,21 @@ impl<'de> serde::Deserialize<'de> for Params { "minInitialDepositRatio" | "min_initial_deposit_ratio" => { Ok(GeneratedField::MinInitialDepositRatio) } + "proposalCancelRatio" | "proposal_cancel_ratio" => { + Ok(GeneratedField::ProposalCancelRatio) + } + "proposalCancelDest" | "proposal_cancel_dest" => { + Ok(GeneratedField::ProposalCancelDest) + } + "expeditedVotingPeriod" | "expedited_voting_period" => { + Ok(GeneratedField::ExpeditedVotingPeriod) + } + "expeditedThreshold" | "expedited_threshold" => { + Ok(GeneratedField::ExpeditedThreshold) + } + "expeditedMinDeposit" | "expedited_min_deposit" => { + Ok(GeneratedField::ExpeditedMinDeposit) + } "burnVoteQuorum" | "burn_vote_quorum" => { Ok(GeneratedField::BurnVoteQuorum) } @@ -2002,6 +2381,9 @@ impl<'de> serde::Deserialize<'de> for Params { Ok(GeneratedField::BurnProposalDepositPrevote) } "burnVoteVeto" | "burn_vote_veto" => Ok(GeneratedField::BurnVoteVeto), + "minDepositRatio" | "min_deposit_ratio" => { + Ok(GeneratedField::MinDepositRatio) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2028,9 +2410,15 @@ impl<'de> serde::Deserialize<'de> for Params { let mut threshold__ = None; let mut veto_threshold__ = None; let mut min_initial_deposit_ratio__ = None; + let mut proposal_cancel_ratio__ = None; + let mut proposal_cancel_dest__ = None; + let mut expedited_voting_period__ = None; + let mut expedited_threshold__ = None; + let mut expedited_min_deposit__ = None; let mut burn_vote_quorum__ = None; let mut burn_proposal_deposit_prevote__ = None; let mut burn_vote_veto__ = None; + let mut min_deposit_ratio__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::MinDeposit => { @@ -2077,6 +2465,46 @@ impl<'de> serde::Deserialize<'de> for Params { } min_initial_deposit_ratio__ = Some(map_.next_value()?); } + GeneratedField::ProposalCancelRatio => { + if proposal_cancel_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field( + "proposalCancelRatio", + )); + } + proposal_cancel_ratio__ = Some(map_.next_value()?); + } + GeneratedField::ProposalCancelDest => { + if proposal_cancel_dest__.is_some() { + return Err(serde::de::Error::duplicate_field( + "proposalCancelDest", + )); + } + proposal_cancel_dest__ = Some(map_.next_value()?); + } + GeneratedField::ExpeditedVotingPeriod => { + if expedited_voting_period__.is_some() { + return Err(serde::de::Error::duplicate_field( + "expeditedVotingPeriod", + )); + } + expedited_voting_period__ = map_.next_value()?; + } + GeneratedField::ExpeditedThreshold => { + if expedited_threshold__.is_some() { + return Err(serde::de::Error::duplicate_field( + "expeditedThreshold", + )); + } + expedited_threshold__ = Some(map_.next_value()?); + } + GeneratedField::ExpeditedMinDeposit => { + if expedited_min_deposit__.is_some() { + return Err(serde::de::Error::duplicate_field( + "expeditedMinDeposit", + )); + } + expedited_min_deposit__ = Some(map_.next_value()?); + } GeneratedField::BurnVoteQuorum => { if burn_vote_quorum__.is_some() { return Err(serde::de::Error::duplicate_field("burnVoteQuorum")); @@ -2097,6 +2525,12 @@ impl<'de> serde::Deserialize<'de> for Params { } burn_vote_veto__ = Some(map_.next_value()?); } + GeneratedField::MinDepositRatio => { + if min_deposit_ratio__.is_some() { + return Err(serde::de::Error::duplicate_field("minDepositRatio")); + } + min_deposit_ratio__ = Some(map_.next_value()?); + } } } Ok(Params { @@ -2107,10 +2541,16 @@ impl<'de> serde::Deserialize<'de> for Params { threshold: threshold__.unwrap_or_default(), veto_threshold: veto_threshold__.unwrap_or_default(), min_initial_deposit_ratio: min_initial_deposit_ratio__.unwrap_or_default(), + proposal_cancel_ratio: proposal_cancel_ratio__.unwrap_or_default(), + proposal_cancel_dest: proposal_cancel_dest__.unwrap_or_default(), + expedited_voting_period: expedited_voting_period__, + expedited_threshold: expedited_threshold__.unwrap_or_default(), + expedited_min_deposit: expedited_min_deposit__.unwrap_or_default(), burn_vote_quorum: burn_vote_quorum__.unwrap_or_default(), burn_proposal_deposit_prevote: burn_proposal_deposit_prevote__ .unwrap_or_default(), burn_vote_veto: burn_vote_veto__.unwrap_or_default(), + min_deposit_ratio: min_deposit_ratio__.unwrap_or_default(), }) } } @@ -2165,6 +2605,12 @@ impl serde::Serialize for Proposal { if !self.proposer.is_empty() { len += 1; } + if self.expedited { + len += 1; + } + if !self.failed_reason.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.gov.v1.Proposal", len)?; if self.id != 0 { #[allow(clippy::needless_borrow)] @@ -2209,6 +2655,12 @@ impl serde::Serialize for Proposal { if !self.proposer.is_empty() { struct_ser.serialize_field("proposer", &self.proposer)?; } + if self.expedited { + struct_ser.serialize_field("expedited", &self.expedited)?; + } + if !self.failed_reason.is_empty() { + struct_ser.serialize_field("failedReason", &self.failed_reason)?; + } struct_ser.end() } } @@ -2239,6 +2691,9 @@ impl<'de> serde::Deserialize<'de> for Proposal { "title", "summary", "proposer", + "expedited", + "failed_reason", + "failedReason", ]; #[allow(clippy::enum_variant_names)] @@ -2256,6 +2711,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { Title, Summary, Proposer, + Expedited, + FailedReason, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2302,6 +2759,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { "title" => Ok(GeneratedField::Title), "summary" => Ok(GeneratedField::Summary), "proposer" => Ok(GeneratedField::Proposer), + "expedited" => Ok(GeneratedField::Expedited), + "failedReason" | "failed_reason" => Ok(GeneratedField::FailedReason), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2334,6 +2793,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { let mut title__ = None; let mut summary__ = None; let mut proposer__ = None; + let mut expedited__ = None; + let mut failed_reason__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Id => { @@ -2417,6 +2878,18 @@ impl<'de> serde::Deserialize<'de> for Proposal { } proposer__ = Some(map_.next_value()?); } + GeneratedField::Expedited => { + if expedited__.is_some() { + return Err(serde::de::Error::duplicate_field("expedited")); + } + expedited__ = Some(map_.next_value()?); + } + GeneratedField::FailedReason => { + if failed_reason__.is_some() { + return Err(serde::de::Error::duplicate_field("failedReason")); + } + failed_reason__ = Some(map_.next_value()?); + } } } Ok(Proposal { @@ -2433,6 +2906,8 @@ impl<'de> serde::Deserialize<'de> for Proposal { title: title__.unwrap_or_default(), summary: summary__.unwrap_or_default(), proposer: proposer__.unwrap_or_default(), + expedited: expedited__.unwrap_or_default(), + failed_reason: failed_reason__.unwrap_or_default(), }) } } @@ -2525,6 +3000,191 @@ impl<'de> serde::Deserialize<'de> for ProposalStatus { } } #[cfg(feature = "serde")] +impl serde::Serialize for QueryConstitutionRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryConstitutionRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryConstitutionRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConstitutionRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryConstitutionRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(QueryConstitutionRequest {}) + } + } + deserializer.deserialize_struct( + "cosmos.gov.v1.QueryConstitutionRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryConstitutionResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.constitution.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.gov.v1.QueryConstitutionResponse", len)?; + if !self.constitution.is_empty() { + struct_ser.serialize_field("constitution", &self.constitution)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryConstitutionResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["constitution"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Constitution, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "constitution" => Ok(GeneratedField::Constitution), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConstitutionResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.gov.v1.QueryConstitutionResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut constitution__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Constitution => { + if constitution__.is_some() { + return Err(serde::de::Error::duplicate_field("constitution")); + } + constitution__ = Some(map_.next_value()?); + } + } + } + Ok(QueryConstitutionResponse { + constitution: constitution__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.gov.v1.QueryConstitutionResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for QueryDepositRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result 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 243010a5..4a47824c 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 @@ -85,6 +85,24 @@ pub mod query_client { self.inner = self.inner.max_encoding_message_size(limit); self } + pub async fn constitution( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Query/Constitution"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Query", "Constitution")); + self.inner.unary(req, path, codec).await + } pub async fn proposal( &mut self, request: impl tonic::IntoRequest, @@ -238,6 +256,10 @@ pub mod query_server { /// Generated trait containing gRPC methods that should be implemented for use with QueryServer. #[async_trait] pub trait Query: Send + Sync + 'static { + async fn constitution( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; async fn proposal( &self, request: tonic::Request, @@ -347,6 +369,44 @@ pub mod query_server { fn call(&mut self, req: http::Request) -> Self::Future { let inner = self.inner.clone(); match req.uri().path() { + "/cosmos.gov.v1.Query/Constitution" => { + #[allow(non_camel_case_types)] + struct ConstitutionSvc(pub Arc); + impl tonic::server::UnaryService for ConstitutionSvc { + type Response = super::QueryConstitutionResponse; + 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).constitution(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 = ConstitutionSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } "/cosmos.gov.v1.Query/Proposal" => { #[allow(non_camel_case_types)] struct ProposalSvc(pub Arc); @@ -878,6 +938,24 @@ pub mod msg_client { .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "UpdateParams")); self.inner.unary(req, path, codec).await } + pub async fn cancel_proposal( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static("/cosmos.gov.v1.Msg/CancelProposal"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmos.gov.v1.Msg", "CancelProposal")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -912,6 +990,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn cancel_proposal( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1217,6 +1299,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/cosmos.gov.v1.Msg/CancelProposal" => { + #[allow(non_camel_case_types)] + struct CancelProposalSvc(pub Arc); + impl tonic::server::UnaryService for CancelProposalSvc { + type Response = super::MsgCancelProposalResponse; + 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_proposal(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 = CancelProposalSvc(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) 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 7f0e30c7..1de289be 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 @@ -256,13 +256,13 @@ pub struct GenesisState { /// proposals defines all the proposals present at genesis. #[prost(message, repeated, tag = "4")] pub proposals: ::prost::alloc::vec::Vec, - /// params defines all the parameters of related to deposit. + /// deposit_params defines all the parameters related to deposit. #[prost(message, optional, tag = "5")] pub deposit_params: ::core::option::Option, - /// params defines all the parameters of related to voting. + /// voting_params defines all the parameters related to voting. #[prost(message, optional, tag = "6")] pub voting_params: ::core::option::Option, - /// params defines all the parameters of related to tally. + /// tally_params defines all the parameters related to tally. #[prost(message, optional, tag = "7")] pub tally_params: ::core::option::Option, } 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 37a231c1..d938b9a5 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 @@ -105,6 +105,7 @@ pub struct GroupInfo { #[prost(string, tag = "2")] pub admin: ::prost::alloc::string::String, /// metadata is any arbitrary metadata to attached to the group. + /// the recommended format of the metadata is to be found here: #[prost(string, tag = "3")] pub metadata: ::prost::alloc::string::String, /// version is used to track changes to a group's membership structure that @@ -244,7 +245,7 @@ pub struct TallyResult { #[prost(string, tag = "4")] pub no_with_veto_count: ::prost::alloc::string::String, } -/// Vote represents a vote for a proposal. +/// Vote represents a vote for a proposal.string metadata #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Vote { @@ -258,6 +259,7 @@ pub struct Vote { #[prost(enumeration = "VoteOption", tag = "3")] pub option: i32, /// metadata is any arbitrary metadata attached to the vote. + /// the recommended format of the metadata is to be found here: #[prost(string, tag = "4")] pub metadata: ::prost::alloc::string::String, /// submit_time is the timestamp when the vote was submitted. diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.textual.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.textual.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.msg.textual.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) 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 index 0301a2cb..10b3c53c 100644 --- 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 @@ -1,7 +1,7 @@ // @generated /// Module defines the ORM module which adds providers to the app container for -/// module-scoped DB's. In the future it may provide gRPC services for interacting -/// with ORM data. +/// 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 {} 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 index f444af15..761bace3 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1.rs @@ -38,8 +38,11 @@ pub struct PrimaryKeyDescriptor { /// with a 32-bit unsigned varint in non-terminal segments. /// - int32, sint32, int64, sint64, sfixed32, sfixed64 are encoded as fixed width bytes with /// an encoding that enables sorted iteration. - /// - google.protobuf.Timestamp and google.protobuf.Duration are encoded - /// as 12 bytes using an encoding that enables sorted iteration. + /// - 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. 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 index 8753b2ec..996f70d4 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.orm.v1alpha1.rs @@ -36,11 +36,8 @@ pub mod module_schema_descriptor { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum StorageType { - /// STORAGE_TYPE_DEFAULT_UNSPECIFIED indicates the persistent - /// KV-storage where primary key entries are stored in merkle-tree - /// backed commitment storage and indexes and seqs are stored in - /// fast index storage. Note that the Cosmos SDK before store/v2alpha1 - /// does not support this. + /// 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 @@ -52,19 +49,6 @@ pub enum StorageType { /// will by default be ignored when importing and exporting a module's /// state from JSON. Transient = 2, - /// STORAGE_TYPE_INDEX indicates persistent storage which is not backed - /// by a merkle-tree and won't affect the app hash. Note that the Cosmos SDK - /// before store/v2alpha1 does not support this. - Index = 3, - /// STORAGE_TYPE_INDEX indicates persistent storage which is backed by - /// a merkle-tree. With this type of storage, both primary and index keys - /// will affect the app hash and this is generally less efficient - /// than using STORAGE_TYPE_DEFAULT_UNSPECIFIED which separates index - /// keys into index storage. Note that modules built with the - /// Cosmos SDK before store/v2alpha1 must specify STORAGE_TYPE_COMMITMENT - /// instead of STORAGE_TYPE_DEFAULT_UNSPECIFIED or STORAGE_TYPE_INDEX - /// because this is the only type of persistent storage available. - Commitment = 4, } impl StorageType { /// String value of the enum field names used in the ProtoBuf definition. @@ -76,8 +60,6 @@ impl StorageType { StorageType::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", StorageType::Memory => "STORAGE_TYPE_MEMORY", StorageType::Transient => "STORAGE_TYPE_TRANSIENT", - StorageType::Index => "STORAGE_TYPE_INDEX", - StorageType::Commitment => "STORAGE_TYPE_COMMITMENT", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -86,8 +68,6 @@ impl StorageType { "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Some(Self::DefaultUnspecified), "STORAGE_TYPE_MEMORY" => Some(Self::Memory), "STORAGE_TYPE_TRANSIENT" => Some(Self::Transient), - "STORAGE_TYPE_INDEX" => Some(Self::Index), - "STORAGE_TYPE_COMMITMENT" => Some(Self::Commitment), _ => None, } } 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 index 2b5b4f84..80656265 100644 --- 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 @@ -285,8 +285,6 @@ impl serde::Serialize for StorageType { Self::DefaultUnspecified => "STORAGE_TYPE_DEFAULT_UNSPECIFIED", Self::Memory => "STORAGE_TYPE_MEMORY", Self::Transient => "STORAGE_TYPE_TRANSIENT", - Self::Index => "STORAGE_TYPE_INDEX", - Self::Commitment => "STORAGE_TYPE_COMMITMENT", }; serializer.serialize_str(variant) } @@ -302,8 +300,6 @@ impl<'de> serde::Deserialize<'de> for StorageType { "STORAGE_TYPE_DEFAULT_UNSPECIFIED", "STORAGE_TYPE_MEMORY", "STORAGE_TYPE_TRANSIENT", - "STORAGE_TYPE_INDEX", - "STORAGE_TYPE_COMMITMENT", ]; struct GeneratedVisitor; @@ -347,8 +343,6 @@ impl<'de> serde::Deserialize<'de> for StorageType { "STORAGE_TYPE_DEFAULT_UNSPECIFIED" => Ok(StorageType::DefaultUnspecified), "STORAGE_TYPE_MEMORY" => Ok(StorageType::Memory), "STORAGE_TYPE_TRANSIENT" => Ok(StorageType::Transient), - "STORAGE_TYPE_INDEX" => Ok(StorageType::Index), - "STORAGE_TYPE_COMMITMENT" => Ok(StorageType::Commitment), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } 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 afd799bb..f7e32b2e 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 @@ -6,23 +6,24 @@ pub struct ValidatorSigningInfo { #[prost(string, tag = "1")] pub address: ::prost::alloc::string::String, - /// Height at which validator was first a candidate OR was unjailed + /// Height at which validator was first a candidate OR was un-jailed #[prost(int64, tag = "2")] pub start_height: i64, - /// Index which is incremented each time the validator was a bonded - /// in a block and may have signed a precommit or not. This in conjunction with the - /// `SignedBlocksWindow` param determines the index in the `MissedBlocksBitArray`. + /// Index which is incremented every time a validator is bonded in a block and + /// _may_ have signed a pre-commit or not. This in conjunction with the + /// signed_blocks_window param determines the index in the missed block bitmap. #[prost(int64, tag = "3")] pub index_offset: i64, /// Timestamp until which the validator is jailed due to liveness downtime. #[prost(message, optional, tag = "4")] pub jailed_until: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, - /// Whether or not a validator has been tombstoned (killed out of validator set). It is set - /// once the validator commits an equivocation or for any other configured misbehiavor. + /// Whether or not a validator has been tombstoned (killed out of validator + /// set). It is set once the validator commits an equivocation or for any other + /// configured misbehavior. #[prost(bool, tag = "5")] pub tombstoned: bool, - /// A counter kept to avoid unnecessary array reads. - /// Note that `Sum(MissedBlocksBitArray)` always equals `MissedBlocksCounter`. + /// A counter of missed (unsigned) blocks. It is used to avoid unnecessary + /// reads in the missed block bitmap. #[prost(int64, tag = "6")] pub missed_blocks_counter: i64, } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs index 7ee74d3d..434a06d2 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.rs @@ -11,6 +11,12 @@ pub struct Module { /// authority defines the custom module authority. If not set, defaults to the governance module. #[prost(string, tag = "2")] pub authority: ::prost::alloc::string::String, + /// bech32_prefix_validator is the bech32 validator prefix for the app. + #[prost(string, tag = "3")] + pub bech32_prefix_validator: ::prost::alloc::string::String, + /// bech32_prefix_consensus is the bech32 consensus node prefix for the app. + #[prost(string, tag = "4")] + pub bech32_prefix_consensus: ::prost::alloc::string::String, } include!("cosmos.staking.module.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs index 871447f9..20ee79ca 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.module.v1.serde.rs @@ -14,6 +14,12 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { len += 1; } + if !self.bech32_prefix_validator.is_empty() { + len += 1; + } + if !self.bech32_prefix_consensus.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.staking.module.v1.Module", len)?; if !self.hooks_order.is_empty() { struct_ser.serialize_field("hooksOrder", &self.hooks_order)?; @@ -21,6 +27,12 @@ impl serde::Serialize for Module { if !self.authority.is_empty() { struct_ser.serialize_field("authority", &self.authority)?; } + if !self.bech32_prefix_validator.is_empty() { + struct_ser.serialize_field("bech32PrefixValidator", &self.bech32_prefix_validator)?; + } + if !self.bech32_prefix_consensus.is_empty() { + struct_ser.serialize_field("bech32PrefixConsensus", &self.bech32_prefix_consensus)?; + } struct_ser.end() } } @@ -31,12 +43,22 @@ impl<'de> serde::Deserialize<'de> for Module { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["hooks_order", "hooksOrder", "authority"]; + const FIELDS: &[&str] = &[ + "hooks_order", + "hooksOrder", + "authority", + "bech32_prefix_validator", + "bech32PrefixValidator", + "bech32_prefix_consensus", + "bech32PrefixConsensus", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { HooksOrder, Authority, + Bech32PrefixValidator, + Bech32PrefixConsensus, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -64,6 +86,12 @@ impl<'de> serde::Deserialize<'de> for Module { match value { "hooksOrder" | "hooks_order" => Ok(GeneratedField::HooksOrder), "authority" => Ok(GeneratedField::Authority), + "bech32PrefixValidator" | "bech32_prefix_validator" => { + Ok(GeneratedField::Bech32PrefixValidator) + } + "bech32PrefixConsensus" | "bech32_prefix_consensus" => { + Ok(GeneratedField::Bech32PrefixConsensus) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -85,6 +113,8 @@ impl<'de> serde::Deserialize<'de> for Module { { let mut hooks_order__ = None; let mut authority__ = None; + let mut bech32_prefix_validator__ = None; + let mut bech32_prefix_consensus__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::HooksOrder => { @@ -99,11 +129,29 @@ impl<'de> serde::Deserialize<'de> for Module { } authority__ = Some(map_.next_value()?); } + GeneratedField::Bech32PrefixValidator => { + if bech32_prefix_validator__.is_some() { + return Err(serde::de::Error::duplicate_field( + "bech32PrefixValidator", + )); + } + bech32_prefix_validator__ = Some(map_.next_value()?); + } + GeneratedField::Bech32PrefixConsensus => { + if bech32_prefix_consensus__.is_some() { + return Err(serde::de::Error::duplicate_field( + "bech32PrefixConsensus", + )); + } + bech32_prefix_consensus__ = Some(map_.next_value()?); + } } } Ok(Module { hooks_order: hooks_order__.unwrap_or_default(), authority: authority__.unwrap_or_default(), + bech32_prefix_validator: bech32_prefix_validator__.unwrap_or_default(), + bech32_prefix_consensus: bech32_prefix_consensus__.unwrap_or_default(), }) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.rs index 5cf79cd7..5f208e01 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 @@ -52,6 +52,8 @@ pub enum AuthorizationType { Undelegate = 2, /// AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate Redelegate = 3, + /// AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION defines an authorization type for Msg/MsgCancelUnbondingDelegation + CancelUnbondingDelegation = 4, } impl AuthorizationType { /// String value of the enum field names used in the ProtoBuf definition. @@ -64,6 +66,9 @@ impl AuthorizationType { AuthorizationType::Delegate => "AUTHORIZATION_TYPE_DELEGATE", AuthorizationType::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", AuthorizationType::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + AuthorizationType::CancelUnbondingDelegation => { + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" + } } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -73,6 +78,9 @@ impl AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE" => Some(Self::Delegate), "AUTHORIZATION_TYPE_UNDELEGATE" => Some(Self::Undelegate), "AUTHORIZATION_TYPE_REDELEGATE" => Some(Self::Redelegate), + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => { + Some(Self::CancelUnbondingDelegation) + } _ => None, } } @@ -240,10 +248,10 @@ pub struct DvvTriplets { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Delegation { - /// delegator_address is the bech32-encoded address of the delegator. + /// delegator_address is the encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the bech32-encoded address of the validator. + /// validator_address is the encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// shares define the delegation shares received. @@ -255,10 +263,10 @@ pub struct Delegation { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UnbondingDelegation { - /// delegator_address is the bech32-encoded address of the delegator. + /// delegator_address is the encoded address of the delegator. #[prost(string, tag = "1")] pub delegator_address: ::prost::alloc::string::String, - /// validator_address is the bech32-encoded address of the validator. + /// validator_address is the encoded address of the validator. #[prost(string, tag = "2")] pub validator_address: ::prost::alloc::string::String, /// entries are the unbonding delegation entries. @@ -491,7 +499,7 @@ pub struct GenesisState { /// of the last-block's bonded validators. #[prost(message, repeated, tag = "3")] pub last_validator_powers: ::prost::alloc::vec::Vec, - /// delegations defines the validator set at genesis. + /// validators defines the validator set at genesis. #[prost(message, repeated, tag = "4")] pub validators: ::prost::alloc::vec::Vec, /// delegations defines the delegations active at genesis. @@ -503,6 +511,7 @@ pub struct GenesisState { /// redelegations defines the redelegations active at genesis. #[prost(message, repeated, tag = "7")] pub redelegations: ::prost::alloc::vec::Vec, + /// exported defines a bool to identify whether the chain dealing with exported or initialized genesis. #[prost(bool, tag = "8")] pub exported: bool, } @@ -814,6 +823,10 @@ pub struct MsgCreateValidator { pub commission: ::core::option::Option, #[prost(string, tag = "3")] pub min_self_delegation: ::prost::alloc::string::String, + /// Deprecated: Use of Delegator Address in MsgCreateValidator is deprecated. + /// The validator address bytes and delegator address bytes refer to the same account while creating validator (defer + /// only in bech32 notation). + #[deprecated] #[prost(string, tag = "4")] pub delegator_address: ::prost::alloc::string::String, #[prost(string, tag = "5")] @@ -903,6 +916,11 @@ pub struct MsgUndelegate { 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, } /// MsgCancelUnbondingDelegation defines the SDK message for performing a cancel unbonding delegation for delegator /// diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs index 2c39cfba..dd251796 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.staking.v1beta1.serde.rs @@ -11,6 +11,7 @@ impl serde::Serialize for AuthorizationType { Self::Delegate => "AUTHORIZATION_TYPE_DELEGATE", Self::Undelegate => "AUTHORIZATION_TYPE_UNDELEGATE", Self::Redelegate => "AUTHORIZATION_TYPE_REDELEGATE", + Self::CancelUnbondingDelegation => "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION", }; serializer.serialize_str(variant) } @@ -27,6 +28,7 @@ impl<'de> serde::Deserialize<'de> for AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE", "AUTHORIZATION_TYPE_UNDELEGATE", "AUTHORIZATION_TYPE_REDELEGATE", + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION", ]; struct GeneratedVisitor; @@ -71,6 +73,9 @@ impl<'de> serde::Deserialize<'de> for AuthorizationType { "AUTHORIZATION_TYPE_DELEGATE" => Ok(AuthorizationType::Delegate), "AUTHORIZATION_TYPE_UNDELEGATE" => Ok(AuthorizationType::Undelegate), "AUTHORIZATION_TYPE_REDELEGATE" => Ok(AuthorizationType::Redelegate), + "AUTHORIZATION_TYPE_CANCEL_UNBONDING_DELEGATION" => { + Ok(AuthorizationType::CancelUnbondingDelegation) + } _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } } @@ -3310,11 +3315,17 @@ impl serde::Serialize for MsgUndelegateResponse { if self.completion_time.is_some() { len += 1; } + if self.amount.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.staking.v1beta1.MsgUndelegateResponse", len)?; if let Some(v) = self.completion_time.as_ref() { struct_ser.serialize_field("completionTime", v)?; } + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } struct_ser.end() } } @@ -3325,11 +3336,12 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["completion_time", "completionTime"]; + const FIELDS: &[&str] = &["completion_time", "completionTime", "amount"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { CompletionTime, + Amount, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3358,6 +3370,7 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { "completionTime" | "completion_time" => { Ok(GeneratedField::CompletionTime) } + "amount" => Ok(GeneratedField::Amount), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3381,6 +3394,7 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { V: serde::de::MapAccess<'de>, { let mut completion_time__ = None; + let mut amount__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::CompletionTime => { @@ -3389,10 +3403,17 @@ impl<'de> serde::Deserialize<'de> for MsgUndelegateResponse { } completion_time__ = map_.next_value()?; } + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } } } Ok(MsgUndelegateResponse { completion_time: completion_time__, + amount: amount__, }) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.rs similarity index 80% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.rs index ddd20355..2075e8e1 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.rs @@ -1,4 +1,6 @@ // @generated +// This is duplicated from the base kv directory to avoid a circular dependency with the cosmos-sdk + /// Pairs defines a repeated slice of Pair objects. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -15,5 +17,5 @@ pub struct Pair { #[prost(bytes = "vec", tag = "2")] pub value: ::prost::alloc::vec::Vec, } -include!("cosmos.base.kv.v1beta1.serde.rs"); +include!("cosmos.store.internal.kv.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.serde.rs similarity index 91% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.serde.rs index 98c15527..19de4b0e 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.kv.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.internal.kv.v1beta1.serde.rs @@ -14,7 +14,8 @@ impl serde::Serialize for Pair { if !self.value.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pair", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.store.internal.kv.v1beta1.Pair", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -82,7 +83,7 @@ impl<'de> serde::Deserialize<'de> for Pair { type Value = Pair; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pair") + formatter.write_str("struct cosmos.store.internal.kv.v1beta1.Pair") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -119,7 +120,11 @@ impl<'de> serde::Deserialize<'de> for Pair { }) } } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pair", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.store.internal.kv.v1beta1.Pair", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] @@ -134,7 +139,8 @@ impl serde::Serialize for Pairs { if !self.pairs.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("cosmos.base.kv.v1beta1.Pairs", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.store.internal.kv.v1beta1.Pairs", len)?; if !self.pairs.is_empty() { struct_ser.serialize_field("pairs", &self.pairs)?; } @@ -191,7 +197,7 @@ impl<'de> serde::Deserialize<'de> for Pairs { type Value = Pairs; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.kv.v1beta1.Pairs") + formatter.write_str("struct cosmos.store.internal.kv.v1beta1.Pairs") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -214,6 +220,10 @@ impl<'de> serde::Deserialize<'de> for Pairs { }) } } - deserializer.deserialize_struct("cosmos.base.kv.v1beta1.Pairs", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.store.internal.kv.v1beta1.Pairs", + FIELDS, + GeneratedVisitor, + ) } } diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs similarity index 74% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs index a9bfb424..f30c9599 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.rs @@ -29,7 +29,7 @@ pub struct Metadata { #[derive(Clone, PartialEq, ::prost::Message)] pub struct SnapshotItem { /// item is the specific type of snapshot item. - #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4, 5, 6")] + #[prost(oneof = "snapshot_item::Item", tags = "1, 2, 3, 4")] pub item: ::core::option::Option, } /// Nested message and enum types in `SnapshotItem`. @@ -46,10 +46,6 @@ pub mod snapshot_item { Extension(super::SnapshotExtensionMeta), #[prost(message, tag = "4")] ExtensionPayload(super::SnapshotExtensionPayload), - #[prost(message, tag = "5")] - Kv(super::SnapshotKvItem), - #[prost(message, tag = "6")] - Schema(super::SnapshotSchema), } } /// SnapshotStoreItem contains metadata about a snapshotted store. @@ -98,27 +94,5 @@ pub struct SnapshotExtensionPayload { #[prost(bytes = "vec", tag = "1")] pub payload: ::prost::alloc::vec::Vec, } -/// SnapshotKVItem is an exported Key/Value Pair -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotKvItem { - #[prost(bytes = "vec", tag = "1")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub value: ::prost::alloc::vec::Vec, -} -/// SnapshotSchema is an exported schema of smt store -/// -/// Since: cosmos-sdk 0.46 -/// Deprecated: This message was part of store/v2alpha1 which has been deleted from v0.47. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SnapshotSchema { - #[prost(bytes = "vec", repeated, tag = "1")] - pub keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, -} -include!("cosmos.base.snapshots.v1beta1.serde.rs"); +include!("cosmos.store.snapshots.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.serde.rs similarity index 74% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.serde.rs index faddc89d..1b1cefbd 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.snapshots.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.snapshots.v1.serde.rs @@ -12,7 +12,7 @@ impl serde::Serialize for Metadata { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Metadata", len)?; + serializer.serialize_struct("cosmos.store.snapshots.v1.Metadata", len)?; if !self.chunk_hashes.is_empty() { struct_ser.serialize_field( "chunkHashes", @@ -76,7 +76,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { type Value = Metadata; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Metadata") + formatter.write_str("struct cosmos.store.snapshots.v1.Metadata") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -105,7 +105,7 @@ impl<'de> serde::Deserialize<'de> for Metadata { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.Metadata", + "cosmos.store.snapshots.v1.Metadata", FIELDS, GeneratedVisitor, ) @@ -136,7 +136,7 @@ impl serde::Serialize for Snapshot { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.Snapshot", len)?; + serializer.serialize_struct("cosmos.store.snapshots.v1.Snapshot", len)?; if self.height != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; @@ -216,7 +216,7 @@ impl<'de> serde::Deserialize<'de> for Snapshot { type Value = Snapshot; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.Snapshot") + formatter.write_str("struct cosmos.store.snapshots.v1.Snapshot") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -284,7 +284,7 @@ impl<'de> serde::Deserialize<'de> for Snapshot { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.Snapshot", + "cosmos.store.snapshots.v1.Snapshot", FIELDS, GeneratedVisitor, ) @@ -305,8 +305,8 @@ impl serde::Serialize for SnapshotExtensionMeta { if self.format != 0 { len += 1; } - let mut struct_ser = serializer - .serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.store.snapshots.v1.SnapshotExtensionMeta", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } @@ -368,7 +368,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { type Value = SnapshotExtensionMeta; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta") + formatter.write_str("struct cosmos.store.snapshots.v1.SnapshotExtensionMeta") } fn visit_map( @@ -406,7 +406,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotExtensionMeta { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotExtensionMeta", + "cosmos.store.snapshots.v1.SnapshotExtensionMeta", FIELDS, GeneratedVisitor, ) @@ -424,10 +424,8 @@ impl serde::Serialize for SnapshotExtensionPayload { if !self.payload.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", - len, - )?; + let mut struct_ser = serializer + .serialize_struct("cosmos.store.snapshots.v1.SnapshotExtensionPayload", len)?; if !self.payload.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( @@ -488,7 +486,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { type Value = SnapshotExtensionPayload; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload") + formatter.write_str("struct cosmos.store.snapshots.v1.SnapshotExtensionPayload") } fn visit_map( @@ -518,7 +516,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotExtensionPayload { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotExtensionPayload", + "cosmos.store.snapshots.v1.SnapshotExtensionPayload", FIELDS, GeneratedVisitor, ) @@ -546,7 +544,7 @@ impl serde::Serialize for SnapshotIavlItem { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", len)?; + serializer.serialize_struct("cosmos.store.snapshots.v1.SnapshotIAVLItem", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -625,7 +623,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { type Value = SnapshotIavlItem; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotIAVLItem") + formatter.write_str("struct cosmos.store.snapshots.v1.SnapshotIAVLItem") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -685,7 +683,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotIavlItem { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotIAVLItem", + "cosmos.store.snapshots.v1.SnapshotIAVLItem", FIELDS, GeneratedVisitor, ) @@ -704,7 +702,7 @@ impl serde::Serialize for SnapshotItem { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotItem", len)?; + serializer.serialize_struct("cosmos.store.snapshots.v1.SnapshotItem", len)?; if let Some(v) = self.item.as_ref() { match v { snapshot_item::Item::Store(v) => { @@ -719,12 +717,6 @@ impl serde::Serialize for SnapshotItem { snapshot_item::Item::ExtensionPayload(v) => { struct_ser.serialize_field("extensionPayload", v)?; } - snapshot_item::Item::Kv(v) => { - struct_ser.serialize_field("kv", v)?; - } - snapshot_item::Item::Schema(v) => { - struct_ser.serialize_field("schema", v)?; - } } } struct_ser.end() @@ -743,8 +735,6 @@ impl<'de> serde::Deserialize<'de> for SnapshotItem { "extension", "extension_payload", "extensionPayload", - "kv", - "schema", ]; #[allow(clippy::enum_variant_names)] @@ -753,8 +743,6 @@ impl<'de> serde::Deserialize<'de> for SnapshotItem { Iavl, Extension, ExtensionPayload, - Kv, - Schema, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -786,8 +774,6 @@ impl<'de> serde::Deserialize<'de> for SnapshotItem { "extensionPayload" | "extension_payload" => { Ok(GeneratedField::ExtensionPayload) } - "kv" => Ok(GeneratedField::Kv), - "schema" => Ok(GeneratedField::Schema), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -800,7 +786,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotItem { type Value = SnapshotItem; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotItem") + formatter.write_str("struct cosmos.store.snapshots.v1.SnapshotItem") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -842,269 +828,13 @@ impl<'de> serde::Deserialize<'de> for SnapshotItem { .next_value::<::std::option::Option<_>>()? .map(snapshot_item::Item::ExtensionPayload); } - GeneratedField::Kv => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("kv")); - } - item__ = map_ - .next_value::<::std::option::Option<_>>()? - .map(snapshot_item::Item::Kv); - } - GeneratedField::Schema => { - if item__.is_some() { - return Err(serde::de::Error::duplicate_field("schema")); - } - item__ = map_ - .next_value::<::std::option::Option<_>>()? - .map(snapshot_item::Item::Schema); - } } } Ok(SnapshotItem { item: item__ }) } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotItem", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for SnapshotKvItem { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.key.is_empty() { - len += 1; - } - if !self.value.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotKVItem", len)?; - if !self.key.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("key", pbjson::private::base64::encode(&self.key).as_str())?; - } - if !self.value.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "value", - pbjson::private::base64::encode(&self.value).as_str(), - )?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for SnapshotKvItem { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["key", "value"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Key, - Value, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "key" => Ok(GeneratedField::Key), - "value" => Ok(GeneratedField::Value), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotKvItem; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotKVItem") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut key__ = None; - let mut value__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Key => { - if key__.is_some() { - return Err(serde::de::Error::duplicate_field("key")); - } - key__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Value => { - if value__.is_some() { - return Err(serde::de::Error::duplicate_field("value")); - } - value__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - } - } - Ok(SnapshotKvItem { - key: key__.unwrap_or_default(), - value: value__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotKVItem", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for SnapshotSchema { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.keys.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotSchema", len)?; - if !self.keys.is_empty() { - struct_ser.serialize_field( - "keys", - &self - .keys - .iter() - .map(pbjson::private::base64::encode) - .collect::>(), - )?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for SnapshotSchema { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["keys"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Keys, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "keys" => Ok(GeneratedField::Keys), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SnapshotSchema; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotSchema") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut keys__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Keys => { - if keys__.is_some() { - return Err(serde::de::Error::duplicate_field("keys")); - } - keys__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - } - } - Ok(SnapshotSchema { - keys: keys__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotSchema", + "cosmos.store.snapshots.v1.SnapshotItem", FIELDS, GeneratedVisitor, ) @@ -1123,7 +853,7 @@ impl serde::Serialize for SnapshotStoreItem { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.snapshots.v1beta1.SnapshotStoreItem", len)?; + serializer.serialize_struct("cosmos.store.snapshots.v1.SnapshotStoreItem", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } @@ -1180,7 +910,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { type Value = SnapshotStoreItem; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.snapshots.v1beta1.SnapshotStoreItem") + formatter.write_str("struct cosmos.store.snapshots.v1.SnapshotStoreItem") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1204,7 +934,7 @@ impl<'de> serde::Deserialize<'de> for SnapshotStoreItem { } } deserializer.deserialize_struct( - "cosmos.base.snapshots.v1beta1.SnapshotStoreItem", + "cosmos.store.snapshots.v1.SnapshotStoreItem", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.rs new file mode 100644 index 00000000..328d7337 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.rs @@ -0,0 +1,33 @@ +// @generated +/// ListenEndBlockRequest is the request type for the ListenEndBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListenFinalizeBlockRequest { + #[prost(message, optional, tag = "1")] + pub req: ::core::option::Option<::tendermint_proto::v0_34::abci::RequestFinalizeBlock>, + #[prost(message, optional, tag = "2")] + pub res: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseFinalizeBlock>, +} +/// ListenEndBlockResponse is the response type for the ListenEndBlock RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListenFinalizeBlockResponse {} +/// ListenCommitRequest is the request type for the ListenCommit RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListenCommitRequest { + /// explicitly pass in block height as ResponseCommit does not contain this info + #[prost(int64, tag = "1")] + pub block_height: i64, + #[prost(message, optional, tag = "2")] + pub res: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseCommit>, + #[prost(message, repeated, tag = "3")] + pub change_set: ::prost::alloc::vec::Vec, +} +/// ListenCommitResponse is the response type for the ListenCommit RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ListenCommitResponse {} +include!("cosmos.store.streaming.abci.serde.rs"); +include!("cosmos.store.streaming.abci.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.serde.rs new file mode 100644 index 00000000..a54a53ba --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.serde.rs @@ -0,0 +1,434 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ListenCommitRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.block_height != 0 { + len += 1; + } + if self.res.is_some() { + len += 1; + } + if !self.change_set.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.store.streaming.abci.ListenCommitRequest", len)?; + if self.block_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blockHeight", + ToString::to_string(&self.block_height).as_str(), + )?; + } + if let Some(v) = self.res.as_ref() { + struct_ser.serialize_field("res", v)?; + } + if !self.change_set.is_empty() { + struct_ser.serialize_field("changeSet", &self.change_set)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListenCommitRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "block_height", + "blockHeight", + "res", + "change_set", + "changeSet", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + BlockHeight, + Res, + ChangeSet, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "blockHeight" | "block_height" => Ok(GeneratedField::BlockHeight), + "res" => Ok(GeneratedField::Res), + "changeSet" | "change_set" => Ok(GeneratedField::ChangeSet), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListenCommitRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.store.streaming.abci.ListenCommitRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut block_height__ = None; + let mut res__ = None; + let mut change_set__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::BlockHeight => { + if block_height__.is_some() { + return Err(serde::de::Error::duplicate_field("blockHeight")); + } + block_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Res => { + if res__.is_some() { + return Err(serde::de::Error::duplicate_field("res")); + } + res__ = map_.next_value()?; + } + GeneratedField::ChangeSet => { + if change_set__.is_some() { + return Err(serde::de::Error::duplicate_field("changeSet")); + } + change_set__ = Some(map_.next_value()?); + } + } + } + Ok(ListenCommitRequest { + block_height: block_height__.unwrap_or_default(), + res: res__, + change_set: change_set__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.store.streaming.abci.ListenCommitRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListenCommitResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = + serializer.serialize_struct("cosmos.store.streaming.abci.ListenCommitResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListenCommitResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = ListenCommitResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.store.streaming.abci.ListenCommitResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(ListenCommitResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.store.streaming.abci.ListenCommitResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListenFinalizeBlockRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.req.is_some() { + len += 1; + } + if self.res.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "cosmos.store.streaming.abci.ListenFinalizeBlockRequest", + len, + )?; + if let Some(v) = self.req.as_ref() { + struct_ser.serialize_field("req", v)?; + } + if let Some(v) = self.res.as_ref() { + struct_ser.serialize_field("res", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListenFinalizeBlockRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["req", "res"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Req, + Res, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "req" => Ok(GeneratedField::Req), + "res" => Ok(GeneratedField::Res), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ListenFinalizeBlockRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.store.streaming.abci.ListenFinalizeBlockRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut req__ = None; + let mut res__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Req => { + if req__.is_some() { + return Err(serde::de::Error::duplicate_field("req")); + } + req__ = map_.next_value()?; + } + GeneratedField::Res => { + if res__.is_some() { + return Err(serde::de::Error::duplicate_field("res")); + } + res__ = map_.next_value()?; + } + } + } + Ok(ListenFinalizeBlockRequest { + req: req__, + res: res__, + }) + } + } + deserializer.deserialize_struct( + "cosmos.store.streaming.abci.ListenFinalizeBlockRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ListenFinalizeBlockResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct( + "cosmos.store.streaming.abci.ListenFinalizeBlockResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ListenFinalizeBlockResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::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) -> std::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 std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::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 = ListenFinalizeBlockResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct cosmos.store.streaming.abci.ListenFinalizeBlockResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(ListenFinalizeBlockResponse {}) + } + } + deserializer.deserialize_struct( + "cosmos.store.streaming.abci.ListenFinalizeBlockResponse", + FIELDS, + GeneratedVisitor, + ) + } +} 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 new file mode 100644 index 00000000..e4fee26e --- /dev/null +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.streaming.abci.tonic.rs @@ -0,0 +1,357 @@ +// @generated +/// Generated client implementations. +#[cfg(feature = "grpc")] +pub mod abci_listener_service_client { + #![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 + */ + #[derive(Debug, Clone)] + pub struct AbciListenerServiceClient { + inner: tonic::client::Grpc, + } + #[cfg(feature = "grpc-transport")] + impl AbciListenerServiceClient { + /// 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 AbciListenerServiceClient + 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, + ) -> AbciListenerServiceClient> + where + F: tonic::service::Interceptor, + T::ResponseBody: Default, + T: tonic::codegen::Service< + http::Request, + Response = http::Response< + >::ResponseBody, + >, + >, + >>::Error: + Into + Send + Sync, + { + AbciListenerServiceClient::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 + } + /** ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + */ + pub async fn listen_finalize_block( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.store.streaming.abci.ABCIListenerService", + "ListenFinalizeBlock", + )); + self.inner.unary(req, path, codec).await + } + /** ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + */ + pub async fn listen_commit( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result, tonic::Status> + { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/cosmos.store.streaming.abci.ABCIListenerService/ListenCommit", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "cosmos.store.streaming.abci.ABCIListenerService", + "ListenCommit", + )); + self.inner.unary(req, path, codec).await + } + } +} +/// Generated server implementations. +#[cfg(feature = "grpc")] +pub mod abci_listener_service_server { + #![allow(unused_variables, dead_code, missing_docs, clippy::let_unit_value)] + use tonic::codegen::*; + /// Generated trait containing gRPC methods that should be implemented for use with AbciListenerServiceServer. + #[async_trait] + pub trait AbciListenerService: Send + Sync + 'static { + /** ListenFinalizeBlock is the corresponding endpoint for ABCIListener.ListenEndBlock + */ + async fn listen_finalize_block( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + /** ListenCommit is the corresponding endpoint for ABCIListener.ListenCommit + */ + async fn listen_commit( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + /** ABCIListenerService is the service for the BaseApp ABCIListener interface + */ + #[derive(Debug)] + pub struct AbciListenerServiceServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + 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(), + 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 AbciListenerServiceServer + where + T: AbciListenerService, + 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.store.streaming.abci.ABCIListenerService/ListenFinalizeBlock" => { + #[allow(non_camel_case_types)] + struct ListenFinalizeBlockSvc(pub Arc); + impl + tonic::server::UnaryService + for ListenFinalizeBlockSvc + { + type Response = super::ListenFinalizeBlockResponse; + 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).listen_finalize_block(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 = ListenFinalizeBlockSvc(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.store.streaming.abci.ABCIListenerService/ListenCommit" => { + #[allow(non_camel_case_types)] + struct ListenCommitSvc(pub Arc); + impl + tonic::server::UnaryService + for ListenCommitSvc + { + type Response = super::ListenCommitResponse; + 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).listen_commit(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 = ListenCommitSvc(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 AbciListenerServiceServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for AbciListenerServiceServer { + const NAME: &'static str = "cosmos.store.streaming.abci.ABCIListenerService"; + } +} diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs similarity index 68% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs index 1e502ae4..fca3246c 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.rs @@ -1,4 +1,38 @@ // @generated +/// 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 { + /// the store key for the KVStore this pair originates from + #[prost(string, tag = "1")] + pub store_key: ::prost::alloc::string::String, + /// true indicates a delete operation, false indicates a set operation + #[prost(bool, tag = "2")] + pub delete: bool, + #[prost(bytes = "vec", tag = "3")] + pub key: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + pub value: ::prost::alloc::vec::Vec, +} +/// BlockMetadata contains all the abci event data of a block +/// the file streamer dump them into files together with the state changes. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct BlockMetadata { + #[prost(message, optional, tag = "6")] + pub response_commit: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseCommit>, + #[prost(message, optional, tag = "7")] + pub request_finalize_block: + ::core::option::Option<::tendermint_proto::v0_34::abci::RequestFinalizeBlock>, + /// TODO: should we renumber this? + #[prost(message, optional, tag = "8")] + pub response_finalize_block: + ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseFinalizeBlock>, +} /// CommitInfo defines commit information used by the multi-store when committing /// a version/height. #[allow(clippy::derive_partial_eq_without_eq)] @@ -31,57 +65,5 @@ pub struct CommitId { #[prost(bytes = "vec", tag = "2")] pub hash: ::prost::alloc::vec::Vec, } -/// 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 { - /// the store key for the KVStore this pair originates from - #[prost(string, tag = "1")] - pub store_key: ::prost::alloc::string::String, - /// true indicates a delete operation, false indicates a set operation - #[prost(bool, tag = "2")] - pub delete: bool, - #[prost(bytes = "vec", tag = "3")] - pub key: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "4")] - pub value: ::prost::alloc::vec::Vec, -} -/// BlockMetadata contains all the abci event data of a block -/// the file streamer dump them into files together with the state changes. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct BlockMetadata { - #[prost(message, optional, tag = "1")] - pub request_begin_block: - ::core::option::Option<::tendermint_proto::v0_34::abci::RequestBeginBlock>, - #[prost(message, optional, tag = "2")] - pub response_begin_block: - ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseBeginBlock>, - #[prost(message, repeated, tag = "3")] - pub deliver_txs: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub request_end_block: ::core::option::Option<::tendermint_proto::v0_34::abci::RequestEndBlock>, - #[prost(message, optional, tag = "5")] - pub response_end_block: - ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseEndBlock>, - #[prost(message, optional, tag = "6")] - pub response_commit: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseCommit>, -} -/// Nested message and enum types in `BlockMetadata`. -pub mod block_metadata { - /// DeliverTx encapulate deliver tx request and response. - #[allow(clippy::derive_partial_eq_without_eq)] - #[derive(Clone, PartialEq, ::prost::Message)] - pub struct DeliverTx { - #[prost(message, optional, tag = "1")] - pub request: ::core::option::Option<::tendermint_proto::v0_34::abci::RequestDeliverTx>, - #[prost(message, optional, tag = "2")] - pub response: ::core::option::Option<::tendermint_proto::v0_34::abci::ResponseDeliverTx>, - } -} -include!("cosmos.base.store.v1beta1.serde.rs"); +include!("cosmos.store.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.serde.rs similarity index 69% rename from cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs rename to cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.serde.rs index b59515e4..7ddbd71f 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.base.store.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.store.v1beta1.serde.rs @@ -8,44 +8,26 @@ impl serde::Serialize for BlockMetadata { { use serde::ser::SerializeStruct; let mut len = 0; - if self.request_begin_block.is_some() { - len += 1; - } - if self.response_begin_block.is_some() { - len += 1; - } - if !self.deliver_txs.is_empty() { - len += 1; - } - if self.request_end_block.is_some() { + if self.response_commit.is_some() { len += 1; } - if self.response_end_block.is_some() { + if self.request_finalize_block.is_some() { len += 1; } - if self.response_commit.is_some() { + if self.response_finalize_block.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.BlockMetadata", len)?; - if let Some(v) = self.request_begin_block.as_ref() { - struct_ser.serialize_field("requestBeginBlock", v)?; - } - if let Some(v) = self.response_begin_block.as_ref() { - struct_ser.serialize_field("responseBeginBlock", v)?; - } - if !self.deliver_txs.is_empty() { - struct_ser.serialize_field("deliverTxs", &self.deliver_txs)?; - } - if let Some(v) = self.request_end_block.as_ref() { - struct_ser.serialize_field("requestEndBlock", v)?; - } - if let Some(v) = self.response_end_block.as_ref() { - struct_ser.serialize_field("responseEndBlock", v)?; - } + serializer.serialize_struct("cosmos.store.v1beta1.BlockMetadata", len)?; if let Some(v) = self.response_commit.as_ref() { struct_ser.serialize_field("responseCommit", v)?; } + if let Some(v) = self.request_finalize_block.as_ref() { + struct_ser.serialize_field("requestFinalizeBlock", v)?; + } + if let Some(v) = self.response_finalize_block.as_ref() { + struct_ser.serialize_field("responseFinalizeBlock", v)?; + } struct_ser.end() } } @@ -57,28 +39,19 @@ impl<'de> serde::Deserialize<'de> for BlockMetadata { D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "request_begin_block", - "requestBeginBlock", - "response_begin_block", - "responseBeginBlock", - "deliver_txs", - "deliverTxs", - "request_end_block", - "requestEndBlock", - "response_end_block", - "responseEndBlock", "response_commit", "responseCommit", + "request_finalize_block", + "requestFinalizeBlock", + "response_finalize_block", + "responseFinalizeBlock", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - RequestBeginBlock, - ResponseBeginBlock, - DeliverTxs, - RequestEndBlock, - ResponseEndBlock, ResponseCommit, + RequestFinalizeBlock, + ResponseFinalizeBlock, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -104,22 +77,15 @@ impl<'de> serde::Deserialize<'de> for BlockMetadata { E: serde::de::Error, { match value { - "requestBeginBlock" | "request_begin_block" => { - Ok(GeneratedField::RequestBeginBlock) - } - "responseBeginBlock" | "response_begin_block" => { - Ok(GeneratedField::ResponseBeginBlock) - } - "deliverTxs" | "deliver_txs" => Ok(GeneratedField::DeliverTxs), - "requestEndBlock" | "request_end_block" => { - Ok(GeneratedField::RequestEndBlock) - } - "responseEndBlock" | "response_end_block" => { - Ok(GeneratedField::ResponseEndBlock) - } "responseCommit" | "response_commit" => { Ok(GeneratedField::ResponseCommit) } + "requestFinalizeBlock" | "request_finalize_block" => { + Ok(GeneratedField::RequestFinalizeBlock) + } + "responseFinalizeBlock" | "response_finalize_block" => { + Ok(GeneratedField::ResponseFinalizeBlock) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -132,192 +98,51 @@ impl<'de> serde::Deserialize<'de> for BlockMetadata { type Value = BlockMetadata; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata") + formatter.write_str("struct cosmos.store.v1beta1.BlockMetadata") } fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut request_begin_block__ = None; - let mut response_begin_block__ = None; - let mut deliver_txs__ = None; - let mut request_end_block__ = None; - let mut response_end_block__ = None; let mut response_commit__ = None; + let mut request_finalize_block__ = None; + let mut response_finalize_block__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::RequestBeginBlock => { - if request_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestBeginBlock")); - } - request_begin_block__ = map_.next_value()?; - } - GeneratedField::ResponseBeginBlock => { - if response_begin_block__.is_some() { - return Err(serde::de::Error::duplicate_field( - "responseBeginBlock", - )); - } - response_begin_block__ = map_.next_value()?; - } - GeneratedField::DeliverTxs => { - if deliver_txs__.is_some() { - return Err(serde::de::Error::duplicate_field("deliverTxs")); - } - deliver_txs__ = Some(map_.next_value()?); - } - GeneratedField::RequestEndBlock => { - if request_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("requestEndBlock")); - } - request_end_block__ = map_.next_value()?; - } - GeneratedField::ResponseEndBlock => { - if response_end_block__.is_some() { - return Err(serde::de::Error::duplicate_field("responseEndBlock")); - } - response_end_block__ = map_.next_value()?; - } GeneratedField::ResponseCommit => { if response_commit__.is_some() { return Err(serde::de::Error::duplicate_field("responseCommit")); } response_commit__ = map_.next_value()?; } - } - } - Ok(BlockMetadata { - request_begin_block: request_begin_block__, - response_begin_block: response_begin_block__, - deliver_txs: deliver_txs__.unwrap_or_default(), - request_end_block: request_end_block__, - response_end_block: response_end_block__, - response_commit: response_commit__, - }) - } - } - deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.BlockMetadata", - FIELDS, - GeneratedVisitor, - ) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for block_metadata::DeliverTx { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.request.is_some() { - len += 1; - } - if self.response.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", len)?; - if let Some(v) = self.request.as_ref() { - struct_ser.serialize_field("request", v)?; - } - if let Some(v) = self.response.as_ref() { - struct_ser.serialize_field("response", v)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for block_metadata::DeliverTx { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["request", "response"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Request, - Response, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::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 std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } - - #[allow(unused_variables)] - fn visit_str(self, value: &str) -> std::result::Result - where - E: serde::de::Error, - { - match value { - "request" => Ok(GeneratedField::Request), - "response" => Ok(GeneratedField::Response), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = block_metadata::DeliverTx; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.BlockMetadata.DeliverTx") - } - - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut request__ = None; - let mut response__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Request => { - if request__.is_some() { - return Err(serde::de::Error::duplicate_field("request")); + GeneratedField::RequestFinalizeBlock => { + if request_finalize_block__.is_some() { + return Err(serde::de::Error::duplicate_field( + "requestFinalizeBlock", + )); } - request__ = map_.next_value()?; + request_finalize_block__ = map_.next_value()?; } - GeneratedField::Response => { - if response__.is_some() { - return Err(serde::de::Error::duplicate_field("response")); + GeneratedField::ResponseFinalizeBlock => { + if response_finalize_block__.is_some() { + return Err(serde::de::Error::duplicate_field( + "responseFinalizeBlock", + )); } - response__ = map_.next_value()?; + response_finalize_block__ = map_.next_value()?; } } } - Ok(block_metadata::DeliverTx { - request: request__, - response: response__, + Ok(BlockMetadata { + response_commit: response_commit__, + request_finalize_block: request_finalize_block__, + response_finalize_block: response_finalize_block__, }) } } deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.BlockMetadata.DeliverTx", + "cosmos.store.v1beta1.BlockMetadata", FIELDS, GeneratedVisitor, ) @@ -338,8 +163,7 @@ impl serde::Serialize for CommitId { if !self.hash.is_empty() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.CommitID", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.store.v1beta1.CommitID", len)?; if self.version != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; @@ -404,7 +228,7 @@ impl<'de> serde::Deserialize<'de> for CommitId { type Value = CommitId; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitID") + formatter.write_str("struct cosmos.store.v1beta1.CommitID") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -441,11 +265,7 @@ impl<'de> serde::Deserialize<'de> for CommitId { }) } } - deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.CommitID", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.store.v1beta1.CommitID", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -466,8 +286,7 @@ impl serde::Serialize for CommitInfo { if self.timestamp.is_some() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.CommitInfo", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.store.v1beta1.CommitInfo", len)?; if self.version != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("version", ToString::to_string(&self.version).as_str())?; @@ -535,7 +354,7 @@ impl<'de> serde::Deserialize<'de> for CommitInfo { type Value = CommitInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.CommitInfo") + formatter.write_str("struct cosmos.store.v1beta1.CommitInfo") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -577,11 +396,7 @@ impl<'de> serde::Deserialize<'de> for CommitInfo { }) } } - deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.CommitInfo", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.store.v1beta1.CommitInfo", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -599,8 +414,7 @@ impl serde::Serialize for StoreInfo { if self.commit_id.is_some() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.StoreInfo", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.store.v1beta1.StoreInfo", len)?; if !self.name.is_empty() { struct_ser.serialize_field("name", &self.name)?; } @@ -662,7 +476,7 @@ impl<'de> serde::Deserialize<'de> for StoreInfo { type Value = StoreInfo; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreInfo") + formatter.write_str("struct cosmos.store.v1beta1.StoreInfo") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -693,11 +507,7 @@ impl<'de> serde::Deserialize<'de> for StoreInfo { }) } } - deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.StoreInfo", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("cosmos.store.v1beta1.StoreInfo", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -722,7 +532,7 @@ impl serde::Serialize for StoreKvPair { len += 1; } let mut struct_ser = - serializer.serialize_struct("cosmos.base.store.v1beta1.StoreKVPair", len)?; + serializer.serialize_struct("cosmos.store.v1beta1.StoreKVPair", len)?; if !self.store_key.is_empty() { struct_ser.serialize_field("storeKey", &self.store_key)?; } @@ -800,7 +610,7 @@ impl<'de> serde::Deserialize<'de> for StoreKvPair { type Value = StoreKvPair; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.store.v1beta1.StoreKVPair") + formatter.write_str("struct cosmos.store.v1beta1.StoreKVPair") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -854,7 +664,7 @@ impl<'de> serde::Deserialize<'de> for StoreKvPair { } } deserializer.deserialize_struct( - "cosmos.base.store.v1beta1.StoreKVPair", + "cosmos.store.v1beta1.StoreKVPair", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs index c98eddaf..7d511a78 100644 --- a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.signing.v1beta1.rs @@ -93,12 +93,13 @@ pub enum SignMode { Direct = 1, /// SIGN_MODE_TEXTUAL is a future signing mode that will verify some /// human-readable textual representation on top of the binary representation - /// from SIGN_MODE_DIRECT. It is currently not supported. + /// from SIGN_MODE_DIRECT. + /// + /// Since: cosmos-sdk 0.50 Textual = 2, /// SIGN_MODE_DIRECT_AUX specifies a signing mode which uses /// SignDocDirectAux. As opposed to SIGN_MODE_DIRECT, this sign mode does not - /// require signers signing over other signers' `signer_info`. It also allows - /// for adding Tips in transactions. + /// require signers signing over other signers' `signer_info`. /// /// Since: cosmos-sdk 0.46 DirectAux = 3, diff --git a/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs b/cosmos-sdk-proto/src/prost/cosmos-sdk/cosmos.tx.v1beta1.rs index cfaa30fb..39e4d910 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 @@ -84,12 +84,8 @@ pub struct SignDocDirectAux { /// sequence is the sequence number of the signing account. #[prost(uint64, tag = "5")] pub sequence: u64, - /// Tip is the optional tip used for transactions fees paid in another denom. - /// It should be left empty if the signer is not the tipper for this - /// transaction. - /// - /// This field is ignored if the chain didn't enable tips, i.e. didn't add the - /// `TipDecorator` in its posthandler. + /// tips have been depreacted and should not be used + #[deprecated] #[prost(message, optional, tag = "6")] pub tip: ::core::option::Option, } @@ -150,6 +146,7 @@ pub struct AuthInfo { /// `TipDecorator` in its posthandler. /// /// Since: cosmos-sdk 0.46 + #[deprecated] #[prost(message, optional, tag = "3")] pub tip: ::core::option::Option, } @@ -289,6 +286,9 @@ pub struct AuxSignerData { #[derive(Clone, PartialEq, ::prost::Message)] pub struct GetTxsEventRequest { /// events is the list of transaction event type. + /// Deprecated post v0.47.x: use query instead, which should contain a valid + /// events query. + #[deprecated] #[prost(string, repeated, tag = "1")] pub events: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, /// pagination defines a pagination for the request. @@ -298,13 +298,20 @@ pub struct GetTxsEventRequest { pub pagination: ::core::option::Option, #[prost(enumeration = "OrderBy", tag = "3")] pub order_by: i32, - /// page is the page number to query, starts at 1. If not provided, will default to first page. + /// page is the page number to query, starts at 1. If not provided, will + /// default to first page. #[prost(uint64, tag = "4")] pub page: u64, /// limit is the total number of results to be returned in the result page. /// If left empty it will default to a value to be set by each app. #[prost(uint64, tag = "5")] pub limit: u64, + /// query defines the transaction event query that is proxied to Tendermint's + /// TxSearch RPC method. The query must be valid. + /// + /// Since cosmos-sdk 0.50 + #[prost(string, tag = "6")] + pub query: ::prost::alloc::string::String, } /// GetTxsEventResponse is the response type for the Service.TxsByEvents /// RPC method. @@ -408,7 +415,8 @@ pub struct GetBlockWithTxsRequest { #[prost(message, optional, tag = "2")] pub pagination: ::core::option::Option, } -/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs method. +/// GetBlockWithTxsResponse is the response type for the Service.GetBlockWithTxs +/// method. /// /// Since: cosmos-sdk 0.45.2 #[allow(clippy::derive_partial_eq_without_eq)] @@ -513,7 +521,8 @@ pub struct TxDecodeAminoResponse { #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum OrderBy { - /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults to ASC in this case. + /// ORDER_BY_UNSPECIFIED specifies an unknown sorting order. OrderBy defaults + /// to ASC in this case. Unspecified = 0, /// ORDER_BY_ASC defines ascending order Asc = 1, @@ -542,7 +551,8 @@ impl OrderBy { } } } -/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC method. +/// BroadcastMode specifies the broadcast mode for the TxService.Broadcast RPC +/// method. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum BroadcastMode { @@ -551,11 +561,11 @@ pub enum BroadcastMode { /// DEPRECATED: use BROADCAST_MODE_SYNC instead, /// BROADCAST_MODE_BLOCK is not supported by the SDK from v0.47.x onwards. Block = 1, - /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits for - /// a CheckTx execution response only. + /// BROADCAST_MODE_SYNC defines a tx broadcasting mode where the client waits + /// for a CheckTx execution response only. Sync = 2, - /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client returns - /// immediately. + /// BROADCAST_MODE_ASYNC defines a tx broadcasting mode where the client + /// returns immediately. Async = 3, } impl BroadcastMode { diff --git a/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 0c74aa9d..e84b9251 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 @@ -1234,6 +1234,9 @@ impl serde::Serialize for GetTxsEventRequest { if self.limit != 0 { len += 1; } + if !self.query.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("cosmos.tx.v1beta1.GetTxsEventRequest", len)?; if !self.events.is_empty() { @@ -1256,6 +1259,9 @@ impl serde::Serialize for GetTxsEventRequest { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; } + if !self.query.is_empty() { + struct_ser.serialize_field("query", &self.query)?; + } struct_ser.end() } } @@ -1273,6 +1279,7 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { "orderBy", "page", "limit", + "query", ]; #[allow(clippy::enum_variant_names)] @@ -1282,6 +1289,7 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { OrderBy, Page, Limit, + Query, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1312,6 +1320,7 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { "orderBy" | "order_by" => Ok(GeneratedField::OrderBy), "page" => Ok(GeneratedField::Page), "limit" => Ok(GeneratedField::Limit), + "query" => Ok(GeneratedField::Query), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1336,6 +1345,7 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { let mut order_by__ = None; let mut page__ = None; let mut limit__ = None; + let mut query__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Events => { @@ -1374,6 +1384,12 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { .0, ); } + GeneratedField::Query => { + if query__.is_some() { + return Err(serde::de::Error::duplicate_field("query")); + } + query__ = Some(map_.next_value()?); + } } } Ok(GetTxsEventRequest { @@ -1382,6 +1398,7 @@ impl<'de> serde::Deserialize<'de> for GetTxsEventRequest { order_by: order_by__.unwrap_or_default(), page: page__.unwrap_or_default(), limit: limit__.unwrap_or_default(), + query: query__.unwrap_or_default(), }) } } diff --git a/cosmrs/src/tx/auth_info.rs b/cosmrs/src/tx/auth_info.rs index b91a2402..b2a617a0 100644 --- a/cosmrs/src/tx/auth_info.rs +++ b/cosmrs/src/tx/auth_info.rs @@ -41,7 +41,6 @@ impl TryFrom for AuthInfo { type Error = ErrorReport; fn try_from(proto: proto::cosmos::tx::v1beta1::AuthInfo) -> Result { - // TODO(tarcieri): parse tip Ok(AuthInfo { signer_infos: proto .signer_infos @@ -58,6 +57,7 @@ impl TryFrom for AuthInfo { impl From for proto::cosmos::tx::v1beta1::AuthInfo { fn from(auth_info: AuthInfo) -> proto::cosmos::tx::v1beta1::AuthInfo { + #[allow(deprecated)] // tip proto::cosmos::tx::v1beta1::AuthInfo { signer_infos: auth_info.signer_infos.into_iter().map(Into::into).collect(), fee: Some(auth_info.fee.into()), diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 14f5f64a..4d1f113d 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -20,7 +20,7 @@ use walkdir::WalkDir; static QUIET: AtomicBool = AtomicBool::new(false); /// The Cosmos SDK commit or tag to be cloned and used to build the proto files -const COSMOS_SDK_REV: &str = "v0.47.10"; +const COSMOS_SDK_REV: &str = "v0.50.9"; /// The Cosmos ibc-go commit or tag to be cloned and used to build the proto files const IBC_REV: &str = "v6.3.1";