diff --git a/src/IBC_GO_COMMIT b/src/IBC_GO_COMMIT index 47f08cce..8c33106a 100644 --- a/src/IBC_GO_COMMIT +++ b/src/IBC_GO_COMMIT @@ -1 +1 @@ -2551dea41cd3c512845007ca895c8402afa9b79f +7a89e5d5b5ebb7643ce3992c34008c35373ecf34 diff --git a/src/lib.rs b/src/lib.rs index 4287448b..5abf7bf4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -5,7 +5,11 @@ #![cfg_attr(not(feature = "std"), no_std)] #![deny(warnings, trivial_casts, trivial_numeric_casts, unused_import_braces)] -#![allow(clippy::large_enum_variant, clippy::derive_partial_eq_without_eq)] +#![allow( + clippy::large_enum_variant, + clippy::derive_partial_eq_without_eq, + clippy::needless_borrows_for_generic_args +)] #![allow(rustdoc::bare_urls)] #![forbid(unsafe_code)] diff --git a/src/prost/google.protobuf.rs b/src/prost/google.protobuf.rs index 3878889e..33731f49 100644 --- a/src/prost/google.protobuf.rs +++ b/src/prost/google.protobuf.rs @@ -22,8 +22,12 @@ /// if (any.is(Foo.class)) { /// foo = any.unpack(Foo.class); /// } +/// // or ... +/// if (any.isSameTypeAs(Foo.getDefaultInstance())) { +/// foo = any.unpack(Foo.getDefaultInstance()); +/// } /// -/// Example 3: Pack and unpack a message in Python. +/// Example 3: Pack and unpack a message in Python. /// /// foo = Foo(...) /// any = Any() @@ -33,7 +37,7 @@ /// any.Unpack(foo) /// ... /// -/// Example 4: Pack and unpack a message in Go +/// Example 4: Pack and unpack a message in Go /// /// foo := &pb.Foo{...} /// any, err := anypb.New(foo) @@ -52,9 +56,8 @@ /// in the type URL, for example "foo.bar.com/x/y.z" will yield type /// name "y.z". /// -/// /// JSON -/// +/// ==== /// The JSON representation of an `Any` value uses the regular /// representation of the deserialized, embedded message, with an /// additional field `@type` which contains the type URL. Example: @@ -113,7 +116,8 @@ pub struct Any { /// /// Note: this functionality is not currently available in the official /// protobuf release, and it is not used for type URLs beginning with - /// type.googleapis.com. + /// type.googleapis.com. As of May 2023, there are no widely used type server + /// implementations and no plans to implement one. /// /// Schemes other than `http`, `https` (or the empty scheme) might be /// used with implementation specific semantics. @@ -170,9 +174,14 @@ pub struct FileDescriptorProto { #[prost(message, optional, tag = "9")] pub source_code_info: ::core::option::Option, /// The syntax of the proto file. - /// The supported values are "proto2" and "proto3". + /// The supported values are "proto2", "proto3", and "editions". + /// + /// If `edition` is present, this value must be "editions". #[prost(string, optional, tag = "12")] pub syntax: ::core::option::Option<::prost::alloc::string::String>, + /// The edition of the proto file, which is an opaque string. + #[prost(string, optional, tag = "13")] + pub edition: ::core::option::Option<::prost::alloc::string::String>, } /// Describes a message type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -235,6 +244,90 @@ pub struct ExtensionRangeOptions { /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, + /// For external users: DO NOT USE. We are in the process of open sourcing + /// extension declaration and executing internal cleanups before it can be + /// used externally. + #[prost(message, repeated, tag = "2")] + pub declaration: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, + /// The verification state of the range. + /// TODO(b/278783756): flip the default to DECLARATION once all empty ranges + /// are marked as UNVERIFIED. + #[prost( + enumeration = "extension_range_options::VerificationState", + optional, + tag = "3", + default = "Unverified" + )] + pub verification: ::core::option::Option, +} +/// Nested message and enum types in `ExtensionRangeOptions`. +pub mod extension_range_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct Declaration { + /// The extension number declared within the extension range. + #[prost(int32, optional, tag = "1")] + pub number: ::core::option::Option, + /// The fully-qualified name of the extension field. There must be a leading + /// dot in front of the full name. + #[prost(string, optional, tag = "2")] + pub full_name: ::core::option::Option<::prost::alloc::string::String>, + /// The fully-qualified type name of the extension field. Unlike + /// Metadata.type, Declaration.type must have a leading dot for messages + /// and enums. + #[prost(string, optional, tag = "3")] + pub r#type: ::core::option::Option<::prost::alloc::string::String>, + /// If true, indicates that the number is reserved in the extension range, + /// and any extension field with the number will fail to compile. Set this + /// when a declared extension field is deleted. + #[prost(bool, optional, tag = "5")] + pub reserved: ::core::option::Option, + /// If true, indicates that the extension must be defined as repeated. + /// Otherwise the extension must be defined as optional. + #[prost(bool, optional, tag = "6")] + pub repeated: ::core::option::Option, + } + /// The verification state of the extension range. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum VerificationState { + /// All the extensions of the range must be declared. + Declaration = 0, + Unverified = 1, + } + impl VerificationState { + /// 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 { + VerificationState::Declaration => "DECLARATION", + VerificationState::Unverified => "UNVERIFIED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "DECLARATION" => Some(Self::Declaration), + "UNVERIFIED" => Some(Self::Unverified), + _ => None, + } + } + } } /// Describes a field within a message. #[allow(clippy::derive_partial_eq_without_eq)] @@ -647,6 +740,9 @@ pub struct FileOptions { /// determining the ruby package. #[prost(string, optional, tag = "45")] pub ruby_package: ::core::option::Option<::prost::alloc::string::String>, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "50")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. /// See the documentation for the "Options" section above. #[prost(message, repeated, tag = "999")] @@ -734,6 +830,10 @@ pub struct MessageOptions { /// this is a formalization for deprecating messages. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// NOTE: Do not set the option in .proto files. Always use the maps syntax + /// instead. The option should only be implicitly set by the proto compiler + /// parser. + /// /// Whether the message is an automatically generated map entry type for the /// maps field. /// @@ -751,12 +851,24 @@ pub struct MessageOptions { /// use a native map in the target language to hold the keys and values. /// The reflection APIs in such implementations still need to work as /// if the field is a repeated message field. - /// - /// NOTE: Do not set the option in .proto files. Always use the maps syntax - /// instead. The option should only be implicitly set by the proto compiler - /// parser. #[prost(bool, optional, tag = "7")] pub map_entry: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// + /// This should only be used as a temporary measure against broken builds due + /// to the change in behavior for JSON field name conflicts. + /// + /// TODO(b/261750190) This is legacy behavior we plan to remove once downstream + /// teams have had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "11")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "12")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -766,8 +878,10 @@ pub struct MessageOptions { pub struct FieldOptions { /// The ctype option instructs the C++ code generator to use a different /// representation of the field than it normally would. See the specific - /// options below. This option is not yet implemented in the open source - /// release -- sorry, we'll try to include it in a future version! + /// options below. This option is only implemented to support use of + /// \[ctype=CORD\] and \[ctype=STRING\] (the default) on non-repeated fields of + /// type "bytes" in the open source release -- sorry, we'll try to include + /// other types in a future version! #[prost( enumeration = "field_options::CType", optional, @@ -817,7 +931,6 @@ pub struct FieldOptions { /// call from multiple threads concurrently, while non-const methods continue /// to require exclusive access. /// - /// /// Note that implementations may choose not to check required fields within /// a lazy sub-message. That is, calling IsInitialized() on the outer message /// may return true even if the inner message has missing required fields. @@ -829,11 +942,8 @@ pub struct FieldOptions { /// check its required fields, regardless of whether or not the message has /// been parsed. /// - /// As of 2021, lazy does no correctness checks on the byte stream during - /// parsing. This may lead to crashes if and when an invalid byte stream is - /// finally parsed upon access. - /// - /// TODO(b/211906113): Enable validation on lazy fields. + /// As of May 2022, lazy verifies the contents of the byte stream during + /// parsing. An invalid byte stream will cause the overall parsing to fail. #[prost(bool, optional, tag = "5", default = "false")] pub lazy: ::core::option::Option, /// unverified_lazy does no correctness checks on the byte stream. This should @@ -850,12 +960,39 @@ pub struct FieldOptions { /// For Google-internal migration only. Do not use. #[prost(bool, optional, tag = "10", default = "false")] pub weak: ::core::option::Option, + /// Indicate that the field value should not be printed out when using debug + /// formats, e.g. when the field contains sensitive credentials. + #[prost(bool, optional, tag = "16", default = "false")] + pub debug_redact: ::core::option::Option, + #[prost(enumeration = "field_options::OptionRetention", optional, tag = "17")] + pub retention: ::core::option::Option, + #[prost( + enumeration = "field_options::OptionTargetType", + repeated, + packed = "false", + tag = "19" + )] + pub targets: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "20")] + pub edition_defaults: ::prost::alloc::vec::Vec, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "21")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, } /// Nested message and enum types in `FieldOptions`. pub mod field_options { + #[allow(clippy::derive_partial_eq_without_eq)] + #[derive(Clone, PartialEq, ::prost::Message)] + pub struct EditionDefault { + #[prost(string, optional, tag = "1")] + pub edition: ::core::option::Option<::prost::alloc::string::String>, + /// Textproto value. + #[prost(string, optional, tag = "2")] + pub value: ::core::option::Option<::prost::alloc::string::String>, + } #[derive( Clone, Copy, @@ -871,6 +1008,12 @@ pub mod field_options { pub enum CType { /// Default mode. String = 0, + /// The option \[ctype=CORD\] may be applied to a non-repeated field of type + /// "bytes". It indicates that in C++, the data should be stored in a Cord + /// instead of a string. For very large strings, this may reduce memory + /// fragmentation. It may also allow better performance when parsing from a + /// Cord, or when parsing with aliasing enabled, as the parsed Cord may then + /// alias the original buffer. Cord = 1, StringPiece = 2, } @@ -938,10 +1081,121 @@ pub mod field_options { } } } + /// If set to RETENTION_SOURCE, the option will be omitted from the binary. + /// Note: as of January 2023, support for this is in progress and does not yet + /// have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionRetention { + RetentionUnknown = 0, + RetentionRuntime = 1, + RetentionSource = 2, + } + impl OptionRetention { + /// 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 { + OptionRetention::RetentionUnknown => "RETENTION_UNKNOWN", + OptionRetention::RetentionRuntime => "RETENTION_RUNTIME", + OptionRetention::RetentionSource => "RETENTION_SOURCE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "RETENTION_UNKNOWN" => Some(Self::RetentionUnknown), + "RETENTION_RUNTIME" => Some(Self::RetentionRuntime), + "RETENTION_SOURCE" => Some(Self::RetentionSource), + _ => None, + } + } + } + /// This indicates the types of entities that the field may apply to when used + /// as an option. If it is unset, then the field may be freely used as an + /// option on any kind of entity. Note: as of January 2023, support for this is + /// in progress and does not yet have an effect (b/264593489). + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum OptionTargetType { + TargetTypeUnknown = 0, + TargetTypeFile = 1, + TargetTypeExtensionRange = 2, + TargetTypeMessage = 3, + TargetTypeField = 4, + TargetTypeOneof = 5, + TargetTypeEnum = 6, + TargetTypeEnumEntry = 7, + TargetTypeService = 8, + TargetTypeMethod = 9, + } + impl OptionTargetType { + /// 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 { + OptionTargetType::TargetTypeUnknown => "TARGET_TYPE_UNKNOWN", + OptionTargetType::TargetTypeFile => "TARGET_TYPE_FILE", + OptionTargetType::TargetTypeExtensionRange => { + "TARGET_TYPE_EXTENSION_RANGE" + } + OptionTargetType::TargetTypeMessage => "TARGET_TYPE_MESSAGE", + OptionTargetType::TargetTypeField => "TARGET_TYPE_FIELD", + OptionTargetType::TargetTypeOneof => "TARGET_TYPE_ONEOF", + OptionTargetType::TargetTypeEnum => "TARGET_TYPE_ENUM", + OptionTargetType::TargetTypeEnumEntry => "TARGET_TYPE_ENUM_ENTRY", + OptionTargetType::TargetTypeService => "TARGET_TYPE_SERVICE", + OptionTargetType::TargetTypeMethod => "TARGET_TYPE_METHOD", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "TARGET_TYPE_UNKNOWN" => Some(Self::TargetTypeUnknown), + "TARGET_TYPE_FILE" => Some(Self::TargetTypeFile), + "TARGET_TYPE_EXTENSION_RANGE" => Some(Self::TargetTypeExtensionRange), + "TARGET_TYPE_MESSAGE" => Some(Self::TargetTypeMessage), + "TARGET_TYPE_FIELD" => Some(Self::TargetTypeField), + "TARGET_TYPE_ONEOF" => Some(Self::TargetTypeOneof), + "TARGET_TYPE_ENUM" => Some(Self::TargetTypeEnum), + "TARGET_TYPE_ENUM_ENTRY" => Some(Self::TargetTypeEnumEntry), + "TARGET_TYPE_SERVICE" => Some(Self::TargetTypeService), + "TARGET_TYPE_METHOD" => Some(Self::TargetTypeMethod), + _ => None, + } + } + } } #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct OneofOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "1")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -959,6 +1213,18 @@ pub struct EnumOptions { /// is a formalization for deprecating enums. #[prost(bool, optional, tag = "3", default = "false")] pub deprecated: ::core::option::Option, + /// Enable the legacy handling of JSON field name conflicts. This lowercases + /// and strips underscored from the fields before comparison in proto3 only. + /// The new behavior takes `json_name` into account and applies to proto2 as + /// well. + /// TODO(b/261750190) Remove this legacy behavior once downstream teams have + /// had time to migrate. + #[deprecated] + #[prost(bool, optional, tag = "6")] + pub deprecated_legacy_json_field_conflicts: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "7")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -972,6 +1238,14 @@ pub struct EnumValueOptions { /// this is a formalization for deprecating enum values. #[prost(bool, optional, tag = "1", default = "false")] pub deprecated: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "2")] + pub features: ::core::option::Option, + /// Indicate that fields annotated with this enum value should not be printed + /// out when using debug formats, e.g. when the field contains sensitive + /// credentials. + #[prost(bool, optional, tag = "3", default = "false")] + pub debug_redact: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -979,6 +1253,9 @@ pub struct EnumValueOptions { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ServiceOptions { + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "34")] + pub features: ::core::option::Option, /// Is this service deprecated? /// Depending on the target platform, this can emit Deprecated annotations /// for the service, or it will be completely ignored; in the very least, @@ -1005,6 +1282,9 @@ pub struct MethodOptions { default = "IdempotencyUnknown" )] pub idempotency_level: ::core::option::Option, + /// Any features defined in the specific edition. + #[prost(message, optional, tag = "35")] + pub features: ::core::option::Option, /// The parser stores options it doesn't recognize here. See above. #[prost(message, repeated, tag = "999")] pub uninterpreted_option: ::prost::alloc::vec::Vec, @@ -1098,6 +1378,273 @@ pub mod uninterpreted_option { pub is_extension: bool, } } +/// TODO(b/274655146) Enums in C++ gencode (and potentially other languages) are +/// not well scoped. This means that each of the feature enums below can clash +/// with each other. The short names we've chosen maximize call-site +/// readability, but leave us very open to this scenario. A future feature will +/// be designed and implemented to handle this, hopefully before we ever hit a +/// conflict here. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct FeatureSet { + #[prost(enumeration = "feature_set::FieldPresence", optional, tag = "1")] + pub field_presence: ::core::option::Option, + #[prost(enumeration = "feature_set::EnumType", optional, tag = "2")] + pub enum_type: ::core::option::Option, + #[prost(enumeration = "feature_set::RepeatedFieldEncoding", optional, tag = "3")] + pub repeated_field_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::StringFieldValidation", optional, tag = "4")] + pub string_field_validation: ::core::option::Option, + #[prost(enumeration = "feature_set::MessageEncoding", optional, tag = "5")] + pub message_encoding: ::core::option::Option, + #[prost(enumeration = "feature_set::JsonFormat", optional, tag = "6")] + pub json_format: ::core::option::Option, + #[prost(message, optional, boxed, tag = "999")] + pub raw_features: ::core::option::Option<::prost::alloc::boxed::Box>, +} +/// Nested message and enum types in `FeatureSet`. +pub mod feature_set { + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum FieldPresence { + Unknown = 0, + Explicit = 1, + Implicit = 2, + LegacyRequired = 3, + } + impl FieldPresence { + /// 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 { + FieldPresence::Unknown => "FIELD_PRESENCE_UNKNOWN", + FieldPresence::Explicit => "EXPLICIT", + FieldPresence::Implicit => "IMPLICIT", + FieldPresence::LegacyRequired => "LEGACY_REQUIRED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "FIELD_PRESENCE_UNKNOWN" => Some(Self::Unknown), + "EXPLICIT" => Some(Self::Explicit), + "IMPLICIT" => Some(Self::Implicit), + "LEGACY_REQUIRED" => Some(Self::LegacyRequired), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum EnumType { + Unknown = 0, + Open = 1, + Closed = 2, + } + impl EnumType { + /// 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 { + EnumType::Unknown => "ENUM_TYPE_UNKNOWN", + EnumType::Open => "OPEN", + EnumType::Closed => "CLOSED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "ENUM_TYPE_UNKNOWN" => Some(Self::Unknown), + "OPEN" => Some(Self::Open), + "CLOSED" => Some(Self::Closed), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum RepeatedFieldEncoding { + Unknown = 0, + Packed = 1, + Expanded = 2, + } + impl RepeatedFieldEncoding { + /// 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 { + RepeatedFieldEncoding::Unknown => "REPEATED_FIELD_ENCODING_UNKNOWN", + RepeatedFieldEncoding::Packed => "PACKED", + RepeatedFieldEncoding::Expanded => "EXPANDED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "REPEATED_FIELD_ENCODING_UNKNOWN" => Some(Self::Unknown), + "PACKED" => Some(Self::Packed), + "EXPANDED" => Some(Self::Expanded), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum StringFieldValidation { + Unknown = 0, + Mandatory = 1, + Hint = 2, + None = 3, + } + impl StringFieldValidation { + /// 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 { + StringFieldValidation::Unknown => "STRING_FIELD_VALIDATION_UNKNOWN", + StringFieldValidation::Mandatory => "MANDATORY", + StringFieldValidation::Hint => "HINT", + StringFieldValidation::None => "NONE", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "STRING_FIELD_VALIDATION_UNKNOWN" => Some(Self::Unknown), + "MANDATORY" => Some(Self::Mandatory), + "HINT" => Some(Self::Hint), + "NONE" => Some(Self::None), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum MessageEncoding { + Unknown = 0, + LengthPrefixed = 1, + Delimited = 2, + } + impl MessageEncoding { + /// 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 { + MessageEncoding::Unknown => "MESSAGE_ENCODING_UNKNOWN", + MessageEncoding::LengthPrefixed => "LENGTH_PREFIXED", + MessageEncoding::Delimited => "DELIMITED", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "MESSAGE_ENCODING_UNKNOWN" => Some(Self::Unknown), + "LENGTH_PREFIXED" => Some(Self::LengthPrefixed), + "DELIMITED" => Some(Self::Delimited), + _ => None, + } + } + } + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum JsonFormat { + Unknown = 0, + Allow = 1, + LegacyBestEffort = 2, + } + impl JsonFormat { + /// 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 { + JsonFormat::Unknown => "JSON_FORMAT_UNKNOWN", + JsonFormat::Allow => "ALLOW", + JsonFormat::LegacyBestEffort => "LEGACY_BEST_EFFORT", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "JSON_FORMAT_UNKNOWN" => Some(Self::Unknown), + "ALLOW" => Some(Self::Allow), + "LEGACY_BEST_EFFORT" => Some(Self::LegacyBestEffort), + _ => None, + } + } + } +} /// Encapsulates information about the original source file from which a /// FileDescriptorProto was generated. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1271,10 +1818,59 @@ pub mod generated_code_info { #[prost(int32, optional, tag = "3")] pub begin: ::core::option::Option, /// Identifies the ending offset in bytes in the generated code that - /// relates to the identified offset. The end offset should be one past + /// relates to the identified object. The end offset should be one past /// the last relevant byte (so the length of the text = end - begin). #[prost(int32, optional, tag = "4")] pub end: ::core::option::Option, + #[prost(enumeration = "annotation::Semantic", optional, tag = "5")] + pub semantic: ::core::option::Option, + } + /// Nested message and enum types in `Annotation`. + pub mod annotation { + /// Represents the identified object's effect on the element in the original + /// .proto file. + #[derive( + Clone, + Copy, + Debug, + PartialEq, + Eq, + Hash, + PartialOrd, + Ord, + ::prost::Enumeration + )] + #[repr(i32)] + pub enum Semantic { + /// There is no effect or the effect is indescribable. + None = 0, + /// The element is set or otherwise mutated. + Set = 1, + /// An alias to the element is returned. + Alias = 2, + } + impl Semantic { + /// 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 { + Semantic::None => "NONE", + Semantic::Set => "SET", + Semantic::Alias => "ALIAS", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "NONE" => Some(Self::None), + "SET" => Some(Self::Set), + "ALIAS" => Some(Self::Alias), + _ => None, + } + } + } } } /// A Timestamp represents a point in time independent of any time zone or local @@ -1327,7 +1923,6 @@ pub mod generated_code_info { /// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000) /// .setNanos((int) ((millis % 1000) * 1000000)).build(); /// -/// /// Example 5: Compute Timestamp from Java `Instant.now()`. /// /// Instant now = Instant.now(); @@ -1336,7 +1931,6 @@ pub mod generated_code_info { /// Timestamp.newBuilder().setSeconds(now.getEpochSecond()) /// .setNanos(now.getNano()).build(); /// -/// /// Example 6: Compute Timestamp from current time in Python. /// /// timestamp = Timestamp() @@ -1366,10 +1960,9 @@ pub mod generated_code_info { /// [`strftime`]() with /// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use /// the Joda Time's [`ISODateTimeFormat.dateTime()`]( -/// +/// ) /// ) to obtain a formatter capable of generating timestamps in this format. /// -/// #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1445,7 +2038,6 @@ pub struct Timestamp { /// be expressed in JSON format as "3.000000001s", and 3 seconds and 1 /// microsecond should be expressed in JSON format as "3.000001s". /// -/// #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Eq)] #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/src/prost/ibc.core.channel.v1.rs b/src/prost/ibc.core.channel.v1.rs index 9e13647a..b6053be0 100644 --- a/src/prost/ibc.core.channel.v1.rs +++ b/src/prost/ibc.core.channel.v1.rs @@ -58,6 +58,10 @@ pub struct IdentifiedChannel { /// channel identifier #[prost(string, tag = "7")] pub channel_id: ::prost::alloc::string::String, + /// upgrade sequence indicates the latest upgrade attempt performed by this channel + /// the value of 0 indicates the channel has never been upgraded + #[prost(uint64, tag = "8")] + pub upgrade_sequence: u64, } /// Counterparty defines a channel end counterparty #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] @@ -324,8 +328,9 @@ pub struct PacketSequence { } /// Upgrade is a verifiable type which contains the relevant information /// for an attempted upgrade. It provides the proposed changes to the channel -/// end, the timeout for this upgrade attempt and the latest packet sequence sent -/// to allow the counterparty to block sends after the upgrade has started. +/// end, the timeout for this upgrade attempt and the next packet sequence +/// which allows the counterparty to efficiently know the highest sequence it has received. +/// The next sequence send is used for pruning and upgrading from unordered to ordered channels. #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -335,7 +340,7 @@ pub struct Upgrade { #[prost(message, optional, tag = "2")] pub timeout: ::core::option::Option, #[prost(uint64, tag = "3")] - pub latest_sequence_send: u64, + pub next_sequence_send: u64, } /// UpgradeFields are the fields in a channel end which may be changed /// during a channel upgrade. @@ -505,6 +510,8 @@ pub struct MsgChannelCloseConfirm { pub proof_height: ::core::option::Option, #[prost(string, tag = "5")] pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "6")] + pub counterparty_upgrade_sequence: u64, } /// MsgChannelCloseConfirmResponse defines the Msg/ChannelCloseConfirm response /// type. @@ -575,6 +582,8 @@ pub struct MsgTimeoutOnClose { pub next_sequence_recv: u64, #[prost(string, tag = "6")] pub signer: ::prost::alloc::string::String, + #[prost(uint64, tag = "7")] + pub counterparty_upgrade_sequence: u64, } /// MsgTimeoutOnCloseResponse defines the Msg/TimeoutOnClose response type. #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] @@ -627,11 +636,9 @@ pub struct MsgChannelUpgradeInit { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeInitResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag = "1")] pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "3")] + #[prost(uint64, tag = "2")] pub upgrade_sequence: u64, } /// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc @@ -665,13 +672,11 @@ pub struct MsgChannelUpgradeTry { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelUpgradeTryResponse { - #[prost(string, tag = "1")] - pub channel_id: ::prost::alloc::string::String, - #[prost(message, optional, tag = "2")] + #[prost(message, optional, tag = "1")] pub upgrade: ::core::option::Option, - #[prost(uint64, tag = "3")] + #[prost(uint64, tag = "2")] pub upgrade_sequence: u64, - #[prost(enumeration = "ResponseResultType", tag = "4")] + #[prost(enumeration = "ResponseResultType", tag = "3")] pub result: i32, } /// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc @@ -777,10 +782,7 @@ pub struct MsgChannelUpgradeTimeout { #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] -pub struct MsgChannelUpgradeTimeoutResponse { - #[prost(enumeration = "ResponseResultType", tag = "1")] - pub result: i32, -} +pub struct MsgChannelUpgradeTimeoutResponse {} /// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[allow(clippy::derive_partial_eq_without_eq)] @@ -823,6 +825,32 @@ pub struct MsgUpdateParams { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateParamsResponse {} +/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgements { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub limit: u64, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgementsResponse { + /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + #[prost(uint64, tag = "1")] + pub total_pruned_sequences: u64, + /// Number of sequences left after pruning. + #[prost(uint64, tag = "2")] + pub total_remaining_sequences: u64, +} /// ResponseResultType defines the possible outcomes of the execution of a message #[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] @@ -1433,6 +1461,34 @@ pub mod msg_client { ); self.inner.unary(req, path, codec).await } + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + pub async fn prune_acknowledgements( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.channel.v1.Msg/PruneAcknowledgements", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "PruneAcknowledgements"), + ); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -1588,6 +1644,14 @@ pub mod msg_server { tonic::Response, tonic::Status, >; + /// PruneAcknowledgements defines a rpc handler method for MsgPruneAcknowledgements. + async fn prune_acknowledgements( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Msg defines the ibc/channel Msg service. #[derive(Debug)] @@ -2475,6 +2539,52 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Msg/PruneAcknowledgements" => { + #[allow(non_camel_case_types)] + struct PruneAcknowledgementsSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for PruneAcknowledgementsSvc { + type Response = super::MsgPruneAcknowledgementsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::prune_acknowledgements(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = PruneAcknowledgementsSvc(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( @@ -3013,6 +3123,20 @@ pub struct QueryUpgradeResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsRequest {} +/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +#[cfg_attr(feature = "serde", derive(::serde::Serialize, ::serde::Deserialize))] +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} /// Generated client implementations. #[cfg(feature = "client")] pub mod query_client { @@ -3547,6 +3671,32 @@ pub mod query_client { .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Upgrade")); self.inner.unary(req, path, codec).await } + /// ChannelParams queries all parameters of the ibc channel submodule. + pub async fn channel_params( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner + .ready() + .await + .map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.channel.v1.Query/ChannelParams", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "ChannelParams")); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -3693,6 +3843,14 @@ pub mod query_server { tonic::Response, tonic::Status, >; + /// ChannelParams queries all parameters of the ibc channel submodule. + async fn channel_params( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } /// Query provides defines the gRPC querier service #[derive(Debug)] @@ -4525,6 +4683,52 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Query/ChannelParams" => { + #[allow(non_camel_case_types)] + struct ChannelParamsSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService + for ChannelParamsSvc { + type Response = super::QueryChannelParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::channel_params(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChannelParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index bb1bdf04..67a1abe3 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ