From 5d90d20cfa8d4e21b211602e22f5180542e3eb17 Mon Sep 17 00:00:00 2001 From: Tony Arcieri Date: Wed, 14 Aug 2024 14:49:06 -0600 Subject: [PATCH] ibc-go: bump to v8.4.0 --- cosmos-sdk-proto/src/lib.rs | 29 +- cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT | 2 +- cosmos-sdk-proto/src/prost/ibc-go/amino.rs | 2 + .../src/prost/ibc-go/capability.v1.rs | 52 + .../src/prost/ibc-go/capability.v1.serde.rs | 536 + .../src/prost/ibc-go/cosmos.auth.v1beta1.rs | 14 + .../prost/ibc-go/cosmos.auth.v1beta1.serde.rs | 135 + .../src/prost/ibc-go/cosmos.base.v1beta1.rs | 14 - .../prost/ibc-go/cosmos.base.v1beta1.serde.rs | 190 - .../ibc-go/{ics23.rs => cosmos.ics23.v1.rs} | 2 +- ...cs23.serde.rs => cosmos.ics23.v1.serde.rs} | 98 +- .../src/prost/ibc-go/cosmos.msg.v1.rs | 2 + .../src/prost/ibc-go/cosmos.query.v1.rs | 2 + .../prost/ibc-go/cosmos.upgrade.v1beta1.rs | 6 +- .../src/prost/ibc-go/cosmos_proto.rs | 74 + .../src/prost/ibc-go/cosmos_proto.serde.rs | 334 + .../prost/ibc-go/ibc.applications.fee.v1.rs | 15 + .../ibc-go/ibc.applications.fee.v1.serde.rs | 54 +- ...tions.interchain_accounts.controller.v1.rs | 28 +- ...interchain_accounts.controller.v1.serde.rs | 250 +- ...interchain_accounts.controller.v1.tonic.rs | 70 + ...pplications.interchain_accounts.host.v1.rs | 53 + ...tions.interchain_accounts.host.v1.serde.rs | 587 ++ ...tions.interchain_accounts.host.v1.tonic.rs | 335 + .../ibc-go/ibc.applications.transfer.v1.rs | 41 + .../ibc.applications.transfer.v1.serde.rs | 456 +- .../ibc.applications.transfer.v1.tonic.rs | 136 + .../src/prost/ibc-go/ibc.core.channel.v1.rs | 397 +- .../prost/ibc-go/ibc.core.channel.v1.serde.rs | 8684 +++++++++++++---- .../prost/ibc-go/ibc.core.channel.v1.tonic.rs | 991 +- .../src/prost/ibc-go/ibc.core.client.v1.rs | 169 +- .../prost/ibc-go/ibc.core.client.v1.serde.rs | 1747 +++- .../prost/ibc-go/ibc.core.client.v1.tonic.rs | 254 + .../prost/ibc-go/ibc.core.commitment.v1.rs | 3 +- .../prost/ibc-go/ibc.core.connection.v1.rs | 23 + .../ibc-go/ibc.core.connection.v1.serde.rs | 256 + .../ibc-go/ibc.core.connection.v1.tonic.rs | 65 + .../ibc-go/ibc.lightclients.localhost.v1.rs | 15 - .../ibc-go/ibc.lightclients.localhost.v2.rs | 11 + ...=> ibc.lightclients.localhost.v2.serde.rs} | 46 +- .../ibc-go/ibc.lightclients.solomachine.v1.rs | 260 - .../ibc-go/ibc.lightclients.solomachine.v3.rs | 114 + .../ibc.lightclients.solomachine.v3.serde.rs | 1203 +++ .../ibc-go/ibc.lightclients.tendermint.v1.rs | 5 +- .../prost/ibc-go/ibc.lightclients.wasm.v1.rs | 152 + ...e.rs => ibc.lightclients.wasm.v1.serde.rs} | 1490 +-- .../ibc-go/ibc.lightclients.wasm.v1.tonic.rs | 729 ++ ibc-go | 2 +- proto-build/src/main.rs | 2 +- 49 files changed, 15991 insertions(+), 4144 deletions(-) create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/amino.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/capability.v1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/capability.v1.serde.rs rename cosmos-sdk-proto/src/prost/ibc-go/{ics23.rs => cosmos.ics23.v1.rs} (99%) rename cosmos-sdk-proto/src/prost/ibc-go/{ics23.serde.rs => cosmos.ics23.v1.serde.rs} (95%) create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos.msg.v1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos.query.v1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.serde.rs delete mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.rs rename cosmos-sdk-proto/src/prost/ibc-go/{ibc.lightclients.localhost.v1.serde.rs => ibc.lightclients.localhost.v2.serde.rs} (67%) delete mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.serde.rs create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.rs rename cosmos-sdk-proto/src/prost/ibc-go/{ibc.lightclients.solomachine.v1.serde.rs => ibc.lightclients.wasm.v1.serde.rs} (50%) create mode 100644 cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.tonic.rs diff --git a/cosmos-sdk-proto/src/lib.rs b/cosmos-sdk-proto/src/lib.rs index 2299ca23..41350f8d 100644 --- a/cosmos-sdk-proto/src/lib.rs +++ b/cosmos-sdk-proto/src/lib.rs @@ -160,6 +160,13 @@ pub mod cosmos { } } + /// ICS23 protobuf definitions. + pub mod ics23 { + pub mod v1 { + include!("prost/ibc-go/cosmos.ics23.v1.rs"); + } + } + /// Messages and services handling minting pub mod mint { pub mod v1beta1 { @@ -304,28 +311,28 @@ pub mod ibc { /// IBC light clients. pub mod lightclients { pub mod localhost { - pub mod v1 { - include!("prost/ibc-go/ibc.lightclients.localhost.v1.rs"); + pub mod v2 { + include!("prost/ibc-go/ibc.lightclients.localhost.v2.rs"); } } pub mod solomachine { - pub mod v1 { - include!("prost/ibc-go/ibc.lightclients.solomachine.v1.rs"); - } - pub mod v2 { include!("prost/ibc-go/ibc.lightclients.solomachine.v2.rs"); } + + pub mod v3 { + include!("prost/ibc-go/ibc.lightclients.solomachine.v3.rs"); + } } pub mod tendermint { pub mod v1 { include!("prost/ibc-go/ibc.lightclients.tendermint.v1.rs"); } } + pub mod wasm { + pub mod v1 { + include!("prost/ibc-go/ibc.lightclients.wasm.v1.rs"); + } + } } } - -/// ICS23 protobuf definitions. -pub mod ics23 { - include!("prost/ibc-go/ics23.rs"); -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT b/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT index 875fb7b9..0fd78d1e 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT +++ b/cosmos-sdk-proto/src/prost/ibc-go/IBC_COMMIT @@ -1 +1 @@ -v6.3.1 \ No newline at end of file +v8.4.0 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/ibc-go/amino.rs b/cosmos-sdk-proto/src/prost/ibc-go/amino.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/amino.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.rs new file mode 100644 index 00000000..8a37de10 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.rs @@ -0,0 +1,52 @@ +// @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!("capability.v1.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.serde.rs new file mode 100644 index 00000000..5c700ce9 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/capability.v1.serde.rs @@ -0,0 +1,536 @@ +// @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("capability.v1.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 capability.v1.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("capability.v1.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("capability.v1.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 capability.v1.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("capability.v1.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("capability.v1.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 capability.v1.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("capability.v1.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("capability.v1.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 capability.v1.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("capability.v1.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("capability.v1.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 capability.v1.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("capability.v1.Owner", FIELDS, GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs index 06136eb1..72beb305 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.rs @@ -25,6 +25,20 @@ pub struct ModuleAccount { #[prost(string, repeated, tag = "3")] pub permissions: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// ModuleCredential represents a unclaimable pubkey for base accounts controlled by modules. +/// +/// Since: cosmos-sdk 0.47 +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ModuleCredential { + /// module_name is the name of the module used for address derivation (passed into address.Module). + #[prost(string, tag = "1")] + pub module_name: ::prost::alloc::string::String, + /// derivation_keys is for deriving a module account address (passed into address.Module) + /// adding more keys creates sub-account addresses (passed into address.Derive) + #[prost(bytes = "vec", repeated, tag = "2")] + pub derivation_keys: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} /// Params defines the parameters for the auth module. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.serde.rs index ea25be70..8c72b207 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.auth.v1beta1.serde.rs @@ -293,6 +293,141 @@ impl<'de> serde::Deserialize<'de> for ModuleAccount { } } #[cfg(feature = "serde")] +impl serde::Serialize for ModuleCredential { + #[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_name.is_empty() { + len += 1; + } + if !self.derivation_keys.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos.auth.v1beta1.ModuleCredential", len)?; + if !self.module_name.is_empty() { + struct_ser.serialize_field("moduleName", &self.module_name)?; + } + if !self.derivation_keys.is_empty() { + struct_ser.serialize_field( + "derivationKeys", + &self + .derivation_keys + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ModuleCredential { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "module_name", + "moduleName", + "derivation_keys", + "derivationKeys", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ModuleName, + DerivationKeys, + } + #[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 { + "moduleName" | "module_name" => Ok(GeneratedField::ModuleName), + "derivationKeys" | "derivation_keys" => { + Ok(GeneratedField::DerivationKeys) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ModuleCredential; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos.auth.v1beta1.ModuleCredential") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut module_name__ = None; + let mut derivation_keys__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ModuleName => { + if module_name__.is_some() { + return Err(serde::de::Error::duplicate_field("moduleName")); + } + module_name__ = Some(map_.next_value()?); + } + GeneratedField::DerivationKeys => { + if derivation_keys__.is_some() { + return Err(serde::de::Error::duplicate_field("derivationKeys")); + } + derivation_keys__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(ModuleCredential { + module_name: module_name__.unwrap_or_default(), + derivation_keys: derivation_keys__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos.auth.v1beta1.ModuleCredential", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs index 8a02bbd7..b36ec8b7 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.rs @@ -23,19 +23,5 @@ pub struct DecCoin { #[prost(string, tag = "2")] pub amount: ::prost::alloc::string::String, } -/// IntProto defines a Protobuf wrapper around an Int object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct IntProto { - #[prost(string, tag = "1")] - pub int: ::prost::alloc::string::String, -} -/// DecProto defines a Protobuf wrapper around a Dec object. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct DecProto { - #[prost(string, tag = "1")] - pub dec: ::prost::alloc::string::String, -} include!("cosmos.base.v1beta1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.serde.rs index 92880130..40f3eea1 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.base.v1beta1.serde.rs @@ -221,193 +221,3 @@ impl<'de> serde::Deserialize<'de> for DecCoin { deserializer.deserialize_struct("cosmos.base.v1beta1.DecCoin", FIELDS, GeneratedVisitor) } } -#[cfg(feature = "serde")] -impl serde::Serialize for DecProto { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.dec.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.DecProto", len)?; - if !self.dec.is_empty() { - struct_ser.serialize_field("dec", &self.dec)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for DecProto { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["dec"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Dec, - } - #[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 { - "dec" => Ok(GeneratedField::Dec), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DecProto; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.DecProto") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut dec__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Dec => { - if dec__.is_some() { - return Err(serde::de::Error::duplicate_field("dec")); - } - dec__ = Some(map_.next_value()?); - } - } - } - Ok(DecProto { - dec: dec__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.DecProto", FIELDS, GeneratedVisitor) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for IntProto { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - use serde::ser::SerializeStruct; - let mut len = 0; - if !self.int.is_empty() { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("cosmos.base.v1beta1.IntProto", len)?; - if !self.int.is_empty() { - struct_ser.serialize_field("int", &self.int)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for IntProto { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &["int"]; - - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Int, - } - #[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 { - "int" => Ok(GeneratedField::Int), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) - } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = IntProto; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct cosmos.base.v1beta1.IntProto") - } - - fn visit_map(self, mut map_: V) -> std::result::Result - where - V: serde::de::MapAccess<'de>, - { - let mut int__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Int => { - if int__.is_some() { - return Err(serde::de::Error::duplicate_field("int")); - } - int__ = Some(map_.next_value()?); - } - } - } - Ok(IntProto { - int: int__.unwrap_or_default(), - }) - } - } - deserializer.deserialize_struct("cosmos.base.v1beta1.IntProto", FIELDS, GeneratedVisitor) - } -} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.rs similarity index 99% rename from cosmos-sdk-proto/src/prost/ibc-go/ics23.rs rename to cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.rs index 7a97b7ce..04f112c2 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ics23.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.rs @@ -365,5 +365,5 @@ impl LengthOp { } } } -include!("ics23.serde.rs"); +include!("cosmos.ics23.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ics23.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.serde.rs similarity index 95% rename from cosmos-sdk-proto/src/prost/ibc-go/ics23.serde.rs rename to cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.serde.rs index 1e331637..5f63c33b 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ics23.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.ics23.v1.serde.rs @@ -11,7 +11,7 @@ impl serde::Serialize for BatchEntry { if self.proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.BatchEntry", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchEntry", len)?; if let Some(v) = self.proof.as_ref() { match v { batch_entry::Proof::Exist(v) => { @@ -77,7 +77,7 @@ impl<'de> serde::Deserialize<'de> for BatchEntry { type Value = BatchEntry; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.BatchEntry") + formatter.write_str("struct cosmos.ics23.v1.BatchEntry") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -108,7 +108,7 @@ impl<'de> serde::Deserialize<'de> for BatchEntry { Ok(BatchEntry { proof: proof__ }) } } - deserializer.deserialize_struct("ics23.BatchEntry", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.BatchEntry", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -123,7 +123,7 @@ impl serde::Serialize for BatchProof { if !self.entries.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.BatchProof", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.BatchProof", len)?; if !self.entries.is_empty() { struct_ser.serialize_field("entries", &self.entries)?; } @@ -180,7 +180,7 @@ impl<'de> serde::Deserialize<'de> for BatchProof { type Value = BatchProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.BatchProof") + formatter.write_str("struct cosmos.ics23.v1.BatchProof") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -203,7 +203,7 @@ impl<'de> serde::Deserialize<'de> for BatchProof { }) } } - deserializer.deserialize_struct("ics23.BatchProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.BatchProof", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -218,7 +218,7 @@ impl serde::Serialize for CommitmentProof { if self.proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.CommitmentProof", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.CommitmentProof", len)?; if let Some(v) = self.proof.as_ref() { match v { commitment_proof::Proof::Exist(v) => { @@ -294,7 +294,7 @@ impl<'de> serde::Deserialize<'de> for CommitmentProof { type Value = CommitmentProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.CommitmentProof") + formatter.write_str("struct cosmos.ics23.v1.CommitmentProof") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -341,7 +341,7 @@ impl<'de> serde::Deserialize<'de> for CommitmentProof { Ok(CommitmentProof { proof: proof__ }) } } - deserializer.deserialize_struct("ics23.CommitmentProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.CommitmentProof", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -356,7 +356,8 @@ impl serde::Serialize for CompressedBatchEntry { if self.proof.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.CompressedBatchEntry", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchEntry", len)?; if let Some(v) = self.proof.as_ref() { match v { compressed_batch_entry::Proof::Exist(v) => { @@ -422,7 +423,7 @@ impl<'de> serde::Deserialize<'de> for CompressedBatchEntry { type Value = CompressedBatchEntry; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.CompressedBatchEntry") + formatter.write_str("struct cosmos.ics23.v1.CompressedBatchEntry") } fn visit_map( @@ -456,7 +457,11 @@ impl<'de> serde::Deserialize<'de> for CompressedBatchEntry { Ok(CompressedBatchEntry { proof: proof__ }) } } - deserializer.deserialize_struct("ics23.CompressedBatchEntry", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.ics23.v1.CompressedBatchEntry", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] @@ -474,7 +479,8 @@ impl serde::Serialize for CompressedBatchProof { if !self.lookup_inners.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.CompressedBatchProof", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.ics23.v1.CompressedBatchProof", len)?; if !self.entries.is_empty() { struct_ser.serialize_field("entries", &self.entries)?; } @@ -536,7 +542,7 @@ impl<'de> serde::Deserialize<'de> for CompressedBatchProof { type Value = CompressedBatchProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.CompressedBatchProof") + formatter.write_str("struct cosmos.ics23.v1.CompressedBatchProof") } fn visit_map( @@ -570,7 +576,11 @@ impl<'de> serde::Deserialize<'de> for CompressedBatchProof { }) } } - deserializer.deserialize_struct("ics23.CompressedBatchProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.ics23.v1.CompressedBatchProof", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] @@ -594,7 +604,8 @@ impl serde::Serialize for CompressedExistenceProof { if !self.path.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.CompressedExistenceProof", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.ics23.v1.CompressedExistenceProof", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -672,7 +683,7 @@ impl<'de> serde::Deserialize<'de> for CompressedExistenceProof { type Value = CompressedExistenceProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.CompressedExistenceProof") + formatter.write_str("struct cosmos.ics23.v1.CompressedExistenceProof") } fn visit_map( @@ -733,7 +744,11 @@ impl<'de> serde::Deserialize<'de> for CompressedExistenceProof { }) } } - deserializer.deserialize_struct("ics23.CompressedExistenceProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.ics23.v1.CompressedExistenceProof", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] @@ -755,7 +770,7 @@ impl serde::Serialize for CompressedNonExistenceProof { len += 1; } let mut struct_ser = - serializer.serialize_struct("ics23.CompressedNonExistenceProof", len)?; + serializer.serialize_struct("cosmos.ics23.v1.CompressedNonExistenceProof", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -824,7 +839,7 @@ impl<'de> serde::Deserialize<'de> for CompressedNonExistenceProof { type Value = CompressedNonExistenceProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.CompressedNonExistenceProof") + formatter.write_str("struct cosmos.ics23.v1.CompressedNonExistenceProof") } fn visit_map( @@ -870,7 +885,7 @@ impl<'de> serde::Deserialize<'de> for CompressedNonExistenceProof { } } deserializer.deserialize_struct( - "ics23.CompressedNonExistenceProof", + "cosmos.ics23.v1.CompressedNonExistenceProof", FIELDS, GeneratedVisitor, ) @@ -897,7 +912,7 @@ impl serde::Serialize for ExistenceProof { if !self.path.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.ExistenceProof", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ExistenceProof", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -975,7 +990,7 @@ impl<'de> serde::Deserialize<'de> for ExistenceProof { type Value = ExistenceProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.ExistenceProof") + formatter.write_str("struct cosmos.ics23.v1.ExistenceProof") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1028,7 +1043,7 @@ impl<'de> serde::Deserialize<'de> for ExistenceProof { }) } } - deserializer.deserialize_struct("ics23.ExistenceProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.ExistenceProof", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -1137,7 +1152,7 @@ impl serde::Serialize for InnerOp { if !self.suffix.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.InnerOp", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerOp", len)?; if self.hash != 0 { let v = HashOp::try_from(self.hash) .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.hash)))?; @@ -1214,7 +1229,7 @@ impl<'de> serde::Deserialize<'de> for InnerOp { type Value = InnerOp; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.InnerOp") + formatter.write_str("struct cosmos.ics23.v1.InnerOp") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1259,7 +1274,7 @@ impl<'de> serde::Deserialize<'de> for InnerOp { }) } } - deserializer.deserialize_struct("ics23.InnerOp", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.InnerOp", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -1289,7 +1304,7 @@ impl serde::Serialize for InnerSpec { if self.hash != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.InnerSpec", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.InnerSpec", len)?; if !self.child_order.is_empty() { struct_ser.serialize_field("childOrder", &self.child_order)?; } @@ -1393,7 +1408,7 @@ impl<'de> serde::Deserialize<'de> for InnerSpec { type Value = InnerSpec; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.InnerSpec") + formatter.write_str("struct cosmos.ics23.v1.InnerSpec") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1473,7 +1488,7 @@ impl<'de> serde::Deserialize<'de> for InnerSpec { }) } } - deserializer.deserialize_struct("ics23.InnerSpec", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.InnerSpec", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -1500,7 +1515,7 @@ impl serde::Serialize for LeafOp { if !self.prefix.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.LeafOp", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.LeafOp", len)?; if self.hash != 0 { let v = HashOp::try_from(self.hash) .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", self.hash)))?; @@ -1600,7 +1615,7 @@ impl<'de> serde::Deserialize<'de> for LeafOp { type Value = LeafOp; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.LeafOp") + formatter.write_str("struct cosmos.ics23.v1.LeafOp") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1658,7 +1673,7 @@ impl<'de> serde::Deserialize<'de> for LeafOp { }) } } - deserializer.deserialize_struct("ics23.LeafOp", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.LeafOp", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] @@ -1773,7 +1788,8 @@ impl serde::Serialize for NonExistenceProof { if self.right.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.NonExistenceProof", len)?; + let mut struct_ser = + serializer.serialize_struct("cosmos.ics23.v1.NonExistenceProof", len)?; if !self.key.is_empty() { #[allow(clippy::needless_borrow)] struct_ser @@ -1842,7 +1858,7 @@ impl<'de> serde::Deserialize<'de> for NonExistenceProof { type Value = NonExistenceProof; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.NonExistenceProof") + formatter.write_str("struct cosmos.ics23.v1.NonExistenceProof") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -1884,7 +1900,11 @@ impl<'de> serde::Deserialize<'de> for NonExistenceProof { }) } } - deserializer.deserialize_struct("ics23.NonExistenceProof", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "cosmos.ics23.v1.NonExistenceProof", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] @@ -1908,7 +1928,7 @@ impl serde::Serialize for ProofSpec { if self.min_depth != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct("ics23.ProofSpec", len)?; + let mut struct_ser = serializer.serialize_struct("cosmos.ics23.v1.ProofSpec", len)?; if let Some(v) = self.leaf_spec.as_ref() { struct_ser.serialize_field("leafSpec", v)?; } @@ -1989,7 +2009,7 @@ impl<'de> serde::Deserialize<'de> for ProofSpec { type Value = ProofSpec; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ics23.ProofSpec") + formatter.write_str("struct cosmos.ics23.v1.ProofSpec") } fn visit_map(self, mut map_: V) -> std::result::Result @@ -2042,6 +2062,6 @@ impl<'de> serde::Deserialize<'de> for ProofSpec { }) } } - deserializer.deserialize_struct("ics23.ProofSpec", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct("cosmos.ics23.v1.ProofSpec", FIELDS, GeneratedVisitor) } } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.msg.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.msg.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.msg.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.query.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.query.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.query.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs index 72c6d53b..65af999b 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos.upgrade.v1beta1.rs @@ -19,7 +19,6 @@ pub struct Plan { #[prost(message, optional, tag = "2")] pub time: ::core::option::Option<::tendermint_proto::google::protobuf::Timestamp>, /// The height at which the upgrade must be performed. - /// Only used if Time is not set. #[prost(int64, tag = "3")] pub height: i64, /// Any application specific upgrade info to be included on-chain @@ -40,10 +39,13 @@ pub struct Plan { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct SoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, + /// plan of the proposal #[prost(message, optional, tag = "3")] pub plan: ::core::option::Option, } @@ -54,8 +56,10 @@ pub struct SoftwareUpgradeProposal { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct CancelSoftwareUpgradeProposal { + /// title of the proposal #[prost(string, tag = "1")] pub title: ::prost::alloc::string::String, + /// description of the proposal #[prost(string, tag = "2")] pub description: ::prost::alloc::string::String, } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs index 8e2ac1be..2353a154 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.rs @@ -1,2 +1,76 @@ // @generated +/// InterfaceDescriptor describes an interface type to be used with +/// accepts_interface and implements_interface and declared by declare_interface. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct InterfaceDescriptor { + /// name is the name of the interface. It should be a short-name (without + /// a period) such that the fully qualified name of the interface will be + /// package.name, ex. for the package a.b and interface named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the interface and its + /// purpose. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, +} +/// ScalarDescriptor describes an scalar type to be used with +/// the scalar field option and declared by declare_scalar. +/// Scalars extend simple protobuf built-in types with additional +/// syntax and semantics, for instance to represent big integers. +/// Scalars should ideally define an encoding such that there is only one +/// valid syntactical representation for a given semantic meaning, +/// i.e. the encoding should be deterministic. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ScalarDescriptor { + /// name is the name of the scalar. It should be a short-name (without + /// a period) such that the fully qualified name of the scalar will be + /// package.name, ex. for the package a.b and scalar named C, the + /// fully-qualified name will be a.b.C. + #[prost(string, tag = "1")] + pub name: ::prost::alloc::string::String, + /// description is a human-readable description of the scalar and its + /// encoding format. For instance a big integer or decimal scalar should + /// specify precisely the expected encoding format. + #[prost(string, tag = "2")] + pub description: ::prost::alloc::string::String, + /// field_type is the type of field with which this scalar can be used. + /// Scalars can be used with one and only one type of field so that + /// encoding standards and simple and clear. Currently only string and + /// bytes fields are supported for scalars. + #[prost(enumeration = "ScalarType", repeated, tag = "3")] + pub field_type: ::prost::alloc::vec::Vec, +} +#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] +#[repr(i32)] +pub enum ScalarType { + Unspecified = 0, + String = 1, + Bytes = 2, +} +impl ScalarType { + /// String value of the enum field names used in the ProtoBuf definition. + /// + /// The values are not transformed in any way and thus are considered stable + /// (if the ProtoBuf definition does not change) and safe for programmatic use. + pub fn as_str_name(&self) -> &'static str { + match self { + ScalarType::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + ScalarType::String => "SCALAR_TYPE_STRING", + ScalarType::Bytes => "SCALAR_TYPE_BYTES", + } + } + /// Creates an enum from field names used in the ProtoBuf definition. + pub fn from_str_name(value: &str) -> ::core::option::Option { + match value { + "SCALAR_TYPE_UNSPECIFIED" => Some(Self::Unspecified), + "SCALAR_TYPE_STRING" => Some(Self::String), + "SCALAR_TYPE_BYTES" => Some(Self::Bytes), + _ => None, + } + } +} +include!("cosmos_proto.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.serde.rs new file mode 100644 index 00000000..0ebdf0ed --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/cosmos_proto.serde.rs @@ -0,0 +1,334 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for InterfaceDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmos_proto.InterfaceDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for InterfaceDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + } + #[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 { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = InterfaceDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.InterfaceDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + } + } + Ok(InterfaceDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmos_proto.InterfaceDescriptor", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarDescriptor { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.name.is_empty() { + len += 1; + } + if !self.description.is_empty() { + len += 1; + } + if !self.field_type.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("cosmos_proto.ScalarDescriptor", len)?; + if !self.name.is_empty() { + struct_ser.serialize_field("name", &self.name)?; + } + if !self.description.is_empty() { + struct_ser.serialize_field("description", &self.description)?; + } + if !self.field_type.is_empty() { + let v = self + .field_type + .iter() + .cloned() + .map(|v| { + ScalarType::try_from(v) + .map_err(|_| serde::ser::Error::custom(format!("Invalid variant {}", v))) + }) + .collect::, _>>()?; + struct_ser.serialize_field("fieldType", &v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarDescriptor { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["name", "description", "field_type", "fieldType"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Name, + Description, + FieldType, + } + #[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 { + "name" => Ok(GeneratedField::Name), + "description" => Ok(GeneratedField::Description), + "fieldType" | "field_type" => Ok(GeneratedField::FieldType), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarDescriptor; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmos_proto.ScalarDescriptor") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut name__ = None; + let mut description__ = None; + let mut field_type__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Name => { + if name__.is_some() { + return Err(serde::de::Error::duplicate_field("name")); + } + name__ = Some(map_.next_value()?); + } + GeneratedField::Description => { + if description__.is_some() { + return Err(serde::de::Error::duplicate_field("description")); + } + description__ = Some(map_.next_value()?); + } + GeneratedField::FieldType => { + if field_type__.is_some() { + return Err(serde::de::Error::duplicate_field("fieldType")); + } + field_type__ = Some( + map_.next_value::>()? + .into_iter() + .map(|x| x as i32) + .collect(), + ); + } + } + } + Ok(ScalarDescriptor { + name: name__.unwrap_or_default(), + description: description__.unwrap_or_default(), + field_type: field_type__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("cosmos_proto.ScalarDescriptor", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ScalarType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "SCALAR_TYPE_UNSPECIFIED", + Self::String => "SCALAR_TYPE_STRING", + Self::Bytes => "SCALAR_TYPE_BYTES", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ScalarType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "SCALAR_TYPE_UNSPECIFIED", + "SCALAR_TYPE_STRING", + "SCALAR_TYPE_BYTES", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ScalarType; + + 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 { + "SCALAR_TYPE_UNSPECIFIED" => Ok(ScalarType::Unspecified), + "SCALAR_TYPE_STRING" => Ok(ScalarType::String), + "SCALAR_TYPE_BYTES" => Ok(ScalarType::Bytes), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.rs index 2833d799..3ba7def1 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.rs @@ -164,6 +164,11 @@ pub struct QueryIncentivizedPacketsResponse { /// list of identified fees for incentivized packets #[prost(message, repeated, tag = "1")] pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, } /// QueryIncentivizedPacketRequest defines the request type for the IncentivizedPacket rpc #[allow(clippy::derive_partial_eq_without_eq)] @@ -209,6 +214,11 @@ pub struct QueryIncentivizedPacketsForChannelResponse { /// Map of all incentivized_packets #[prost(message, repeated, tag = "1")] pub incentivized_packets: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, } /// QueryTotalRecvFeesRequest defines the request type for the TotalRecvFees rpc #[allow(clippy::derive_partial_eq_without_eq)] @@ -318,6 +328,11 @@ pub struct QueryFeeEnabledChannelsResponse { /// list of fee enabled channels #[prost(message, repeated, tag = "1")] pub fee_enabled_channels: ::prost::alloc::vec::Vec, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, } /// QueryFeeEnabledChannelRequest defines the request type for the FeeEnabledChannel rpc #[allow(clippy::derive_partial_eq_without_eq)] diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.serde.rs index 59330340..334427f6 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.fee.v1.serde.rs @@ -2720,6 +2720,9 @@ impl serde::Serialize for QueryFeeEnabledChannelsResponse { if !self.fee_enabled_channels.is_empty() { len += 1; } + if self.pagination.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct( "ibc.applications.fee.v1.QueryFeeEnabledChannelsResponse", len, @@ -2727,6 +2730,9 @@ impl serde::Serialize for QueryFeeEnabledChannelsResponse { if !self.fee_enabled_channels.is_empty() { struct_ser.serialize_field("feeEnabledChannels", &self.fee_enabled_channels)?; } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } struct_ser.end() } } @@ -2737,11 +2743,12 @@ impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["fee_enabled_channels", "feeEnabledChannels"]; + const FIELDS: &[&str] = &["fee_enabled_channels", "feeEnabledChannels", "pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { FeeEnabledChannels, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2770,6 +2777,7 @@ impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { "feeEnabledChannels" | "fee_enabled_channels" => { Ok(GeneratedField::FeeEnabledChannels) } + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2794,6 +2802,7 @@ impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { V: serde::de::MapAccess<'de>, { let mut fee_enabled_channels__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::FeeEnabledChannels => { @@ -2804,10 +2813,17 @@ impl<'de> serde::Deserialize<'de> for QueryFeeEnabledChannelsResponse { } fee_enabled_channels__ = Some(map_.next_value()?); } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } } } Ok(QueryFeeEnabledChannelsResponse { fee_enabled_channels: fee_enabled_channels__.unwrap_or_default(), + pagination: pagination__, }) } } @@ -3238,6 +3254,9 @@ impl serde::Serialize for QueryIncentivizedPacketsForChannelResponse { if !self.incentivized_packets.is_empty() { len += 1; } + if self.pagination.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct( "ibc.applications.fee.v1.QueryIncentivizedPacketsForChannelResponse", len, @@ -3245,6 +3264,9 @@ impl serde::Serialize for QueryIncentivizedPacketsForChannelResponse { if !self.incentivized_packets.is_empty() { struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } struct_ser.end() } } @@ -3255,11 +3277,12 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets"]; + const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets", "pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { IncentivizedPackets, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3288,6 +3311,7 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse "incentivizedPackets" | "incentivized_packets" => { Ok(GeneratedField::IncentivizedPackets) } + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3313,6 +3337,7 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse V: serde::de::MapAccess<'de>, { let mut incentivized_packets__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::IncentivizedPackets => { @@ -3323,10 +3348,17 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsForChannelResponse } incentivized_packets__ = Some(map_.next_value()?); } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } } } Ok(QueryIncentivizedPacketsForChannelResponse { incentivized_packets: incentivized_packets__.unwrap_or_default(), + pagination: pagination__, }) } } @@ -3478,6 +3510,9 @@ impl serde::Serialize for QueryIncentivizedPacketsResponse { if !self.incentivized_packets.is_empty() { len += 1; } + if self.pagination.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct( "ibc.applications.fee.v1.QueryIncentivizedPacketsResponse", len, @@ -3485,6 +3520,9 @@ impl serde::Serialize for QueryIncentivizedPacketsResponse { if !self.incentivized_packets.is_empty() { struct_ser.serialize_field("incentivizedPackets", &self.incentivized_packets)?; } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } struct_ser.end() } } @@ -3495,11 +3533,12 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets"]; + const FIELDS: &[&str] = &["incentivized_packets", "incentivizedPackets", "pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { IncentivizedPackets, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3528,6 +3567,7 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { "incentivizedPackets" | "incentivized_packets" => { Ok(GeneratedField::IncentivizedPackets) } + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3552,6 +3592,7 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { V: serde::de::MapAccess<'de>, { let mut incentivized_packets__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::IncentivizedPackets => { @@ -3562,10 +3603,17 @@ impl<'de> serde::Deserialize<'de> for QueryIncentivizedPacketsResponse { } incentivized_packets__ = Some(map_.next_value()?); } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } } } Ok(QueryIncentivizedPacketsResponse { incentivized_packets: incentivized_packets__.unwrap_or_default(), + pagination: pagination__, }) } } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs index 6256c36c..93237d45 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.rs @@ -36,7 +36,7 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } -/// MsgRegisterInterchainAccount defines the payload for Msg/MsgRegisterInterchainAccount +/// MsgRegisterInterchainAccount defines the payload for Msg/RegisterAccount #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccount { @@ -46,13 +46,20 @@ pub struct MsgRegisterInterchainAccount { pub connection_id: ::prost::alloc::string::String, #[prost(string, tag = "3")] pub version: ::prost::alloc::string::String, + #[prost( + enumeration = "super::super::super::super::core::channel::v1::Order", + tag = "4" + )] + pub ordering: i32, } -/// MsgRegisterInterchainAccountResponse defines the response for Msg/MsgRegisterInterchainAccountResponse +/// MsgRegisterInterchainAccountResponse defines the response for Msg/RegisterAccount #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgRegisterInterchainAccountResponse { #[prost(string, tag = "1")] pub channel_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub port_id: ::prost::alloc::string::String, } /// MsgSendTx defines the payload for Msg/SendTx #[allow(clippy::derive_partial_eq_without_eq)] @@ -76,6 +83,23 @@ pub struct MsgSendTxResponse { #[prost(uint64, tag = "1")] pub sequence: u64, } +/// MsgUpdateParams defines the payload for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/controller parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("ibc.applications.interchain_accounts.controller.v1.serde.rs"); include!("ibc.applications.interchain_accounts.controller.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.serde.rs index 421ee36a..2ef18968 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.serde.rs @@ -17,6 +17,9 @@ impl serde::Serialize for MsgRegisterInterchainAccount { if !self.version.is_empty() { len += 1; } + if self.ordering != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct( "ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccount", len, @@ -30,6 +33,13 @@ impl serde::Serialize for MsgRegisterInterchainAccount { if !self.version.is_empty() { struct_ser.serialize_field("version", &self.version)?; } + if self.ordering != 0 { + let v = super::super::super::super::core::channel::v1::Order::try_from(self.ordering) + .map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.ordering)) + })?; + struct_ser.serialize_field("ordering", &v)?; + } struct_ser.end() } } @@ -40,13 +50,20 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["owner", "connection_id", "connectionId", "version"]; + const FIELDS: &[&str] = &[ + "owner", + "connection_id", + "connectionId", + "version", + "ordering", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Owner, ConnectionId, Version, + Ordering, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -75,6 +92,7 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { "owner" => Ok(GeneratedField::Owner), "connectionId" | "connection_id" => Ok(GeneratedField::ConnectionId), "version" => Ok(GeneratedField::Version), + "ordering" => Ok(GeneratedField::Ordering), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -100,6 +118,7 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { let mut owner__ = None; let mut connection_id__ = None; let mut version__ = None; + let mut ordering__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Owner => { @@ -120,12 +139,19 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccount { } version__ = Some(map_.next_value()?); } + GeneratedField::Ordering => { + if ordering__.is_some() { + return Err(serde::de::Error::duplicate_field("ordering")); + } + ordering__ = Some(map_.next_value::()? as i32); + } } } Ok(MsgRegisterInterchainAccount { owner: owner__.unwrap_or_default(), connection_id: connection_id__.unwrap_or_default(), version: version__.unwrap_or_default(), + ordering: ordering__.unwrap_or_default(), }) } } @@ -148,10 +174,16 @@ impl serde::Serialize for MsgRegisterInterchainAccountResponse { if !self.channel_id.is_empty() { len += 1; } + if !self.port_id.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.applications.interchain_accounts.controller.v1.MsgRegisterInterchainAccountResponse", len)?; if !self.channel_id.is_empty() { struct_ser.serialize_field("channelId", &self.channel_id)?; } + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } struct_ser.end() } } @@ -162,11 +194,12 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["channel_id", "channelId"]; + const FIELDS: &[&str] = &["channel_id", "channelId", "port_id", "portId"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { ChannelId, + PortId, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -193,6 +226,7 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { { match value { "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "portId" | "port_id" => Ok(GeneratedField::PortId), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -216,6 +250,7 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { V: serde::de::MapAccess<'de>, { let mut channel_id__ = None; + let mut port_id__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ChannelId => { @@ -224,10 +259,17 @@ impl<'de> serde::Deserialize<'de> for MsgRegisterInterchainAccountResponse { } channel_id__ = Some(map_.next_value()?); } + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } } } Ok(MsgRegisterInterchainAccountResponse { channel_id: channel_id__.unwrap_or_default(), + port_id: port_id__.unwrap_or_default(), }) } } @@ -512,6 +554,210 @@ impl<'de> serde::Deserialize<'de> for MsgSendTxResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + len, + )?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Params, + } + #[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 { + "signer" => Ok(GeneratedField::Signer), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + ) + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.controller.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[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( + "ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[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 = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse") + } + + 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(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.controller.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.tonic.rs index 6d03bc15..2e1d8764 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.controller.v1.tonic.rs @@ -472,6 +472,28 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &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( + "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.interchain_accounts.controller.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -493,6 +515,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -658,6 +684,50 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.applications.interchain_accounts.controller.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService + for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + (*inner).update_params(request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => { Box::pin(async move { Ok( diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs index 1abb5f46..5e5bb9e6 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.rs @@ -11,6 +11,20 @@ pub struct Params { #[prost(string, repeated, tag = "2")] pub allow_messages: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } +/// QueryRequest defines the parameters for a particular query request +/// by an interchain account. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryRequest { + /// path defines the path of the query request as defined by ADR-021. + /// + #[prost(string, tag = "1")] + pub path: ::prost::alloc::string::String, + /// data defines the payload of the query request as defined by ADR-021. + /// + #[prost(bytes = "vec", tag = "2")] + pub data: ::prost::alloc::vec::Vec, +} /// QueryParamsRequest is the request type for the Query/Params RPC method. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -23,6 +37,45 @@ pub struct QueryParamsResponse { #[prost(message, optional, tag = "1")] pub params: ::core::option::Option, } +/// MsgUpdateParams defines the payload for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the 27-interchain-accounts/host parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response for Msg/UpdateParams +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +/// MsgModuleQuerySafe defines the payload for Msg/ModuleQuerySafe +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgModuleQuerySafe { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// requests defines the module safe queries to execute. + #[prost(message, repeated, tag = "2")] + pub requests: ::prost::alloc::vec::Vec, +} +/// MsgModuleQuerySafeResponse defines the response for Msg/ModuleQuerySafe +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgModuleQuerySafeResponse { + /// height at which the responses were queried + #[prost(uint64, tag = "1")] + pub height: u64, + /// protobuf encoded responses for each query + #[prost(bytes = "vec", repeated, tag = "2")] + pub responses: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} include!("ibc.applications.interchain_accounts.host.v1.serde.rs"); include!("ibc.applications.interchain_accounts.host.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.serde.rs index 99282c4c..17050d30 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.serde.rs @@ -1,5 +1,468 @@ // @generated #[cfg(feature = "serde")] +impl serde::Serialize for MsgModuleQuerySafe { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + if !self.requests.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + len, + )?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if !self.requests.is_empty() { + struct_ser.serialize_field("requests", &self.requests)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgModuleQuerySafe { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer", "requests"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Requests, + } + #[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 { + "signer" => Ok(GeneratedField::Signer), + "requests" => Ok(GeneratedField::Requests), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgModuleQuerySafe; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + ) + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut requests__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Requests => { + if requests__.is_some() { + return Err(serde::de::Error::duplicate_field("requests")); + } + requests__ = Some(map_.next_value()?); + } + } + } + Ok(MsgModuleQuerySafe { + signer: signer__.unwrap_or_default(), + requests: requests__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafe", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgModuleQuerySafeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height != 0 { + len += 1; + } + if !self.responses.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse", + len, + )?; + if self.height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("height", ToString::to_string(&self.height).as_str())?; + } + if !self.responses.is_empty() { + struct_ser.serialize_field( + "responses", + &self + .responses + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgModuleQuerySafeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height", "responses"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Responses, + } + #[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 { + "height" => Ok(GeneratedField::Height), + "responses" => Ok(GeneratedField::Responses), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgModuleQuerySafeResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut responses__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Responses => { + if responses__.is_some() { + return Err(serde::de::Error::duplicate_field("responses")); + } + responses__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(MsgModuleQuerySafeResponse { + height: height__.unwrap_or_default(), + responses: responses__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgModuleQuerySafeResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + len, + )?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Params, + } + #[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 { + "signer" => Ok(GeneratedField::Signer), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + ) + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[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( + "ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + len, + )?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[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 = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + ) + } + + 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(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.host.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -305,3 +768,127 @@ impl<'de> serde::Deserialize<'de> for QueryParamsResponse { ) } } +#[cfg(feature = "serde")] +impl serde::Serialize for QueryRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.path.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.interchain_accounts.host.v1.QueryRequest", + len, + )?; + if !self.path.is_empty() { + struct_ser.serialize_field("path", &self.path)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["path", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Path, + Data, + } + #[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 { + "path" => Ok(GeneratedField::Path), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct ibc.applications.interchain_accounts.host.v1.QueryRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut path__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = Some(map_.next_value()?); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryRequest { + path: path__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.interchain_accounts.host.v1.QueryRequest", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.tonic.rs index 2e57e67f..3ae6b412 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.interchain_accounts.host.v1.tonic.rs @@ -281,3 +281,338 @@ pub mod query_server { const NAME: &'static str = "ibc.applications.interchain_accounts.host.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 update_params( + &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( + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.interchain_accounts.host.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } + pub async fn module_query_safe( + &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( + "/ibc.applications.interchain_accounts.host.v1.Msg/ModuleQuerySafe", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.interchain_accounts.host.v1.Msg", + "ModuleQuerySafe", + )); + 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 update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn module_query_safe( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.applications.interchain_accounts.host.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.applications.interchain_accounts.host.v1.Msg/ModuleQuerySafe" => { + #[allow(non_camel_case_types)] + struct ModuleQuerySafeSvc(pub Arc); + impl tonic::server::UnaryService for ModuleQuerySafeSvc { + type Response = super::MsgModuleQuerySafeResponse; + 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).module_query_safe(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 = ModuleQuerySafeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.applications.interchain_accounts.host.v1.Msg"; + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs index 27b8c899..d5c3a2f0 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.rs @@ -16,6 +16,10 @@ pub struct Allocation { /// allow list of receivers, an empty allow list permits any receiver address #[prost(string, repeated, tag = "4")] pub allow_list: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// allow list of memo strings, an empty list prohibits all memo strings; + /// a list only with "*" permits any memo string + #[prost(string, repeated, tag = "5")] + pub allowed_packet_data: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, } /// TransferAuthorization allows the grantee to spend up to spend_limit coins from /// the granter's account for ibc transfer on a specific channel @@ -65,6 +69,11 @@ pub struct GenesisState { pub denom_traces: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "3")] pub params: ::core::option::Option, + /// total_escrowed contains the total amount of tokens escrowed + /// by the transfer module + #[prost(message, repeated, tag = "4")] + pub total_escrowed: + ::prost::alloc::vec::Vec, } /// QueryDenomTraceRequest is the request type for the Query/DenomTrace RPC /// method @@ -158,6 +167,20 @@ pub struct QueryEscrowAddressResponse { #[prost(string, tag = "1")] pub escrow_address: ::prost::alloc::string::String, } +/// QueryTotalEscrowForDenomRequest is the request type for TotalEscrowForDenom RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomRequest { + #[prost(string, tag = "1")] + pub denom: ::prost::alloc::string::String, +} +/// QueryTotalEscrowForDenomResponse is the response type for TotalEscrowForDenom RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryTotalEscrowForDenomResponse { + #[prost(message, optional, tag = "1")] + pub amount: ::core::option::Option, +} /// MsgTransfer defines a msg to transfer fungible tokens (i.e Coins) between /// ICS20 enabled chains. See ICS Spec here: /// @@ -199,6 +222,24 @@ pub struct MsgTransferResponse { #[prost(uint64, tag = "1")] pub sequence: u64, } +/// MsgUpdateParams is the Msg/UpdateParams request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the transfer parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the response structure for executing a +/// MsgUpdateParams message. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("ibc.applications.transfer.v1.serde.rs"); include!("ibc.applications.transfer.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.serde.rs index 72c791d5..b22c3835 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.serde.rs @@ -20,6 +20,9 @@ impl serde::Serialize for Allocation { if !self.allow_list.is_empty() { len += 1; } + if !self.allowed_packet_data.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.applications.transfer.v1.Allocation", len)?; if !self.source_port.is_empty() { @@ -34,6 +37,9 @@ impl serde::Serialize for Allocation { if !self.allow_list.is_empty() { struct_ser.serialize_field("allowList", &self.allow_list)?; } + if !self.allowed_packet_data.is_empty() { + struct_ser.serialize_field("allowedPacketData", &self.allowed_packet_data)?; + } struct_ser.end() } } @@ -53,6 +59,8 @@ impl<'de> serde::Deserialize<'de> for Allocation { "spendLimit", "allow_list", "allowList", + "allowed_packet_data", + "allowedPacketData", ]; #[allow(clippy::enum_variant_names)] @@ -61,6 +69,7 @@ impl<'de> serde::Deserialize<'de> for Allocation { SourceChannel, SpendLimit, AllowList, + AllowedPacketData, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -90,6 +99,9 @@ impl<'de> serde::Deserialize<'de> for Allocation { "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), "spendLimit" | "spend_limit" => Ok(GeneratedField::SpendLimit), "allowList" | "allow_list" => Ok(GeneratedField::AllowList), + "allowedPacketData" | "allowed_packet_data" => { + Ok(GeneratedField::AllowedPacketData) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -113,6 +125,7 @@ impl<'de> serde::Deserialize<'de> for Allocation { let mut source_channel__ = None; let mut spend_limit__ = None; let mut allow_list__ = None; + let mut allowed_packet_data__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::SourcePort => { @@ -139,6 +152,12 @@ impl<'de> serde::Deserialize<'de> for Allocation { } allow_list__ = Some(map_.next_value()?); } + GeneratedField::AllowedPacketData => { + if allowed_packet_data__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedPacketData")); + } + allowed_packet_data__ = Some(map_.next_value()?); + } } } Ok(Allocation { @@ -146,6 +165,7 @@ impl<'de> serde::Deserialize<'de> for Allocation { source_channel: source_channel__.unwrap_or_default(), spend_limit: spend_limit__.unwrap_or_default(), allow_list: allow_list__.unwrap_or_default(), + allowed_packet_data: allowed_packet_data__.unwrap_or_default(), }) } } @@ -290,6 +310,9 @@ impl serde::Serialize for GenesisState { if self.params.is_some() { len += 1; } + if !self.total_escrowed.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.applications.transfer.v1.GenesisState", len)?; if !self.port_id.is_empty() { @@ -301,6 +324,9 @@ impl serde::Serialize for GenesisState { if let Some(v) = self.params.as_ref() { struct_ser.serialize_field("params", v)?; } + if !self.total_escrowed.is_empty() { + struct_ser.serialize_field("totalEscrowed", &self.total_escrowed)?; + } struct_ser.end() } } @@ -311,13 +337,22 @@ impl<'de> serde::Deserialize<'de> for GenesisState { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "denom_traces", "denomTraces", "params"]; + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "denom_traces", + "denomTraces", + "params", + "total_escrowed", + "totalEscrowed", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PortId, DenomTraces, Params, + TotalEscrowed, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -346,6 +381,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "portId" | "port_id" => Ok(GeneratedField::PortId), "denomTraces" | "denom_traces" => Ok(GeneratedField::DenomTraces), "params" => Ok(GeneratedField::Params), + "totalEscrowed" | "total_escrowed" => Ok(GeneratedField::TotalEscrowed), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -368,6 +404,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { let mut port_id__ = None; let mut denom_traces__ = None; let mut params__ = None; + let mut total_escrowed__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PortId => { @@ -388,12 +425,19 @@ impl<'de> serde::Deserialize<'de> for GenesisState { } params__ = map_.next_value()?; } + GeneratedField::TotalEscrowed => { + if total_escrowed__.is_some() { + return Err(serde::de::Error::duplicate_field("totalEscrowed")); + } + total_escrowed__ = Some(map_.next_value()?); + } } } Ok(GenesisState { port_id: port_id__.unwrap_or_default(), denom_traces: denom_traces__.unwrap_or_default(), params: params__, + total_escrowed: total_escrowed__.unwrap_or_default(), }) } } @@ -743,6 +787,204 @@ impl<'de> serde::Deserialize<'de> for MsgTransferResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.applications.transfer.v1.MsgUpdateParams", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Params, + } + #[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 { + "signer" => Ok(GeneratedField::Signer), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.transfer.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[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("ibc.applications.transfer.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[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 = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.applications.transfer.v1.MsgUpdateParamsResponse") + } + + 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(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.applications.transfer.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -1904,6 +2146,218 @@ impl<'de> serde::Deserialize<'de> for QueryParamsResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for QueryTotalEscrowForDenomRequest { + #[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( + "ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + 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 QueryTotalEscrowForDenomRequest { + #[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 = QueryTotalEscrowForDenomRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + ) + } + + 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(QueryTotalEscrowForDenomRequest { + denom: denom__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.applications.transfer.v1.QueryTotalEscrowForDenomRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryTotalEscrowForDenomResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.amount.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + len, + )?; + if let Some(v) = self.amount.as_ref() { + struct_ser.serialize_field("amount", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryTotalEscrowForDenomResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["amount"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + 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 { + "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 = QueryTotalEscrowForDenomResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str( + "struct ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + ) + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut amount__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Amount => { + if amount__.is_some() { + return Err(serde::de::Error::duplicate_field("amount")); + } + amount__ = map_.next_value()?; + } + } + } + Ok(QueryTotalEscrowForDenomResponse { amount: amount__ }) + } + } + deserializer.deserialize_struct( + "ibc.applications.transfer.v1.QueryTotalEscrowForDenomResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for TransferAuthorization { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.tonic.rs index aac8b0b1..399f56d2 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.applications.transfer.v1.tonic.rs @@ -194,6 +194,30 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn total_escrow_for_denom( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Query", + "TotalEscrowForDenom", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -224,6 +248,13 @@ pub mod query_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn total_escrow_for_denom( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; } #[derive(Debug)] pub struct QueryServer { @@ -493,6 +524,47 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.applications.transfer.v1.Query/TotalEscrowForDenom" => { + #[allow(non_camel_case_types)] + struct TotalEscrowForDenomSvc(pub Arc); + impl + tonic::server::UnaryService + for TotalEscrowForDenomSvc + { + type Response = super::QueryTotalEscrowForDenomResponse; + 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).total_escrow_for_denom(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 = TotalEscrowForDenomSvc(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) @@ -634,6 +706,28 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_params( + &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( + "/ibc.applications.transfer.v1.Msg/UpdateParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.applications.transfer.v1.Msg", + "UpdateParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -648,6 +742,10 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn update_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -763,6 +861,44 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.applications.transfer.v1.Msg/UpdateParams" => { + #[allow(non_camel_case_types)] + struct UpdateParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } _ => Box::pin(async move { Ok(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs index ebf40c5e..1e6f325e 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.rs @@ -21,6 +21,10 @@ pub struct Channel { /// opaque channel version, which is agreed upon during the handshake #[prost(string, tag = "5")] pub version: ::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 = "6")] + pub upgrade_sequence: u64, } /// IdentifiedChannel defines a channel with additional port and channel /// identifier fields. @@ -49,6 +53,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 #[allow(clippy::derive_partial_eq_without_eq)] @@ -154,8 +162,29 @@ pub mod acknowledgement { Error(::prost::alloc::string::String), } } +/// Timeout defines an execution deadline structure for 04-channel handlers. +/// This includes packet lifecycle handlers as well as the upgrade handshake handlers. +/// A valid Timeout contains either one or both of a timestamp and block height (sequence). +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Timeout { + /// block height after which the packet or upgrade times out + #[prost(message, optional, tag = "1")] + pub height: ::core::option::Option, + /// block timestamp (in nanoseconds) after which the packet or upgrade times out + #[prost(uint64, tag = "2")] + pub timestamp: u64, +} +/// Params defines the set of IBC channel parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// the relative timeout after which channel upgrades will time out. + #[prost(message, optional, tag = "1")] + pub upgrade_timeout: ::core::option::Option, +} /// State defines if a channel is in one of the following states: -/// CLOSED, INIT, TRYOPEN, OPEN or UNINITIALIZED. +/// CLOSED, INIT, TRYOPEN, OPEN, FLUSHING, FLUSHCOMPLETE or UNINITIALIZED. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] pub enum State { @@ -171,6 +200,10 @@ pub enum State { /// A channel has been closed and can no longer be used to send or receive /// packets. Closed = 4, + /// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. + Flushing = 5, + /// A channel has just completed flushing any in-flight packets. + Flushcomplete = 6, } impl State { /// String value of the enum field names used in the ProtoBuf definition. @@ -184,6 +217,8 @@ impl State { State::Tryopen => "STATE_TRYOPEN", State::Open => "STATE_OPEN", State::Closed => "STATE_CLOSED", + State::Flushing => "STATE_FLUSHING", + State::Flushcomplete => "STATE_FLUSHCOMPLETE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -194,6 +229,8 @@ impl State { "STATE_TRYOPEN" => Some(Self::Tryopen), "STATE_OPEN" => Some(Self::Open), "STATE_CLOSED" => Some(Self::Closed), + "STATE_FLUSHING" => Some(Self::Flushing), + "STATE_FLUSHCOMPLETE" => Some(Self::Flushcomplete), _ => None, } } @@ -253,6 +290,8 @@ pub struct GenesisState { /// the sequence for the next generated channel identifier #[prost(uint64, tag = "8")] pub next_channel_sequence: u64, + #[prost(message, optional, tag = "9")] + pub params: ::core::option::Option, } /// PacketSequence defines the genesis type necessary to retrieve and store /// next send and receive sequences. @@ -266,6 +305,46 @@ pub struct PacketSequence { #[prost(uint64, tag = "3")] pub sequence: u64, } +/// 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 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. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Upgrade { + #[prost(message, optional, tag = "1")] + pub fields: ::core::option::Option, + #[prost(message, optional, tag = "2")] + pub timeout: ::core::option::Option, + #[prost(uint64, tag = "3")] + pub next_sequence_send: u64, +} +/// UpgradeFields are the fields in a channel end which may be changed +/// during a channel upgrade. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct UpgradeFields { + #[prost(enumeration = "Order", tag = "1")] + pub ordering: i32, + #[prost(string, repeated, tag = "2")] + pub connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(string, tag = "3")] + pub version: ::prost::alloc::string::String, +} +/// ErrorReceipt defines a type which encapsulates the upgrade sequence and error associated with the +/// upgrade handshake failure. When a channel upgrade handshake is aborted both chains are expected to increment to the +/// next sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ErrorReceipt { + /// the channel upgrade sequence + #[prost(uint64, tag = "1")] + pub sequence: u64, + /// the error message detailing the cause of failure + #[prost(string, tag = "2")] + pub message: ::prost::alloc::string::String, +} /// QueryChannelRequest is the request type for the Query/Channel RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -642,7 +721,7 @@ pub struct QueryNextSequenceReceiveRequest { #[prost(string, tag = "2")] pub channel_id: ::prost::alloc::string::String, } -/// QuerySequenceResponse is the request type for the +/// QuerySequenceResponse is the response type for the /// Query/QueryNextSequenceReceiveResponse RPC method #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -657,6 +736,89 @@ pub struct QueryNextSequenceReceiveResponse { #[prost(message, optional, tag = "3")] pub proof_height: ::core::option::Option, } +/// QueryNextSequenceSendRequest is the request type for the +/// Query/QueryNextSequenceSend RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNextSequenceSendRequest { + /// port unique identifier + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + /// channel unique identifier + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryNextSequenceSendResponse is the request type for the +/// Query/QueryNextSequenceSend RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNextSequenceSendResponse { + /// next sequence send number + #[prost(uint64, tag = "1")] + pub next_sequence_send: u64, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryUpgradeErrorRequest is the request type for the Query/QueryUpgradeError RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradeErrorRequest { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryUpgradeErrorResponse is the response type for the Query/QueryUpgradeError RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradeErrorResponse { + #[prost(message, optional, tag = "1")] + pub error_receipt: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryUpgradeRequest is the request type for the QueryUpgradeRequest RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradeRequest { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, +} +/// QueryUpgradeResponse is the response type for the QueryUpgradeResponse RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryUpgradeResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + /// merkle proof of existence + #[prost(bytes = "vec", tag = "2")] + pub proof: ::prost::alloc::vec::Vec, + /// height at which the proof was retrieved + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, +} +/// QueryChannelParamsRequest is the request type for the Query/ChannelParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsRequest {} +/// QueryChannelParamsResponse is the response type for the Query/ChannelParams RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChannelParamsResponse { + /// params defines the parameters of the module. + #[prost(message, optional, tag = "1")] + pub params: ::core::option::Option, +} /// MsgChannelOpenInit defines an sdk.Msg to initialize a channel handshake. It /// is called by a relayer on Chain A. #[allow(clippy::derive_partial_eq_without_eq)] @@ -708,9 +870,14 @@ pub struct MsgChannelOpenTry { pub struct MsgChannelOpenTryResponse { #[prost(string, tag = "1")] pub version: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, } /// MsgChannelOpenAck defines a msg sent by a Relayer to Chain A to acknowledge /// the change of channel state to TRYOPEN on Chain B. +/// WARNING: a channel upgrade MUST NOT initialize an upgrade for this channel +/// in the same block as executing this message otherwise the counterparty will +/// be incapable of opening. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgChannelOpenAck { @@ -785,6 +952,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. @@ -849,6 +1018,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. #[allow(clippy::derive_partial_eq_without_eq)] @@ -879,6 +1050,224 @@ pub struct MsgAcknowledgementResponse { #[prost(enumeration = "ResponseResultType", tag = "1")] pub result: i32, } +/// MsgChannelUpgradeInit defines the request type for the ChannelUpgradeInit rpc +/// WARNING: Initializing a channel upgrade in the same block as opening the channel +/// may result in the counterparty being incapable of opening. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeInit { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub fields: ::core::option::Option, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeInitResponse defines the MsgChannelUpgradeInit response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeInitResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub upgrade_sequence: u64, +} +/// MsgChannelUpgradeTry defines the request type for the ChannelUpgradeTry rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeTry { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(string, repeated, tag = "3")] + pub proposed_upgrade_connection_hops: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade_fields: ::core::option::Option, + #[prost(uint64, tag = "5")] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "6")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "7")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "8")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "9")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeTryResponse defines the MsgChannelUpgradeTry response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeTryResponse { + #[prost(message, optional, tag = "1")] + pub upgrade: ::core::option::Option, + #[prost(uint64, tag = "2")] + pub upgrade_sequence: u64, + #[prost(enumeration = "ResponseResultType", tag = "3")] + pub result: i32, +} +/// MsgChannelUpgradeAck defines the request type for the ChannelUpgradeAck rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeAck { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "5")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeAckResponse defines MsgChannelUpgradeAck response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeAckResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, +} +/// MsgChannelUpgradeConfirm defines the request type for the ChannelUpgradeConfirm rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeConfirm { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(enumeration = "State", tag = "3")] + pub counterparty_channel_state: i32, + #[prost(message, optional, tag = "4")] + pub counterparty_upgrade: ::core::option::Option, + #[prost(bytes = "vec", tag = "5")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "6")] + pub proof_upgrade: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "7")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "8")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeConfirmResponse defines MsgChannelUpgradeConfirm response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeConfirmResponse { + #[prost(enumeration = "ResponseResultType", tag = "1")] + pub result: i32, +} +/// MsgChannelUpgradeOpen defines the request type for the ChannelUpgradeOpen rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeOpen { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(enumeration = "State", tag = "3")] + pub counterparty_channel_state: i32, + #[prost(uint64, tag = "4")] + pub counterparty_upgrade_sequence: u64, + #[prost(bytes = "vec", tag = "5")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "6")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "7")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeOpenResponse defines the MsgChannelUpgradeOpen response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeOpenResponse {} +/// MsgChannelUpgradeTimeout defines the request type for the ChannelUpgradeTimeout rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeTimeout { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub counterparty_channel: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_channel: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeTimeoutRepsonse defines the MsgChannelUpgradeTimeout response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeTimeoutResponse {} +/// MsgChannelUpgradeCancel defines the request type for the ChannelUpgradeCancel rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeCancel { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(message, optional, tag = "3")] + pub error_receipt: ::core::option::Option, + #[prost(bytes = "vec", tag = "4")] + pub proof_error_receipt: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "5")] + pub proof_height: ::core::option::Option, + #[prost(string, tag = "6")] + pub signer: ::prost::alloc::string::String, +} +/// MsgChannelUpgradeCancelResponse defines the MsgChannelUpgradeCancel response type +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelUpgradeCancelResponse {} +/// MsgUpdateParams is the MsgUpdateParams request type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// authority is the address that controls the module (defaults to x/gov unless overwritten). + #[prost(string, tag = "1")] + pub authority: ::prost::alloc::string::String, + /// params defines the channel parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} +/// MsgPruneAcknowledgements defines the request type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgements { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub limit: u64, + #[prost(string, tag = "4")] + pub signer: ::prost::alloc::string::String, +} +/// MsgPruneAcknowledgementsResponse defines the response type for the PruneAcknowledgements rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgPruneAcknowledgementsResponse { + /// Number of sequences pruned (includes both packet acknowledgements and packet receipts where appropriate). + #[prost(uint64, tag = "1")] + pub total_pruned_sequences: u64, + /// Number of sequences left after pruning. + #[prost(uint64, tag = "2")] + pub total_remaining_sequences: u64, +} /// ResponseResultType defines the possible outcomes of the execution of a message #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -889,6 +1278,8 @@ pub enum ResponseResultType { Noop = 1, /// The message was executed successfully Success = 2, + /// The message was executed unsuccessfully + Failure = 3, } impl ResponseResultType { /// String value of the enum field names used in the ProtoBuf definition. @@ -900,6 +1291,7 @@ impl ResponseResultType { ResponseResultType::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", ResponseResultType::Noop => "RESPONSE_RESULT_TYPE_NOOP", ResponseResultType::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + ResponseResultType::Failure => "RESPONSE_RESULT_TYPE_FAILURE", } } /// Creates an enum from field names used in the ProtoBuf definition. @@ -908,6 +1300,7 @@ impl ResponseResultType { "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Some(Self::Unspecified), "RESPONSE_RESULT_TYPE_NOOP" => Some(Self::Noop), "RESPONSE_RESULT_TYPE_SUCCESS" => Some(Self::Success), + "RESPONSE_RESULT_TYPE_FAILURE" => Some(Self::Failure), _ => None, } } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.serde.rs index b43bc7e4..1c25518c 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.serde.rs @@ -142,6 +142,9 @@ impl serde::Serialize for Channel { if !self.version.is_empty() { len += 1; } + if self.upgrade_sequence != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Channel", len)?; if self.state != 0 { let v = State::try_from(self.state).map_err(|_| { @@ -164,6 +167,13 @@ impl serde::Serialize for Channel { if !self.version.is_empty() { struct_ser.serialize_field("version", &self.version)?; } + if self.upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "upgradeSequence", + ToString::to_string(&self.upgrade_sequence).as_str(), + )?; + } struct_ser.end() } } @@ -181,6 +191,8 @@ impl<'de> serde::Deserialize<'de> for Channel { "connection_hops", "connectionHops", "version", + "upgrade_sequence", + "upgradeSequence", ]; #[allow(clippy::enum_variant_names)] @@ -190,6 +202,7 @@ impl<'de> serde::Deserialize<'de> for Channel { Counterparty, ConnectionHops, Version, + UpgradeSequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -222,6 +235,9 @@ impl<'de> serde::Deserialize<'de> for Channel { Ok(GeneratedField::ConnectionHops) } "version" => Ok(GeneratedField::Version), + "upgradeSequence" | "upgrade_sequence" => { + Ok(GeneratedField::UpgradeSequence) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -246,6 +262,7 @@ impl<'de> serde::Deserialize<'de> for Channel { let mut counterparty__ = None; let mut connection_hops__ = None; let mut version__ = None; + let mut upgrade_sequence__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::State => { @@ -278,6 +295,15 @@ impl<'de> serde::Deserialize<'de> for Channel { } version__ = Some(map_.next_value()?); } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } } } Ok(Channel { @@ -286,6 +312,7 @@ impl<'de> serde::Deserialize<'de> for Channel { counterparty: counterparty__, connection_hops: connection_hops__.unwrap_or_default(), version: version__.unwrap_or_default(), + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), }) } } @@ -409,6 +436,126 @@ impl<'de> serde::Deserialize<'de> for Counterparty { } } #[cfg(feature = "serde")] +impl serde::Serialize for ErrorReceipt { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.sequence != 0 { + len += 1; + } + if !self.message.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.ErrorReceipt", len)?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if !self.message.is_empty() { + struct_ser.serialize_field("message", &self.message)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ErrorReceipt { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sequence", "message"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Message, + } + #[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 { + "sequence" => Ok(GeneratedField::Sequence), + "message" => Ok(GeneratedField::Message), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ErrorReceipt; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.ErrorReceipt") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut message__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Message => { + if message__.is_some() { + return Err(serde::de::Error::duplicate_field("message")); + } + message__ = Some(map_.next_value()?); + } + } + } + Ok(ErrorReceipt { + sequence: sequence__.unwrap_or_default(), + message: message__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.ErrorReceipt", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for GenesisState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -441,6 +588,9 @@ impl serde::Serialize for GenesisState { if self.next_channel_sequence != 0 { len += 1; } + if self.params.is_some() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.GenesisState", len)?; if !self.channels.is_empty() { @@ -471,6 +621,9 @@ impl serde::Serialize for GenesisState { ToString::to_string(&self.next_channel_sequence).as_str(), )?; } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } struct_ser.end() } } @@ -494,6 +647,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "ackSequences", "next_channel_sequence", "nextChannelSequence", + "params", ]; #[allow(clippy::enum_variant_names)] @@ -506,6 +660,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { RecvSequences, AckSequences, NextChannelSequence, + Params, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -541,6 +696,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { "nextChannelSequence" | "next_channel_sequence" => { Ok(GeneratedField::NextChannelSequence) } + "params" => Ok(GeneratedField::Params), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -568,6 +724,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { let mut recv_sequences__ = None; let mut ack_sequences__ = None; let mut next_channel_sequence__ = None; + let mut params__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Channels => { @@ -623,6 +780,12 @@ impl<'de> serde::Deserialize<'de> for GenesisState { .0, ); } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } } } Ok(GenesisState { @@ -634,6 +797,7 @@ impl<'de> serde::Deserialize<'de> for GenesisState { recv_sequences: recv_sequences__.unwrap_or_default(), ack_sequences: ack_sequences__.unwrap_or_default(), next_channel_sequence: next_channel_sequence__.unwrap_or_default(), + params: params__, }) } } @@ -674,6 +838,9 @@ impl serde::Serialize for IdentifiedChannel { if !self.channel_id.is_empty() { len += 1; } + if self.upgrade_sequence != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.IdentifiedChannel", len)?; if self.state != 0 { @@ -703,6 +870,13 @@ impl serde::Serialize for IdentifiedChannel { if !self.channel_id.is_empty() { struct_ser.serialize_field("channelId", &self.channel_id)?; } + if self.upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "upgradeSequence", + ToString::to_string(&self.upgrade_sequence).as_str(), + )?; + } struct_ser.end() } } @@ -724,6 +898,8 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { "portId", "channel_id", "channelId", + "upgrade_sequence", + "upgradeSequence", ]; #[allow(clippy::enum_variant_names)] @@ -735,6 +911,7 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { Version, PortId, ChannelId, + UpgradeSequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -769,6 +946,9 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { "version" => Ok(GeneratedField::Version), "portId" | "port_id" => Ok(GeneratedField::PortId), "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "upgradeSequence" | "upgrade_sequence" => { + Ok(GeneratedField::UpgradeSequence) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -795,6 +975,7 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { let mut version__ = None; let mut port_id__ = None; let mut channel_id__ = None; + let mut upgrade_sequence__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::State => { @@ -839,6 +1020,15 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { } channel_id__ = Some(map_.next_value()?); } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } } } Ok(IdentifiedChannel { @@ -849,6 +1039,7 @@ impl<'de> serde::Deserialize<'de> for IdentifiedChannel { version: version__.unwrap_or_default(), port_id: port_id__.unwrap_or_default(), channel_id: channel_id__.unwrap_or_default(), + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), }) } } @@ -1175,6 +1366,9 @@ impl serde::Serialize for MsgChannelCloseConfirm { if !self.signer.is_empty() { len += 1; } + if self.counterparty_upgrade_sequence != 0 { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirm", len)?; if !self.port_id.is_empty() { @@ -1196,6 +1390,13 @@ impl serde::Serialize for MsgChannelCloseConfirm { if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; } + if self.counterparty_upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "counterpartyUpgradeSequence", + ToString::to_string(&self.counterparty_upgrade_sequence).as_str(), + )?; + } struct_ser.end() } } @@ -1216,6 +1417,8 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { "proof_height", "proofHeight", "signer", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", ]; #[allow(clippy::enum_variant_names)] @@ -1225,6 +1428,7 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { ProofInit, ProofHeight, Signer, + CounterpartyUpgradeSequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1255,6 +1459,9 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { "proofInit" | "proof_init" => Ok(GeneratedField::ProofInit), "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), "signer" => Ok(GeneratedField::Signer), + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => { + Ok(GeneratedField::CounterpartyUpgradeSequence) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1282,6 +1489,7 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { let mut proof_init__ = None; let mut proof_height__ = None; let mut signer__ = None; + let mut counterparty_upgrade_sequence__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PortId => { @@ -1317,6 +1525,17 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { } signer__ = Some(map_.next_value()?); } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgradeSequence", + )); + } + counterparty_upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } } } Ok(MsgChannelCloseConfirm { @@ -1325,6 +1544,8 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirm { proof_init: proof_init__.unwrap_or_default(), proof_height: proof_height__, signer: signer__.unwrap_or_default(), + counterparty_upgrade_sequence: counterparty_upgrade_sequence__ + .unwrap_or_default(), }) } } @@ -2689,11 +2910,17 @@ impl serde::Serialize for MsgChannelOpenTryResponse { if !self.version.is_empty() { len += 1; } + if !self.channel_id.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgChannelOpenTryResponse", len)?; if !self.version.is_empty() { struct_ser.serialize_field("version", &self.version)?; } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } struct_ser.end() } } @@ -2704,11 +2931,12 @@ impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["version"]; + const FIELDS: &[&str] = &["version", "channel_id", "channelId"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { Version, + ChannelId, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2735,6 +2963,7 @@ impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { { match value { "version" => Ok(GeneratedField::Version), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2758,6 +2987,7 @@ impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { V: serde::de::MapAccess<'de>, { let mut version__ = None; + let mut channel_id__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::Version => { @@ -2766,10 +2996,17 @@ impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { } version__ = Some(map_.next_value()?); } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } } } Ok(MsgChannelOpenTryResponse { version: version__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), }) } } @@ -2781,7 +3018,7 @@ impl<'de> serde::Deserialize<'de> for MsgChannelOpenTryResponse { } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgRecvPacket { +impl serde::Serialize for MsgChannelUpgradeAck { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2789,10 +3026,19 @@ impl serde::Serialize for MsgRecvPacket { { use serde::ser::SerializeStruct; let mut len = 0; - if self.packet.is_some() { + if !self.port_id.is_empty() { len += 1; } - if !self.proof_commitment.is_empty() { + if !self.channel_id.is_empty() { + len += 1; + } + if self.counterparty_upgrade.is_some() { + len += 1; + } + if !self.proof_channel.is_empty() { + len += 1; + } + if !self.proof_upgrade.is_empty() { len += 1; } if self.proof_height.is_some() { @@ -2802,15 +3048,28 @@ impl serde::Serialize for MsgRecvPacket { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgRecvPacket", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeAck", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if !self.proof_commitment.is_empty() { + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.counterparty_upgrade.as_ref() { + struct_ser.serialize_field("counterpartyUpgrade", v)?; + } + if !self.proof_channel.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proofCommitment", - pbjson::private::base64::encode(&self.proof_commitment).as_str(), + "proofChannel", + pbjson::private::base64::encode(&self.proof_channel).as_str(), + )?; + } + if !self.proof_upgrade.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proofUpgrade", + pbjson::private::base64::encode(&self.proof_upgrade).as_str(), )?; } if let Some(v) = self.proof_height.as_ref() { @@ -2823,16 +3082,23 @@ impl serde::Serialize for MsgRecvPacket { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgRecvPacket { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeAck { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "packet", - "proof_commitment", - "proofCommitment", + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_upgrade", + "counterpartyUpgrade", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", "proof_height", "proofHeight", "signer", @@ -2840,8 +3106,11 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacket { #[allow(clippy::enum_variant_names)] enum GeneratedField { - Packet, - ProofCommitment, + PortId, + ChannelId, + CounterpartyUpgrade, + ProofChannel, + ProofUpgrade, ProofHeight, Signer, } @@ -2869,10 +3138,13 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacket { E: serde::de::Error, { match value { - "packet" => Ok(GeneratedField::Packet), - "proofCommitment" | "proof_commitment" => { - Ok(GeneratedField::ProofCommitment) + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyUpgrade" | "counterparty_upgrade" => { + Ok(GeneratedField::CounterpartyUpgrade) } + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), @@ -2884,33 +3156,62 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacket { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRecvPacket; + type Value = MsgChannelUpgradeAck; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacket") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeAck") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut packet__ = None; - let mut proof_commitment__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_upgrade__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; let mut proof_height__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - packet__ = map_.next_value()?; + port_id__ = Some(map_.next_value()?); } - GeneratedField::ProofCommitment => { - if proof_commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("proofCommitment")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof_commitment__ = Some( + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgrade => { + if counterparty_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgrade", + )); + } + counterparty_upgrade__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); + } + proof_upgrade__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); @@ -2929,23 +3230,26 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacket { } } } - Ok(MsgRecvPacket { - packet: packet__, - proof_commitment: proof_commitment__.unwrap_or_default(), + Ok(MsgChannelUpgradeAck { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_upgrade: counterparty_upgrade__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), proof_height: proof_height__, signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgRecvPacket", + "ibc.core.channel.v1.MsgChannelUpgradeAck", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgRecvPacketResponse { +impl serde::Serialize for MsgChannelUpgradeAckResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2957,7 +3261,7 @@ impl serde::Serialize for MsgRecvPacketResponse { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgRecvPacketResponse", len)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeAckResponse", len)?; if self.result != 0 { let v = ResponseResultType::try_from(self.result).map_err(|_| { serde::ser::Error::custom(format!("Invalid variant {}", self.result)) @@ -2968,7 +3272,7 @@ impl serde::Serialize for MsgRecvPacketResponse { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeAckResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -3014,16 +3318,16 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgRecvPacketResponse; + type Value = MsgChannelUpgradeAckResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacketResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeAckResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -3038,20 +3342,20 @@ impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { } } } - Ok(MsgRecvPacketResponse { + Ok(MsgChannelUpgradeAckResponse { result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgRecvPacketResponse", + "ibc.core.channel.v1.MsgChannelUpgradeAckResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgTimeout { +impl serde::Serialize for MsgChannelUpgradeCancel { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3059,42 +3363,45 @@ impl serde::Serialize for MsgTimeout { { use serde::ser::SerializeStruct; let mut len = 0; - if self.packet.is_some() { + if !self.port_id.is_empty() { len += 1; } - if !self.proof_unreceived.is_empty() { + if !self.channel_id.is_empty() { len += 1; } - if self.proof_height.is_some() { + if self.error_receipt.is_some() { len += 1; } - if self.next_sequence_recv != 0 { + if !self.proof_error_receipt.is_empty() { + len += 1; + } + if self.proof_height.is_some() { len += 1; } if !self.signer.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgTimeout", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeCancel", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if !self.proof_unreceived.is_empty() { + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.error_receipt.as_ref() { + struct_ser.serialize_field("errorReceipt", v)?; + } + if !self.proof_error_receipt.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proofUnreceived", - pbjson::private::base64::encode(&self.proof_unreceived).as_str(), + "proofErrorReceipt", + pbjson::private::base64::encode(&self.proof_error_receipt).as_str(), )?; } if let Some(v) = self.proof_height.as_ref() { struct_ser.serialize_field("proofHeight", v)?; } - if self.next_sequence_recv != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "nextSequenceRecv", - ToString::to_string(&self.next_sequence_recv).as_str(), - )?; - } if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; } @@ -3102,29 +3409,33 @@ impl serde::Serialize for MsgTimeout { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgTimeout { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeCancel { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "packet", - "proof_unreceived", - "proofUnreceived", + "port_id", + "portId", + "channel_id", + "channelId", + "error_receipt", + "errorReceipt", + "proof_error_receipt", + "proofErrorReceipt", "proof_height", "proofHeight", - "next_sequence_recv", - "nextSequenceRecv", "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Packet, - ProofUnreceived, + PortId, + ChannelId, + ErrorReceipt, + ProofErrorReceipt, ProofHeight, - NextSequenceRecv, Signer, } #[cfg(feature = "serde")] @@ -3151,14 +3462,13 @@ impl<'de> serde::Deserialize<'de> for MsgTimeout { E: serde::de::Error, { match value { - "packet" => Ok(GeneratedField::Packet), - "proofUnreceived" | "proof_unreceived" => { - Ok(GeneratedField::ProofUnreceived) + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "errorReceipt" | "error_receipt" => Ok(GeneratedField::ErrorReceipt), + "proofErrorReceipt" | "proof_error_receipt" => { + Ok(GeneratedField::ProofErrorReceipt) } "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "nextSequenceRecv" | "next_sequence_recv" => { - Ok(GeneratedField::NextSequenceRecv) - } "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -3169,34 +3479,50 @@ impl<'de> serde::Deserialize<'de> for MsgTimeout { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeout; + type Value = MsgChannelUpgradeCancel; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeout") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeCancel") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut packet__ = None; - let mut proof_unreceived__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut error_receipt__ = None; + let mut proof_error_receipt__ = None; let mut proof_height__ = None; - let mut next_sequence_recv__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - packet__ = map_.next_value()?; + port_id__ = Some(map_.next_value()?); } - GeneratedField::ProofUnreceived => { - if proof_unreceived__.is_some() { - return Err(serde::de::Error::duplicate_field("proofUnreceived")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof_unreceived__ = Some( + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::ErrorReceipt => { + if error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("errorReceipt")); + } + error_receipt__ = map_.next_value()?; + } + GeneratedField::ProofErrorReceipt => { + if proof_error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("proofErrorReceipt")); + } + proof_error_receipt__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); @@ -3207,15 +3533,6 @@ impl<'de> serde::Deserialize<'de> for MsgTimeout { } proof_height__ = map_.next_value()?; } - GeneratedField::NextSequenceRecv => { - if next_sequence_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); - } - next_sequence_recv__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } GeneratedField::Signer => { if signer__.is_some() { return Err(serde::de::Error::duplicate_field("signer")); @@ -3224,20 +3541,107 @@ impl<'de> serde::Deserialize<'de> for MsgTimeout { } } } - Ok(MsgTimeout { - packet: packet__, - proof_unreceived: proof_unreceived__.unwrap_or_default(), + Ok(MsgChannelUpgradeCancel { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + error_receipt: error_receipt__, + proof_error_receipt: proof_error_receipt__.unwrap_or_default(), proof_height: proof_height__, - next_sequence_recv: next_sequence_recv__.unwrap_or_default(), signer: signer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeout", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeCancel", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgTimeoutOnClose { +impl serde::Serialize for MsgChannelUpgradeCancelResponse { + #[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("ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeCancelResponse { + #[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 = MsgChannelUpgradeCancelResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeCancelResponse") + } + + 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(MsgChannelUpgradeCancelResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeCancelResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgChannelUpgradeConfirm { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3245,53 +3649,67 @@ impl serde::Serialize for MsgTimeoutOnClose { { use serde::ser::SerializeStruct; let mut len = 0; - if self.packet.is_some() { + if !self.port_id.is_empty() { len += 1; } - if !self.proof_unreceived.is_empty() { + if !self.channel_id.is_empty() { len += 1; } - if !self.proof_close.is_empty() { + if self.counterparty_channel_state != 0 { len += 1; } - if self.proof_height.is_some() { + if self.counterparty_upgrade.is_some() { len += 1; } - if self.next_sequence_recv != 0 { + if !self.proof_channel.is_empty() { + len += 1; + } + if !self.proof_upgrade.is_empty() { + len += 1; + } + if self.proof_height.is_some() { len += 1; } if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutOnClose", len)?; - if let Some(v) = self.packet.as_ref() { - struct_ser.serialize_field("packet", v)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeConfirm", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if !self.proof_unreceived.is_empty() { + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.counterparty_channel_state != 0 { + let v = State::try_from(self.counterparty_channel_state).map_err(|_| { + serde::ser::Error::custom(format!( + "Invalid variant {}", + self.counterparty_channel_state + )) + })?; + struct_ser.serialize_field("counterpartyChannelState", &v)?; + } + if let Some(v) = self.counterparty_upgrade.as_ref() { + struct_ser.serialize_field("counterpartyUpgrade", v)?; + } + if !self.proof_channel.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proofUnreceived", - pbjson::private::base64::encode(&self.proof_unreceived).as_str(), + "proofChannel", + pbjson::private::base64::encode(&self.proof_channel).as_str(), )?; } - if !self.proof_close.is_empty() { + if !self.proof_upgrade.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proofClose", - pbjson::private::base64::encode(&self.proof_close).as_str(), + "proofUpgrade", + pbjson::private::base64::encode(&self.proof_upgrade).as_str(), )?; } if let Some(v) = self.proof_height.as_ref() { struct_ser.serialize_field("proofHeight", v)?; } - if self.next_sequence_recv != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "nextSequenceRecv", - ToString::to_string(&self.next_sequence_recv).as_str(), - )?; - } if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; } @@ -3299,32 +3717,39 @@ impl serde::Serialize for MsgTimeoutOnClose { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeConfirm { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "packet", - "proof_unreceived", - "proofUnreceived", - "proof_close", - "proofClose", + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel_state", + "counterpartyChannelState", + "counterparty_upgrade", + "counterpartyUpgrade", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", "proof_height", "proofHeight", - "next_sequence_recv", - "nextSequenceRecv", "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Packet, - ProofUnreceived, - ProofClose, + PortId, + ChannelId, + CounterpartyChannelState, + CounterpartyUpgrade, + ProofChannel, + ProofUpgrade, ProofHeight, - NextSequenceRecv, Signer, } #[cfg(feature = "serde")] @@ -3351,15 +3776,17 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { E: serde::de::Error, { match value { - "packet" => Ok(GeneratedField::Packet), - "proofUnreceived" | "proof_unreceived" => { - Ok(GeneratedField::ProofUnreceived) + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannelState" | "counterparty_channel_state" => { + Ok(GeneratedField::CounterpartyChannelState) } - "proofClose" | "proof_close" => Ok(GeneratedField::ProofClose), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - "nextSequenceRecv" | "next_sequence_recv" => { - Ok(GeneratedField::NextSequenceRecv) + "counterpartyUpgrade" | "counterparty_upgrade" => { + Ok(GeneratedField::CounterpartyUpgrade) } + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -3370,44 +3797,71 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeoutOnClose; + type Value = MsgChannelUpgradeConfirm; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnClose") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeConfirm") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut packet__ = None; - let mut proof_unreceived__ = None; - let mut proof_close__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel_state__ = None; + let mut counterparty_upgrade__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; let mut proof_height__ = None; - let mut next_sequence_recv__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Packet => { - if packet__.is_some() { - return Err(serde::de::Error::duplicate_field("packet")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - packet__ = map_.next_value()?; + port_id__ = Some(map_.next_value()?); } - GeneratedField::ProofUnreceived => { - if proof_unreceived__.is_some() { - return Err(serde::de::Error::duplicate_field("proofUnreceived")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof_unreceived__ = Some( + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyChannelState => { + if counterparty_channel_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyChannelState", + )); + } + counterparty_channel_state__ = Some(map_.next_value::()? as i32); + } + GeneratedField::CounterpartyUpgrade => { + if counterparty_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgrade", + )); + } + counterparty_upgrade__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::ProofClose => { - if proof_close__.is_some() { - return Err(serde::de::Error::duplicate_field("proofClose")); + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); } - proof_close__ = Some( + proof_upgrade__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); @@ -3418,15 +3872,6 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { } proof_height__ = map_.next_value()?; } - GeneratedField::NextSequenceRecv => { - if next_sequence_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); - } - next_sequence_recv__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } GeneratedField::Signer => { if signer__.is_some() { return Err(serde::de::Error::duplicate_field("signer")); @@ -3435,25 +3880,27 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { } } } - Ok(MsgTimeoutOnClose { - packet: packet__, - proof_unreceived: proof_unreceived__.unwrap_or_default(), - proof_close: proof_close__.unwrap_or_default(), + Ok(MsgChannelUpgradeConfirm { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel_state: counterparty_channel_state__.unwrap_or_default(), + counterparty_upgrade: counterparty_upgrade__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), proof_height: proof_height__, - next_sequence_recv: next_sequence_recv__.unwrap_or_default(), signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutOnClose", + "ibc.core.channel.v1.MsgChannelUpgradeConfirm", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgTimeoutOnCloseResponse { +impl serde::Serialize for MsgChannelUpgradeConfirmResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3464,8 +3911,8 @@ impl serde::Serialize for MsgTimeoutOnCloseResponse { if self.result != 0 { len += 1; } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutOnCloseResponse", len)?; + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", len)?; if self.result != 0 { let v = ResponseResultType::try_from(self.result).map_err(|_| { serde::ser::Error::custom(format!("Invalid variant {}", self.result)) @@ -3476,7 +3923,7 @@ impl serde::Serialize for MsgTimeoutOnCloseResponse { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeConfirmResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -3522,16 +3969,16 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeoutOnCloseResponse; + type Value = MsgChannelUpgradeConfirmResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnCloseResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { @@ -3546,20 +3993,20 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { } } } - Ok(MsgTimeoutOnCloseResponse { + Ok(MsgChannelUpgradeConfirmResponse { result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutOnCloseResponse", + "ibc.core.channel.v1.MsgChannelUpgradeConfirmResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgTimeoutResponse { +impl serde::Serialize for MsgChannelUpgradeInit { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3567,32 +4014,57 @@ impl serde::Serialize for MsgTimeoutResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.result != 0 { + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.fields.is_some() { + len += 1; + } + if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutResponse", len)?; - if self.result != 0 { - let v = ResponseResultType::try_from(self.result).map_err(|_| { - serde::ser::Error::custom(format!("Invalid variant {}", self.result)) - })?; - struct_ser.serialize_field("result", &v)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeInit", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.fields.as_ref() { + struct_ser.serialize_field("fields", v)?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeInit { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["result"]; + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "fields", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Result, + PortId, + ChannelId, + Fields, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3618,7 +4090,10 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { E: serde::de::Error, { match value { - "result" => Ok(GeneratedField::Result), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "fields" => Ok(GeneratedField::Fields), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3628,113 +4103,196 @@ impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgTimeoutResponse; + type Value = MsgChannelUpgradeInit; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeInit") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut result__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut fields__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Result => { - if result__.is_some() { - return Err(serde::de::Error::duplicate_field("result")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - result__ = Some(map_.next_value::()? as i32); + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); } } } - Ok(MsgTimeoutResponse { - result: result__.unwrap_or_default(), + Ok(MsgChannelUpgradeInit { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + fields: fields__, + signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.MsgTimeoutResponse", + "ibc.core.channel.v1.MsgChannelUpgradeInit", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for Order { +impl serde::Serialize for MsgChannelUpgradeInitResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", - Self::Unordered => "ORDER_UNORDERED", - Self::Ordered => "ORDER_ORDERED", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if self.upgrade.is_some() { + len += 1; + } + if self.upgrade_sequence != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeInitResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if self.upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "upgradeSequence", + ToString::to_string(&self.upgrade_sequence).as_str(), + )?; + } + struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Order { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeInitResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["ORDER_NONE_UNSPECIFIED", "ORDER_UNORDERED", "ORDER_ORDERED"]; + const FIELDS: &[&str] = &["upgrade", "upgrade_sequence", "upgradeSequence"]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Upgrade, + UpgradeSequence, + } + #[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 = Order; + 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) - } + 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) - }) + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "upgrade" => Ok(GeneratedField::Upgrade), + "upgradeSequence" | "upgrade_sequence" => { + Ok(GeneratedField::UpgradeSequence) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelUpgradeInitResponse; - 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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeInitResponse") } - fn visit_str(self, value: &str) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where - E: serde::de::Error, + V: serde::de::MapAccess<'de>, { - match value { - "ORDER_NONE_UNSPECIFIED" => Ok(Order::NoneUnspecified), - "ORDER_UNORDERED" => Ok(Order::Unordered), - "ORDER_ORDERED" => Ok(Order::Ordered), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut upgrade__ = None; + let mut upgrade_sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); + } + upgrade__ = map_.next_value()?; + } + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); + } + upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } } + Ok(MsgChannelUpgradeInitResponse { + upgrade: upgrade__, + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeInitResponse", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for Packet { +impl serde::Serialize for MsgChannelUpgradeOpen { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3742,99 +4300,99 @@ impl serde::Serialize for Packet { { use serde::ser::SerializeStruct; let mut len = 0; - if self.sequence != 0 { + if !self.port_id.is_empty() { len += 1; } - if !self.source_port.is_empty() { + if !self.channel_id.is_empty() { len += 1; } - if !self.source_channel.is_empty() { + if self.counterparty_channel_state != 0 { len += 1; } - if !self.destination_port.is_empty() { + if self.counterparty_upgrade_sequence != 0 { len += 1; } - if !self.destination_channel.is_empty() { + if !self.proof_channel.is_empty() { len += 1; } - if !self.data.is_empty() { + if self.proof_height.is_some() { len += 1; } - if self.timeout_height.is_some() { + if !self.signer.is_empty() { len += 1; } - if self.timeout_timestamp != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Packet", len)?; - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if !self.source_port.is_empty() { - struct_ser.serialize_field("sourcePort", &self.source_port)?; - } - if !self.source_channel.is_empty() { - struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeOpen", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if !self.destination_port.is_empty() { - struct_ser.serialize_field("destinationPort", &self.destination_port)?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; } - if !self.destination_channel.is_empty() { - struct_ser.serialize_field("destinationChannel", &self.destination_channel)?; + if self.counterparty_channel_state != 0 { + let v = State::try_from(self.counterparty_channel_state).map_err(|_| { + serde::ser::Error::custom(format!( + "Invalid variant {}", + self.counterparty_channel_state + )) + })?; + struct_ser.serialize_field("counterpartyChannelState", &v)?; } - if !self.data.is_empty() { + if self.counterparty_upgrade_sequence != 0 { #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if let Some(v) = self.timeout_height.as_ref() { - struct_ser.serialize_field("timeoutHeight", v)?; + struct_ser.serialize_field( + "counterpartyUpgradeSequence", + ToString::to_string(&self.counterparty_upgrade_sequence).as_str(), + )?; } - if self.timeout_timestamp != 0 { + if !self.proof_channel.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "timeoutTimestamp", - ToString::to_string(&self.timeout_timestamp).as_str(), + "proofChannel", + pbjson::private::base64::encode(&self.proof_channel).as_str(), )?; } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Packet { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeOpen { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "sequence", - "source_port", - "sourcePort", - "source_channel", - "sourceChannel", - "destination_port", - "destinationPort", - "destination_channel", - "destinationChannel", - "data", - "timeout_height", - "timeoutHeight", - "timeout_timestamp", - "timeoutTimestamp", + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel_state", + "counterpartyChannelState", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + "proof_channel", + "proofChannel", + "proof_height", + "proofHeight", + "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequence, - SourcePort, - SourceChannel, - DestinationPort, - DestinationChannel, - Data, - TimeoutHeight, - TimeoutTimestamp, + PortId, + ChannelId, + CounterpartyChannelState, + CounterpartyUpgradeSequence, + ProofChannel, + ProofHeight, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3860,20 +4418,17 @@ impl<'de> serde::Deserialize<'de> for Packet { E: serde::de::Error, { match value { - "sequence" => Ok(GeneratedField::Sequence), - "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), - "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), - "destinationPort" | "destination_port" => { - Ok(GeneratedField::DestinationPort) - } - "destinationChannel" | "destination_channel" => { - Ok(GeneratedField::DestinationChannel) + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "counterpartyChannelState" | "counterparty_channel_state" => { + Ok(GeneratedField::CounterpartyChannelState) } - "data" => Ok(GeneratedField::Data), - "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), - "timeoutTimestamp" | "timeout_timestamp" => { - Ok(GeneratedField::TimeoutTimestamp) + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => { + Ok(GeneratedField::CounterpartyUpgradeSequence) } + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3883,149 +4438,126 @@ impl<'de> serde::Deserialize<'de> for Packet { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Packet; + type Value = MsgChannelUpgradeOpen; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.Packet") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeOpen") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequence__ = None; - let mut source_port__ = None; - let mut source_channel__ = None; - let mut destination_port__ = None; - let mut destination_channel__ = None; - let mut data__ = None; - let mut timeout_height__ = None; - let mut timeout_timestamp__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut counterparty_channel_state__ = None; + let mut counterparty_upgrade_sequence__ = None; + let mut proof_channel__ = None; + let mut proof_height__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::SourcePort => { - if source_port__.is_some() { - return Err(serde::de::Error::duplicate_field("sourcePort")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - source_port__ = Some(map_.next_value()?); + port_id__ = Some(map_.next_value()?); } - GeneratedField::SourceChannel => { - if source_channel__.is_some() { - return Err(serde::de::Error::duplicate_field("sourceChannel")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - source_channel__ = Some(map_.next_value()?); + channel_id__ = Some(map_.next_value()?); } - GeneratedField::DestinationPort => { - if destination_port__.is_some() { - return Err(serde::de::Error::duplicate_field("destinationPort")); + GeneratedField::CounterpartyChannelState => { + if counterparty_channel_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyChannelState", + )); } - destination_port__ = Some(map_.next_value()?); + counterparty_channel_state__ = Some(map_.next_value::()? as i32); } - GeneratedField::DestinationChannel => { - if destination_channel__.is_some() { + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { return Err(serde::de::Error::duplicate_field( - "destinationChannel", + "counterpartyUpgradeSequence", )); } - destination_channel__ = Some(map_.next_value()?); + counterparty_upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); } - data__ = Some( + proof_channel__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::TimeoutHeight => { - if timeout_height__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutHeight")); + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); } - timeout_height__ = map_.next_value()?; + proof_height__ = map_.next_value()?; } - GeneratedField::TimeoutTimestamp => { - if timeout_timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - timeout_timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); + signer__ = Some(map_.next_value()?); } } } - Ok(Packet { - sequence: sequence__.unwrap_or_default(), - source_port: source_port__.unwrap_or_default(), - source_channel: source_channel__.unwrap_or_default(), - destination_port: destination_port__.unwrap_or_default(), - destination_channel: destination_channel__.unwrap_or_default(), - data: data__.unwrap_or_default(), - timeout_height: timeout_height__, - timeout_timestamp: timeout_timestamp__.unwrap_or_default(), + Ok(MsgChannelUpgradeOpen { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + counterparty_channel_state: counterparty_channel_state__.unwrap_or_default(), + counterparty_upgrade_sequence: counterparty_upgrade_sequence__ + .unwrap_or_default(), + proof_channel: proof_channel__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("ibc.core.channel.v1.Packet", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeOpen", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketId { +impl serde::Serialize for MsgChannelUpgradeOpenResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketId", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } + let len = 0; + let struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PacketId { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeOpenResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - Sequence, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -4049,12 +4581,7 @@ impl<'de> serde::Deserialize<'de> for PacketId { where E: serde::de::Error, { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -4062,56 +4589,34 @@ impl<'de> serde::Deserialize<'de> for PacketId { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketId; + type Value = MsgChannelUpgradeOpenResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketId") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeOpenResponse") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map_.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(PacketId { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - }) + Ok(MsgChannelUpgradeOpenResponse {}) } } - deserializer.deserialize_struct("ibc.core.channel.v1.PacketId", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeOpenResponse", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketSequence { +impl serde::Serialize for MsgChannelUpgradeTimeout { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4125,38 +4630,74 @@ impl serde::Serialize for PacketSequence { if !self.channel_id.is_empty() { len += 1; } - if self.sequence != 0 { + if self.counterparty_channel.is_some() { + len += 1; + } + if !self.proof_channel.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.PacketSequence", len)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTimeout", len)?; if !self.port_id.is_empty() { struct_ser.serialize_field("portId", &self.port_id)?; } if !self.channel_id.is_empty() { struct_ser.serialize_field("channelId", &self.channel_id)?; } - if self.sequence != 0 { + if let Some(v) = self.counterparty_channel.as_ref() { + struct_ser.serialize_field("counterpartyChannel", v)?; + } + if !self.proof_channel.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + struct_ser.serialize_field( + "proofChannel", + pbjson::private::base64::encode(&self.proof_channel).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PacketSequence { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTimeout { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "counterparty_channel", + "counterpartyChannel", + "proof_channel", + "proofChannel", + "proof_height", + "proofHeight", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PortId, ChannelId, - Sequence, + CounterpartyChannel, + ProofChannel, + ProofHeight, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4184,7 +4725,12 @@ impl<'de> serde::Deserialize<'de> for PacketSequence { match value { "portId" | "port_id" => Ok(GeneratedField::PortId), "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), + "counterpartyChannel" | "counterparty_channel" => { + Ok(GeneratedField::CounterpartyChannel) + } + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4194,19 +4740,25 @@ impl<'de> serde::Deserialize<'de> for PacketSequence { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketSequence; + type Value = MsgChannelUpgradeTimeout; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketSequence") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTimeout") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut port_id__ = None; let mut channel_id__ = None; - let mut sequence__ = None; + let mut counterparty_channel__ = None; + let mut proof_channel__ = None; + let mut proof_height__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PortId => { @@ -4221,33 +4773,138 @@ impl<'de> serde::Deserialize<'de> for PacketSequence { } channel_id__ = Some(map_.next_value()?); } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::CounterpartyChannel => { + if counterparty_channel__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyChannel", + )); } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + counterparty_channel__ = map_.next_value()?; + } + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); + } + proof_channel__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } } } - Ok(PacketSequence { + Ok(MsgChannelUpgradeTimeout { port_id: port_id__.unwrap_or_default(), channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), + counterparty_channel: counterparty_channel__, + proof_channel: proof_channel__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.PacketSequence", + "ibc.core.channel.v1.MsgChannelUpgradeTimeout", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketState { +impl serde::Serialize for MsgChannelUpgradeTimeoutResponse { + #[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("ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTimeoutResponse { + #[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 = MsgChannelUpgradeTimeoutResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse") + } + + 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(MsgChannelUpgradeTimeoutResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeTimeoutResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgChannelUpgradeTry { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4261,33 +4918,76 @@ impl serde::Serialize for PacketState { if !self.channel_id.is_empty() { len += 1; } - if self.sequence != 0 { + if !self.proposed_upgrade_connection_hops.is_empty() { len += 1; } - if !self.data.is_empty() { + if self.counterparty_upgrade_fields.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketState", len)?; + if self.counterparty_upgrade_sequence != 0 { + len += 1; + } + if !self.proof_channel.is_empty() { + len += 1; + } + if !self.proof_upgrade.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + if !self.signer.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTry", len)?; if !self.port_id.is_empty() { struct_ser.serialize_field("portId", &self.port_id)?; } if !self.channel_id.is_empty() { struct_ser.serialize_field("channelId", &self.channel_id)?; } - if self.sequence != 0 { + if !self.proposed_upgrade_connection_hops.is_empty() { + struct_ser.serialize_field( + "proposedUpgradeConnectionHops", + &self.proposed_upgrade_connection_hops, + )?; + } + if let Some(v) = self.counterparty_upgrade_fields.as_ref() { + struct_ser.serialize_field("counterpartyUpgradeFields", v)?; + } + if self.counterparty_upgrade_sequence != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + struct_ser.serialize_field( + "counterpartyUpgradeSequence", + ToString::to_string(&self.counterparty_upgrade_sequence).as_str(), + )?; } - if !self.data.is_empty() { + if !self.proof_channel.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + struct_ser.serialize_field( + "proofChannel", + pbjson::private::base64::encode(&self.proof_channel).as_str(), + )?; + } + if !self.proof_upgrade.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proofUpgrade", + pbjson::private::base64::encode(&self.proof_upgrade).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PacketState { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTry { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -4298,16 +4998,32 @@ impl<'de> serde::Deserialize<'de> for PacketState { "portId", "channel_id", "channelId", - "sequence", - "data", + "proposed_upgrade_connection_hops", + "proposedUpgradeConnectionHops", + "counterparty_upgrade_fields", + "counterpartyUpgradeFields", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + "proof_channel", + "proofChannel", + "proof_upgrade", + "proofUpgrade", + "proof_height", + "proofHeight", + "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PortId, ChannelId, - Sequence, - Data, + ProposedUpgradeConnectionHops, + CounterpartyUpgradeFields, + CounterpartyUpgradeSequence, + ProofChannel, + ProofUpgrade, + ProofHeight, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4335,8 +5051,20 @@ impl<'de> serde::Deserialize<'de> for PacketState { match value { "portId" | "port_id" => Ok(GeneratedField::PortId), "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), - "data" => Ok(GeneratedField::Data), + "proposedUpgradeConnectionHops" + | "proposed_upgrade_connection_hops" => { + Ok(GeneratedField::ProposedUpgradeConnectionHops) + } + "counterpartyUpgradeFields" | "counterparty_upgrade_fields" => { + Ok(GeneratedField::CounterpartyUpgradeFields) + } + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => { + Ok(GeneratedField::CounterpartyUpgradeSequence) + } + "proofChannel" | "proof_channel" => Ok(GeneratedField::ProofChannel), + "proofUpgrade" | "proof_upgrade" => Ok(GeneratedField::ProofUpgrade), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4346,20 +5074,28 @@ impl<'de> serde::Deserialize<'de> for PacketState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketState; + type Value = MsgChannelUpgradeTry; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.PacketState") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTry") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut port_id__ = None; let mut channel_id__ = None; - let mut sequence__ = None; - let mut data__ = None; + let mut proposed_upgrade_connection_hops__ = None; + let mut counterparty_upgrade_fields__ = None; + let mut counterparty_upgrade_sequence__ = None; + let mut proof_channel__ = None; + let mut proof_upgrade__ = None; + let mut proof_height__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PortId => { @@ -4374,39 +5110,89 @@ impl<'de> serde::Deserialize<'de> for PacketState { } channel_id__ = Some(map_.next_value()?); } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::ProposedUpgradeConnectionHops => { + if proposed_upgrade_connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field( + "proposedUpgradeConnectionHops", + )); } - sequence__ = Some( + proposed_upgrade_connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgradeFields => { + if counterparty_upgrade_fields__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgradeFields", + )); + } + counterparty_upgrade_fields__ = map_.next_value()?; + } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgradeSequence", + )); + } + counterparty_upgrade_sequence__ = Some( map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); + GeneratedField::ProofChannel => { + if proof_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("proofChannel")); } - data__ = Some( + proof_channel__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - } - } - Ok(PacketState { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - data: data__.unwrap_or_default(), + GeneratedField::ProofUpgrade => { + if proof_upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUpgrade")); + } + proof_upgrade__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgChannelUpgradeTry { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + proposed_upgrade_connection_hops: proposed_upgrade_connection_hops__ + .unwrap_or_default(), + counterparty_upgrade_fields: counterparty_upgrade_fields__, + counterparty_upgrade_sequence: counterparty_upgrade_sequence__ + .unwrap_or_default(), + proof_channel: proof_channel__.unwrap_or_default(), + proof_upgrade: proof_upgrade__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("ibc.core.channel.v1.PacketState", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.MsgChannelUpgradeTry", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelClientStateRequest { +impl serde::Serialize for MsgChannelUpgradeTryResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4414,36 +5200,50 @@ impl serde::Serialize for QueryChannelClientStateRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.upgrade.is_some() { len += 1; } - if !self.channel_id.is_empty() { + if self.upgrade_sequence != 0 { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; + if self.result != 0 { + len += 1; } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTryResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if self.upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "upgradeSequence", + ToString::to_string(&self.upgrade_sequence).as_str(), + )?; + } + if self.result != 0 { + let v = ResponseResultType::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { +impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTryResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + const FIELDS: &[&str] = &["upgrade", "upgrade_sequence", "upgradeSequence", "result"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, + Upgrade, + UpgradeSequence, + Result, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4469,8 +5269,11 @@ impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "upgrade" => Ok(GeneratedField::Upgrade), + "upgradeSequence" | "upgrade_sequence" => { + Ok(GeneratedField::UpgradeSequence) + } + "result" => Ok(GeneratedField::Result), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4480,52 +5283,63 @@ impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelClientStateRequest; + type Value = MsgChannelUpgradeTryResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgChannelUpgradeTryResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; + let mut upgrade__ = None; + let mut upgrade_sequence__ = None; + let mut result__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); } - port_id__ = Some(map_.next_value()?); + upgrade__ = map_.next_value()?; } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::UpgradeSequence => { + if upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeSequence")); } - channel_id__ = Some(map_.next_value()?); + upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); + } + result__ = Some(map_.next_value::()? as i32); } } } - Ok(QueryChannelClientStateRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), + Ok(MsgChannelUpgradeTryResponse { + upgrade: upgrade__, + upgrade_sequence: upgrade_sequence__.unwrap_or_default(), + result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelClientStateRequest", + "ibc.core.channel.v1.MsgChannelUpgradeTryResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelClientStateResponse { +impl serde::Serialize for MsgPruneAcknowledgements { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4533,53 +5347,58 @@ impl serde::Serialize for QueryChannelClientStateResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.identified_client_state.is_some() { + if !self.port_id.is_empty() { len += 1; } - if !self.proof.is_empty() { + if !self.channel_id.is_empty() { len += 1; } - if self.proof_height.is_some() { + if self.limit != 0 { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateResponse", len)?; - if let Some(v) = self.identified_client_state.as_ref() { - struct_ser.serialize_field("identifiedClientState", v)?; + if !self.signer.is_empty() { + len += 1; } - if !self.proof.is_empty() { + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgPruneAcknowledgements", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.limit != 0 { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; + struct_ser.serialize_field("limit", ToString::to_string(&self.limit).as_str())?; } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { +impl<'de> serde::Deserialize<'de> for MsgPruneAcknowledgements { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "identified_client_state", - "identifiedClientState", - "proof", - "proof_height", - "proofHeight", + "port_id", + "portId", + "channel_id", + "channelId", + "limit", + "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - IdentifiedClientState, - Proof, - ProofHeight, + PortId, + ChannelId, + Limit, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4605,11 +5424,10 @@ impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { E: serde::de::Error, { match value { - "identifiedClientState" | "identified_client_state" => { - Ok(GeneratedField::IdentifiedClientState) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "limit" => Ok(GeneratedField::Limit), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4619,65 +5437,71 @@ impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelClientStateResponse; + type Value = MsgPruneAcknowledgements; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgPruneAcknowledgements") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut identified_client_state__ = None; - let mut proof__ = None; - let mut proof_height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut limit__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::IdentifiedClientState => { - if identified_client_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "identifiedClientState", - )); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - identified_client_state__ = map_.next_value()?; + port_id__ = Some(map_.next_value()?); } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Limit => { + if limit__.is_some() { + return Err(serde::de::Error::duplicate_field("limit")); + } + limit__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - proof_height__ = map_.next_value()?; + signer__ = Some(map_.next_value()?); } } } - Ok(QueryChannelClientStateResponse { - identified_client_state: identified_client_state__, - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, + Ok(MsgPruneAcknowledgements { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + limit: limit__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelClientStateResponse", + "ibc.core.channel.v1.MsgPruneAcknowledgements", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelConsensusStateRequest { +impl serde::Serialize for MsgPruneAcknowledgementsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4685,67 +5509,49 @@ impl serde::Serialize for QueryChannelConsensusStateRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if self.revision_number != 0 { + if self.total_pruned_sequences != 0 { len += 1; } - if self.revision_height != 0 { + if self.total_remaining_sequences != 0 { len += 1; } let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryChannelConsensusStateRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.revision_number != 0 { + .serialize_struct("ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", len)?; + if self.total_pruned_sequences != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "revisionNumber", - ToString::to_string(&self.revision_number).as_str(), + "totalPrunedSequences", + ToString::to_string(&self.total_pruned_sequences).as_str(), )?; } - if self.revision_height != 0 { + if self.total_remaining_sequences != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "revisionHeight", - ToString::to_string(&self.revision_height).as_str(), + "totalRemainingSequences", + ToString::to_string(&self.total_remaining_sequences).as_str(), )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { +impl<'de> serde::Deserialize<'de> for MsgPruneAcknowledgementsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "revision_number", - "revisionNumber", - "revision_height", - "revisionHeight", + "total_pruned_sequences", + "totalPrunedSequences", + "total_remaining_sequences", + "totalRemainingSequences", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - RevisionNumber, - RevisionHeight, + TotalPrunedSequences, + TotalRemainingSequences, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4771,13 +5577,11 @@ impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "revisionNumber" | "revision_number" => { - Ok(GeneratedField::RevisionNumber) + "totalPrunedSequences" | "total_pruned_sequences" => { + Ok(GeneratedField::TotalPrunedSequences) } - "revisionHeight" | "revision_height" => { - Ok(GeneratedField::RevisionHeight) + "totalRemainingSequences" | "total_remaining_sequences" => { + Ok(GeneratedField::TotalRemainingSequences) } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -4788,74 +5592,62 @@ impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelConsensusStateRequest; + type Value = MsgPruneAcknowledgementsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgPruneAcknowledgementsResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut revision_number__ = None; - let mut revision_height__ = None; + let mut total_pruned_sequences__ = None; + let mut total_remaining_sequences__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map_.next_value()?); - } - GeneratedField::RevisionNumber => { - if revision_number__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionNumber")); + GeneratedField::TotalPrunedSequences => { + if total_pruned_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field( + "totalPrunedSequences", + )); } - revision_number__ = Some( + total_pruned_sequences__ = Some( map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } - GeneratedField::RevisionHeight => { - if revision_height__.is_some() { - return Err(serde::de::Error::duplicate_field("revisionHeight")); + GeneratedField::TotalRemainingSequences => { + if total_remaining_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field( + "totalRemainingSequences", + )); } - revision_height__ = Some( + total_remaining_sequences__ = Some( map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? .0, ); } } } - Ok(QueryChannelConsensusStateRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - revision_number: revision_number__.unwrap_or_default(), - revision_height: revision_height__.unwrap_or_default(), + Ok(MsgPruneAcknowledgementsResponse { + total_pruned_sequences: total_pruned_sequences__.unwrap_or_default(), + total_remaining_sequences: total_remaining_sequences__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateRequest", + "ibc.core.channel.v1.MsgPruneAcknowledgementsResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelConsensusStateResponse { +impl serde::Serialize for MsgRecvPacket { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4863,64 +5655,61 @@ impl serde::Serialize for QueryChannelConsensusStateResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.consensus_state.is_some() { - len += 1; - } - if !self.client_id.is_empty() { + if self.packet.is_some() { len += 1; } - if !self.proof.is_empty() { + if !self.proof_commitment.is_empty() { len += 1; } if self.proof_height.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateResponse", - len, - )?; - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; + if !self.signer.is_empty() { + len += 1; } - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgRecvPacket", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; } - if !self.proof.is_empty() { + if !self.proof_commitment.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), + "proofCommitment", + pbjson::private::base64::encode(&self.proof_commitment).as_str(), )?; } if let Some(v) = self.proof_height.as_ref() { struct_ser.serialize_field("proofHeight", v)?; } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { +impl<'de> serde::Deserialize<'de> for MsgRecvPacket { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ - "consensus_state", - "consensusState", - "client_id", - "clientId", - "proof", + "packet", + "proof_commitment", + "proofCommitment", "proof_height", "proofHeight", + "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ConsensusState, - ClientId, - Proof, + Packet, + ProofCommitment, ProofHeight, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4946,12 +5735,12 @@ impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { E: serde::de::Error, { match value { - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) + "packet" => Ok(GeneratedField::Packet), + "proofCommitment" | "proof_commitment" => { + Ok(GeneratedField::ProofCommitment) } - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "proof" => Ok(GeneratedField::Proof), "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4961,42 +5750,33 @@ impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelConsensusStateResponse; + type Value = MsgRecvPacket; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacket") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut consensus_state__ = None; - let mut client_id__ = None; - let mut proof__ = None; + let mut packet__ = None; + let mut proof_commitment__ = None; let mut proof_height__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map_.next_value()?; - } - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); } - client_id__ = Some(map_.next_value()?); + packet__ = map_.next_value()?; } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); + GeneratedField::ProofCommitment => { + if proof_commitment__.is_some() { + return Err(serde::de::Error::duplicate_field("proofCommitment")); } - proof__ = Some( + proof_commitment__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); @@ -5007,25 +5787,31 @@ impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { } proof_height__ = map_.next_value()?; } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } } } - Ok(QueryChannelConsensusStateResponse { - consensus_state: consensus_state__, - client_id: client_id__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), + Ok(MsgRecvPacket { + packet: packet__, + proof_commitment: proof_commitment__.unwrap_or_default(), proof_height: proof_height__, + signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelConsensusStateResponse", + "ibc.core.channel.v1.MsgRecvPacket", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelRequest { +impl serde::Serialize for MsgRecvPacketResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5033,36 +5819,32 @@ impl serde::Serialize for QueryChannelRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { + if self.result != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgRecvPacketResponse", len)?; + if self.result != 0 { + let v = ResponseResultType::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelRequest { +impl<'de> serde::Deserialize<'de> for MsgRecvPacketResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + const FIELDS: &[&str] = &["result"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, + Result, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5088,8 +5870,7 @@ impl<'de> serde::Deserialize<'de> for QueryChannelRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "result" => Ok(GeneratedField::Result), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5099,49 +5880,44 @@ impl<'de> serde::Deserialize<'de> for QueryChannelRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelRequest; + type Value = MsgRecvPacketResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgRecvPacketResponse") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; + let mut result__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); } - channel_id__ = Some(map_.next_value()?); + result__ = Some(map_.next_value::()? as i32); } } } - Ok(QueryChannelRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), + Ok(MsgRecvPacketResponse { + result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelRequest", + "ibc.core.channel.v1.MsgRecvPacketResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelResponse { +impl serde::Serialize for MsgTimeout { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5149,47 +5925,73 @@ impl serde::Serialize for QueryChannelResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.channel.is_some() { + if self.packet.is_some() { len += 1; } - if !self.proof.is_empty() { + if !self.proof_unreceived.is_empty() { len += 1; } if self.proof_height.is_some() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelResponse", len)?; - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; + if self.next_sequence_recv != 0 { + len += 1; } - if !self.proof.is_empty() { + if !self.signer.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgTimeout", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if !self.proof_unreceived.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), + "proofUnreceived", + pbjson::private::base64::encode(&self.proof_unreceived).as_str(), )?; } if let Some(v) = self.proof_height.as_ref() { struct_ser.serialize_field("proofHeight", v)?; } + if self.next_sequence_recv != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextSequenceRecv", + ToString::to_string(&self.next_sequence_recv).as_str(), + )?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelResponse { +impl<'de> serde::Deserialize<'de> for MsgTimeout { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["channel", "proof", "proof_height", "proofHeight"]; + const FIELDS: &[&str] = &[ + "packet", + "proof_unreceived", + "proofUnreceived", + "proof_height", + "proofHeight", + "next_sequence_recv", + "nextSequenceRecv", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Channel, - Proof, + Packet, + ProofUnreceived, ProofHeight, + NextSequenceRecv, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5215,9 +6017,15 @@ impl<'de> serde::Deserialize<'de> for QueryChannelResponse { E: serde::de::Error, { match value { - "channel" => Ok(GeneratedField::Channel), - "proof" => Ok(GeneratedField::Proof), + "packet" => Ok(GeneratedField::Packet), + "proofUnreceived" | "proof_unreceived" => { + Ok(GeneratedField::ProofUnreceived) + } "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "nextSequenceRecv" | "next_sequence_recv" => { + Ok(GeneratedField::NextSequenceRecv) + } + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5227,35 +6035,34 @@ impl<'de> serde::Deserialize<'de> for QueryChannelResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelResponse; + type Value = MsgTimeout; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgTimeout") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut channel__ = None; - let mut proof__ = None; + let mut packet__ = None; + let mut proof_unreceived__ = None; let mut proof_height__ = None; + let mut next_sequence_recv__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); } - channel__ = map_.next_value()?; + packet__ = map_.next_value()?; } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); + GeneratedField::ProofUnreceived => { + if proof_unreceived__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUnreceived")); } - proof__ = Some( + proof_unreceived__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); @@ -5266,24 +6073,37 @@ impl<'de> serde::Deserialize<'de> for QueryChannelResponse { } proof_height__ = map_.next_value()?; } + GeneratedField::NextSequenceRecv => { + if next_sequence_recv__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); + } + next_sequence_recv__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } } } - Ok(QueryChannelResponse { - channel: channel__, - proof: proof__.unwrap_or_default(), + Ok(MsgTimeout { + packet: packet__, + proof_unreceived: proof_unreceived__.unwrap_or_default(), proof_height: proof_height__, + next_sequence_recv: next_sequence_recv__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelResponse", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("ibc.core.channel.v1.MsgTimeout", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelsRequest { +impl serde::Serialize for MsgTimeoutOnClose { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5291,29 +6111,100 @@ impl serde::Serialize for QueryChannelsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if self.pagination.is_some() { + if self.packet.is_some() { + len += 1; + } + if !self.proof_unreceived.is_empty() { + len += 1; + } + if !self.proof_close.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + if self.next_sequence_recv != 0 { + len += 1; + } + if !self.signer.is_empty() { + len += 1; + } + if self.counterparty_upgrade_sequence != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelsRequest", len)?; - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutOnClose", len)?; + if let Some(v) = self.packet.as_ref() { + struct_ser.serialize_field("packet", v)?; + } + if !self.proof_unreceived.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proofUnreceived", + pbjson::private::base64::encode(&self.proof_unreceived).as_str(), + )?; + } + if !self.proof_close.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proofClose", + pbjson::private::base64::encode(&self.proof_close).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if self.next_sequence_recv != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextSequenceRecv", + ToString::to_string(&self.next_sequence_recv).as_str(), + )?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if self.counterparty_upgrade_sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "counterpartyUpgradeSequence", + ToString::to_string(&self.counterparty_upgrade_sequence).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { +impl<'de> serde::Deserialize<'de> for MsgTimeoutOnClose { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["pagination"]; + const FIELDS: &[&str] = &[ + "packet", + "proof_unreceived", + "proofUnreceived", + "proof_close", + "proofClose", + "proof_height", + "proofHeight", + "next_sequence_recv", + "nextSequenceRecv", + "signer", + "counterparty_upgrade_sequence", + "counterpartyUpgradeSequence", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Pagination, + Packet, + ProofUnreceived, + ProofClose, + ProofHeight, + NextSequenceRecv, + Signer, + CounterpartyUpgradeSequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5339,7 +6230,19 @@ impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { E: serde::de::Error, { match value { - "pagination" => Ok(GeneratedField::Pagination), + "packet" => Ok(GeneratedField::Packet), + "proofUnreceived" | "proof_unreceived" => { + Ok(GeneratedField::ProofUnreceived) + } + "proofClose" | "proof_close" => Ok(GeneratedField::ProofClose), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "nextSequenceRecv" | "next_sequence_recv" => { + Ok(GeneratedField::NextSequenceRecv) + } + "signer" => Ok(GeneratedField::Signer), + "counterpartyUpgradeSequence" | "counterparty_upgrade_sequence" => { + Ok(GeneratedField::CounterpartyUpgradeSequence) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5349,44 +6252,104 @@ impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelsRequest; + type Value = MsgTimeoutOnClose; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelsRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnClose") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut pagination__ = None; + let mut packet__ = None; + let mut proof_unreceived__ = None; + let mut proof_close__ = None; + let mut proof_height__ = None; + let mut next_sequence_recv__ = None; + let mut signer__ = None; + let mut counterparty_upgrade_sequence__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::Packet => { + if packet__.is_some() { + return Err(serde::de::Error::duplicate_field("packet")); } - pagination__ = map_.next_value()?; + packet__ = map_.next_value()?; + } + GeneratedField::ProofUnreceived => { + if proof_unreceived__.is_some() { + return Err(serde::de::Error::duplicate_field("proofUnreceived")); + } + proof_unreceived__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofClose => { + if proof_close__.is_some() { + return Err(serde::de::Error::duplicate_field("proofClose")); + } + proof_close__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::NextSequenceRecv => { + if next_sequence_recv__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceRecv")); + } + next_sequence_recv__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::CounterpartyUpgradeSequence => { + if counterparty_upgrade_sequence__.is_some() { + return Err(serde::de::Error::duplicate_field( + "counterpartyUpgradeSequence", + )); + } + counterparty_upgrade_sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(QueryChannelsRequest { - pagination: pagination__, + Ok(MsgTimeoutOnClose { + packet: packet__, + proof_unreceived: proof_unreceived__.unwrap_or_default(), + proof_close: proof_close__.unwrap_or_default(), + proof_height: proof_height__, + next_sequence_recv: next_sequence_recv__.unwrap_or_default(), + signer: signer__.unwrap_or_default(), + counterparty_upgrade_sequence: counterparty_upgrade_sequence__ + .unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelsRequest", + "ibc.core.channel.v1.MsgTimeoutOnClose", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryChannelsResponse { +impl serde::Serialize for MsgTimeoutOnCloseResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5394,43 +6357,32 @@ impl serde::Serialize for QueryChannelsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.channels.is_empty() { - len += 1; - } - if self.pagination.is_some() { - len += 1; - } - if self.height.is_some() { + if self.result != 0 { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryChannelsResponse", len)?; - if !self.channels.is_empty() { - struct_ser.serialize_field("channels", &self.channels)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutOnCloseResponse", len)?; + if self.result != 0 { + let v = ResponseResultType::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { +impl<'de> serde::Deserialize<'de> for MsgTimeoutOnCloseResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["channels", "pagination", "height"]; + const FIELDS: &[&str] = &["result"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Channels, - Pagination, - Height, + Result, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5456,9 +6408,7 @@ impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { E: serde::de::Error, { match value { - "channels" => Ok(GeneratedField::Channels), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), + "result" => Ok(GeneratedField::Result), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5468,60 +6418,44 @@ impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryChannelsResponse; + type Value = MsgTimeoutOnCloseResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryChannelsResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutOnCloseResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut channels__ = None; - let mut pagination__ = None; - let mut height__ = None; + let mut result__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); } - height__ = map_.next_value()?; + result__ = Some(map_.next_value::()? as i32); } } } - Ok(QueryChannelsResponse { - channels: channels__.unwrap_or_default(), - pagination: pagination__, - height: height__, + Ok(MsgTimeoutOnCloseResponse { + result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryChannelsResponse", + "ibc.core.channel.v1.MsgTimeoutOnCloseResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryConnectionChannelsRequest { +impl serde::Serialize for MsgTimeoutResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5529,36 +6463,32 @@ impl serde::Serialize for QueryConnectionChannelsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.connection.is_empty() { - len += 1; - } - if self.pagination.is_some() { + if self.result != 0 { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsRequest", len)?; - if !self.connection.is_empty() { - struct_ser.serialize_field("connection", &self.connection)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgTimeoutResponse", len)?; + if self.result != 0 { + let v = ResponseResultType::try_from(self.result).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.result)) + })?; + struct_ser.serialize_field("result", &v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { +impl<'de> serde::Deserialize<'de> for MsgTimeoutResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["connection", "pagination"]; + const FIELDS: &[&str] = &["result"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Connection, - Pagination, + Result, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5584,8 +6514,7 @@ impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { E: serde::de::Error, { match value { - "connection" => Ok(GeneratedField::Connection), - "pagination" => Ok(GeneratedField::Pagination), + "result" => Ok(GeneratedField::Result), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5595,52 +6524,41 @@ impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionChannelsRequest; + type Value = MsgTimeoutResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgTimeoutResponse") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut connection__ = None; - let mut pagination__ = None; + let mut result__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Connection => { - if connection__.is_some() { - return Err(serde::de::Error::duplicate_field("connection")); - } - connection__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::Result => { + if result__.is_some() { + return Err(serde::de::Error::duplicate_field("result")); } - pagination__ = map_.next_value()?; + result__ = Some(map_.next_value::()? as i32); } } } - Ok(QueryConnectionChannelsRequest { - connection: connection__.unwrap_or_default(), - pagination: pagination__, + Ok(MsgTimeoutResponse { + result: result__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryConnectionChannelsRequest", + "ibc.core.channel.v1.MsgTimeoutResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryConnectionChannelsResponse { +impl serde::Serialize for MsgUpdateParams { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -5648,43 +6566,36 @@ impl serde::Serialize for QueryConnectionChannelsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.channels.is_empty() { - len += 1; - } - if self.pagination.is_some() { + if !self.authority.is_empty() { len += 1; } - if self.height.is_some() { + if self.params.is_some() { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsResponse", len)?; - if !self.channels.is_empty() { - struct_ser.serialize_field("channels", &self.channels)?; - } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgUpdateParams", len)?; + if !self.authority.is_empty() { + struct_ser.serialize_field("authority", &self.authority)?; } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["channels", "pagination", "height"]; + const FIELDS: &[&str] = &["authority", "params"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Channels, - Pagination, - Height, + Authority, + Params, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -5710,9 +6621,8 @@ impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { E: serde::de::Error, { match value { - "channels" => Ok(GeneratedField::Channels), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), + "authority" => Ok(GeneratedField::Authority), + "params" => Ok(GeneratedField::Params), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -5722,98 +6632,72 @@ impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryConnectionChannelsResponse; + type Value = MsgUpdateParams; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsResponse") + formatter.write_str("struct ibc.core.channel.v1.MsgUpdateParams") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut channels__ = None; - let mut pagination__ = None; - let mut height__ = None; + let mut authority__ = None; + let mut params__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Channels => { - if channels__.is_some() { - return Err(serde::de::Error::duplicate_field("channels")); - } - channels__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::Authority => { + if authority__.is_some() { + return Err(serde::de::Error::duplicate_field("authority")); } - pagination__ = map_.next_value()?; + authority__ = Some(map_.next_value()?); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); } - height__ = map_.next_value()?; + params__ = map_.next_value()?; } } } - Ok(QueryConnectionChannelsResponse { - channels: channels__.unwrap_or_default(), - pagination: pagination__, - height: height__, + Ok(MsgUpdateParams { + authority: authority__.unwrap_or_default(), + params: params__, }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryConnectionChannelsResponse", + "ibc.core.channel.v1.MsgUpdateParams", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryNextSequenceReceiveRequest { +impl serde::Serialize for MsgUpdateParamsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } + let len = 0; + let struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.MsgUpdateParamsResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - PortId, - ChannelId, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -5837,11 +6721,7 @@ impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { where E: serde::de::Error, { - match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -5849,211 +6729,106 @@ impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryNextSequenceReceiveRequest; + type Value = MsgUpdateParamsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveRequest") + formatter.write_str("struct ibc.core.channel.v1.MsgUpdateParamsResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map_.next_value()?); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(QueryNextSequenceReceiveRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - }) + Ok(MsgUpdateParamsResponse {}) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryNextSequenceReceiveRequest", + "ibc.core.channel.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryNextSequenceReceiveResponse { +impl serde::Serialize for Order { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - use serde::ser::SerializeStruct; - let mut len = 0; - if self.next_sequence_receive != 0 { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveResponse", len)?; - if self.next_sequence_receive != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "nextSequenceReceive", - ToString::to_string(&self.next_sequence_receive).as_str(), - )?; - } - if !self.proof.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } - struct_ser.end() - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveResponse { - #[allow(deprecated)] + let variant = match self { + Self::NoneUnspecified => "ORDER_NONE_UNSPECIFIED", + Self::Unordered => "ORDER_UNORDERED", + Self::Ordered => "ORDER_ORDERED", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Order { + #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "next_sequence_receive", - "nextSequenceReceive", - "proof", - "proof_height", - "proofHeight", - ]; + const FIELDS: &[&str] = &["ORDER_NONE_UNSPECIFIED", "ORDER_UNORDERED", "ORDER_ORDERED"]; - #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NextSequenceReceive, - Proof, - ProofHeight, - } - #[cfg(feature = "serde")] - impl<'de> serde::Deserialize<'de> for GeneratedField { - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - struct GeneratedVisitor; + struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = GeneratedField; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Order; - fn expecting( - &self, - formatter: &mut std::fmt::Formatter<'_>, - ) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } + 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 { - "nextSequenceReceive" | "next_sequence_receive" => { - Ok(GeneratedField::NextSequenceReceive) - } - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } - } - } - deserializer.deserialize_identifier(GeneratedVisitor) + 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) + }) } - } - struct GeneratedVisitor; - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryNextSequenceReceiveResponse; - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveResponse") + 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_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_str(self, value: &str) -> std::result::Result where - V: serde::de::MapAccess<'de>, + E: serde::de::Error, { - let mut next_sequence_receive__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::NextSequenceReceive => { - if next_sequence_receive__.is_some() { - return Err(serde::de::Error::duplicate_field( - "nextSequenceReceive", - )); - } - next_sequence_receive__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map_.next_value()?; - } - } + match value { + "ORDER_NONE_UNSPECIFIED" => Ok(Order::NoneUnspecified), + "ORDER_UNORDERED" => Ok(Order::Unordered), + "ORDER_ORDERED" => Ok(Order::Ordered), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), } - Ok(QueryNextSequenceReceiveResponse { - next_sequence_receive: next_sequence_receive__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryNextSequenceReceiveResponse", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_any(GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketAcknowledgementRequest { +impl serde::Serialize for Packet { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6061,44 +6836,99 @@ impl serde::Serialize for QueryPacketAcknowledgementRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.sequence != 0 { len += 1; } - if !self.channel_id.is_empty() { + if !self.source_port.is_empty() { len += 1; } - if self.sequence != 0 { + if !self.source_channel.is_empty() { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; + if !self.destination_port.is_empty() { + len += 1; } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + if !self.destination_channel.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + if self.timeout_height.is_some() { + len += 1; + } + if self.timeout_timestamp != 0 { + len += 1; } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Packet", len)?; if self.sequence != 0 { #[allow(clippy::needless_borrow)] struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; } + if !self.source_port.is_empty() { + struct_ser.serialize_field("sourcePort", &self.source_port)?; + } + if !self.source_channel.is_empty() { + struct_ser.serialize_field("sourceChannel", &self.source_channel)?; + } + if !self.destination_port.is_empty() { + struct_ser.serialize_field("destinationPort", &self.destination_port)?; + } + if !self.destination_channel.is_empty() { + struct_ser.serialize_field("destinationChannel", &self.destination_channel)?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if let Some(v) = self.timeout_height.as_ref() { + struct_ser.serialize_field("timeoutHeight", v)?; + } + if self.timeout_timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "timeoutTimestamp", + ToString::to_string(&self.timeout_timestamp).as_str(), + )?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { +impl<'de> serde::Deserialize<'de> for Packet { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + const FIELDS: &[&str] = &[ + "sequence", + "source_port", + "sourcePort", + "source_channel", + "sourceChannel", + "destination_port", + "destinationPort", + "destination_channel", + "destinationChannel", + "data", + "timeout_height", + "timeoutHeight", + "timeout_timestamp", + "timeoutTimestamp", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, Sequence, + SourcePort, + SourceChannel, + DestinationPort, + DestinationChannel, + Data, + TimeoutHeight, + TimeoutTimestamp, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6124,9 +6954,20 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), "sequence" => Ok(GeneratedField::Sequence), + "sourcePort" | "source_port" => Ok(GeneratedField::SourcePort), + "sourceChannel" | "source_channel" => Ok(GeneratedField::SourceChannel), + "destinationPort" | "destination_port" => { + Ok(GeneratedField::DestinationPort) + } + "destinationChannel" | "destination_channel" => { + Ok(GeneratedField::DestinationChannel) + } + "data" => Ok(GeneratedField::Data), + "timeoutHeight" | "timeout_height" => Ok(GeneratedField::TimeoutHeight), + "timeoutTimestamp" | "timeout_timestamp" => { + Ok(GeneratedField::TimeoutTimestamp) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6136,36 +6977,26 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementRequest; + type Value = Packet; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementRequest") + formatter.write_str("struct ibc.core.channel.v1.Packet") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; let mut sequence__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map_.next_value()?); - } + let mut source_port__ = None; + let mut source_channel__ = None; + let mut destination_port__ = None; + let mut destination_channel__ = None; + let mut data__ = None; + let mut timeout_height__ = None; + let mut timeout_timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { GeneratedField::Sequence => { if sequence__.is_some() { return Err(serde::de::Error::duplicate_field("sequence")); @@ -6175,24 +7006,75 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { .0, ); } + GeneratedField::SourcePort => { + if source_port__.is_some() { + return Err(serde::de::Error::duplicate_field("sourcePort")); + } + source_port__ = Some(map_.next_value()?); + } + GeneratedField::SourceChannel => { + if source_channel__.is_some() { + return Err(serde::de::Error::duplicate_field("sourceChannel")); + } + source_channel__ = Some(map_.next_value()?); + } + GeneratedField::DestinationPort => { + if destination_port__.is_some() { + return Err(serde::de::Error::duplicate_field("destinationPort")); + } + destination_port__ = Some(map_.next_value()?); + } + GeneratedField::DestinationChannel => { + if destination_channel__.is_some() { + return Err(serde::de::Error::duplicate_field( + "destinationChannel", + )); + } + destination_channel__ = Some(map_.next_value()?); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::TimeoutHeight => { + if timeout_height__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutHeight")); + } + timeout_height__ = map_.next_value()?; + } + GeneratedField::TimeoutTimestamp => { + if timeout_timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timeoutTimestamp")); + } + timeout_timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } } } - Ok(QueryPacketAcknowledgementRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), + Ok(Packet { sequence: sequence__.unwrap_or_default(), + source_port: source_port__.unwrap_or_default(), + source_channel: source_channel__.unwrap_or_default(), + destination_port: destination_port__.unwrap_or_default(), + destination_channel: destination_channel__.unwrap_or_default(), + data: data__.unwrap_or_default(), + timeout_height: timeout_height__, + timeout_timestamp: timeout_timestamp__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementRequest", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("ibc.core.channel.v1.Packet", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketAcknowledgementResponse { +impl serde::Serialize for PacketId { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6200,53 +7082,43 @@ impl serde::Serialize for QueryPacketAcknowledgementResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.acknowledgement.is_empty() { + if !self.port_id.is_empty() { len += 1; } - if !self.proof.is_empty() { + if !self.channel_id.is_empty() { len += 1; } - if self.proof_height.is_some() { + if self.sequence != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", - len, - )?; - if !self.acknowledgement.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "acknowledgement", - pbjson::private::base64::encode(&self.acknowledgement).as_str(), - )?; + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketId", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if !self.proof.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { +impl<'de> serde::Deserialize<'de> for PacketId { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["acknowledgement", "proof", "proof_height", "proofHeight"]; + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Acknowledgement, - Proof, - ProofHeight, + PortId, + ChannelId, + Sequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6272,9 +7144,9 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { E: serde::de::Error, { match value { - "acknowledgement" => Ok(GeneratedField::Acknowledgement), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6284,66 +7156,56 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementResponse; + type Value = PacketId; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementResponse") + formatter.write_str("struct ibc.core.channel.v1.PacketId") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut acknowledgement__ = None; - let mut proof__ = None; - let mut proof_height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Acknowledgement => { - if acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgement")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - acknowledgement__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + port_id__ = Some(map_.next_value()?); } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + channel_id__ = Some(map_.next_value()?); } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); } - proof_height__ = map_.next_value()?; + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(QueryPacketAcknowledgementResponse { - acknowledgement: acknowledgement__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, + Ok(PacketId { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("ibc.core.channel.v1.PacketId", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketAcknowledgementsRequest { +impl serde::Serialize for PacketSequence { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6357,61 +7219,38 @@ impl serde::Serialize for QueryPacketAcknowledgementsRequest { if !self.channel_id.is_empty() { len += 1; } - if self.pagination.is_some() { - len += 1; - } - if !self.packet_commitment_sequences.is_empty() { + if self.sequence != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", - len, - )?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.PacketSequence", len)?; if !self.port_id.is_empty() { struct_ser.serialize_field("portId", &self.port_id)?; } if !self.channel_id.is_empty() { struct_ser.serialize_field("channelId", &self.channel_id)?; } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; - } - if !self.packet_commitment_sequences.is_empty() { - struct_ser.serialize_field( - "packetCommitmentSequences", - &self - .packet_commitment_sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { +impl<'de> serde::Deserialize<'de> for PacketSequence { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "pagination", - "packet_commitment_sequences", - "packetCommitmentSequences", - ]; + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { PortId, ChannelId, - Pagination, - PacketCommitmentSequences, + Sequence, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6439,10 +7278,7 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { match value { "portId" | "port_id" => Ok(GeneratedField::PortId), "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "pagination" => Ok(GeneratedField::Pagination), - "packetCommitmentSequences" | "packet_commitment_sequences" => { - Ok(GeneratedField::PacketCommitmentSequences) - } + "sequence" => Ok(GeneratedField::Sequence), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6452,23 +7288,19 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementsRequest; + type Value = PacketSequence; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsRequest") + formatter.write_str("struct ibc.core.channel.v1.PacketSequence") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut port_id__ = None; let mut channel_id__ = None; - let mut pagination__ = None; - let mut packet_commitment_sequences__ = None; + let mut sequence__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::PortId => { @@ -6483,44 +7315,33 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { } channel_id__ = Some(map_.next_value()?); } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); - } - pagination__ = map_.next_value()?; - } - GeneratedField::PacketCommitmentSequences => { - if packet_commitment_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetCommitmentSequences", - )); + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); } - packet_commitment_sequences__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, ); } } } - Ok(QueryPacketAcknowledgementsRequest { + Ok(PacketSequence { port_id: port_id__.unwrap_or_default(), channel_id: channel_id__.unwrap_or_default(), - pagination: pagination__, - packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + "ibc.core.channel.v1.PacketSequence", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketAcknowledgementsResponse { +impl serde::Serialize for PacketState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6528,45 +7349,59 @@ impl serde::Serialize for QueryPacketAcknowledgementsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.acknowledgements.is_empty() { + if !self.port_id.is_empty() { len += 1; } - if self.pagination.is_some() { + if !self.channel_id.is_empty() { len += 1; } - if self.height.is_some() { + if self.sequence != 0 { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", - len, - )?; - if !self.acknowledgements.is_empty() { - struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; + if !self.data.is_empty() { + len += 1; } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.PacketState", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { +impl<'de> serde::Deserialize<'de> for PacketState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["acknowledgements", "pagination", "height"]; + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "sequence", + "data", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Acknowledgements, - Pagination, - Height, + PortId, + ChannelId, + Sequence, + Data, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6592,9 +7427,10 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { E: serde::de::Error, { match value { - "acknowledgements" => Ok(GeneratedField::Acknowledgements), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), + "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6604,61 +7440,67 @@ impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketAcknowledgementsResponse; + type Value = PacketState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsResponse") + formatter.write_str("struct ibc.core.channel.v1.PacketState") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut acknowledgements__ = None; - let mut pagination__ = None; - let mut height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + let mut data__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Acknowledgements => { - if acknowledgements__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgements")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - acknowledgements__ = Some(map_.next_value()?); + port_id__ = Some(map_.next_value()?); } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - pagination__ = map_.next_value()?; + channel_id__ = Some(map_.next_value()?); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); } - height__ = map_.next_value()?; + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); } } } - Ok(QueryPacketAcknowledgementsResponse { - acknowledgements: acknowledgements__.unwrap_or_default(), - pagination: pagination__, - height: height__, + Ok(PacketState { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + data: data__.unwrap_or_default(), }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("ibc.core.channel.v1.PacketState", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketCommitmentRequest { +impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6666,44 +7508,28 @@ impl serde::Serialize for QueryPacketCommitmentRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.upgrade_timeout.is_some() { len += 1; } - if !self.channel_id.is_empty() { - len += 1; - } - if self.sequence != 0 { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Params", len)?; + if let Some(v) = self.upgrade_timeout.as_ref() { + struct_ser.serialize_field("upgradeTimeout", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentRequest { +impl<'de> serde::Deserialize<'de> for Params { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + const FIELDS: &[&str] = &["upgrade_timeout", "upgradeTimeout"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - Sequence, + UpgradeTimeout, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6729,9 +7555,9 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), + "upgradeTimeout" | "upgrade_timeout" => { + Ok(GeneratedField::UpgradeTimeout) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6741,63 +7567,37 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentRequest; + type Value = Params; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentRequest") + formatter.write_str("struct ibc.core.channel.v1.Params") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; + let mut upgrade_timeout__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); - } - channel_id__ = Some(map_.next_value()?); - } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::UpgradeTimeout => { + if upgrade_timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("upgradeTimeout")); } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); + upgrade_timeout__ = map_.next_value()?; } } } - Ok(QueryPacketCommitmentRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), + Ok(Params { + upgrade_timeout: upgrade_timeout__, }) } } - deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentRequest", - FIELDS, - GeneratedVisitor, - ) + deserializer.deserialize_struct("ibc.core.channel.v1.Params", FIELDS, GeneratedVisitor) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketCommitmentResponse { +impl serde::Serialize for QueryChannelClientStateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6805,51 +7605,36 @@ impl serde::Serialize for QueryPacketCommitmentResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.commitment.is_empty() { - len += 1; - } - if !self.proof.is_empty() { + if !self.port_id.is_empty() { len += 1; } - if self.proof_height.is_some() { + if !self.channel_id.is_empty() { len += 1; } let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentResponse", len)?; - if !self.commitment.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "commitment", - pbjson::private::base64::encode(&self.commitment).as_str(), - )?; - } - if !self.proof.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; + .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { +impl<'de> serde::Deserialize<'de> for QueryChannelClientStateRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["commitment", "proof", "proof_height", "proofHeight"]; + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Commitment, - Proof, - ProofHeight, + PortId, + ChannelId, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -6875,9 +7660,8 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { E: serde::de::Error, { match value { - "commitment" => Ok(GeneratedField::Commitment), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -6887,66 +7671,52 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentResponse; + type Value = QueryChannelClientStateRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentResponse") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut commitment__ = None; - let mut proof__ = None; - let mut proof_height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Commitment => { - if commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("commitment")); - } - commitment__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - proof__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + port_id__ = Some(map_.next_value()?); } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - proof_height__ = map_.next_value()?; + channel_id__ = Some(map_.next_value()?); } } } - Ok(QueryPacketCommitmentResponse { - commitment: commitment__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, + Ok(QueryChannelClientStateRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentResponse", + "ibc.core.channel.v1.QueryChannelClientStateRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketCommitmentsRequest { +impl serde::Serialize for QueryChannelClientStateResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -6954,43 +7724,53 @@ impl serde::Serialize for QueryPacketCommitmentsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.identified_client_state.is_some() { len += 1; } - if !self.channel_id.is_empty() { + if !self.proof.is_empty() { len += 1; } - if self.pagination.is_some() { + if self.proof_height.is_some() { len += 1; } let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; + .serialize_struct("ibc.core.channel.v1.QueryChannelClientStateResponse", len)?; + if let Some(v) = self.identified_client_state.as_ref() { + struct_ser.serialize_field("identifiedClientState", v)?; } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsRequest { +impl<'de> serde::Deserialize<'de> for QueryChannelClientStateResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "pagination"]; + const FIELDS: &[&str] = &[ + "identified_client_state", + "identifiedClientState", + "proof", + "proof_height", + "proofHeight", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - Pagination, + IdentifiedClientState, + Proof, + ProofHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7016,9 +7796,11 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "pagination" => Ok(GeneratedField::Pagination), + "identifiedClientState" | "identified_client_state" => { + Ok(GeneratedField::IdentifiedClientState) + } + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7028,60 +7810,65 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentsRequest; + type Value = QueryChannelClientStateResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsRequest") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelClientStateResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut pagination__ = None; + let mut identified_client_state__ = None; + let mut proof__ = None; + let mut proof_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); + GeneratedField::IdentifiedClientState => { + if identified_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "identifiedClientState", + )); } - port_id__ = Some(map_.next_value()?); + identified_client_state__ = map_.next_value()?; } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); } - channel_id__ = Some(map_.next_value()?); + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); } - pagination__ = map_.next_value()?; + proof_height__ = map_.next_value()?; } } } - Ok(QueryPacketCommitmentsRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - pagination: pagination__, + Ok(QueryChannelClientStateResponse { + identified_client_state: identified_client_state__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentsRequest", + "ibc.core.channel.v1.QueryChannelClientStateResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketCommitmentsResponse { +impl serde::Serialize for QueryChannelConsensusStateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7089,43 +7876,67 @@ impl serde::Serialize for QueryPacketCommitmentsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.commitments.is_empty() { + if !self.port_id.is_empty() { len += 1; } - if self.pagination.is_some() { + if !self.channel_id.is_empty() { len += 1; } - if self.height.is_some() { + if self.revision_number != 0 { + len += 1; + } + if self.revision_height != 0 { len += 1; } let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsResponse", len)?; - if !self.commitments.is_empty() { - struct_ser.serialize_field("commitments", &self.commitments)?; + .serialize_struct("ibc.core.channel.v1.QueryChannelConsensusStateRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if let Some(v) = self.pagination.as_ref() { - struct_ser.serialize_field("pagination", v)?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + if self.revision_number != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "revisionNumber", + ToString::to_string(&self.revision_number).as_str(), + )?; + } + if self.revision_height != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "revisionHeight", + ToString::to_string(&self.revision_height).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { +impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["commitments", "pagination", "height"]; + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Commitments, - Pagination, - Height, + PortId, + ChannelId, + RevisionNumber, + RevisionHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7151,9 +7962,14 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { E: serde::de::Error, { match value { - "commitments" => Ok(GeneratedField::Commitments), - "pagination" => Ok(GeneratedField::Pagination), - "height" => Ok(GeneratedField::Height), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "revisionNumber" | "revision_number" => { + Ok(GeneratedField::RevisionNumber) + } + "revisionHeight" | "revision_height" => { + Ok(GeneratedField::RevisionHeight) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7163,60 +7979,74 @@ impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketCommitmentsResponse; + type Value = QueryChannelConsensusStateRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsResponse") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut commitments__ = None; - let mut pagination__ = None; - let mut height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; + let mut revision_number__ = None; + let mut revision_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Commitments => { - if commitments__.is_some() { - return Err(serde::de::Error::duplicate_field("commitments")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - commitments__ = Some(map_.next_value()?); + port_id__ = Some(map_.next_value()?); } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - pagination__ = map_.next_value()?; + channel_id__ = Some(map_.next_value()?); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); } - height__ = map_.next_value()?; + revision_number__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::RevisionHeight => { + if revision_height__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionHeight")); + } + revision_height__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); } } } - Ok(QueryPacketCommitmentsResponse { - commitments: commitments__.unwrap_or_default(), - pagination: pagination__, - height: height__, + Ok(QueryChannelConsensusStateRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketCommitmentsResponse", + "ibc.core.channel.v1.QueryChannelConsensusStateRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketReceiptRequest { +impl serde::Serialize for QueryChannelConsensusStateResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7224,44 +8054,64 @@ impl serde::Serialize for QueryPacketReceiptRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.consensus_state.is_some() { len += 1; } - if !self.channel_id.is_empty() { + if !self.client_id.is_empty() { len += 1; } - if self.sequence != 0 { + if !self.proof.is_empty() { len += 1; } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; + if self.proof_height.is_some() { + len += 1; } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + let mut struct_ser = serializer.serialize_struct( + "ibc.core.channel.v1.QueryChannelConsensusStateResponse", + len, + )?; + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; } - if self.sequence != 0 { + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if !self.proof.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketReceiptRequest { +impl<'de> serde::Deserialize<'de> for QueryChannelConsensusStateResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + const FIELDS: &[&str] = &[ + "consensus_state", + "consensusState", + "client_id", + "clientId", + "proof", + "proof_height", + "proofHeight", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - Sequence, + ConsensusState, + ClientId, + Proof, + ProofHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7287,9 +8137,12 @@ impl<'de> serde::Deserialize<'de> for QueryPacketReceiptRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "sequence" => Ok(GeneratedField::Sequence), + "consensusState" | "consensus_state" => { + Ok(GeneratedField::ConsensusState) + } + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7299,112 +8152,94 @@ impl<'de> serde::Deserialize<'de> for QueryPacketReceiptRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketReceiptRequest; + type Value = QueryChannelConsensusStateResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptRequest") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelConsensusStateResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut sequence__ = None; + let mut consensus_state__ = None; + let mut client_id__ = None; + let mut proof__ = None; + let mut proof_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); } - port_id__ = Some(map_.next_value()?); + consensus_state__ = map_.next_value()?; } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); } - channel_id__ = Some(map_.next_value()?); + client_id__ = Some(map_.next_value()?); } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } } } - Ok(QueryPacketReceiptRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), + Ok(QueryChannelConsensusStateResponse { + consensus_state: consensus_state__, + client_id: client_id__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketReceiptRequest", + "ibc.core.channel.v1.QueryChannelConsensusStateResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryPacketReceiptResponse { +impl serde::Serialize for QueryChannelParamsRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if self.received { - len += 1; - } - if !self.proof.is_empty() { - len += 1; - } - if self.proof_height.is_some() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptResponse", len)?; - if self.received { - struct_ser.serialize_field("received", &self.received)?; - } - if !self.proof.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), - )?; - } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; - } + let len = 0; + let struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelParamsRequest", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { +impl<'de> serde::Deserialize<'de> for QueryChannelParamsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["received", "proof", "proof_height", "proofHeight"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Received, - Proof, - ProofHeight, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -7428,12 +8263,7 @@ impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { where E: serde::de::Error, { - match value { - "received" => Ok(GeneratedField::Received), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -7441,63 +8271,34 @@ impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryPacketReceiptResponse; + type Value = QueryChannelParamsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptResponse") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelParamsRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut received__ = None; - let mut proof__ = None; - let mut proof_height__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Received => { - if received__.is_some() { - return Err(serde::de::Error::duplicate_field("received")); - } - received__ = Some(map_.next_value()?); - } - GeneratedField::Proof => { - if proof__.is_some() { - return Err(serde::de::Error::duplicate_field("proof")); - } - proof__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofHeight => { - if proof_height__.is_some() { - return Err(serde::de::Error::duplicate_field("proofHeight")); - } - proof_height__ = map_.next_value()?; - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(QueryPacketReceiptResponse { - received: received__.unwrap_or_default(), - proof: proof__.unwrap_or_default(), - proof_height: proof_height__, - }) + Ok(QueryChannelParamsRequest {}) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryPacketReceiptResponse", + "ibc.core.channel.v1.QueryChannelParamsRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUnreceivedAcksRequest { +impl serde::Serialize for QueryChannelParamsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7505,57 +8306,29 @@ impl serde::Serialize for QueryUnreceivedAcksRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { - len += 1; - } - if !self.channel_id.is_empty() { - len += 1; - } - if !self.packet_ack_sequences.is_empty() { + if self.params.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; - } - if !self.packet_ack_sequences.is_empty() { - struct_ser.serialize_field( - "packetAckSequences", - &self - .packet_ack_sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { +impl<'de> serde::Deserialize<'de> for QueryChannelParamsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "packet_ack_sequences", - "packetAckSequences", - ]; + const FIELDS: &[&str] = &["params"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - PacketAckSequences, + Params, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7581,11 +8354,7 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "packetAckSequences" | "packet_ack_sequences" => { - Ok(GeneratedField::PacketAckSequences) - } + "params" => Ok(GeneratedField::Params), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7595,67 +8364,42 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedAcksRequest; + type Value = QueryChannelParamsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksRequest") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelParamsResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut packet_ack_sequences__ = None; + let mut params__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); - } - port_id__ = Some(map_.next_value()?); - } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); } - channel_id__ = Some(map_.next_value()?); - } - GeneratedField::PacketAckSequences => { - if packet_ack_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetAckSequences", - )); - } - packet_ack_sequences__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); + params__ = map_.next_value()?; } } } - Ok(QueryUnreceivedAcksRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - packet_ack_sequences: packet_ack_sequences__.unwrap_or_default(), - }) + Ok(QueryChannelParamsResponse { params: params__ }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedAcksRequest", + "ibc.core.channel.v1.QueryChannelParamsResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUnreceivedAcksResponse { +impl serde::Serialize for QueryChannelRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7663,43 +8407,36 @@ impl serde::Serialize for QueryUnreceivedAcksResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sequences.is_empty() { + if !self.port_id.is_empty() { len += 1; } - if self.height.is_some() { + if !self.channel_id.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksResponse", len)?; - if !self.sequences.is_empty() { - struct_ser.serialize_field( - "sequences", - &self - .sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { +impl<'de> serde::Deserialize<'de> for QueryChannelRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["sequences", "height"]; + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequences, - Height, + PortId, + ChannelId, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7725,8 +8462,8 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { E: serde::de::Error, { match value { - "sequences" => Ok(GeneratedField::Sequences), - "height" => Ok(GeneratedField::Height), + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7736,57 +8473,49 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedAcksResponse; + type Value = QueryChannelRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksResponse") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelRequest") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequences__ = None; - let mut height__ = None; + let mut port_id__ = None; + let mut channel_id__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequences => { - if sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("sequences")); + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); } - sequences__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); + port_id__ = Some(map_.next_value()?); } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); } - height__ = map_.next_value()?; + channel_id__ = Some(map_.next_value()?); } } } - Ok(QueryUnreceivedAcksResponse { - sequences: sequences__.unwrap_or_default(), - height: height__, + Ok(QueryChannelRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedAcksResponse", + "ibc.core.channel.v1.QueryChannelRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUnreceivedPacketsRequest { +impl serde::Serialize for QueryChannelResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7794,57 +8523,47 @@ impl serde::Serialize for QueryUnreceivedPacketsRequest { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.port_id.is_empty() { + if self.channel.is_some() { len += 1; } - if !self.channel_id.is_empty() { + if !self.proof.is_empty() { len += 1; } - if !self.packet_commitment_sequences.is_empty() { + if self.proof_height.is_some() { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsRequest", len)?; - if !self.port_id.is_empty() { - struct_ser.serialize_field("portId", &self.port_id)?; - } - if !self.channel_id.is_empty() { - struct_ser.serialize_field("channelId", &self.channel_id)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelResponse", len)?; + if let Some(v) = self.channel.as_ref() { + struct_ser.serialize_field("channel", v)?; } - if !self.packet_commitment_sequences.is_empty() { + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "packetCommitmentSequences", - &self - .packet_commitment_sequences - .iter() - .map(ToString::to_string) - .collect::>(), + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), )?; } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { +impl<'de> serde::Deserialize<'de> for QueryChannelResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "port_id", - "portId", - "channel_id", - "channelId", - "packet_commitment_sequences", - "packetCommitmentSequences", - ]; + const FIELDS: &[&str] = &["channel", "proof", "proof_height", "proofHeight"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PortId, - ChannelId, - PacketCommitmentSequences, + Channel, + Proof, + ProofHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -7870,11 +8589,9 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { E: serde::de::Error, { match value { - "portId" | "port_id" => Ok(GeneratedField::PortId), - "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), - "packetCommitmentSequences" | "packet_commitment_sequences" => { - Ok(GeneratedField::PacketCommitmentSequences) - } + "channel" => Ok(GeneratedField::Channel), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -7884,67 +8601,63 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedPacketsRequest; + type Value = QueryChannelResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsRequest") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut port_id__ = None; - let mut channel_id__ = None; - let mut packet_commitment_sequences__ = None; + let mut channel__ = None; + let mut proof__ = None; + let mut proof_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PortId => { - if port_id__.is_some() { - return Err(serde::de::Error::duplicate_field("portId")); + GeneratedField::Channel => { + if channel__.is_some() { + return Err(serde::de::Error::duplicate_field("channel")); } - port_id__ = Some(map_.next_value()?); + channel__ = map_.next_value()?; } - GeneratedField::ChannelId => { - if channel_id__.is_some() { - return Err(serde::de::Error::duplicate_field("channelId")); + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); } - channel_id__ = Some(map_.next_value()?); + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); } - GeneratedField::PacketCommitmentSequences => { - if packet_commitment_sequences__.is_some() { - return Err(serde::de::Error::duplicate_field( - "packetCommitmentSequences", - )); + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); } - packet_commitment_sequences__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); + proof_height__ = map_.next_value()?; } } } - Ok(QueryUnreceivedPacketsRequest { - port_id: port_id__.unwrap_or_default(), - channel_id: channel_id__.unwrap_or_default(), - packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + Ok(QueryChannelResponse { + channel: channel__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedPacketsRequest", + "ibc.core.channel.v1.QueryChannelResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUnreceivedPacketsResponse { +impl serde::Serialize for QueryChannelsRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -7952,43 +8665,29 @@ impl serde::Serialize for QueryUnreceivedPacketsResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.sequences.is_empty() { + if self.pagination.is_some() { len += 1; } - if self.height.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsResponse", len)?; - if !self.sequences.is_empty() { - struct_ser.serialize_field( - "sequences", - &self - .sequences - .iter() - .map(ToString::to_string) - .collect::>(), - )?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelsRequest", 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 QueryUnreceivedPacketsResponse { +impl<'de> serde::Deserialize<'de> for QueryChannelsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["sequences", "height"]; + const FIELDS: &[&str] = &["pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequences, - Height, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -8014,8 +8713,7 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsResponse { E: serde::de::Error, { match value { - "sequences" => Ok(GeneratedField::Sequences), - "height" => Ok(GeneratedField::Height), + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -8025,210 +8723,4090 @@ impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUnreceivedPacketsResponse; + type Value = QueryChannelsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsResponse") + formatter.write_str("struct ibc.core.channel.v1.QueryChannelsRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequences__ = None; - let mut height__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequences => { - if sequences__.is_some() { - return Err(serde::de::Error::duplicate_field("sequences")); - } - sequences__ = Some( - map_.next_value::>>()? - .into_iter() - .map(|x| x.0) - .collect(), - ); - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); } - height__ = map_.next_value()?; + pagination__ = map_.next_value()?; } } } - Ok(QueryUnreceivedPacketsResponse { - sequences: sequences__.unwrap_or_default(), - height: height__, + Ok(QueryChannelsRequest { + pagination: pagination__, }) } } deserializer.deserialize_struct( - "ibc.core.channel.v1.QueryUnreceivedPacketsResponse", + "ibc.core.channel.v1.QueryChannelsRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ResponseResultType { +impl serde::Serialize for QueryChannelsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", - Self::Noop => "RESPONSE_RESULT_TYPE_NOOP", - Self::Success => "RESPONSE_RESULT_TYPE_SUCCESS", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.channels.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryChannelsResponse", len)?; + if !self.channels.is_empty() { + struct_ser.serialize_field("channels", &self.channels)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ResponseResultType { +impl<'de> serde::Deserialize<'de> for QueryChannelsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "RESPONSE_RESULT_TYPE_UNSPECIFIED", - "RESPONSE_RESULT_TYPE_NOOP", - "RESPONSE_RESULT_TYPE_SUCCESS", - ]; + const FIELDS: &[&str] = &["channels", "pagination", "height"]; - struct GeneratedVisitor; + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Pagination, + Height, + } + #[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 = ResponseResultType; + 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) - } + 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) - }) + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "channels" => Ok(GeneratedField::Channels), + "pagination" => Ok(GeneratedField::Pagination), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryChannelsResponse; - 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 expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryChannelsResponse") } - fn visit_str(self, value: &str) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where - E: serde::de::Error, + V: serde::de::MapAccess<'de>, { - match value { - "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Ok(ResponseResultType::Unspecified), - "RESPONSE_RESULT_TYPE_NOOP" => Ok(ResponseResultType::Noop), - "RESPONSE_RESULT_TYPE_SUCCESS" => Ok(ResponseResultType::Success), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut channels__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); + } + channels__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } } + Ok(QueryChannelsResponse { + channels: channels__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryChannelsResponse", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for State { +impl serde::Serialize for QueryConnectionChannelsRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { - let variant = match self { - Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", - Self::Init => "STATE_INIT", - Self::Tryopen => "STATE_TRYOPEN", - Self::Open => "STATE_OPEN", - Self::Closed => "STATE_CLOSED", - }; - serializer.serialize_str(variant) + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.connection.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsRequest", len)?; + if !self.connection.is_empty() { + struct_ser.serialize_field("connection", &self.connection)?; + } + 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 State { +impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "STATE_UNINITIALIZED_UNSPECIFIED", - "STATE_INIT", - "STATE_TRYOPEN", - "STATE_OPEN", - "STATE_CLOSED", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = State; - - fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - write!(formatter, "expected one of: {:?}", &FIELDS) - } + const FIELDS: &[&str] = &["connection", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Connection, + 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 { + "connection" => Ok(GeneratedField::Connection), + "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 = QueryConnectionChannelsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut connection__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Connection => { + if connection__.is_some() { + return Err(serde::de::Error::duplicate_field("connection")); + } + connection__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionChannelsRequest { + connection: connection__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryConnectionChannelsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryConnectionChannelsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.channels.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryConnectionChannelsResponse", len)?; + if !self.channels.is_empty() { + struct_ser.serialize_field("channels", &self.channels)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryConnectionChannelsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["channels", "pagination", "height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Channels, + Pagination, + Height, + } + #[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 { + "channels" => Ok(GeneratedField::Channels), + "pagination" => Ok(GeneratedField::Pagination), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryConnectionChannelsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryConnectionChannelsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut channels__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Channels => { + if channels__.is_some() { + return Err(serde::de::Error::duplicate_field("channels")); + } + channels__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryConnectionChannelsResponse { + channels: channels__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryConnectionChannelsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNextSequenceReceiveRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceReceiveRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryNextSequenceReceiveRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryNextSequenceReceiveRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNextSequenceReceiveResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.next_sequence_receive != 0 { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryNextSequenceReceiveResponse", len)?; + if self.next_sequence_receive != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextSequenceReceive", + ToString::to_string(&self.next_sequence_receive).as_str(), + )?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNextSequenceReceiveResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "next_sequence_receive", + "nextSequenceReceive", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextSequenceReceive, + Proof, + ProofHeight, + } + #[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 { + "nextSequenceReceive" | "next_sequence_receive" => { + Ok(GeneratedField::NextSequenceReceive) + } + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceReceiveResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceReceiveResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut next_sequence_receive__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NextSequenceReceive => { + if next_sequence_receive__.is_some() { + return Err(serde::de::Error::duplicate_field( + "nextSequenceReceive", + )); + } + next_sequence_receive__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryNextSequenceReceiveResponse { + next_sequence_receive: next_sequence_receive__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryNextSequenceReceiveResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNextSequenceSendRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryNextSequenceSendRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNextSequenceSendRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceSendRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceSendRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryNextSequenceSendRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryNextSequenceSendRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryNextSequenceSendResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.next_sequence_send != 0 { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryNextSequenceSendResponse", len)?; + if self.next_sequence_send != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextSequenceSend", + ToString::to_string(&self.next_sequence_send).as_str(), + )?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryNextSequenceSendResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "next_sequence_send", + "nextSequenceSend", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NextSequenceSend, + Proof, + ProofHeight, + } + #[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 { + "nextSequenceSend" | "next_sequence_send" => { + Ok(GeneratedField::NextSequenceSend) + } + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextSequenceSendResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryNextSequenceSendResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut next_sequence_send__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NextSequenceSend => { + if next_sequence_send__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceSend")); + } + next_sequence_send__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryNextSequenceSendResponse { + next_sequence_send: next_sequence_send__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryNextSequenceSendResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketAcknowledgementRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryPacketAcknowledgementRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Sequence, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryPacketAcknowledgementRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketAcknowledgementResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.acknowledgement.is_empty() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", + len, + )?; + if !self.acknowledgement.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "acknowledgement", + pbjson::private::base64::encode(&self.acknowledgement).as_str(), + )?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["acknowledgement", "proof", "proof_height", "proofHeight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Acknowledgement, + Proof, + ProofHeight, + } + #[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 { + "acknowledgement" => Ok(GeneratedField::Acknowledgement), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut acknowledgement__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Acknowledgement => { + if acknowledgement__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgement")); + } + acknowledgement__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketAcknowledgementResponse { + acknowledgement: acknowledgement__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketAcknowledgementsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if !self.packet_commitment_sequences.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + len, + )?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if !self.packet_commitment_sequences.is_empty() { + struct_ser.serialize_field( + "packetCommitmentSequences", + &self + .packet_commitment_sequences + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "pagination", + "packet_commitment_sequences", + "packetCommitmentSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Pagination, + PacketCommitmentSequences, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "pagination" => Ok(GeneratedField::Pagination), + "packetCommitmentSequences" | "packet_commitment_sequences" => { + Ok(GeneratedField::PacketCommitmentSequences) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut pagination__ = None; + let mut packet_commitment_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::PacketCommitmentSequences => { + if packet_commitment_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field( + "packetCommitmentSequences", + )); + } + packet_commitment_sequences__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(QueryPacketAcknowledgementsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + pagination: pagination__, + packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketAcknowledgementsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.acknowledgements.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", + len, + )?; + if !self.acknowledgements.is_empty() { + struct_ser.serialize_field("acknowledgements", &self.acknowledgements)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketAcknowledgementsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["acknowledgements", "pagination", "height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Acknowledgements, + Pagination, + Height, + } + #[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 { + "acknowledgements" => Ok(GeneratedField::Acknowledgements), + "pagination" => Ok(GeneratedField::Pagination), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketAcknowledgementsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct ibc.core.channel.v1.QueryPacketAcknowledgementsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut acknowledgements__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Acknowledgements => { + if acknowledgements__.is_some() { + return Err(serde::de::Error::duplicate_field("acknowledgements")); + } + acknowledgements__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketAcknowledgementsResponse { + acknowledgements: acknowledgements__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketAcknowledgementsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketCommitmentRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Sequence, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketCommitmentRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryPacketCommitmentRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketCommitmentRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketCommitmentResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.commitment.is_empty() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentResponse", len)?; + if !self.commitment.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "commitment", + pbjson::private::base64::encode(&self.commitment).as_str(), + )?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["commitment", "proof", "proof_height", "proofHeight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commitment, + Proof, + ProofHeight, + } + #[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 { + "commitment" => Ok(GeneratedField::Commitment), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketCommitmentResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commitment__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commitment => { + if commitment__.is_some() { + return Err(serde::de::Error::duplicate_field("commitment")); + } + commitment__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentResponse { + commitment: commitment__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketCommitmentResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketCommitmentsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + 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 QueryPacketCommitmentsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "pagination"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + 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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "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 = QueryPacketCommitmentsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketCommitmentsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketCommitmentsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.commitments.is_empty() { + len += 1; + } + if self.pagination.is_some() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryPacketCommitmentsResponse", len)?; + if !self.commitments.is_empty() { + struct_ser.serialize_field("commitments", &self.commitments)?; + } + if let Some(v) = self.pagination.as_ref() { + struct_ser.serialize_field("pagination", v)?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketCommitmentsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["commitments", "pagination", "height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Commitments, + Pagination, + Height, + } + #[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 { + "commitments" => Ok(GeneratedField::Commitments), + "pagination" => Ok(GeneratedField::Pagination), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketCommitmentsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketCommitmentsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut commitments__ = None; + let mut pagination__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Commitments => { + if commitments__.is_some() { + return Err(serde::de::Error::duplicate_field("commitments")); + } + commitments__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketCommitmentsResponse { + commitments: commitments__.unwrap_or_default(), + pagination: pagination__, + height: height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketCommitmentsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketReceiptRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if self.sequence != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketReceiptRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId", "sequence"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + Sequence, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "sequence" => Ok(GeneratedField::Sequence), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketReceiptRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut sequence__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryPacketReceiptRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + sequence: sequence__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketReceiptRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryPacketReceiptResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.received { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryPacketReceiptResponse", len)?; + if self.received { + struct_ser.serialize_field("received", &self.received)?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryPacketReceiptResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["received", "proof", "proof_height", "proofHeight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Received, + Proof, + ProofHeight, + } + #[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 { + "received" => Ok(GeneratedField::Received), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryPacketReceiptResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryPacketReceiptResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut received__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Received => { + if received__.is_some() { + return Err(serde::de::Error::duplicate_field("received")); + } + received__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryPacketReceiptResponse { + received: received__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryPacketReceiptResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnreceivedAcksRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if !self.packet_ack_sequences.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if !self.packet_ack_sequences.is_empty() { + struct_ser.serialize_field( + "packetAckSequences", + &self + .packet_ack_sequences + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "packet_ack_sequences", + "packetAckSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + PacketAckSequences, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "packetAckSequences" | "packet_ack_sequences" => { + Ok(GeneratedField::PacketAckSequences) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedAcksRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut packet_ack_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::PacketAckSequences => { + if packet_ack_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field( + "packetAckSequences", + )); + } + packet_ack_sequences__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(QueryUnreceivedAcksRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + packet_ack_sequences: packet_ack_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUnreceivedAcksRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnreceivedAcksResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sequences.is_empty() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUnreceivedAcksResponse", len)?; + if !self.sequences.is_empty() { + struct_ser.serialize_field( + "sequences", + &self + .sequences + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnreceivedAcksResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sequences", "height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequences, + Height, + } + #[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 { + "sequences" => Ok(GeneratedField::Sequences), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedAcksResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedAcksResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequences__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequences => { + if sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sequences")); + } + sequences__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryUnreceivedAcksResponse { + sequences: sequences__.unwrap_or_default(), + height: height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUnreceivedAcksResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnreceivedPacketsRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + if !self.packet_commitment_sequences.is_empty() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if !self.packet_commitment_sequences.is_empty() { + struct_ser.serialize_field( + "packetCommitmentSequences", + &self + .packet_commitment_sequences + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "packet_commitment_sequences", + "packetCommitmentSequences", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + PacketCommitmentSequences, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "packetCommitmentSequences" | "packet_commitment_sequences" => { + Ok(GeneratedField::PacketCommitmentSequences) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedPacketsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut packet_commitment_sequences__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + GeneratedField::PacketCommitmentSequences => { + if packet_commitment_sequences__.is_some() { + return Err(serde::de::Error::duplicate_field( + "packetCommitmentSequences", + )); + } + packet_commitment_sequences__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + } + } + Ok(QueryUnreceivedPacketsRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + packet_commitment_sequences: packet_commitment_sequences__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUnreceivedPacketsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUnreceivedPacketsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.sequences.is_empty() { + len += 1; + } + if self.height.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.channel.v1.QueryUnreceivedPacketsResponse", len)?; + if !self.sequences.is_empty() { + struct_ser.serialize_field( + "sequences", + &self + .sequences + .iter() + .map(ToString::to_string) + .collect::>(), + )?; + } + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUnreceivedPacketsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sequences", "height"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequences, + Height, + } + #[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 { + "sequences" => Ok(GeneratedField::Sequences), + "height" => Ok(GeneratedField::Height), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUnreceivedPacketsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUnreceivedPacketsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequences__ = None; + let mut height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequences => { + if sequences__.is_some() { + return Err(serde::de::Error::duplicate_field("sequences")); + } + sequences__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), + ); + } + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + } + } + Ok(QueryUnreceivedPacketsResponse { + sequences: sequences__.unwrap_or_default(), + height: height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUnreceivedPacketsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradeErrorRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUpgradeErrorRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradeErrorRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeErrorRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeErrorRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryUpgradeErrorRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUpgradeErrorRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradeErrorResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.error_receipt.is_some() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUpgradeErrorResponse", len)?; + if let Some(v) = self.error_receipt.as_ref() { + struct_ser.serialize_field("errorReceipt", v)?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradeErrorResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "error_receipt", + "errorReceipt", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ErrorReceipt, + Proof, + ProofHeight, + } + #[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 { + "errorReceipt" | "error_receipt" => Ok(GeneratedField::ErrorReceipt), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeErrorResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeErrorResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut error_receipt__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ErrorReceipt => { + if error_receipt__.is_some() { + return Err(serde::de::Error::duplicate_field("errorReceipt")); + } + error_receipt__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradeErrorResponse { + error_receipt: error_receipt__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUpgradeErrorResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradeRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.port_id.is_empty() { + len += 1; + } + if !self.channel_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUpgradeRequest", len)?; + if !self.port_id.is_empty() { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if !self.channel_id.is_empty() { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradeRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["port_id", "portId", "channel_id", "channelId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + } + #[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 { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeRequest") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PortId => { + if port_id__.is_some() { + return Err(serde::de::Error::duplicate_field("portId")); + } + port_id__ = Some(map_.next_value()?); + } + GeneratedField::ChannelId => { + if channel_id__.is_some() { + return Err(serde::de::Error::duplicate_field("channelId")); + } + channel_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryUpgradeRequest { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUpgradeRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradeResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.upgrade.is_some() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.QueryUpgradeResponse", len)?; + if let Some(v) = self.upgrade.as_ref() { + struct_ser.serialize_field("upgrade", v)?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradeResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["upgrade", "proof", "proof_height", "proofHeight"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Upgrade, + Proof, + ProofHeight, + } + #[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 { + "upgrade" => Ok(GeneratedField::Upgrade), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradeResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.QueryUpgradeResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut upgrade__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Upgrade => { + if upgrade__.is_some() { + return Err(serde::de::Error::duplicate_field("upgrade")); + } + upgrade__ = map_.next_value()?; + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + } + } + Ok(QueryUpgradeResponse { + upgrade: upgrade__, + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.channel.v1.QueryUpgradeResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ResponseResultType { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::Unspecified => "RESPONSE_RESULT_TYPE_UNSPECIFIED", + Self::Noop => "RESPONSE_RESULT_TYPE_NOOP", + Self::Success => "RESPONSE_RESULT_TYPE_SUCCESS", + Self::Failure => "RESPONSE_RESULT_TYPE_FAILURE", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ResponseResultType { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "RESPONSE_RESULT_TYPE_UNSPECIFIED", + "RESPONSE_RESULT_TYPE_NOOP", + "RESPONSE_RESULT_TYPE_SUCCESS", + "RESPONSE_RESULT_TYPE_FAILURE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ResponseResultType; + + 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 { + "RESPONSE_RESULT_TYPE_UNSPECIFIED" => Ok(ResponseResultType::Unspecified), + "RESPONSE_RESULT_TYPE_NOOP" => Ok(ResponseResultType::Noop), + "RESPONSE_RESULT_TYPE_SUCCESS" => Ok(ResponseResultType::Success), + "RESPONSE_RESULT_TYPE_FAILURE" => Ok(ResponseResultType::Failure), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for State { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + let variant = match self { + Self::UninitializedUnspecified => "STATE_UNINITIALIZED_UNSPECIFIED", + Self::Init => "STATE_INIT", + Self::Tryopen => "STATE_TRYOPEN", + Self::Open => "STATE_OPEN", + Self::Closed => "STATE_CLOSED", + Self::Flushing => "STATE_FLUSHING", + Self::Flushcomplete => "STATE_FLUSHCOMPLETE", + }; + serializer.serialize_str(variant) + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for State { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "STATE_UNINITIALIZED_UNSPECIFIED", + "STATE_INIT", + "STATE_TRYOPEN", + "STATE_OPEN", + "STATE_CLOSED", + "STATE_FLUSHING", + "STATE_FLUSHCOMPLETE", + ]; + + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = State; + + 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, + 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 { + "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), + "STATE_INIT" => Ok(State::Init), + "STATE_TRYOPEN" => Ok(State::Tryopen), + "STATE_OPEN" => Ok(State::Open), + "STATE_CLOSED" => Ok(State::Closed), + "STATE_FLUSHING" => Ok(State::Flushing), + "STATE_FLUSHCOMPLETE" => Ok(State::Flushcomplete), + _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + } + } + } + deserializer.deserialize_any(GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Timeout { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.height.is_some() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Timeout", len)?; + if let Some(v) = self.height.as_ref() { + struct_ser.serialize_field("height", v)?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Timeout { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["height", "timestamp"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Height, + Timestamp, + } + #[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 { + "height" => Ok(GeneratedField::Height), + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Timeout; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Timeout") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut height__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Height => { + if height__.is_some() { + return Err(serde::de::Error::duplicate_field("height")); + } + height__ = map_.next_value()?; + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Timeout { + height: height__, + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Timeout", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Upgrade { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.fields.is_some() { + len += 1; + } + if self.timeout.is_some() { + len += 1; + } + if self.next_sequence_send != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.Upgrade", len)?; + if let Some(v) = self.fields.as_ref() { + struct_ser.serialize_field("fields", v)?; + } + if let Some(v) = self.timeout.as_ref() { + struct_ser.serialize_field("timeout", v)?; + } + if self.next_sequence_send != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "nextSequenceSend", + ToString::to_string(&self.next_sequence_send).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Upgrade { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "fields", + "timeout", + "next_sequence_send", + "nextSequenceSend", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Fields, + Timeout, + NextSequenceSend, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, { - 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) - }) + 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 { + "fields" => Ok(GeneratedField::Fields), + "timeout" => Ok(GeneratedField::Timeout), + "nextSequenceSend" | "next_sequence_send" => { + Ok(GeneratedField::NextSequenceSend) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Upgrade; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.Upgrade") } - fn visit_u64(self, v: u64) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where - E: serde::de::Error, + V: serde::de::MapAccess<'de>, { - 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) - }) + let mut fields__ = None; + let mut timeout__ = None; + let mut next_sequence_send__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Fields => { + if fields__.is_some() { + return Err(serde::de::Error::duplicate_field("fields")); + } + fields__ = map_.next_value()?; + } + GeneratedField::Timeout => { + if timeout__.is_some() { + return Err(serde::de::Error::duplicate_field("timeout")); + } + timeout__ = map_.next_value()?; + } + GeneratedField::NextSequenceSend => { + if next_sequence_send__.is_some() { + return Err(serde::de::Error::duplicate_field("nextSequenceSend")); + } + next_sequence_send__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(Upgrade { + fields: fields__, + timeout: timeout__, + next_sequence_send: next_sequence_send__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.Upgrade", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for UpgradeFields { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.ordering != 0 { + len += 1; + } + if !self.connection_hops.is_empty() { + len += 1; + } + if !self.version.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.channel.v1.UpgradeFields", len)?; + if self.ordering != 0 { + let v = Order::try_from(self.ordering).map_err(|_| { + serde::ser::Error::custom(format!("Invalid variant {}", self.ordering)) + })?; + struct_ser.serialize_field("ordering", &v)?; + } + if !self.connection_hops.is_empty() { + struct_ser.serialize_field("connectionHops", &self.connection_hops)?; + } + if !self.version.is_empty() { + struct_ser.serialize_field("version", &self.version)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for UpgradeFields { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["ordering", "connection_hops", "connectionHops", "version"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Ordering, + ConnectionHops, + Version, + } + #[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 { + "ordering" => Ok(GeneratedField::Ordering), + "connectionHops" | "connection_hops" => { + Ok(GeneratedField::ConnectionHops) + } + "version" => Ok(GeneratedField::Version), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = UpgradeFields; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.UpgradeFields") } - fn visit_str(self, value: &str) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where - E: serde::de::Error, + V: serde::de::MapAccess<'de>, { - match value { - "STATE_UNINITIALIZED_UNSPECIFIED" => Ok(State::UninitializedUnspecified), - "STATE_INIT" => Ok(State::Init), - "STATE_TRYOPEN" => Ok(State::Tryopen), - "STATE_OPEN" => Ok(State::Open), - "STATE_CLOSED" => Ok(State::Closed), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), + let mut ordering__ = None; + let mut connection_hops__ = None; + let mut version__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Ordering => { + if ordering__.is_some() { + return Err(serde::de::Error::duplicate_field("ordering")); + } + ordering__ = Some(map_.next_value::()? as i32); + } + GeneratedField::ConnectionHops => { + if connection_hops__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionHops")); + } + connection_hops__ = Some(map_.next_value()?); + } + GeneratedField::Version => { + if version__.is_some() { + return Err(serde::de::Error::duplicate_field("version")); + } + version__ = Some(map_.next_value()?); + } + } } + Ok(UpgradeFields { + ordering: ordering__.unwrap_or_default(), + connection_hops: connection_hops__.unwrap_or_default(), + version: version__.unwrap_or_default(), + }) } } - deserializer.deserialize_any(GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.channel.v1.UpgradeFields", + FIELDS, + GeneratedVisitor, + ) } } diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.tonic.rs index 7b8374e6..a023c8cb 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.channel.v1.tonic.rs @@ -376,6 +376,85 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn next_sequence_send( + &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("/ibc.core.channel.v1.Query/NextSequenceSend"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Query", + "NextSequenceSend", + )); + self.inner.unary(req, path, codec).await + } + pub async fn upgrade_error( + &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("/ibc.core.channel.v1.Query/UpgradeError"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "UpgradeError")); + self.inner.unary(req, path, codec).await + } + pub async fn upgrade( + &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("/ibc.core.channel.v1.Query/Upgrade"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.channel.v1.Query", "Upgrade")); + self.inner.unary(req, path, codec).await + } + pub async fn channel_params( + &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("/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. @@ -462,6 +541,22 @@ pub mod query_server { tonic::Response, tonic::Status, >; + async fn next_sequence_send( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn upgrade_error( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn upgrade( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -1063,6 +1158,162 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Query/NextSequenceSend" => { + #[allow(non_camel_case_types)] + struct NextSequenceSendSvc(pub Arc); + impl tonic::server::UnaryService + for NextSequenceSendSvc + { + type Response = super::QueryNextSequenceSendResponse; + 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).next_sequence_send(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 = NextSequenceSendSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Query/UpgradeError" => { + #[allow(non_camel_case_types)] + struct UpgradeErrorSvc(pub Arc); + impl tonic::server::UnaryService for UpgradeErrorSvc { + type Response = super::QueryUpgradeErrorResponse; + 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).upgrade_error(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 = UpgradeErrorSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Query/Upgrade" => { + #[allow(non_camel_case_types)] + struct UpgradeSvc(pub Arc); + impl tonic::server::UnaryService for UpgradeSvc { + type Response = super::QueryUpgradeResponse; + 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).upgrade(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 = UpgradeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Query/ChannelParams" => { + #[allow(non_camel_case_types)] + struct ChannelParamsSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelParamsSvc + { + type Response = super::QueryChannelParamsResponse; + 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).channel_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = 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(http::Response::builder() .status(200) @@ -1384,73 +1635,323 @@ pub mod msg_client { )); 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 channel_open_init( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn channel_open_try( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn channel_open_ack( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn channel_open_confirm( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn channel_close_init( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn channel_close_confirm( - &self, - request: tonic::Request, - ) -> std::result::Result< - tonic::Response, - tonic::Status, - >; - async fn recv_packet( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn timeout( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn timeout_on_close( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - async fn acknowledgement( - &self, - request: tonic::Request, - ) -> std::result::Result, tonic::Status>; - } - #[derive(Debug)] - pub struct MsgServer { - inner: _Inner, - accept_compression_encodings: EnabledCompressionEncodings, - send_compression_encodings: EnabledCompressionEncodings, - max_decoding_message_size: Option, - max_encoding_message_size: Option, - } - struct _Inner(Arc); - impl MsgServer { - pub fn new(inner: T) -> Self { - Self::from_arc(Arc::new(inner)) - } + pub async fn channel_upgrade_init( + &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("/ibc.core.channel.v1.Msg/ChannelUpgradeInit"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeInit", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_try( + &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("/ibc.core.channel.v1.Msg/ChannelUpgradeTry"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeTry", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_ack( + &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("/ibc.core.channel.v1.Msg/ChannelUpgradeAck"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeAck", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_confirm( + &mut self, + request: impl tonic::IntoRequest, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + > { + self.inner.ready().await.map_err(|e| { + tonic::Status::new( + tonic::Code::Unknown, + format!("Service was not ready: {}", e.into()), + ) + })?; + let codec = tonic::codec::ProstCodec::default(); + let path = http::uri::PathAndQuery::from_static( + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeConfirm", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_open( + &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("/ibc.core.channel.v1.Msg/ChannelUpgradeOpen"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeOpen", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_timeout( + &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/ChannelUpgradeTimeout", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeTimeout", + )); + self.inner.unary(req, path, codec).await + } + pub async fn channel_upgrade_cancel( + &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/ChannelUpgradeCancel", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "ChannelUpgradeCancel", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_channel_params( + &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( + "/ibc.core.channel.v1.Msg/UpdateChannelParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.channel.v1.Msg", + "UpdateChannelParams", + )); + self.inner.unary(req, path, codec).await + } + 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. +#[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 channel_open_init( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_open_try( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_open_ack( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_open_confirm( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_close_init( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_close_confirm( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn recv_packet( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn timeout( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn timeout_on_close( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn acknowledgement( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_upgrade_init( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_upgrade_try( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_upgrade_ack( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_upgrade_confirm( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn channel_upgrade_open( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn channel_upgrade_timeout( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn channel_upgrade_cancel( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; + async fn update_channel_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn prune_acknowledgements( + &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 { @@ -1898,6 +2399,362 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Msg/ChannelUpgradeInit" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeInitSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeInitSvc + { + type Response = super::MsgChannelUpgradeInitResponse; + 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).channel_upgrade_init(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 = ChannelUpgradeInitSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeTry" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeTrySvc(pub Arc); + impl tonic::server::UnaryService for ChannelUpgradeTrySvc { + type Response = super::MsgChannelUpgradeTryResponse; + 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).channel_upgrade_try(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChannelUpgradeTrySvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeAck" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeAckSvc(pub Arc); + impl tonic::server::UnaryService for ChannelUpgradeAckSvc { + type Response = super::MsgChannelUpgradeAckResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).channel_upgrade_ack(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 = ChannelUpgradeAckSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeConfirm" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeConfirmSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeConfirmSvc + { + type Response = super::MsgChannelUpgradeConfirmResponse; + 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).channel_upgrade_confirm(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 = ChannelUpgradeConfirmSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeOpen" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeOpenSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeOpenSvc + { + type Response = super::MsgChannelUpgradeOpenResponse; + 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).channel_upgrade_open(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 = ChannelUpgradeOpenSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeTimeout" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeTimeoutSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeTimeoutSvc + { + type Response = super::MsgChannelUpgradeTimeoutResponse; + 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).channel_upgrade_timeout(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 = ChannelUpgradeTimeoutSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/ChannelUpgradeCancel" => { + #[allow(non_camel_case_types)] + struct ChannelUpgradeCancelSvc(pub Arc); + impl tonic::server::UnaryService + for ChannelUpgradeCancelSvc + { + type Response = super::MsgChannelUpgradeCancelResponse; + 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).channel_upgrade_cancel(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = ChannelUpgradeCancelSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/UpdateChannelParams" => { + #[allow(non_camel_case_types)] + struct UpdateChannelParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateChannelParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_channel_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateChannelParamsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.channel.v1.Msg/PruneAcknowledgements" => { + #[allow(non_camel_case_types)] + struct PruneAcknowledgementsSvc(pub Arc); + impl tonic::server::UnaryService + for PruneAcknowledgementsSvc + { + type Response = super::MsgPruneAcknowledgementsResponse; + 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_acknowledgements(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(http::Response::builder() .status(200) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs index 626875a9..0bc7061f 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.rs @@ -35,10 +35,42 @@ pub struct ClientConsensusStates { #[prost(message, repeated, tag = "2")] pub consensus_states: ::prost::alloc::vec::Vec, } -/// ClientUpdateProposal is a governance proposal. If it passes, the substitute +/// Height is a monotonically increasing data type +/// that can be compared against another Height for the purposes of updating and +/// freezing clients +/// +/// Normally the RevisionHeight is incremented at each height while keeping +/// RevisionNumber the same. However some consensus algorithms may choose to +/// reset the height in certain conditions e.g. hard forks, state-machine +/// breaking changes In these cases, the RevisionNumber is incremented so that +/// height continues to be monitonically increasing even as the RevisionHeight +/// gets reset +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Height { + /// the revision that the client is currently on + #[prost(uint64, tag = "1")] + pub revision_number: u64, + /// the height within the given revision + #[prost(uint64, tag = "2")] + pub revision_height: u64, +} +/// Params defines the set of IBC light client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Params { + /// allowed_clients defines the list of allowed client state types which can be created + /// and interacted with. If a client type is removed from the allowed clients list, usage + /// of this client will be disabled until it is added again to the list. + #[prost(string, repeated, tag = "1")] + pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, +} +/// ClientUpdateProposal is a legacy governance proposal. If it passes, the substitute /// client's latest consensus state is copied over to the subject client. The proposal /// handler may fail if the subject and the substitute do not match in client and /// chain parameters (with exception to latest height, frozen height, and chain-id). +/// +/// Deprecated: Please use MsgRecoverClient in favour of this message type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct ClientUpdateProposal { @@ -58,6 +90,8 @@ pub struct ClientUpdateProposal { } /// UpgradeProposal is a gov Content type for initiating an IBC breaking /// upgrade. +/// +/// Deprecated: Please use MsgIBCSoftwareUpgrade in favour of this message type. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct UpgradeProposal { @@ -76,34 +110,6 @@ pub struct UpgradeProposal { #[prost(message, optional, tag = "4")] pub upgraded_client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } -/// Height is a monotonically increasing data type -/// that can be compared against another Height for the purposes of updating and -/// freezing clients -/// -/// Normally the RevisionHeight is incremented at each height while keeping -/// RevisionNumber the same. However some consensus algorithms may choose to -/// reset the height in certain conditions e.g. hard forks, state-machine -/// breaking changes In these cases, the RevisionNumber is incremented so that -/// height continues to be monitonically increasing even as the RevisionHeight -/// gets reset -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Height { - /// the revision that the client is currently on - #[prost(uint64, tag = "1")] - pub revision_number: u64, - /// the height within the given revision - #[prost(uint64, tag = "2")] - pub revision_height: u64, -} -/// Params defines the set of IBC light client parameters. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Params { - /// allowed_clients defines the list of allowed client state types. - #[prost(string, repeated, tag = "1")] - pub allowed_clients: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, -} /// GenesisState defines the ibc client submodule's genesis state. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -119,7 +125,9 @@ pub struct GenesisState { pub clients_metadata: ::prost::alloc::vec::Vec, #[prost(message, optional, tag = "4")] pub params: ::core::option::Option, - /// create localhost on initialization + /// Deprecated: create_localhost has been deprecated. + /// The localhost client is automatically created at genesis. + #[deprecated] #[prost(bool, tag = "5")] pub create_localhost: bool, /// the sequence for the next generated client identifier @@ -348,6 +356,40 @@ pub struct QueryUpgradedConsensusStateResponse { #[prost(message, optional, tag = "1")] pub upgraded_consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, } +/// QueryVerifyMembershipRequest is the request type for the Query/VerifyMembership RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVerifyMembershipRequest { + /// client unique identifier. + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// the proof to be verified by the client. + #[prost(bytes = "vec", tag = "2")] + pub proof: ::prost::alloc::vec::Vec, + /// the height of the commitment root at which the proof is verified. + #[prost(message, optional, tag = "3")] + pub proof_height: ::core::option::Option, + /// the commitment key path. + #[prost(message, optional, tag = "4")] + pub merkle_path: ::core::option::Option, + /// the value which is proven. + #[prost(bytes = "vec", tag = "5")] + pub value: ::prost::alloc::vec::Vec, + /// optional time delay + #[prost(uint64, tag = "6")] + pub time_delay: u64, + /// optional block delay + #[prost(uint64, tag = "7")] + pub block_delay: u64, +} +/// QueryVerifyMembershipResponse is the response type for the Query/VerifyMembership RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryVerifyMembershipResponse { + /// boolean indicating success or failure of proof verification. + #[prost(bool, tag = "1")] + pub success: bool, +} /// MsgCreateClient defines a message to create an IBC client #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -368,16 +410,16 @@ pub struct MsgCreateClient { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgCreateClientResponse {} /// MsgUpdateClient defines an sdk.Msg to update a IBC client state using -/// the given header. +/// the given client message. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgUpdateClient { /// client unique identifier #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, - /// header to update the light client + /// client message to update the light client #[prost(message, optional, tag = "2")] - pub header: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + pub client_message: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, /// signer address #[prost(string, tag = "3")] pub signer: ::prost::alloc::string::String, @@ -417,6 +459,7 @@ pub struct MsgUpgradeClient { pub struct MsgUpgradeClientResponse {} /// MsgSubmitMisbehaviour defines an sdk.Msg type that submits Evidence for /// light client misbehaviour. +/// This message has been deprecated. Use MsgUpdateClient instead. #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviour { @@ -435,6 +478,66 @@ pub struct MsgSubmitMisbehaviour { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgSubmitMisbehaviourResponse {} +/// MsgRecoverClient defines the message used to recover a frozen or expired client. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRecoverClient { + /// the client identifier for the client to be updated if the proposal passes + #[prost(string, tag = "1")] + pub subject_client_id: ::prost::alloc::string::String, + /// the substitute client identifier for the client which will replace the subject + /// client + #[prost(string, tag = "2")] + pub substitute_client_id: ::prost::alloc::string::String, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgRecoverClientResponse defines the Msg/RecoverClient response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRecoverClientResponse {} +/// MsgIBCSoftwareUpgrade defines the message used to schedule an upgrade of an IBC client using a v1 governance proposal +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgIbcSoftwareUpgrade { + #[prost(message, optional, tag = "1")] + pub plan: ::core::option::Option, + /// An UpgradedClientState must be provided to perform an IBC breaking upgrade. + /// This will make the chain commit to the correct upgraded (self) client state + /// before the upgrade occurs, so that connecting chains can verify that the + /// new upgraded client is valid by verifying a proof on the previous version + /// of the chain. This will allow IBC connections to persist smoothly across + /// planned chain upgrades. Correspondingly, the UpgradedClientState field has been + /// deprecated in the Cosmos SDK to allow for this logic to exist solely in + /// the 02-client module. + #[prost(message, optional, tag = "2")] + pub upgraded_client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + /// signer address + #[prost(string, tag = "3")] + pub signer: ::prost::alloc::string::String, +} +/// MsgIBCSoftwareUpgradeResponse defines the Msg/IBCSoftwareUpgrade response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgIbcSoftwareUpgradeResponse {} +/// MsgUpdateParams defines the sdk.Msg type to update the client parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the client parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("ibc.core.client.v1.serde.rs"); include!("ibc.core.client.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.serde.rs index 8de8633f..b6aba17e 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.serde.rs @@ -1338,7 +1338,7 @@ impl<'de> serde::Deserialize<'de> for MsgCreateClientResponse { } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgSubmitMisbehaviour { +impl serde::Serialize for MsgIbcSoftwareUpgrade { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1346,22 +1346,22 @@ impl serde::Serialize for MsgSubmitMisbehaviour { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.client_id.is_empty() { + if self.plan.is_some() { len += 1; } - if self.misbehaviour.is_some() { + if self.upgraded_client_state.is_some() { len += 1; } if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviour", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; + serializer.serialize_struct("ibc.core.client.v1.MsgIBCSoftwareUpgrade", len)?; + if let Some(v) = self.plan.as_ref() { + struct_ser.serialize_field("plan", v)?; } - if let Some(v) = self.misbehaviour.as_ref() { - struct_ser.serialize_field("misbehaviour", v)?; + if let Some(v) = self.upgraded_client_state.as_ref() { + struct_ser.serialize_field("upgradedClientState", v)?; } if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; @@ -1370,18 +1370,23 @@ impl serde::Serialize for MsgSubmitMisbehaviour { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { +impl<'de> serde::Deserialize<'de> for MsgIbcSoftwareUpgrade { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["client_id", "clientId", "misbehaviour", "signer"]; + const FIELDS: &[&str] = &[ + "plan", + "upgraded_client_state", + "upgradedClientState", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ClientId, - Misbehaviour, + Plan, + UpgradedClientState, Signer, } #[cfg(feature = "serde")] @@ -1408,8 +1413,10 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { E: serde::de::Error, { match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "misbehaviour" => Ok(GeneratedField::Misbehaviour), + "plan" => Ok(GeneratedField::Plan), + "upgradedClientState" | "upgraded_client_state" => { + Ok(GeneratedField::UpgradedClientState) + } "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -1420,35 +1427,37 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitMisbehaviour; + type Value = MsgIbcSoftwareUpgrade; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviour") + formatter.write_str("struct ibc.core.client.v1.MsgIBCSoftwareUpgrade") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut client_id__ = None; - let mut misbehaviour__ = None; + let mut plan__ = None; + let mut upgraded_client_state__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); + GeneratedField::Plan => { + if plan__.is_some() { + return Err(serde::de::Error::duplicate_field("plan")); } - client_id__ = Some(map_.next_value()?); + plan__ = map_.next_value()?; } - GeneratedField::Misbehaviour => { - if misbehaviour__.is_some() { - return Err(serde::de::Error::duplicate_field("misbehaviour")); + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "upgradedClientState", + )); } - misbehaviour__ = map_.next_value()?; + upgraded_client_state__ = map_.next_value()?; } GeneratedField::Signer => { if signer__.is_some() { @@ -1458,22 +1467,22 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { } } } - Ok(MsgSubmitMisbehaviour { - client_id: client_id__.unwrap_or_default(), - misbehaviour: misbehaviour__, + Ok(MsgIbcSoftwareUpgrade { + plan: plan__, + upgraded_client_state: upgraded_client_state__, signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgSubmitMisbehaviour", + "ibc.core.client.v1.MsgIBCSoftwareUpgrade", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgSubmitMisbehaviourResponse { +impl serde::Serialize for MsgIbcSoftwareUpgradeResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1482,12 +1491,12 @@ impl serde::Serialize for MsgSubmitMisbehaviourResponse { use serde::ser::SerializeStruct; let len = 0; let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviourResponse", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviourResponse { +impl<'de> serde::Deserialize<'de> for MsgIbcSoftwareUpgradeResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -1528,34 +1537,34 @@ impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviourResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgSubmitMisbehaviourResponse; + type Value = MsgIbcSoftwareUpgradeResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviourResponse") + formatter.write_str("struct ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(MsgSubmitMisbehaviourResponse {}) + Ok(MsgIbcSoftwareUpgradeResponse {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgSubmitMisbehaviourResponse", + "ibc.core.client.v1.MsgIBCSoftwareUpgradeResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgUpdateClient { +impl serde::Serialize for MsgRecoverClient { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1563,22 +1572,22 @@ impl serde::Serialize for MsgUpdateClient { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.client_id.is_empty() { + if !self.subject_client_id.is_empty() { len += 1; } - if self.header.is_some() { + if !self.substitute_client_id.is_empty() { len += 1; } if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClient", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; + serializer.serialize_struct("ibc.core.client.v1.MsgRecoverClient", len)?; + if !self.subject_client_id.is_empty() { + struct_ser.serialize_field("subjectClientId", &self.subject_client_id)?; } - if let Some(v) = self.header.as_ref() { - struct_ser.serialize_field("header", v)?; + if !self.substitute_client_id.is_empty() { + struct_ser.serialize_field("substituteClientId", &self.substitute_client_id)?; } if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; @@ -1587,18 +1596,24 @@ impl serde::Serialize for MsgUpdateClient { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgUpdateClient { +impl<'de> serde::Deserialize<'de> for MsgRecoverClient { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["client_id", "clientId", "header", "signer"]; + const FIELDS: &[&str] = &[ + "subject_client_id", + "subjectClientId", + "substitute_client_id", + "substituteClientId", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ClientId, - Header, + SubjectClientId, + SubstituteClientId, Signer, } #[cfg(feature = "serde")] @@ -1625,8 +1640,12 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateClient { E: serde::de::Error, { match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "header" => Ok(GeneratedField::Header), + "subjectClientId" | "subject_client_id" => { + Ok(GeneratedField::SubjectClientId) + } + "substituteClientId" | "substitute_client_id" => { + Ok(GeneratedField::SubstituteClientId) + } "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -1637,32 +1656,34 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateClient { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateClient; + type Value = MsgRecoverClient; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpdateClient") + formatter.write_str("struct ibc.core.client.v1.MsgRecoverClient") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut client_id__ = None; - let mut header__ = None; + let mut subject_client_id__ = None; + let mut substitute_client_id__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); + GeneratedField::SubjectClientId => { + if subject_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("subjectClientId")); } - client_id__ = Some(map_.next_value()?); + subject_client_id__ = Some(map_.next_value()?); } - GeneratedField::Header => { - if header__.is_some() { - return Err(serde::de::Error::duplicate_field("header")); + GeneratedField::SubstituteClientId => { + if substitute_client_id__.is_some() { + return Err(serde::de::Error::duplicate_field( + "substituteClientId", + )); } - header__ = map_.next_value()?; + substitute_client_id__ = Some(map_.next_value()?); } GeneratedField::Signer => { if signer__.is_some() { @@ -1672,22 +1693,22 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateClient { } } } - Ok(MsgUpdateClient { - client_id: client_id__.unwrap_or_default(), - header: header__, + Ok(MsgRecoverClient { + subject_client_id: subject_client_id__.unwrap_or_default(), + substitute_client_id: substitute_client_id__.unwrap_or_default(), signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpdateClient", + "ibc.core.client.v1.MsgRecoverClient", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgUpdateClientResponse { +impl serde::Serialize for MsgRecoverClientResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1696,12 +1717,12 @@ impl serde::Serialize for MsgUpdateClientResponse { use serde::ser::SerializeStruct; let len = 0; let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClientResponse", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgRecoverClientResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgUpdateClientResponse { +impl<'de> serde::Deserialize<'de> for MsgRecoverClientResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -1742,34 +1763,34 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateClientResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpdateClientResponse; + type Value = MsgRecoverClientResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpdateClientResponse") + formatter.write_str("struct ibc.core.client.v1.MsgRecoverClientResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(MsgUpdateClientResponse {}) + Ok(MsgRecoverClientResponse {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpdateClientResponse", + "ibc.core.client.v1.MsgRecoverClientResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgUpgradeClient { +impl serde::Serialize for MsgSubmitMisbehaviour { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1780,45 +1801,19 @@ impl serde::Serialize for MsgUpgradeClient { if !self.client_id.is_empty() { len += 1; } - if self.client_state.is_some() { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - if !self.proof_upgrade_client.is_empty() { - len += 1; - } - if !self.proof_upgrade_consensus_state.is_empty() { + if self.misbehaviour.is_some() { len += 1; } if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpgradeClient", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviour", len)?; if !self.client_id.is_empty() { struct_ser.serialize_field("clientId", &self.client_id)?; } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if !self.proof_upgrade_client.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proofUpgradeClient", - pbjson::private::base64::encode(&self.proof_upgrade_client).as_str(), - )?; - } - if !self.proof_upgrade_consensus_state.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "proofUpgradeConsensusState", - pbjson::private::base64::encode(&self.proof_upgrade_consensus_state).as_str(), - )?; + if let Some(v) = self.misbehaviour.as_ref() { + struct_ser.serialize_field("misbehaviour", v)?; } if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; @@ -1827,33 +1822,18 @@ impl serde::Serialize for MsgUpgradeClient { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { +impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviour { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "client_state", - "clientState", - "consensus_state", - "consensusState", - "proof_upgrade_client", - "proofUpgradeClient", - "proof_upgrade_consensus_state", - "proofUpgradeConsensusState", - "signer", - ]; + const FIELDS: &[&str] = &["client_id", "clientId", "misbehaviour", "signer"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { ClientId, - ClientState, - ConsensusState, - ProofUpgradeClient, - ProofUpgradeConsensusState, + Misbehaviour, Signer, } #[cfg(feature = "serde")] @@ -1881,16 +1861,7 @@ impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { { match value { "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "proofUpgradeClient" | "proof_upgrade_client" => { - Ok(GeneratedField::ProofUpgradeClient) - } - "proofUpgradeConsensusState" | "proof_upgrade_consensus_state" => { - Ok(GeneratedField::ProofUpgradeConsensusState) - } + "misbehaviour" => Ok(GeneratedField::Misbehaviour), "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -1901,21 +1872,21 @@ impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpgradeClient; + type Value = MsgSubmitMisbehaviour; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClient") + formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviour") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { let mut client_id__ = None; - let mut client_state__ = None; - let mut consensus_state__ = None; - let mut proof_upgrade_client__ = None; - let mut proof_upgrade_consensus_state__ = None; + let mut misbehaviour__ = None; let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { @@ -1925,39 +1896,11 @@ impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { } client_id__ = Some(map_.next_value()?); } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); - } - client_state__ = map_.next_value()?; - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map_.next_value()?; - } - GeneratedField::ProofUpgradeClient => { - if proof_upgrade_client__.is_some() { - return Err(serde::de::Error::duplicate_field( - "proofUpgradeClient", - )); - } - proof_upgrade_client__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ProofUpgradeConsensusState => { - if proof_upgrade_consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "proofUpgradeConsensusState", - )); + GeneratedField::Misbehaviour => { + if misbehaviour__.is_some() { + return Err(serde::de::Error::duplicate_field("misbehaviour")); } - proof_upgrade_consensus_state__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + misbehaviour__ = map_.next_value()?; } GeneratedField::Signer => { if signer__.is_some() { @@ -1967,26 +1910,22 @@ impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { } } } - Ok(MsgUpgradeClient { + Ok(MsgSubmitMisbehaviour { client_id: client_id__.unwrap_or_default(), - client_state: client_state__, - consensus_state: consensus_state__, - proof_upgrade_client: proof_upgrade_client__.unwrap_or_default(), - proof_upgrade_consensus_state: proof_upgrade_consensus_state__ - .unwrap_or_default(), + misbehaviour: misbehaviour__, signer: signer__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpgradeClient", + "ibc.core.client.v1.MsgSubmitMisbehaviour", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for MsgUpgradeClientResponse { +impl serde::Serialize for MsgSubmitMisbehaviourResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1995,12 +1934,12 @@ impl serde::Serialize for MsgUpgradeClientResponse { use serde::ser::SerializeStruct; let len = 0; let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.MsgUpgradeClientResponse", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgSubmitMisbehaviourResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for MsgUpgradeClientResponse { +impl<'de> serde::Deserialize<'de> for MsgSubmitMisbehaviourResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -2041,34 +1980,34 @@ impl<'de> serde::Deserialize<'de> for MsgUpgradeClientResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = MsgUpgradeClientResponse; + type Value = MsgSubmitMisbehaviourResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClientResponse") + formatter.write_str("struct ibc.core.client.v1.MsgSubmitMisbehaviourResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(MsgUpgradeClientResponse {}) + Ok(MsgSubmitMisbehaviourResponse {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.MsgUpgradeClientResponse", + "ibc.core.client.v1.MsgSubmitMisbehaviourResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for Params { +impl serde::Serialize for MsgUpdateClient { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2076,28 +2015,49 @@ impl serde::Serialize for Params { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.allowed_clients.is_empty() { + if !self.client_id.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.Params", len)?; - if !self.allowed_clients.is_empty() { - struct_ser.serialize_field("allowedClients", &self.allowed_clients)?; + if self.client_message.is_some() { + len += 1; + } + if !self.signer.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClient", len)?; + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if let Some(v) = self.client_message.as_ref() { + struct_ser.serialize_field("clientMessage", v)?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Params { +impl<'de> serde::Deserialize<'de> for MsgUpdateClient { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["allowed_clients", "allowedClients"]; + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "client_message", + "clientMessage", + "signer", + ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - AllowedClients, + ClientId, + ClientMessage, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2123,9 +2083,9 @@ impl<'de> serde::Deserialize<'de> for Params { E: serde::de::Error, { match value { - "allowedClients" | "allowed_clients" => { - Ok(GeneratedField::AllowedClients) - } + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "clientMessage" | "client_message" => Ok(GeneratedField::ClientMessage), + "signer" => Ok(GeneratedField::Signer), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2135,37 +2095,57 @@ impl<'de> serde::Deserialize<'de> for Params { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Params; + type Value = MsgUpdateClient; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.Params") + formatter.write_str("struct ibc.core.client.v1.MsgUpdateClient") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut allowed_clients__ = None; + let mut client_id__ = None; + let mut client_message__ = None; + let mut signer__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::AllowedClients => { - if allowed_clients__.is_some() { - return Err(serde::de::Error::duplicate_field("allowedClients")); + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); } - allowed_clients__ = Some(map_.next_value()?); + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientMessage => { + if client_message__.is_some() { + return Err(serde::de::Error::duplicate_field("clientMessage")); + } + client_message__ = map_.next_value()?; + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); } } } - Ok(Params { - allowed_clients: allowed_clients__.unwrap_or_default(), + Ok(MsgUpdateClient { + client_id: client_id__.unwrap_or_default(), + client_message: client_message__, + signer: signer__.unwrap_or_default(), }) } } - deserializer.deserialize_struct("ibc.core.client.v1.Params", FIELDS, GeneratedVisitor) + deserializer.deserialize_struct( + "ibc.core.client.v1.MsgUpdateClient", + FIELDS, + GeneratedVisitor, + ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryClientParamsRequest { +impl serde::Serialize for MsgUpdateClientResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2174,12 +2154,12 @@ impl serde::Serialize for QueryClientParamsRequest { use serde::ser::SerializeStruct; let len = 0; let struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientParamsRequest", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgUpdateClientResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryClientParamsRequest { +impl<'de> serde::Deserialize<'de> for MsgUpdateClientResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -2220,34 +2200,34 @@ impl<'de> serde::Deserialize<'de> for QueryClientParamsRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientParamsRequest; + type Value = MsgUpdateClientResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientParamsRequest") + formatter.write_str("struct ibc.core.client.v1.MsgUpdateClientResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(QueryClientParamsRequest {}) + Ok(MsgUpdateClientResponse {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientParamsRequest", + "ibc.core.client.v1.MsgUpdateClientResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryClientParamsResponse { +impl serde::Serialize for MsgUpdateParams { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2255,11 +2235,17 @@ impl serde::Serialize for QueryClientParamsResponse { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } if self.params.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientParamsResponse", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgUpdateParams", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } if let Some(v) = self.params.as_ref() { struct_ser.serialize_field("params", v)?; } @@ -2267,16 +2253,17 @@ impl serde::Serialize for QueryClientParamsResponse { } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["params"]; + const FIELDS: &[&str] = &["signer", "params"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + Signer, Params, } #[cfg(feature = "serde")] @@ -2303,6 +2290,7 @@ impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { E: serde::de::Error, { match value { + "signer" => Ok(GeneratedField::Signer), "params" => Ok(GeneratedField::Params), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -2313,22 +2301,26 @@ impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientParamsResponse; + type Value = MsgUpdateParams; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientParamsResponse") + formatter.write_str("struct ibc.core.client.v1.MsgUpdateParams") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { + let mut signer__ = None; let mut params__ = None; while let Some(k) = map_.next_key()? { match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } GeneratedField::Params => { if params__.is_some() { return Err(serde::de::Error::duplicate_field("params")); @@ -2337,49 +2329,44 @@ impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { } } } - Ok(QueryClientParamsResponse { params: params__ }) + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientParamsResponse", + "ibc.core.client.v1.MsgUpdateParams", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryClientStateRequest { +impl serde::Serialize for MsgUpdateParamsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.client_id.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStateRequest", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; - } + let len = 0; + let struct_ser = + serializer.serialize_struct("ibc.core.client.v1.MsgUpdateParamsResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["client_id", "clientId"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - ClientId, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -2403,10 +2390,7 @@ impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { where E: serde::de::Error, { - match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -2414,44 +2398,34 @@ impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryClientStateRequest; + type Value = MsgUpdateParamsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryClientStateRequest") + formatter.write_str("struct ibc.core.client.v1.MsgUpdateParamsResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut client_id__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); - } - client_id__ = Some(map_.next_value()?); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(QueryClientStateRequest { - client_id: client_id__.unwrap_or_default(), - }) + Ok(MsgUpdateParamsResponse {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryClientStateRequest", + "ibc.core.client.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryClientStateResponse { +impl serde::Serialize for MsgUpgradeClient { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2459,53 +2433,84 @@ impl serde::Serialize for QueryClientStateResponse { { use serde::ser::SerializeStruct; let mut len = 0; + if !self.client_id.is_empty() { + len += 1; + } if self.client_state.is_some() { len += 1; } - if !self.proof.is_empty() { + if self.consensus_state.is_some() { len += 1; } - if self.proof_height.is_some() { + if !self.proof_upgrade_client.is_empty() { + len += 1; + } + if !self.proof_upgrade_consensus_state.is_empty() { + len += 1; + } + if !self.signer.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.core.client.v1.QueryClientStateResponse", len)?; + serializer.serialize_struct("ibc.core.client.v1.MsgUpgradeClient", len)?; + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; + } if let Some(v) = self.client_state.as_ref() { struct_ser.serialize_field("clientState", v)?; } - if !self.proof.is_empty() { + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + if !self.proof_upgrade_client.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "proof", - pbjson::private::base64::encode(&self.proof).as_str(), + "proofUpgradeClient", + pbjson::private::base64::encode(&self.proof_upgrade_client).as_str(), )?; } - if let Some(v) = self.proof_height.as_ref() { - struct_ser.serialize_field("proofHeight", v)?; + if !self.proof_upgrade_consensus_state.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proofUpgradeConsensusState", + pbjson::private::base64::encode(&self.proof_upgrade_consensus_state).as_str(), + )?; + } + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryClientStateResponse { +impl<'de> serde::Deserialize<'de> for MsgUpgradeClient { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { const FIELDS: &[&str] = &[ + "client_id", + "clientId", "client_state", "clientState", - "proof", - "proof_height", - "proofHeight", + "consensus_state", + "consensusState", + "proof_upgrade_client", + "proofUpgradeClient", + "proof_upgrade_consensus_state", + "proofUpgradeConsensusState", + "signer", ]; #[allow(clippy::enum_variant_names)] enum GeneratedField { + ClientId, ClientState, - Proof, - ProofHeight, + ConsensusState, + ProofUpgradeClient, + ProofUpgradeConsensusState, + Signer, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2531,9 +2536,660 @@ impl<'de> serde::Deserialize<'de> for QueryClientStateResponse { E: serde::de::Error, { match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), "clientState" | "client_state" => Ok(GeneratedField::ClientState), - "proof" => Ok(GeneratedField::Proof), - "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "consensusState" | "consensus_state" => { + Ok(GeneratedField::ConsensusState) + } + "proofUpgradeClient" | "proof_upgrade_client" => { + Ok(GeneratedField::ProofUpgradeClient) + } + "proofUpgradeConsensusState" | "proof_upgrade_consensus_state" => { + Ok(GeneratedField::ProofUpgradeConsensusState) + } + "signer" => Ok(GeneratedField::Signer), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpgradeClient; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClient") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut client_state__ = None; + let mut consensus_state__ = None; + let mut proof_upgrade_client__ = None; + let mut proof_upgrade_consensus_state__ = None; + let mut signer__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::ClientState => { + if client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("clientState")); + } + client_state__ = map_.next_value()?; + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + GeneratedField::ProofUpgradeClient => { + if proof_upgrade_client__.is_some() { + return Err(serde::de::Error::duplicate_field( + "proofUpgradeClient", + )); + } + proof_upgrade_client__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofUpgradeConsensusState => { + if proof_upgrade_consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "proofUpgradeConsensusState", + )); + } + proof_upgrade_consensus_state__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + } + } + Ok(MsgUpgradeClient { + client_id: client_id__.unwrap_or_default(), + client_state: client_state__, + consensus_state: consensus_state__, + proof_upgrade_client: proof_upgrade_client__.unwrap_or_default(), + proof_upgrade_consensus_state: proof_upgrade_consensus_state__ + .unwrap_or_default(), + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.MsgUpgradeClient", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpgradeClientResponse { + #[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("ibc.core.client.v1.MsgUpgradeClientResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpgradeClientResponse { + #[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 = MsgUpgradeClientResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.MsgUpgradeClientResponse") + } + + 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(MsgUpgradeClientResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.MsgUpgradeClientResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Params { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.allowed_clients.is_empty() { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.Params", len)?; + if !self.allowed_clients.is_empty() { + struct_ser.serialize_field("allowedClients", &self.allowed_clients)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Params { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["allowed_clients", "allowedClients"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + AllowedClients, + } + #[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 { + "allowedClients" | "allowed_clients" => { + Ok(GeneratedField::AllowedClients) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Params; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.Params") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut allowed_clients__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::AllowedClients => { + if allowed_clients__.is_some() { + return Err(serde::de::Error::duplicate_field("allowedClients")); + } + allowed_clients__ = Some(map_.next_value()?); + } + } + } + Ok(Params { + allowed_clients: allowed_clients__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.Params", FIELDS, GeneratedVisitor) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClientParamsRequest { + #[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("ibc.core.client.v1.QueryClientParamsRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClientParamsRequest { + #[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 = QueryClientParamsRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientParamsRequest") + } + + 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(QueryClientParamsRequest {}) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.QueryClientParamsRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClientParamsResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.QueryClientParamsResponse", len)?; + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClientParamsResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Params, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> 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 { + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientParamsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientParamsResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(QueryClientParamsResponse { params: params__ }) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.QueryClientParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClientStateRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.client_id.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.QueryClientStateRequest", len)?; + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClientStateRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["client_id", "clientId"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + } + #[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 { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryClientStateRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryClientStateRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + } + } + Ok(QueryClientStateRequest { + client_id: client_id__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.QueryClientStateRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryClientStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.client_state.is_some() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.QueryClientStateResponse", len)?; + if let Some(v) = self.client_state.as_ref() { + struct_ser.serialize_field("clientState", v)?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_state", + "clientState", + "proof", + "proof_height", + "proofHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientState, + Proof, + ProofHeight, + } + #[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 { + "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -3805,43 +4461,232 @@ impl<'de> serde::Deserialize<'de> for QueryConsensusStatesResponse { fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_states__ = None; + let mut pagination__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusStates => { + if consensus_states__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusStates")); + } + consensus_states__ = Some(map_.next_value()?); + } + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); + } + pagination__ = map_.next_value()?; + } + } + } + Ok(QueryConsensusStatesResponse { + consensus_states: consensus_states__.unwrap_or_default(), + pagination: pagination__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.QueryConsensusStatesResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradedClientStateRequest { + #[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("ibc.core.client.v1.QueryUpgradedClientStateRequest", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateRequest { + #[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 = QueryUpgradedClientStateRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateRequest") + } + + 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(QueryUpgradedClientStateRequest {}) + } + } + deserializer.deserialize_struct( + "ibc.core.client.v1.QueryUpgradedClientStateRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryUpgradedClientStateResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.upgraded_client_state.is_some() { + len += 1; + } + let mut struct_ser = serializer + .serialize_struct("ibc.core.client.v1.QueryUpgradedClientStateResponse", len)?; + if let Some(v) = self.upgraded_client_state.as_ref() { + struct_ser.serialize_field("upgradedClientState", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["upgraded_client_state", "upgradedClientState"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + UpgradedClientState, + } + #[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 { + "upgradedClientState" | "upgraded_client_state" => { + Ok(GeneratedField::UpgradedClientState) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryUpgradedClientStateResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut consensus_states__ = None; - let mut pagination__ = None; + let mut upgraded_client_state__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ConsensusStates => { - if consensus_states__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusStates")); - } - consensus_states__ = Some(map_.next_value()?); - } - GeneratedField::Pagination => { - if pagination__.is_some() { - return Err(serde::de::Error::duplicate_field("pagination")); + GeneratedField::UpgradedClientState => { + if upgraded_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field( + "upgradedClientState", + )); } - pagination__ = map_.next_value()?; + upgraded_client_state__ = map_.next_value()?; } } } - Ok(QueryConsensusStatesResponse { - consensus_states: consensus_states__.unwrap_or_default(), - pagination: pagination__, + Ok(QueryUpgradedClientStateResponse { + upgraded_client_state: upgraded_client_state__, }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryConsensusStatesResponse", + "ibc.core.client.v1.QueryUpgradedClientStateResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUpgradedClientStateRequest { +impl serde::Serialize for QueryUpgradedConsensusStateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3850,12 +4695,12 @@ impl serde::Serialize for QueryUpgradedClientStateRequest { use serde::ser::SerializeStruct; let len = 0; let struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryUpgradedClientStateRequest", len)?; + .serialize_struct("ibc.core.client.v1.QueryUpgradedConsensusStateRequest", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateRequest { +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where @@ -3896,34 +4741,34 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedClientStateRequest; + type Value = QueryUpgradedConsensusStateRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateRequest") + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { while map_.next_key::()?.is_some() { let _ = map_.next_value::()?; } - Ok(QueryUpgradedClientStateRequest {}) + Ok(QueryUpgradedConsensusStateRequest {}) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedClientStateRequest", + "ibc.core.client.v1.QueryUpgradedConsensusStateRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUpgradedClientStateResponse { +impl serde::Serialize for QueryUpgradedConsensusStateResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -3931,29 +4776,31 @@ impl serde::Serialize for QueryUpgradedClientStateResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.upgraded_client_state.is_some() { + if self.upgraded_consensus_state.is_some() { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.core.client.v1.QueryUpgradedClientStateResponse", len)?; - if let Some(v) = self.upgraded_client_state.as_ref() { - struct_ser.serialize_field("upgradedClientState", v)?; + let mut struct_ser = serializer.serialize_struct( + "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + len, + )?; + if let Some(v) = self.upgraded_consensus_state.as_ref() { + struct_ser.serialize_field("upgradedConsensusState", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateResponse { +impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["upgraded_client_state", "upgradedClientState"]; + const FIELDS: &[&str] = &["upgraded_consensus_state", "upgradedConsensusState"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - UpgradedClientState, + UpgradedConsensusState, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -3979,8 +4826,8 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateResponse { E: serde::de::Error, { match value { - "upgradedClientState" | "upgraded_client_state" => { - Ok(GeneratedField::UpgradedClientState) + "upgradedConsensusState" | "upgraded_consensus_state" => { + Ok(GeneratedField::UpgradedConsensusState) } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } @@ -3991,69 +4838,146 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedClientStateResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedClientStateResponse; + type Value = QueryUpgradedConsensusStateResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedClientStateResponse") + formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut upgraded_client_state__ = None; + let mut upgraded_consensus_state__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::UpgradedClientState => { - if upgraded_client_state__.is_some() { + GeneratedField::UpgradedConsensusState => { + if upgraded_consensus_state__.is_some() { return Err(serde::de::Error::duplicate_field( - "upgradedClientState", + "upgradedConsensusState", )); } - upgraded_client_state__ = map_.next_value()?; + upgraded_consensus_state__ = map_.next_value()?; } } } - Ok(QueryUpgradedClientStateResponse { - upgraded_client_state: upgraded_client_state__, + Ok(QueryUpgradedConsensusStateResponse { + upgraded_consensus_state: upgraded_consensus_state__, }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedClientStateResponse", + "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUpgradedConsensusStateRequest { +impl serde::Serialize for QueryVerifyMembershipRequest { #[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("ibc.core.client.v1.QueryUpgradedConsensusStateRequest", len)?; + let mut len = 0; + if !self.client_id.is_empty() { + len += 1; + } + if !self.proof.is_empty() { + len += 1; + } + if self.proof_height.is_some() { + len += 1; + } + if self.merkle_path.is_some() { + len += 1; + } + if !self.value.is_empty() { + len += 1; + } + if self.time_delay != 0 { + len += 1; + } + if self.block_delay != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.QueryVerifyMembershipRequest", len)?; + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if !self.proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "proof", + pbjson::private::base64::encode(&self.proof).as_str(), + )?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if let Some(v) = self.merkle_path.as_ref() { + struct_ser.serialize_field("merklePath", v)?; + } + if !self.value.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "value", + pbjson::private::base64::encode(&self.value).as_str(), + )?; + } + if self.time_delay != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timeDelay", ToString::to_string(&self.time_delay).as_str())?; + } + if self.block_delay != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "blockDelay", + ToString::to_string(&self.block_delay).as_str(), + )?; + } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { +impl<'de> serde::Deserialize<'de> for QueryVerifyMembershipRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[]; + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "proof", + "proof_height", + "proofHeight", + "merkle_path", + "merklePath", + "value", + "time_delay", + "timeDelay", + "block_delay", + "blockDelay", + ]; #[allow(clippy::enum_variant_names)] - enum GeneratedField {} + enum GeneratedField { + ClientId, + Proof, + ProofHeight, + MerklePath, + Value, + TimeDelay, + BlockDelay, + } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -4077,7 +5001,16 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { where E: serde::de::Error, { - Err(serde::de::Error::unknown_field(value, FIELDS)) + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "proof" => Ok(GeneratedField::Proof), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "merklePath" | "merkle_path" => Ok(GeneratedField::MerklePath), + "value" => Ok(GeneratedField::Value), + "timeDelay" | "time_delay" => Ok(GeneratedField::TimeDelay), + "blockDelay" | "block_delay" => Ok(GeneratedField::BlockDelay), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -4085,34 +5018,104 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateRequest { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedConsensusStateRequest; + type Value = QueryVerifyMembershipRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateRequest") + formatter.write_str("struct ibc.core.client.v1.QueryVerifyMembershipRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - while map_.next_key::()?.is_some() { - let _ = map_.next_value::()?; + let mut client_id__ = None; + let mut proof__ = None; + let mut proof_height__ = None; + let mut merkle_path__ = None; + let mut value__ = None; + let mut time_delay__ = None; + let mut block_delay__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); + } + client_id__ = Some(map_.next_value()?); + } + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::ProofHeight => { + if proof_height__.is_some() { + return Err(serde::de::Error::duplicate_field("proofHeight")); + } + proof_height__ = map_.next_value()?; + } + GeneratedField::MerklePath => { + if merkle_path__.is_some() { + return Err(serde::de::Error::duplicate_field("merklePath")); + } + merkle_path__ = map_.next_value()?; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::TimeDelay => { + if time_delay__.is_some() { + return Err(serde::de::Error::duplicate_field("timeDelay")); + } + time_delay__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::BlockDelay => { + if block_delay__.is_some() { + return Err(serde::de::Error::duplicate_field("blockDelay")); + } + block_delay__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } } - Ok(QueryUpgradedConsensusStateRequest {}) + Ok(QueryVerifyMembershipRequest { + client_id: client_id__.unwrap_or_default(), + proof: proof__.unwrap_or_default(), + proof_height: proof_height__, + merkle_path: merkle_path__, + value: value__.unwrap_or_default(), + time_delay: time_delay__.unwrap_or_default(), + block_delay: block_delay__.unwrap_or_default(), + }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateRequest", + "ibc.core.client.v1.QueryVerifyMembershipRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for QueryUpgradedConsensusStateResponse { +impl serde::Serialize for QueryVerifyMembershipResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -4120,31 +5123,29 @@ impl serde::Serialize for QueryUpgradedConsensusStateResponse { { use serde::ser::SerializeStruct; let mut len = 0; - if self.upgraded_consensus_state.is_some() { + if self.success { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", - len, - )?; - if let Some(v) = self.upgraded_consensus_state.as_ref() { - struct_ser.serialize_field("upgradedConsensusState", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.core.client.v1.QueryVerifyMembershipResponse", len)?; + if self.success { + struct_ser.serialize_field("success", &self.success)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { +impl<'de> serde::Deserialize<'de> for QueryVerifyMembershipResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["upgraded_consensus_state", "upgradedConsensusState"]; + const FIELDS: &[&str] = &["success"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - UpgradedConsensusState, + Success, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -4170,9 +5171,7 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { E: serde::de::Error, { match value { - "upgradedConsensusState" | "upgraded_consensus_state" => { - Ok(GeneratedField::UpgradedConsensusState) - } + "success" => Ok(GeneratedField::Success), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -4182,39 +5181,37 @@ impl<'de> serde::Deserialize<'de> for QueryUpgradedConsensusStateResponse { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = QueryUpgradedConsensusStateResponse; + type Value = QueryVerifyMembershipResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.core.client.v1.QueryUpgradedConsensusStateResponse") + formatter.write_str("struct ibc.core.client.v1.QueryVerifyMembershipResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut upgraded_consensus_state__ = None; + let mut success__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::UpgradedConsensusState => { - if upgraded_consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field( - "upgradedConsensusState", - )); + GeneratedField::Success => { + if success__.is_some() { + return Err(serde::de::Error::duplicate_field("success")); } - upgraded_consensus_state__ = map_.next_value()?; + success__ = Some(map_.next_value()?); } } } - Ok(QueryUpgradedConsensusStateResponse { - upgraded_consensus_state: upgraded_consensus_state__, + Ok(QueryVerifyMembershipResponse { + success: success__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.core.client.v1.QueryUpgradedConsensusStateResponse", + "ibc.core.client.v1.QueryVerifyMembershipResponse", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.tonic.rs index 2b97c4bf..5190c5d9 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.client.v1.tonic.rs @@ -275,6 +275,27 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn verify_membership( + &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("/ibc.core.client.v1.Query/VerifyMembership"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.client.v1.Query", + "VerifyMembership", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -330,6 +351,10 @@ pub mod query_server { tonic::Response, tonic::Status, >; + async fn verify_membership( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct QueryServer { @@ -764,6 +789,46 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.core.client.v1.Query/VerifyMembership" => { + #[allow(non_camel_case_types)] + struct VerifyMembershipSvc(pub Arc); + impl tonic::server::UnaryService + for VerifyMembershipSvc + { + type Response = super::QueryVerifyMembershipResponse; + 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).verify_membership(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 = VerifyMembershipSvc(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) @@ -960,6 +1025,67 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn recover_client( + &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("/ibc.core.client.v1.Msg/RecoverClient"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.core.client.v1.Msg", "RecoverClient")); + self.inner.unary(req, path, codec).await + } + pub async fn ibc_software_upgrade( + &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("/ibc.core.client.v1.Msg/IBCSoftwareUpgrade"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.client.v1.Msg", + "IBCSoftwareUpgrade", + )); + self.inner.unary(req, path, codec).await + } + pub async fn update_client_params( + &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("/ibc.core.client.v1.Msg/UpdateClientParams"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.client.v1.Msg", + "UpdateClientParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -986,6 +1112,18 @@ pub mod msg_server { &self, request: tonic::Request, ) -> std::result::Result, tonic::Status>; + async fn recover_client( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn ibc_software_upgrade( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn update_client_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1217,6 +1355,122 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.client.v1.Msg/RecoverClient" => { + #[allow(non_camel_case_types)] + struct RecoverClientSvc(pub Arc); + impl tonic::server::UnaryService for RecoverClientSvc { + type Response = super::MsgRecoverClientResponse; + 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).recover_client(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 = RecoverClientSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.client.v1.Msg/IBCSoftwareUpgrade" => { + #[allow(non_camel_case_types)] + struct IBCSoftwareUpgradeSvc(pub Arc); + impl tonic::server::UnaryService + for IBCSoftwareUpgradeSvc + { + type Response = super::MsgIbcSoftwareUpgradeResponse; + 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).ibc_software_upgrade(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 = IBCSoftwareUpgradeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.core.client.v1.Msg/UpdateClientParams" => { + #[allow(non_camel_case_types)] + struct UpdateClientParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateClientParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { (*inner).update_client_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateClientParamsSvc(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/ibc-go/ibc.core.commitment.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs index 1bae3176..9f31df12 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.commitment.v1.rs @@ -34,7 +34,8 @@ pub struct MerklePath { #[derive(Clone, PartialEq, ::prost::Message)] pub struct MerkleProof { #[prost(message, repeated, tag = "1")] - pub proofs: ::prost::alloc::vec::Vec, + pub proofs: + ::prost::alloc::vec::Vec, } include!("ibc.core.commitment.v1.serde.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs index 6b3c9508..a82dff21 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.rs @@ -363,6 +363,9 @@ pub struct MsgConnectionOpenTry { pub consensus_height: ::core::option::Option, #[prost(string, tag = "12")] pub signer: ::prost::alloc::string::String, + /// optional proof data for host state machines that are unable to introspect their own consensus state + #[prost(bytes = "vec", tag = "13")] + pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenTryResponse defines the Msg/ConnectionOpenTry response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -397,6 +400,9 @@ pub struct MsgConnectionOpenAck { pub consensus_height: ::core::option::Option, #[prost(string, tag = "10")] pub signer: ::prost::alloc::string::String, + /// optional proof data for host state machines that are unable to introspect their own consensus state + #[prost(bytes = "vec", tag = "11")] + pub host_consensus_state_proof: ::prost::alloc::vec::Vec, } /// MsgConnectionOpenAckResponse defines the Msg/ConnectionOpenAck response type. #[allow(clippy::derive_partial_eq_without_eq)] @@ -422,6 +428,23 @@ pub struct MsgConnectionOpenConfirm { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct MsgConnectionOpenConfirmResponse {} +/// MsgUpdateParams defines the sdk.Msg type to update the connection parameters. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParams { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// params defines the connection parameters to update. + /// + /// NOTE: All parameters must be supplied. + #[prost(message, optional, tag = "2")] + pub params: ::core::option::Option, +} +/// MsgUpdateParamsResponse defines the MsgUpdateParams response type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgUpdateParamsResponse {} include!("ibc.core.connection.v1.serde.rs"); include!("ibc.core.connection.v1.tonic.rs"); // @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.serde.rs index b28afb7a..69cd339c 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.serde.rs @@ -946,6 +946,9 @@ impl serde::Serialize for MsgConnectionOpenAck { if !self.signer.is_empty() { len += 1; } + if !self.host_consensus_state_proof.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenAck", len)?; if !self.connection_id.is_empty() { @@ -991,6 +994,13 @@ impl serde::Serialize for MsgConnectionOpenAck { if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; } + if !self.host_consensus_state_proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "hostConsensusStateProof", + pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str(), + )?; + } struct_ser.end() } } @@ -1020,6 +1030,8 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { "consensus_height", "consensusHeight", "signer", + "host_consensus_state_proof", + "hostConsensusStateProof", ]; #[allow(clippy::enum_variant_names)] @@ -1034,6 +1046,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { ProofConsensus, ConsensusHeight, Signer, + HostConsensusStateProof, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1075,6 +1088,9 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { Ok(GeneratedField::ConsensusHeight) } "signer" => Ok(GeneratedField::Signer), + "hostConsensusStateProof" | "host_consensus_state_proof" => { + Ok(GeneratedField::HostConsensusStateProof) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1107,6 +1123,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { let mut proof_consensus__ = None; let mut consensus_height__ = None; let mut signer__ = None; + let mut host_consensus_state_proof__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ConnectionId => { @@ -1180,6 +1197,17 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { } signer__ = Some(map_.next_value()?); } + GeneratedField::HostConsensusStateProof => { + if host_consensus_state_proof__.is_some() { + return Err(serde::de::Error::duplicate_field( + "hostConsensusStateProof", + )); + } + host_consensus_state_proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } } } Ok(MsgConnectionOpenAck { @@ -1193,6 +1221,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenAck { proof_consensus: proof_consensus__.unwrap_or_default(), consensus_height: consensus_height__, signer: signer__.unwrap_or_default(), + host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), }) } } @@ -1845,6 +1874,9 @@ impl serde::Serialize for MsgConnectionOpenTry { if !self.signer.is_empty() { len += 1; } + if !self.host_consensus_state_proof.is_empty() { + len += 1; + } let mut struct_ser = serializer.serialize_struct("ibc.core.connection.v1.MsgConnectionOpenTry", len)?; if !self.client_id.is_empty() { @@ -1899,6 +1931,13 @@ impl serde::Serialize for MsgConnectionOpenTry { if !self.signer.is_empty() { struct_ser.serialize_field("signer", &self.signer)?; } + if !self.host_consensus_state_proof.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "hostConsensusStateProof", + pbjson::private::base64::encode(&self.host_consensus_state_proof).as_str(), + )?; + } struct_ser.end() } } @@ -1932,6 +1971,8 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { "consensus_height", "consensusHeight", "signer", + "host_consensus_state_proof", + "hostConsensusStateProof", ]; #[allow(clippy::enum_variant_names)] @@ -1948,6 +1989,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { ProofConsensus, ConsensusHeight, Signer, + HostConsensusStateProof, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1993,6 +2035,9 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { Ok(GeneratedField::ConsensusHeight) } "signer" => Ok(GeneratedField::Signer), + "hostConsensusStateProof" | "host_consensus_state_proof" => { + Ok(GeneratedField::HostConsensusStateProof) + } _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2027,6 +2072,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { let mut proof_consensus__ = None; let mut consensus_height__ = None; let mut signer__ = None; + let mut host_consensus_state_proof__ = None; while let Some(k) = map_.next_key()? { match k { GeneratedField::ClientId => { @@ -2117,6 +2163,17 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { } signer__ = Some(map_.next_value()?); } + GeneratedField::HostConsensusStateProof => { + if host_consensus_state_proof__.is_some() { + return Err(serde::de::Error::duplicate_field( + "hostConsensusStateProof", + )); + } + host_consensus_state_proof__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } } } Ok(MsgConnectionOpenTry { @@ -2132,6 +2189,7 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTry { proof_consensus: proof_consensus__.unwrap_or_default(), consensus_height: consensus_height__, signer: signer__.unwrap_or_default(), + host_consensus_state_proof: host_consensus_state_proof__.unwrap_or_default(), }) } } @@ -2225,6 +2283,204 @@ impl<'de> serde::Deserialize<'de> for MsgConnectionOpenTryResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParams { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signer.is_empty() { + len += 1; + } + if self.params.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.core.connection.v1.MsgUpdateParams", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; + } + if let Some(v) = self.params.as_ref() { + struct_ser.serialize_field("params", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParams { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signer", "params"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signer, + Params, + } + #[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 { + "signer" => Ok(GeneratedField::Signer), + "params" => Ok(GeneratedField::Params), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgUpdateParams; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgUpdateParams") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signer__ = None; + let mut params__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); + } + signer__ = Some(map_.next_value()?); + } + GeneratedField::Params => { + if params__.is_some() { + return Err(serde::de::Error::duplicate_field("params")); + } + params__ = map_.next_value()?; + } + } + } + Ok(MsgUpdateParams { + signer: signer__.unwrap_or_default(), + params: params__, + }) + } + } + deserializer.deserialize_struct( + "ibc.core.connection.v1.MsgUpdateParams", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for MsgUpdateParamsResponse { + #[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("ibc.core.connection.v1.MsgUpdateParamsResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { + #[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 = MsgUpdateParamsResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.core.connection.v1.MsgUpdateParamsResponse") + } + + 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(MsgUpdateParamsResponse {}) + } + } + deserializer.deserialize_struct( + "ibc.core.connection.v1.MsgUpdateParamsResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for Params { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.tonic.rs index fb5181d3..412ac4bf 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.core.connection.v1.tonic.rs @@ -791,6 +791,28 @@ pub mod msg_client { )); self.inner.unary(req, path, codec).await } + pub async fn update_connection_params( + &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( + "/ibc.core.connection.v1.Msg/UpdateConnectionParams", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.core.connection.v1.Msg", + "UpdateConnectionParams", + )); + self.inner.unary(req, path, codec).await + } } } /// Generated server implementations. @@ -820,6 +842,10 @@ pub mod msg_server { tonic::Response, tonic::Status, >; + async fn update_connection_params( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; } #[derive(Debug)] pub struct MsgServer { @@ -1054,6 +1080,45 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.connection.v1.Msg/UpdateConnectionParams" => { + #[allow(non_camel_case_types)] + struct UpdateConnectionParamsSvc(pub Arc); + impl tonic::server::UnaryService for UpdateConnectionParamsSvc { + type Response = super::MsgUpdateParamsResponse; + type Future = BoxFuture, tonic::Status>; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = + async move { (*inner).update_connection_params(request).await }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let inner = inner.0; + let method = UpdateConnectionParamsSvc(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/ibc-go/ibc.lightclients.localhost.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs deleted file mode 100644 index 69702480..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.rs +++ /dev/null @@ -1,15 +0,0 @@ -// @generated -/// ClientState defines a loopback (localhost) client. It requires (read-only) -/// access to keys outside the client prefix. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - /// self chain ID - #[prost(string, tag = "1")] - pub chain_id: ::prost::alloc::string::String, - /// self latest block height - #[prost(message, optional, tag = "2")] - pub height: ::core::option::Option, -} -include!("ibc.lightclients.localhost.v1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.rs new file mode 100644 index 00000000..c0b2cf71 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.rs @@ -0,0 +1,11 @@ +// @generated +/// ClientState defines the 09-localhost client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// the latest block height + #[prost(message, optional, tag = "1")] + pub latest_height: ::core::option::Option, +} +include!("ibc.lightclients.localhost.v2.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.serde.rs similarity index 67% rename from cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.serde.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.serde.rs index 6cfcf46c..c3c7fe0e 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.localhost.v2.serde.rs @@ -8,19 +8,13 @@ impl serde::Serialize for ClientState { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.chain_id.is_empty() { - len += 1; - } - if self.height.is_some() { + if self.latest_height.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.localhost.v1.ClientState", len)?; - if !self.chain_id.is_empty() { - struct_ser.serialize_field("chainId", &self.chain_id)?; - } - if let Some(v) = self.height.as_ref() { - struct_ser.serialize_field("height", v)?; + serializer.serialize_struct("ibc.lightclients.localhost.v2.ClientState", len)?; + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; } struct_ser.end() } @@ -32,12 +26,11 @@ impl<'de> serde::Deserialize<'de> for ClientState { where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["chain_id", "chainId", "height"]; + const FIELDS: &[&str] = &["latest_height", "latestHeight"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ChainId, - Height, + LatestHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -63,8 +56,7 @@ impl<'de> serde::Deserialize<'de> for ClientState { E: serde::de::Error, { match value { - "chainId" | "chain_id" => Ok(GeneratedField::ChainId), - "height" => Ok(GeneratedField::Height), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -77,39 +69,31 @@ impl<'de> serde::Deserialize<'de> for ClientState { type Value = ClientState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.localhost.v1.ClientState") + formatter.write_str("struct ibc.lightclients.localhost.v2.ClientState") } fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut chain_id__ = None; - let mut height__ = None; + let mut latest_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ChainId => { - if chain_id__.is_some() { - return Err(serde::de::Error::duplicate_field("chainId")); - } - chain_id__ = Some(map_.next_value()?); - } - GeneratedField::Height => { - if height__.is_some() { - return Err(serde::de::Error::duplicate_field("height")); + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); } - height__ = map_.next_value()?; + latest_height__ = map_.next_value()?; } } } Ok(ClientState { - chain_id: chain_id__.unwrap_or_default(), - height: height__, + latest_height: latest_height__, }) } } deserializer.deserialize_struct( - "ibc.lightclients.localhost.v1.ClientState", + "ibc.lightclients.localhost.v2.ClientState", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs deleted file mode 100644 index e6a41f85..00000000 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.rs +++ /dev/null @@ -1,260 +0,0 @@ -// @generated -/// ClientState defines a solo machine client that tracks the current consensus -/// state and if the client is frozen. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientState { - /// latest sequence of the client state - #[prost(uint64, tag = "1")] - pub sequence: u64, - /// frozen sequence of the solo machine - #[prost(uint64, tag = "2")] - pub frozen_sequence: u64, - #[prost(message, optional, tag = "3")] - pub consensus_state: ::core::option::Option, - /// when set to true, will allow governance to update a solo machine client. - /// The client will be unfrozen if it is frozen. - #[prost(bool, tag = "4")] - pub allow_update_after_proposal: bool, -} -/// ConsensusState defines a solo machine consensus state. The sequence of a -/// consensus state is contained in the "height" key used in storing the -/// consensus state. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusState { - /// public key of the solo machine - #[prost(message, optional, tag = "1")] - pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// diversifier allows the same public key to be re-used across different solo - /// machine clients (potentially on different chains) without being considered - /// misbehaviour. - #[prost(string, tag = "2")] - pub diversifier: ::prost::alloc::string::String, - #[prost(uint64, tag = "3")] - pub timestamp: u64, -} -/// Header defines a solo machine consensus header -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Header { - /// sequence to update solo machine public key at - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(bytes = "vec", tag = "3")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "4")] - pub new_public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - #[prost(string, tag = "5")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// Misbehaviour defines misbehaviour for a solo machine which consists -/// of a sequence and two signatures over different messages at that sequence. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct Misbehaviour { - #[prost(string, tag = "1")] - pub client_id: ::prost::alloc::string::String, - #[prost(uint64, tag = "2")] - pub sequence: u64, - #[prost(message, optional, tag = "3")] - pub signature_one: ::core::option::Option, - #[prost(message, optional, tag = "4")] - pub signature_two: ::core::option::Option, -} -/// SignatureAndData contains a signature and the data signed over to create that -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignatureAndData { - #[prost(bytes = "vec", tag = "1")] - pub signature: ::prost::alloc::vec::Vec, - #[prost(enumeration = "DataType", tag = "2")] - pub data_type: i32, - #[prost(bytes = "vec", tag = "3")] - pub data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "4")] - pub timestamp: u64, -} -/// TimestampedSignatureData contains the signature data and the timestamp of the -/// signature. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct TimestampedSignatureData { - #[prost(bytes = "vec", tag = "1")] - pub signature_data: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub timestamp: u64, -} -/// SignBytes defines the signed bytes used for signature verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct SignBytes { - #[prost(uint64, tag = "1")] - pub sequence: u64, - #[prost(uint64, tag = "2")] - pub timestamp: u64, - #[prost(string, tag = "3")] - pub diversifier: ::prost::alloc::string::String, - /// type of the data used - #[prost(enumeration = "DataType", tag = "4")] - pub data_type: i32, - /// marshaled data - #[prost(bytes = "vec", tag = "5")] - pub data: ::prost::alloc::vec::Vec, -} -/// HeaderData returns the SignBytes data for update verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct HeaderData { - /// header public key - #[prost(message, optional, tag = "1")] - pub new_pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, - /// header diversifier - #[prost(string, tag = "2")] - pub new_diversifier: ::prost::alloc::string::String, -} -/// ClientStateData returns the SignBytes data for client state verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ClientStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub client_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, -} -/// ConsensusStateData returns the SignBytes data for consensus state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConsensusStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub consensus_state: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, -} -/// ConnectionStateData returns the SignBytes data for connection state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ConnectionStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub connection: - ::core::option::Option, -} -/// ChannelStateData returns the SignBytes data for channel state -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct ChannelStateData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(message, optional, tag = "2")] - pub channel: ::core::option::Option, -} -/// PacketCommitmentData returns the SignBytes data for packet commitment -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketCommitmentData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub commitment: ::prost::alloc::vec::Vec, -} -/// PacketAcknowledgementData returns the SignBytes data for acknowledgement -/// verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketAcknowledgementData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(bytes = "vec", tag = "2")] - pub acknowledgement: ::prost::alloc::vec::Vec, -} -/// PacketReceiptAbsenceData returns the SignBytes data for -/// packet receipt absence verification. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct PacketReceiptAbsenceData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, -} -/// NextSequenceRecvData returns the SignBytes data for verification of the next -/// sequence to be received. -#[allow(clippy::derive_partial_eq_without_eq)] -#[derive(Clone, PartialEq, ::prost::Message)] -pub struct NextSequenceRecvData { - #[prost(bytes = "vec", tag = "1")] - pub path: ::prost::alloc::vec::Vec, - #[prost(uint64, tag = "2")] - pub next_seq_recv: u64, -} -/// DataType defines the type of solo machine proof being created. This is done -/// to preserve uniqueness of different data sign byte encodings. -#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] -#[repr(i32)] -pub enum DataType { - /// Default State - UninitializedUnspecified = 0, - /// Data type for client state verification - ClientState = 1, - /// Data type for consensus state verification - ConsensusState = 2, - /// Data type for connection state verification - ConnectionState = 3, - /// Data type for channel state verification - ChannelState = 4, - /// Data type for packet commitment verification - PacketCommitment = 5, - /// Data type for packet acknowledgement verification - PacketAcknowledgement = 6, - /// Data type for packet receipt absence verification - PacketReceiptAbsence = 7, - /// Data type for next sequence recv verification - NextSequenceRecv = 8, - /// Data type for header verification - Header = 9, -} -impl DataType { - /// 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 { - DataType::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - DataType::ClientState => "DATA_TYPE_CLIENT_STATE", - DataType::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", - DataType::ConnectionState => "DATA_TYPE_CONNECTION_STATE", - DataType::ChannelState => "DATA_TYPE_CHANNEL_STATE", - DataType::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", - DataType::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - DataType::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - DataType::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", - DataType::Header => "DATA_TYPE_HEADER", - } - } - /// Creates an enum from field names used in the ProtoBuf definition. - pub fn from_str_name(value: &str) -> ::core::option::Option { - match value { - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Some(Self::UninitializedUnspecified), - "DATA_TYPE_CLIENT_STATE" => Some(Self::ClientState), - "DATA_TYPE_CONSENSUS_STATE" => Some(Self::ConsensusState), - "DATA_TYPE_CONNECTION_STATE" => Some(Self::ConnectionState), - "DATA_TYPE_CHANNEL_STATE" => Some(Self::ChannelState), - "DATA_TYPE_PACKET_COMMITMENT" => Some(Self::PacketCommitment), - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Some(Self::PacketAcknowledgement), - "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Some(Self::PacketReceiptAbsence), - "DATA_TYPE_NEXT_SEQUENCE_RECV" => Some(Self::NextSequenceRecv), - "DATA_TYPE_HEADER" => Some(Self::Header), - _ => None, - } - } -} -include!("ibc.lightclients.solomachine.v1.serde.rs"); -// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.rs new file mode 100644 index 00000000..5e0a26e4 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.rs @@ -0,0 +1,114 @@ +// @generated +/// ClientState defines a solo machine client that tracks the current consensus +/// state and if the client is frozen. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// latest sequence of the client state + #[prost(uint64, tag = "1")] + pub sequence: u64, + /// frozen sequence of the solo machine + #[prost(bool, tag = "2")] + pub is_frozen: bool, + #[prost(message, optional, tag = "3")] + pub consensus_state: ::core::option::Option, +} +/// ConsensusState defines a solo machine consensus state. The sequence of a +/// consensus state is contained in the "height" key used in storing the +/// consensus state. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusState { + /// public key of the solo machine + #[prost(message, optional, tag = "1")] + pub public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + /// diversifier allows the same public key to be re-used across different solo + /// machine clients (potentially on different chains) without being considered + /// misbehaviour. + #[prost(string, tag = "2")] + pub diversifier: ::prost::alloc::string::String, + #[prost(uint64, tag = "3")] + pub timestamp: u64, +} +/// Header defines a solo machine consensus header +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Header { + #[prost(uint64, tag = "1")] + pub timestamp: u64, + #[prost(bytes = "vec", tag = "2")] + pub signature: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub new_public_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + #[prost(string, tag = "4")] + pub new_diversifier: ::prost::alloc::string::String, +} +/// Misbehaviour defines misbehaviour for a solo machine which consists +/// of a sequence and two signatures over different messages at that sequence. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Misbehaviour { + #[prost(uint64, tag = "1")] + pub sequence: u64, + #[prost(message, optional, tag = "2")] + pub signature_one: ::core::option::Option, + #[prost(message, optional, tag = "3")] + pub signature_two: ::core::option::Option, +} +/// SignatureAndData contains a signature and the data signed over to create that +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SignatureAndData { + #[prost(bytes = "vec", tag = "1")] + pub signature: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub path: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "4")] + pub timestamp: u64, +} +/// TimestampedSignatureData contains the signature data and the timestamp of the +/// signature. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct TimestampedSignatureData { + #[prost(bytes = "vec", tag = "1")] + pub signature_data: ::prost::alloc::vec::Vec, + #[prost(uint64, tag = "2")] + pub timestamp: u64, +} +/// SignBytes defines the signed bytes used for signature verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct SignBytes { + /// the sequence number + #[prost(uint64, tag = "1")] + pub sequence: u64, + /// the proof timestamp + #[prost(uint64, tag = "2")] + pub timestamp: u64, + /// the public key diversifier + #[prost(string, tag = "3")] + pub diversifier: ::prost::alloc::string::String, + /// the standardised path bytes + #[prost(bytes = "vec", tag = "4")] + pub path: ::prost::alloc::vec::Vec, + /// the marshaled data bytes + #[prost(bytes = "vec", tag = "5")] + pub data: ::prost::alloc::vec::Vec, +} +/// HeaderData returns the SignBytes data for update verification. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct HeaderData { + /// header public key + #[prost(message, optional, tag = "1")] + pub new_pub_key: ::core::option::Option<::tendermint_proto::google::protobuf::Any>, + /// header diversifier + #[prost(string, tag = "2")] + pub new_diversifier: ::prost::alloc::string::String, +} +include!("ibc.lightclients.solomachine.v3.serde.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.serde.rs new file mode 100644 index 00000000..208119a3 --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v3.serde.rs @@ -0,0 +1,1203 @@ +// @generated +#[cfg(feature = "serde")] +impl serde::Serialize for ClientState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.sequence != 0 { + len += 1; + } + if self.is_frozen { + len += 1; + } + if self.consensus_state.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.ClientState", len)?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if self.is_frozen { + struct_ser.serialize_field("isFrozen", &self.is_frozen)?; + } + if let Some(v) = self.consensus_state.as_ref() { + struct_ser.serialize_field("consensusState", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ClientState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "is_frozen", + "isFrozen", + "consensus_state", + "consensusState", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + IsFrozen, + ConsensusState, + } + #[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 { + "sequence" => Ok(GeneratedField::Sequence), + "isFrozen" | "is_frozen" => Ok(GeneratedField::IsFrozen), + "consensusState" | "consensus_state" => { + Ok(GeneratedField::ConsensusState) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ClientState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.ClientState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut is_frozen__ = None; + let mut consensus_state__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::IsFrozen => { + if is_frozen__.is_some() { + return Err(serde::de::Error::duplicate_field("isFrozen")); + } + is_frozen__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusState => { + if consensus_state__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusState")); + } + consensus_state__ = map_.next_value()?; + } + } + } + Ok(ClientState { + sequence: sequence__.unwrap_or_default(), + is_frozen: is_frozen__.unwrap_or_default(), + consensus_state: consensus_state__, + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.ClientState", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for ConsensusState { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.public_key.is_some() { + len += 1; + } + if !self.diversifier.is_empty() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.ConsensusState", len)?; + if let Some(v) = self.public_key.as_ref() { + struct_ser.serialize_field("publicKey", v)?; + } + if !self.diversifier.is_empty() { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for ConsensusState { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["public_key", "publicKey", "diversifier", "timestamp"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PublicKey, + Diversifier, + Timestamp, + } + #[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 { + "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), + "diversifier" => Ok(GeneratedField::Diversifier), + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = ConsensusState; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.ConsensusState") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut public_key__ = None; + let mut diversifier__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::PublicKey => { + if public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("publicKey")); + } + public_key__ = map_.next_value()?; + } + GeneratedField::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(ConsensusState { + public_key: public_key__, + diversifier: diversifier__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.ConsensusState", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Header { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.timestamp != 0 { + len += 1; + } + if !self.signature.is_empty() { + len += 1; + } + if self.new_public_key.is_some() { + len += 1; + } + if !self.new_diversifier.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.Header", len)?; + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + if !self.signature.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "signature", + pbjson::private::base64::encode(&self.signature).as_str(), + )?; + } + if let Some(v) = self.new_public_key.as_ref() { + struct_ser.serialize_field("newPublicKey", v)?; + } + if !self.new_diversifier.is_empty() { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Header { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "timestamp", + "signature", + "new_public_key", + "newPublicKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Timestamp, + Signature, + NewPublicKey, + NewDiversifier, + } + #[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 { + "timestamp" => Ok(GeneratedField::Timestamp), + "signature" => Ok(GeneratedField::Signature), + "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), + "newDiversifier" | "new_diversifier" => { + Ok(GeneratedField::NewDiversifier) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Header; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.Header") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut timestamp__ = None; + let mut signature__ = None; + let mut new_public_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::NewPublicKey => { + if new_public_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPublicKey")); + } + new_public_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(Header { + timestamp: timestamp__.unwrap_or_default(), + signature: signature__.unwrap_or_default(), + new_public_key: new_public_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.Header", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for HeaderData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.new_pub_key.is_some() { + len += 1; + } + if !self.new_diversifier.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.HeaderData", len)?; + if let Some(v) = self.new_pub_key.as_ref() { + struct_ser.serialize_field("newPubKey", v)?; + } + if !self.new_diversifier.is_empty() { + struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for HeaderData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "new_pub_key", + "newPubKey", + "new_diversifier", + "newDiversifier", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + NewPubKey, + NewDiversifier, + } + #[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 { + "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), + "newDiversifier" | "new_diversifier" => { + Ok(GeneratedField::NewDiversifier) + } + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = HeaderData; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.HeaderData") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut new_pub_key__ = None; + let mut new_diversifier__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::NewPubKey => { + if new_pub_key__.is_some() { + return Err(serde::de::Error::duplicate_field("newPubKey")); + } + new_pub_key__ = map_.next_value()?; + } + GeneratedField::NewDiversifier => { + if new_diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("newDiversifier")); + } + new_diversifier__ = Some(map_.next_value()?); + } + } + } + Ok(HeaderData { + new_pub_key: new_pub_key__, + new_diversifier: new_diversifier__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.HeaderData", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for Misbehaviour { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.sequence != 0 { + len += 1; + } + if self.signature_one.is_some() { + len += 1; + } + if self.signature_two.is_some() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.Misbehaviour", len)?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if let Some(v) = self.signature_one.as_ref() { + struct_ser.serialize_field("signatureOne", v)?; + } + if let Some(v) = self.signature_two.as_ref() { + struct_ser.serialize_field("signatureTwo", v)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for Misbehaviour { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "sequence", + "signature_one", + "signatureOne", + "signature_two", + "signatureTwo", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + SignatureOne, + SignatureTwo, + } + #[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 { + "sequence" => Ok(GeneratedField::Sequence), + "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), + "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = Misbehaviour; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.Misbehaviour") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut signature_one__ = None; + let mut signature_two__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::SignatureOne => { + if signature_one__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureOne")); + } + signature_one__ = map_.next_value()?; + } + GeneratedField::SignatureTwo => { + if signature_two__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureTwo")); + } + signature_two__ = map_.next_value()?; + } + } + } + Ok(Misbehaviour { + sequence: sequence__.unwrap_or_default(), + signature_one: signature_one__, + signature_two: signature_two__, + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.Misbehaviour", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignBytes { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if self.sequence != 0 { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + if !self.diversifier.is_empty() { + len += 1; + } + if !self.path.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.SignBytes", len)?; + if self.sequence != 0 { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + if !self.diversifier.is_empty() { + struct_ser.serialize_field("diversifier", &self.diversifier)?; + } + if !self.path.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignBytes { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["sequence", "timestamp", "diversifier", "path", "data"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Sequence, + Timestamp, + Diversifier, + Path, + Data, + } + #[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 { + "sequence" => Ok(GeneratedField::Sequence), + "timestamp" => Ok(GeneratedField::Timestamp), + "diversifier" => Ok(GeneratedField::Diversifier), + "path" => Ok(GeneratedField::Path), + "data" => Ok(GeneratedField::Data), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignBytes; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.SignBytes") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut sequence__ = None; + let mut timestamp__ = None; + let mut diversifier__ = None; + let mut path__ = None; + let mut data__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Sequence => { + if sequence__.is_some() { + return Err(serde::de::Error::duplicate_field("sequence")); + } + sequence__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + GeneratedField::Diversifier => { + if diversifier__.is_some() { + return Err(serde::de::Error::duplicate_field("diversifier")); + } + diversifier__ = Some(map_.next_value()?); + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(SignBytes { + sequence: sequence__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + diversifier: diversifier__.unwrap_or_default(), + path: path__.unwrap_or_default(), + data: data__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.SignBytes", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for SignatureAndData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signature.is_empty() { + len += 1; + } + if !self.path.is_empty() { + len += 1; + } + if !self.data.is_empty() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.solomachine.v3.SignatureAndData", len)?; + if !self.signature.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "signature", + pbjson::private::base64::encode(&self.signature).as_str(), + )?; + } + if !self.path.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + } + if !self.data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for SignatureAndData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signature", "path", "data", "timestamp"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Signature, + Path, + Data, + Timestamp, + } + #[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 { + "signature" => Ok(GeneratedField::Signature), + "path" => Ok(GeneratedField::Path), + "data" => Ok(GeneratedField::Data), + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = SignatureAndData; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct ibc.lightclients.solomachine.v3.SignatureAndData") + } + + fn visit_map(self, mut map_: V) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature__ = None; + let mut path__ = None; + let mut data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Signature => { + if signature__.is_some() { + return Err(serde::de::Error::duplicate_field("signature")); + } + signature__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Path => { + if path__.is_some() { + return Err(serde::de::Error::duplicate_field("path")); + } + path__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); + } + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(SignatureAndData { + signature: signature__.unwrap_or_default(), + path: path__.unwrap_or_default(), + data: data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.SignatureAndData", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for TimestampedSignatureData { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.signature_data.is_empty() { + len += 1; + } + if self.timestamp != 0 { + len += 1; + } + let mut struct_ser = serializer.serialize_struct( + "ibc.lightclients.solomachine.v3.TimestampedSignatureData", + len, + )?; + if !self.signature_data.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "signatureData", + pbjson::private::base64::encode(&self.signature_data).as_str(), + )?; + } + if self.timestamp != 0 { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["signature_data", "signatureData", "timestamp"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + SignatureData, + Timestamp, + } + #[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 { + "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), + "timestamp" => Ok(GeneratedField::Timestamp), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = TimestampedSignatureData; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter + .write_str("struct ibc.lightclients.solomachine.v3.TimestampedSignatureData") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut signature_data__ = None; + let mut timestamp__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::SignatureData => { + if signature_data__.is_some() { + return Err(serde::de::Error::duplicate_field("signatureData")); + } + signature_data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::Timestamp => { + if timestamp__.is_some() { + return Err(serde::de::Error::duplicate_field("timestamp")); + } + timestamp__ = Some( + map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + .0, + ); + } + } + } + Ok(TimestampedSignatureData { + signature_data: signature_data__.unwrap_or_default(), + timestamp: timestamp__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "ibc.lightclients.solomachine.v3.TimestampedSignatureData", + FIELDS, + GeneratedVisitor, + ) + } +} diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs index 5722b04a..7053d3a3 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.tendermint.v1.rs @@ -26,7 +26,8 @@ pub struct ClientState { pub latest_height: ::core::option::Option, /// Proof specifications used in verifying counterparty state #[prost(message, repeated, tag = "8")] - pub proof_specs: ::prost::alloc::vec::Vec, + pub proof_specs: + ::prost::alloc::vec::Vec, /// Path at which next upgraded client will be committed. /// Each element corresponds to the key for a single CommitmentProof in the /// chained proof. NOTE: ClientState must stored under @@ -64,6 +65,8 @@ pub struct ConsensusState { #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] pub struct Misbehaviour { + /// ClientID is deprecated + #[deprecated] #[prost(string, tag = "1")] pub client_id: ::prost::alloc::string::String, #[prost(message, optional, tag = "2")] diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.rs new file mode 100644 index 00000000..66427d1b --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.rs @@ -0,0 +1,152 @@ +// @generated +/// GenesisState defines 08-wasm's keeper genesis state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct GenesisState { + /// uploaded light client wasm contracts + #[prost(message, repeated, tag = "1")] + pub contracts: ::prost::alloc::vec::Vec, +} +/// Contract stores contract code +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Contract { + /// contract byte code + #[prost(bytes = "vec", tag = "1")] + pub code_bytes: ::prost::alloc::vec::Vec, +} +/// QueryChecksumsRequest is the request type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsRequest { + /// pagination defines an optional pagination for the request. + #[prost(message, optional, tag = "1")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageRequest, + >, +} +/// QueryChecksumsResponse is the response type for the Query/Checksums RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryChecksumsResponse { + /// checksums is a list of the hex encoded checksums of all wasm codes stored. + #[prost(string, repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::string::String>, + /// pagination defines the pagination in the response. + #[prost(message, optional, tag = "2")] + pub pagination: ::core::option::Option< + super::super::super::super::cosmos::base::query::v1beta1::PageResponse, + >, +} +/// QueryCodeRequest is the request type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeRequest { + /// checksum is a hex encoded string of the code stored. + #[prost(string, tag = "1")] + pub checksum: ::prost::alloc::string::String, +} +/// QueryCodeResponse is the response type for the Query/Code RPC method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryCodeResponse { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +/// MsgStoreCode defines the request type for the StoreCode rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCode { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// wasm byte code of light client contract. It can be raw or gzip compressed + #[prost(bytes = "vec", tag = "2")] + pub wasm_byte_code: ::prost::alloc::vec::Vec, +} +/// MsgStoreCodeResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgStoreCodeResponse { + /// checksum is the sha256 hash of the stored code + #[prost(bytes = "vec", tag = "1")] + pub checksum: ::prost::alloc::vec::Vec, +} +/// MsgRemoveChecksum defines the request type for the MsgRemoveChecksum rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksum { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// checksum is the sha256 hash to be removed from the store + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, +} +/// MsgStoreChecksumResponse defines the response type for the StoreCode rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgRemoveChecksumResponse {} +/// MsgMigrateContract defines the request type for the MigrateContract rpc. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContract { + /// signer address + #[prost(string, tag = "1")] + pub signer: ::prost::alloc::string::String, + /// the client id of the contract + #[prost(string, tag = "2")] + pub client_id: ::prost::alloc::string::String, + /// checksum is the sha256 hash of the new wasm byte code for the contract + #[prost(bytes = "vec", tag = "3")] + pub checksum: ::prost::alloc::vec::Vec, + /// the json encoded message to be passed to the contract on migration + #[prost(bytes = "vec", tag = "4")] + pub msg: ::prost::alloc::vec::Vec, +} +/// MsgMigrateContractResponse defines the response type for the MigrateContract rpc +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMigrateContractResponse {} +/// Wasm light client's Client state +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientState { + /// bytes encoding the client state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "2")] + pub checksum: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "3")] + pub latest_height: ::core::option::Option, +} +/// Wasm light client's ConsensusState +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ConsensusState { + /// bytes encoding the consensus state of the underlying light client + /// implemented as a Wasm contract. + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +/// Wasm light client message (either header(s) or misbehaviour) +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct ClientMessage { + #[prost(bytes = "vec", tag = "1")] + pub data: ::prost::alloc::vec::Vec, +} +/// Checksums defines a list of all checksums that are stored +/// +/// Deprecated: This message is deprecated in favor of storing the checksums +/// using a Collections.KeySet. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct Checksums { + #[prost(bytes = "vec", repeated, tag = "1")] + pub checksums: ::prost::alloc::vec::Vec<::prost::alloc::vec::Vec>, +} +include!("ibc.lightclients.wasm.v1.serde.rs"); +include!("ibc.lightclients.wasm.v1.tonic.rs"); +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.serde.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.serde.rs similarity index 50% rename from cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.serde.rs rename to cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.serde.rs index 5753003b..5c041260 100644 --- a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.solomachine.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.serde.rs @@ -1,6 +1,6 @@ // @generated #[cfg(feature = "serde")] -impl serde::Serialize for ChannelStateData { +impl serde::Serialize for Checksums { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -8,38 +8,36 @@ impl serde::Serialize for ChannelStateData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.channel.is_some() { + if !self.checksums.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.ChannelStateData", len)?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.channel.as_ref() { - struct_ser.serialize_field("channel", v)?; + serializer.serialize_struct("ibc.lightclients.wasm.v1.Checksums", len)?; + if !self.checksums.is_empty() { + struct_ser.serialize_field( + "checksums", + &self + .checksums + .iter() + .map(pbjson::private::base64::encode) + .collect::>(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ChannelStateData { +impl<'de> serde::Deserialize<'de> for Checksums { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "channel"]; + const FIELDS: &[&str] = &["checksums"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - Channel, + Checksums, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -65,8 +63,7 @@ impl<'de> serde::Deserialize<'de> for ChannelStateData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "channel" => Ok(GeneratedField::Channel), + "checksums" => Ok(GeneratedField::Checksums), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -76,52 +73,46 @@ impl<'de> serde::Deserialize<'de> for ChannelStateData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ChannelStateData; + type Value = Checksums; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ChannelStateData") + formatter.write_str("struct ibc.lightclients.wasm.v1.Checksums") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut channel__ = None; + let mut checksums__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, + checksums__ = Some( + map_.next_value::>>()? + .into_iter() + .map(|x| x.0) + .collect(), ); } - GeneratedField::Channel => { - if channel__.is_some() { - return Err(serde::de::Error::duplicate_field("channel")); - } - channel__ = map_.next_value()?; - } } } - Ok(ChannelStateData { - path: path__.unwrap_or_default(), - channel: channel__, + Ok(Checksums { + checksums: checksums__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ChannelStateData", + "ibc.lightclients.wasm.v1.Checksums", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ClientState { +impl serde::Serialize for ClientMessage { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -129,66 +120,31 @@ impl serde::Serialize for ClientState { { use serde::ser::SerializeStruct; let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.frozen_sequence != 0 { - len += 1; - } - if self.consensus_state.is_some() { - len += 1; - } - if self.allow_update_after_proposal { + if !self.data.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.ClientState", len)?; - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.frozen_sequence != 0 { + serializer.serialize_struct("ibc.lightclients.wasm.v1.ClientMessage", len)?; + if !self.data.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "frozenSequence", - ToString::to_string(&self.frozen_sequence).as_str(), - )?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; - } - if self.allow_update_after_proposal { - struct_ser.serialize_field( - "allowUpdateAfterProposal", - &self.allow_update_after_proposal, - )?; + struct_ser + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ClientState { +impl<'de> serde::Deserialize<'de> for ClientMessage { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "sequence", - "frozen_sequence", - "frozenSequence", - "consensus_state", - "consensusState", - "allow_update_after_proposal", - "allowUpdateAfterProposal", - ]; + const FIELDS: &[&str] = &["data"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequence, - FrozenSequence, - ConsensusState, - AllowUpdateAfterProposal, + Data, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -214,16 +170,7 @@ impl<'de> serde::Deserialize<'de> for ClientState { E: serde::de::Error, { match value { - "sequence" => Ok(GeneratedField::Sequence), - "frozenSequence" | "frozen_sequence" => { - Ok(GeneratedField::FrozenSequence) - } - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } - "allowUpdateAfterProposal" | "allow_update_after_proposal" => { - Ok(GeneratedField::AllowUpdateAfterProposal) - } + "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -233,73 +180,44 @@ impl<'de> serde::Deserialize<'de> for ClientState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientState; + type Value = ClientMessage; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ClientState") + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientMessage") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequence__ = None; - let mut frozen_sequence__ = None; - let mut consensus_state__ = None; - let mut allow_update_after_proposal__ = None; + let mut data__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::FrozenSequence => { - if frozen_sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("frozenSequence")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - frozen_sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + data__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map_.next_value()?; - } - GeneratedField::AllowUpdateAfterProposal => { - if allow_update_after_proposal__.is_some() { - return Err(serde::de::Error::duplicate_field( - "allowUpdateAfterProposal", - )); - } - allow_update_after_proposal__ = Some(map_.next_value()?); - } } } - Ok(ClientState { - sequence: sequence__.unwrap_or_default(), - frozen_sequence: frozen_sequence__.unwrap_or_default(), - consensus_state: consensus_state__, - allow_update_after_proposal: allow_update_after_proposal__.unwrap_or_default(), + Ok(ClientMessage { + data: data__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ClientState", + "ibc.lightclients.wasm.v1.ClientMessage", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ClientStateData { +impl serde::Serialize for ClientState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -307,38 +225,49 @@ impl serde::Serialize for ClientStateData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { + if !self.data.is_empty() { len += 1; } - if self.client_state.is_some() { + if !self.checksum.is_empty() { + len += 1; + } + if self.latest_height.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.ClientStateData", len)?; - if !self.path.is_empty() { + serializer.serialize_struct("ibc.lightclients.wasm.v1.ClientState", len)?; + if !self.data.is_empty() { #[allow(clippy::needless_borrow)] struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + } + if !self.checksum.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "checksum", + pbjson::private::base64::encode(&self.checksum).as_str(), + )?; } - if let Some(v) = self.client_state.as_ref() { - struct_ser.serialize_field("clientState", v)?; + if let Some(v) = self.latest_height.as_ref() { + struct_ser.serialize_field("latestHeight", v)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ClientStateData { +impl<'de> serde::Deserialize<'de> for ClientState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "client_state", "clientState"]; + const FIELDS: &[&str] = &["data", "checksum", "latest_height", "latestHeight"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - ClientState, + Data, + Checksum, + LatestHeight, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -364,8 +293,9 @@ impl<'de> serde::Deserialize<'de> for ClientStateData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "clientState" | "client_state" => Ok(GeneratedField::ClientState), + "data" => Ok(GeneratedField::Data), + "checksum" => Ok(GeneratedField::Checksum), + "latestHeight" | "latest_height" => Ok(GeneratedField::LatestHeight), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -375,52 +305,63 @@ impl<'de> serde::Deserialize<'de> for ClientStateData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ClientStateData; + type Value = ClientState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ClientStateData") + formatter.write_str("struct ibc.lightclients.wasm.v1.ClientState") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut client_state__ = None; + let mut data__ = None; + let mut checksum__ = None; + let mut latest_height__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - path__ = Some( + data__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::ClientState => { - if client_state__.is_some() { - return Err(serde::de::Error::duplicate_field("clientState")); + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); } - client_state__ = map_.next_value()?; + checksum__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + GeneratedField::LatestHeight => { + if latest_height__.is_some() { + return Err(serde::de::Error::duplicate_field("latestHeight")); + } + latest_height__ = map_.next_value()?; } } } - Ok(ClientStateData { - path: path__.unwrap_or_default(), - client_state: client_state__, + Ok(ClientState { + data: data__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + latest_height: latest_height__, }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ClientStateData", + "ibc.lightclients.wasm.v1.ClientState", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ConnectionStateData { +impl serde::Serialize for ConsensusState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -428,38 +369,31 @@ impl serde::Serialize for ConnectionStateData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.connection.is_some() { + if !self.data.is_empty() { len += 1; } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v1.ConnectionStateData", len)?; - if !self.path.is_empty() { + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.ConsensusState", len)?; + if !self.data.is_empty() { #[allow(clippy::needless_borrow)] struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.connection.as_ref() { - struct_ser.serialize_field("connection", v)?; + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ConnectionStateData { +impl<'de> serde::Deserialize<'de> for ConsensusState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "connection"]; + const FIELDS: &[&str] = &["data"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - Connection, + Data, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -485,8 +419,7 @@ impl<'de> serde::Deserialize<'de> for ConnectionStateData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "connection" => Ok(GeneratedField::Connection), + "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -496,52 +429,44 @@ impl<'de> serde::Deserialize<'de> for ConnectionStateData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConnectionStateData; + type Value = ConsensusState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ConnectionStateData") + formatter.write_str("struct ibc.lightclients.wasm.v1.ConsensusState") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut connection__ = None; + let mut data__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - path__ = Some( + data__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::Connection => { - if connection__.is_some() { - return Err(serde::de::Error::duplicate_field("connection")); - } - connection__ = map_.next_value()?; - } } } - Ok(ConnectionStateData { - path: path__.unwrap_or_default(), - connection: connection__, + Ok(ConsensusState { + data: data__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ConnectionStateData", + "ibc.lightclients.wasm.v1.ConsensusState", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ConsensusState { +impl serde::Serialize for Contract { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -549,45 +474,33 @@ impl serde::Serialize for ConsensusState { { use serde::ser::SerializeStruct; let mut len = 0; - if self.public_key.is_some() { - len += 1; - } - if !self.diversifier.is_empty() { - len += 1; - } - if self.timestamp != 0 { + if !self.code_bytes.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.ConsensusState", len)?; - if let Some(v) = self.public_key.as_ref() { - struct_ser.serialize_field("publicKey", v)?; - } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if self.timestamp != 0 { + serializer.serialize_struct("ibc.lightclients.wasm.v1.Contract", len)?; + if !self.code_bytes.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + struct_ser.serialize_field( + "codeBytes", + pbjson::private::base64::encode(&self.code_bytes).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ConsensusState { +impl<'de> serde::Deserialize<'de> for Contract { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["public_key", "publicKey", "diversifier", "timestamp"]; + const FIELDS: &[&str] = &["code_bytes", "codeBytes"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - PublicKey, - Diversifier, - Timestamp, + CodeBytes, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -613,9 +526,7 @@ impl<'de> serde::Deserialize<'de> for ConsensusState { E: serde::de::Error, { match value { - "publicKey" | "public_key" => Ok(GeneratedField::PublicKey), - "diversifier" => Ok(GeneratedField::Diversifier), - "timestamp" => Ok(GeneratedField::Timestamp), + "codeBytes" | "code_bytes" => Ok(GeneratedField::CodeBytes), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -625,60 +536,44 @@ impl<'de> serde::Deserialize<'de> for ConsensusState { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusState; + type Value = Contract; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ConsensusState") + formatter.write_str("struct ibc.lightclients.wasm.v1.Contract") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut public_key__ = None; - let mut diversifier__ = None; - let mut timestamp__ = None; + let mut code_bytes__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::PublicKey => { - if public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("publicKey")); + GeneratedField::CodeBytes => { + if code_bytes__.is_some() { + return Err(serde::de::Error::duplicate_field("codeBytes")); } - public_key__ = map_.next_value()?; - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); - } - diversifier__ = Some(map_.next_value()?); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + code_bytes__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } } } - Ok(ConsensusState { - public_key: public_key__, - diversifier: diversifier__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), + Ok(Contract { + code_bytes: code_bytes__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ConsensusState", + "ibc.lightclients.wasm.v1.Contract", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for ConsensusStateData { +impl serde::Serialize for GenesisState { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -686,38 +581,29 @@ impl serde::Serialize for ConsensusStateData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { + if !self.contracts.is_empty() { len += 1; } - if self.consensus_state.is_some() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v1.ConsensusStateData", len)?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if let Some(v) = self.consensus_state.as_ref() { - struct_ser.serialize_field("consensusState", v)?; + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.GenesisState", len)?; + if !self.contracts.is_empty() { + struct_ser.serialize_field("contracts", &self.contracts)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for ConsensusStateData { +impl<'de> serde::Deserialize<'de> for GenesisState { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "consensus_state", "consensusState"]; + const FIELDS: &[&str] = &["contracts"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - ConsensusState, + Contracts, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -743,10 +629,7 @@ impl<'de> serde::Deserialize<'de> for ConsensusStateData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "consensusState" | "consensus_state" => { - Ok(GeneratedField::ConsensusState) - } + "contracts" => Ok(GeneratedField::Contracts), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -756,149 +639,41 @@ impl<'de> serde::Deserialize<'de> for ConsensusStateData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = ConsensusStateData; + type Value = GenesisState; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.ConsensusStateData") + formatter.write_str("struct ibc.lightclients.wasm.v1.GenesisState") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut consensus_state__ = None; + let mut contracts__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Contracts => { + if contracts__.is_some() { + return Err(serde::de::Error::duplicate_field("contracts")); } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::ConsensusState => { - if consensus_state__.is_some() { - return Err(serde::de::Error::duplicate_field("consensusState")); - } - consensus_state__ = map_.next_value()?; + contracts__ = Some(map_.next_value()?); } } } - Ok(ConsensusStateData { - path: path__.unwrap_or_default(), - consensus_state: consensus_state__, + Ok(GenesisState { + contracts: contracts__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.ConsensusStateData", + "ibc.lightclients.wasm.v1.GenesisState", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for DataType { - #[allow(deprecated)] - fn serialize(&self, serializer: S) -> std::result::Result - where - S: serde::Serializer, - { - let variant = match self { - Self::UninitializedUnspecified => "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - Self::ClientState => "DATA_TYPE_CLIENT_STATE", - Self::ConsensusState => "DATA_TYPE_CONSENSUS_STATE", - Self::ConnectionState => "DATA_TYPE_CONNECTION_STATE", - Self::ChannelState => "DATA_TYPE_CHANNEL_STATE", - Self::PacketCommitment => "DATA_TYPE_PACKET_COMMITMENT", - Self::PacketAcknowledgement => "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - Self::PacketReceiptAbsence => "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - Self::NextSequenceRecv => "DATA_TYPE_NEXT_SEQUENCE_RECV", - Self::Header => "DATA_TYPE_HEADER", - }; - serializer.serialize_str(variant) - } -} -#[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for DataType { - #[allow(deprecated)] - fn deserialize(deserializer: D) -> std::result::Result - where - D: serde::Deserializer<'de>, - { - const FIELDS: &[&str] = &[ - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED", - "DATA_TYPE_CLIENT_STATE", - "DATA_TYPE_CONSENSUS_STATE", - "DATA_TYPE_CONNECTION_STATE", - "DATA_TYPE_CHANNEL_STATE", - "DATA_TYPE_PACKET_COMMITMENT", - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT", - "DATA_TYPE_PACKET_RECEIPT_ABSENCE", - "DATA_TYPE_NEXT_SEQUENCE_RECV", - "DATA_TYPE_HEADER", - ]; - - struct GeneratedVisitor; - - impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = DataType; - - 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 { - "DATA_TYPE_UNINITIALIZED_UNSPECIFIED" => Ok(DataType::UninitializedUnspecified), - "DATA_TYPE_CLIENT_STATE" => Ok(DataType::ClientState), - "DATA_TYPE_CONSENSUS_STATE" => Ok(DataType::ConsensusState), - "DATA_TYPE_CONNECTION_STATE" => Ok(DataType::ConnectionState), - "DATA_TYPE_CHANNEL_STATE" => Ok(DataType::ChannelState), - "DATA_TYPE_PACKET_COMMITMENT" => Ok(DataType::PacketCommitment), - "DATA_TYPE_PACKET_ACKNOWLEDGEMENT" => Ok(DataType::PacketAcknowledgement), - "DATA_TYPE_PACKET_RECEIPT_ABSENCE" => Ok(DataType::PacketReceiptAbsence), - "DATA_TYPE_NEXT_SEQUENCE_RECV" => Ok(DataType::NextSequenceRecv), - "DATA_TYPE_HEADER" => Ok(DataType::Header), - _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), - } - } - } - deserializer.deserialize_any(GeneratedVisitor) - } -} -#[cfg(feature = "serde")] -impl serde::Serialize for Header { +impl serde::Serialize for MsgMigrateContract { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -906,72 +681,56 @@ impl serde::Serialize for Header { { use serde::ser::SerializeStruct; let mut len = 0; - if self.sequence != 0 { + if !self.signer.is_empty() { len += 1; } - if self.timestamp != 0 { - len += 1; - } - if !self.signature.is_empty() { + if !self.client_id.is_empty() { len += 1; } - if self.new_public_key.is_some() { + if !self.checksum.is_empty() { len += 1; } - if !self.new_diversifier.is_empty() { + if !self.msg.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.Header", len)?; - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; + serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContract", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } - if self.timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + if !self.client_id.is_empty() { + struct_ser.serialize_field("clientId", &self.client_id)?; } - if !self.signature.is_empty() { + if !self.checksum.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), + "checksum", + pbjson::private::base64::encode(&self.checksum).as_str(), )?; } - if let Some(v) = self.new_public_key.as_ref() { - struct_ser.serialize_field("newPublicKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; + if !self.msg.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser + .serialize_field("msg", pbjson::private::base64::encode(&self.msg).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Header { +impl<'de> serde::Deserialize<'de> for MsgMigrateContract { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "sequence", - "timestamp", - "signature", - "new_public_key", - "newPublicKey", - "new_diversifier", - "newDiversifier", - ]; + const FIELDS: &[&str] = &["signer", "client_id", "clientId", "checksum", "msg"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequence, - Timestamp, - Signature, - NewPublicKey, - NewDiversifier, + Signer, + ClientId, + Checksum, + Msg, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -997,13 +756,10 @@ impl<'de> serde::Deserialize<'de> for Header { E: serde::de::Error, { match value { - "sequence" => Ok(GeneratedField::Sequence), - "timestamp" => Ok(GeneratedField::Timestamp), - "signature" => Ok(GeneratedField::Signature), - "newPublicKey" | "new_public_key" => Ok(GeneratedField::NewPublicKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } + "signer" => Ok(GeneratedField::Signer), + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "checksum" => Ok(GeneratedField::Checksum), + "msg" => Ok(GeneratedField::Msg), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1013,125 +769,94 @@ impl<'de> serde::Deserialize<'de> for Header { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Header; + type Value = MsgMigrateContract; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.Header") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContract") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequence__ = None; - let mut timestamp__ = None; - let mut signature__ = None; - let mut new_public_key__ = None; - let mut new_diversifier__ = None; + let mut signer__ = None; + let mut client_id__ = None; + let mut checksum__ = None; + let mut msg__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); + signer__ = Some(map_.next_value()?); } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); + GeneratedField::ClientId => { + if client_id__.is_some() { + return Err(serde::de::Error::duplicate_field("clientId")); } - timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); + client_id__ = Some(map_.next_value()?); } - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); } - signature__ = Some( + checksum__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::NewPublicKey => { - if new_public_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPublicKey")); + GeneratedField::Msg => { + if msg__.is_some() { + return Err(serde::de::Error::duplicate_field("msg")); } - new_public_key__ = map_.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map_.next_value()?); + msg__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); } } } - Ok(Header { - sequence: sequence__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - signature: signature__.unwrap_or_default(), - new_public_key: new_public_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), + Ok(MsgMigrateContract { + signer: signer__.unwrap_or_default(), + client_id: client_id__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), + msg: msg__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.Header", + "ibc.lightclients.wasm.v1.MsgMigrateContract", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for HeaderData { +impl serde::Serialize for MsgMigrateContractResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if self.new_pub_key.is_some() { - len += 1; - } - if !self.new_diversifier.is_empty() { - len += 1; - } - let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.HeaderData", len)?; - if let Some(v) = self.new_pub_key.as_ref() { - struct_ser.serialize_field("newPubKey", v)?; - } - if !self.new_diversifier.is_empty() { - struct_ser.serialize_field("newDiversifier", &self.new_diversifier)?; - } + let len = 0; + let struct_ser = serializer + .serialize_struct("ibc.lightclients.wasm.v1.MsgMigrateContractResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for HeaderData { +impl<'de> serde::Deserialize<'de> for MsgMigrateContractResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "new_pub_key", - "newPubKey", - "new_diversifier", - "newDiversifier", - ]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - NewPubKey, - NewDiversifier, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1155,13 +880,7 @@ impl<'de> serde::Deserialize<'de> for HeaderData { where E: serde::de::Error, { - match value { - "newPubKey" | "new_pub_key" => Ok(GeneratedField::NewPubKey), - "newDiversifier" | "new_diversifier" => { - Ok(GeneratedField::NewDiversifier) - } - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -1169,49 +888,34 @@ impl<'de> serde::Deserialize<'de> for HeaderData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = HeaderData; + type Value = MsgMigrateContractResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.HeaderData") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgMigrateContractResponse") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut new_pub_key__ = None; - let mut new_diversifier__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::NewPubKey => { - if new_pub_key__.is_some() { - return Err(serde::de::Error::duplicate_field("newPubKey")); - } - new_pub_key__ = map_.next_value()?; - } - GeneratedField::NewDiversifier => { - if new_diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("newDiversifier")); - } - new_diversifier__ = Some(map_.next_value()?); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(HeaderData { - new_pub_key: new_pub_key__, - new_diversifier: new_diversifier__.unwrap_or_default(), - }) + Ok(MsgMigrateContractResponse {}) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.HeaderData", + "ibc.lightclients.wasm.v1.MsgMigrateContractResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for Misbehaviour { +impl serde::Serialize for MsgRemoveChecksum { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1219,59 +923,40 @@ impl serde::Serialize for Misbehaviour { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.client_id.is_empty() { + if !self.signer.is_empty() { len += 1; } - if self.sequence != 0 { - len += 1; - } - if self.signature_one.is_some() { - len += 1; - } - if self.signature_two.is_some() { + if !self.checksum.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.Misbehaviour", len)?; - if !self.client_id.is_empty() { - struct_ser.serialize_field("clientId", &self.client_id)?; + serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksum", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } - if self.sequence != 0 { + if !self.checksum.is_empty() { #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if let Some(v) = self.signature_one.as_ref() { - struct_ser.serialize_field("signatureOne", v)?; - } - if let Some(v) = self.signature_two.as_ref() { - struct_ser.serialize_field("signatureTwo", v)?; + struct_ser.serialize_field( + "checksum", + pbjson::private::base64::encode(&self.checksum).as_str(), + )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for Misbehaviour { +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksum { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "client_id", - "clientId", - "sequence", - "signature_one", - "signatureOne", - "signature_two", - "signatureTwo", - ]; + const FIELDS: &[&str] = &["signer", "checksum"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - ClientId, - Sequence, - SignatureOne, - SignatureTwo, + Signer, + Checksum, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1297,10 +982,8 @@ impl<'de> serde::Deserialize<'de> for Misbehaviour { E: serde::de::Error, { match value { - "clientId" | "client_id" => Ok(GeneratedField::ClientId), - "sequence" => Ok(GeneratedField::Sequence), - "signatureOne" | "signature_one" => Ok(GeneratedField::SignatureOne), - "signatureTwo" | "signature_two" => Ok(GeneratedField::SignatureTwo), + "signer" => Ok(GeneratedField::Signer), + "checksum" => Ok(GeneratedField::Checksum), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1310,112 +993,75 @@ impl<'de> serde::Deserialize<'de> for Misbehaviour { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = Misbehaviour; + type Value = MsgRemoveChecksum; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.Misbehaviour") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksum") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut client_id__ = None; - let mut sequence__ = None; - let mut signature_one__ = None; - let mut signature_two__ = None; + let mut signer__ = None; + let mut checksum__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::ClientId => { - if client_id__.is_some() { - return Err(serde::de::Error::duplicate_field("clientId")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - client_id__ = Some(map_.next_value()?); + signer__ = Some(map_.next_value()?); } - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? + checksum__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::SignatureOne => { - if signature_one__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureOne")); - } - signature_one__ = map_.next_value()?; - } - GeneratedField::SignatureTwo => { - if signature_two__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureTwo")); - } - signature_two__ = map_.next_value()?; - } } } - Ok(Misbehaviour { - client_id: client_id__.unwrap_or_default(), - sequence: sequence__.unwrap_or_default(), - signature_one: signature_one__, - signature_two: signature_two__, + Ok(MsgRemoveChecksum { + signer: signer__.unwrap_or_default(), + checksum: checksum__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.Misbehaviour", + "ibc.lightclients.wasm.v1.MsgRemoveChecksum", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for NextSequenceRecvData { +impl serde::Serialize for MsgRemoveChecksumResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where S: serde::Serializer, { use serde::ser::SerializeStruct; - let mut len = 0; - if !self.path.is_empty() { - len += 1; - } - if self.next_seq_recv != 0 { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v1.NextSequenceRecvData", len)?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if self.next_seq_recv != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "nextSeqRecv", - ToString::to_string(&self.next_seq_recv).as_str(), - )?; - } + let len = 0; + let struct_ser = serializer + .serialize_struct("ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", len)?; struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for NextSequenceRecvData { +impl<'de> serde::Deserialize<'de> for MsgRemoveChecksumResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "next_seq_recv", "nextSeqRecv"]; + const FIELDS: &[&str] = &[]; #[allow(clippy::enum_variant_names)] - enum GeneratedField { - Path, - NextSeqRecv, - } + enum GeneratedField {} #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { fn deserialize(deserializer: D) -> std::result::Result @@ -1439,11 +1085,7 @@ impl<'de> serde::Deserialize<'de> for NextSequenceRecvData { where E: serde::de::Error, { - match value { - "path" => Ok(GeneratedField::Path), - "nextSeqRecv" | "next_seq_recv" => Ok(GeneratedField::NextSeqRecv), - _ => Err(serde::de::Error::unknown_field(value, FIELDS)), - } + Err(serde::de::Error::unknown_field(value, FIELDS)) } } deserializer.deserialize_identifier(GeneratedVisitor) @@ -1451,58 +1093,34 @@ impl<'de> serde::Deserialize<'de> for NextSequenceRecvData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = NextSequenceRecvData; + type Value = MsgRemoveChecksumResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.NextSequenceRecvData") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut next_seq_recv__ = None; - while let Some(k) = map_.next_key()? { - match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); - } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::NextSeqRecv => { - if next_seq_recv__.is_some() { - return Err(serde::de::Error::duplicate_field("nextSeqRecv")); - } - next_seq_recv__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - } + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; } - Ok(NextSequenceRecvData { - path: path__.unwrap_or_default(), - next_seq_recv: next_seq_recv__.unwrap_or_default(), - }) + Ok(MsgRemoveChecksumResponse {}) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.NextSequenceRecvData", + "ibc.lightclients.wasm.v1.MsgRemoveChecksumResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketAcknowledgementData { +impl serde::Serialize for MsgStoreCode { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1510,44 +1128,40 @@ impl serde::Serialize for PacketAcknowledgementData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { + if !self.signer.is_empty() { len += 1; } - if !self.acknowledgement.is_empty() { + if !self.wasm_byte_code.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v1.PacketAcknowledgementData", - len, - )?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgStoreCode", len)?; + if !self.signer.is_empty() { + struct_ser.serialize_field("signer", &self.signer)?; } - if !self.acknowledgement.is_empty() { + if !self.wasm_byte_code.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "acknowledgement", - pbjson::private::base64::encode(&self.acknowledgement).as_str(), + "wasmByteCode", + pbjson::private::base64::encode(&self.wasm_byte_code).as_str(), )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PacketAcknowledgementData { +impl<'de> serde::Deserialize<'de> for MsgStoreCode { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "acknowledgement"]; + const FIELDS: &[&str] = &["signer", "wasm_byte_code", "wasmByteCode"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - Acknowledgement, + Signer, + WasmByteCode, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1573,8 +1187,8 @@ impl<'de> serde::Deserialize<'de> for PacketAcknowledgementData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "acknowledgement" => Ok(GeneratedField::Acknowledgement), + "signer" => Ok(GeneratedField::Signer), + "wasmByteCode" | "wasm_byte_code" => Ok(GeneratedField::WasmByteCode), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1584,59 +1198,52 @@ impl<'de> serde::Deserialize<'de> for PacketAcknowledgementData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketAcknowledgementData; + type Value = MsgStoreCode; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v1.PacketAcknowledgementData") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCode") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut acknowledgement__ = None; + let mut signer__ = None; + let mut wasm_byte_code__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Signer => { + if signer__.is_some() { + return Err(serde::de::Error::duplicate_field("signer")); } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + signer__ = Some(map_.next_value()?); } - GeneratedField::Acknowledgement => { - if acknowledgement__.is_some() { - return Err(serde::de::Error::duplicate_field("acknowledgement")); + GeneratedField::WasmByteCode => { + if wasm_byte_code__.is_some() { + return Err(serde::de::Error::duplicate_field("wasmByteCode")); } - acknowledgement__ = Some( + wasm_byte_code__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } } } - Ok(PacketAcknowledgementData { - path: path__.unwrap_or_default(), - acknowledgement: acknowledgement__.unwrap_or_default(), + Ok(MsgStoreCode { + signer: signer__.unwrap_or_default(), + wasm_byte_code: wasm_byte_code__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.PacketAcknowledgementData", + "ibc.lightclients.wasm.v1.MsgStoreCode", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketCommitmentData { +impl serde::Serialize for MsgStoreCodeResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1644,42 +1251,33 @@ impl serde::Serialize for PacketCommitmentData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { + if !self.checksum.is_empty() { len += 1; } - if !self.commitment.is_empty() { - len += 1; - } - let mut struct_ser = serializer - .serialize_struct("ibc.lightclients.solomachine.v1.PacketCommitmentData", len)?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; - } - if !self.commitment.is_empty() { + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.MsgStoreCodeResponse", len)?; + if !self.checksum.is_empty() { #[allow(clippy::needless_borrow)] struct_ser.serialize_field( - "commitment", - pbjson::private::base64::encode(&self.commitment).as_str(), + "checksum", + pbjson::private::base64::encode(&self.checksum).as_str(), )?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for PacketCommitmentData { +impl<'de> serde::Deserialize<'de> for MsgStoreCodeResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path", "commitment"]; + const FIELDS: &[&str] = &["checksum"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, - Commitment, + Checksum, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1705,8 +1303,7 @@ impl<'de> serde::Deserialize<'de> for PacketCommitmentData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), - "commitment" => Ok(GeneratedField::Commitment), + "checksum" => Ok(GeneratedField::Checksum), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1716,58 +1313,47 @@ impl<'de> serde::Deserialize<'de> for PacketCommitmentData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketCommitmentData; + type Value = MsgStoreCodeResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.PacketCommitmentData") + formatter.write_str("struct ibc.lightclients.wasm.v1.MsgStoreCodeResponse") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; - let mut commitment__ = None; + let mut checksum__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Commitment => { - if commitment__.is_some() { - return Err(serde::de::Error::duplicate_field("commitment")); - } - commitment__ = Some( + checksum__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } } } - Ok(PacketCommitmentData { - path: path__.unwrap_or_default(), - commitment: commitment__.unwrap_or_default(), + Ok(MsgStoreCodeResponse { + checksum: checksum__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.PacketCommitmentData", + "ibc.lightclients.wasm.v1.MsgStoreCodeResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for PacketReceiptAbsenceData { +impl serde::Serialize for QueryChecksumsRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1775,33 +1361,29 @@ impl serde::Serialize for PacketReceiptAbsenceData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.path.is_empty() { + if self.pagination.is_some() { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData", - len, - )?; - if !self.path.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("path", pbjson::private::base64::encode(&self.path).as_str())?; + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsRequest", 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 PacketReceiptAbsenceData { +impl<'de> serde::Deserialize<'de> for QueryChecksumsRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["path"]; + const FIELDS: &[&str] = &["pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Path, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1827,7 +1409,7 @@ impl<'de> serde::Deserialize<'de> for PacketReceiptAbsenceData { E: serde::de::Error, { match value { - "path" => Ok(GeneratedField::Path), + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1837,48 +1419,44 @@ impl<'de> serde::Deserialize<'de> for PacketReceiptAbsenceData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = PacketReceiptAbsenceData; + type Value = QueryChecksumsRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData") + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsRequest") } fn visit_map( self, mut map_: V, - ) -> std::result::Result + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut path__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Path => { - if path__.is_some() { - return Err(serde::de::Error::duplicate_field("path")); + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); } - path__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + pagination__ = map_.next_value()?; } } } - Ok(PacketReceiptAbsenceData { - path: path__.unwrap_or_default(), + Ok(QueryChecksumsRequest { + pagination: pagination__, }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.PacketReceiptAbsenceData", + "ibc.lightclients.wasm.v1.QueryChecksumsRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for SignBytes { +impl serde::Serialize for QueryChecksumsResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -1886,72 +1464,36 @@ impl serde::Serialize for SignBytes { { use serde::ser::SerializeStruct; let mut len = 0; - if self.sequence != 0 { - len += 1; - } - if self.timestamp != 0 { - len += 1; - } - if !self.diversifier.is_empty() { + if !self.checksums.is_empty() { len += 1; } - if self.data_type != 0 { - len += 1; - } - if !self.data.is_empty() { + if self.pagination.is_some() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.SignBytes", len)?; - if self.sequence != 0 { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field("sequence", ToString::to_string(&self.sequence).as_str())?; - } - if self.timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryChecksumsResponse", len)?; + if !self.checksums.is_empty() { + struct_ser.serialize_field("checksums", &self.checksums)?; } - if !self.diversifier.is_empty() { - struct_ser.serialize_field("diversifier", &self.diversifier)?; - } - if self.data_type != 0 { - let v = DataType::try_from(self.data_type).map_err(|_| { - serde::ser::Error::custom(format!("Invalid variant {}", self.data_type)) - })?; - struct_ser.serialize_field("dataType", &v)?; - } - if !self.data.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; + 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 SignBytes { +impl<'de> serde::Deserialize<'de> for QueryChecksumsResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &[ - "sequence", - "timestamp", - "diversifier", - "data_type", - "dataType", - "data", - ]; + const FIELDS: &[&str] = &["checksums", "pagination"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Sequence, - Timestamp, - Diversifier, - DataType, - Data, + Checksums, + Pagination, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -1977,11 +1519,8 @@ impl<'de> serde::Deserialize<'de> for SignBytes { E: serde::de::Error, { match value { - "sequence" => Ok(GeneratedField::Sequence), - "timestamp" => Ok(GeneratedField::Timestamp), - "diversifier" => Ok(GeneratedField::Diversifier), - "dataType" | "data_type" => Ok(GeneratedField::DataType), - "data" => Ok(GeneratedField::Data), + "checksums" => Ok(GeneratedField::Checksums), + "pagination" => Ok(GeneratedField::Pagination), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -1991,82 +1530,52 @@ impl<'de> serde::Deserialize<'de> for SignBytes { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignBytes; + type Value = QueryChecksumsResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.SignBytes") + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryChecksumsResponse") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut sequence__ = None; - let mut timestamp__ = None; - let mut diversifier__ = None; - let mut data_type__ = None; - let mut data__ = None; + let mut checksums__ = None; + let mut pagination__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Sequence => { - if sequence__.is_some() { - return Err(serde::de::Error::duplicate_field("sequence")); - } - sequence__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } - GeneratedField::Diversifier => { - if diversifier__.is_some() { - return Err(serde::de::Error::duplicate_field("diversifier")); + GeneratedField::Checksums => { + if checksums__.is_some() { + return Err(serde::de::Error::duplicate_field("checksums")); } - diversifier__ = Some(map_.next_value()?); + checksums__ = Some(map_.next_value()?); } - GeneratedField::DataType => { - if data_type__.is_some() { - return Err(serde::de::Error::duplicate_field("dataType")); + GeneratedField::Pagination => { + if pagination__.is_some() { + return Err(serde::de::Error::duplicate_field("pagination")); } - data_type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); - } - data__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); + pagination__ = map_.next_value()?; } } } - Ok(SignBytes { - sequence: sequence__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), - diversifier: diversifier__.unwrap_or_default(), - data_type: data_type__.unwrap_or_default(), - data: data__.unwrap_or_default(), + Ok(QueryChecksumsResponse { + checksums: checksums__.unwrap_or_default(), + pagination: pagination__, }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.SignBytes", + "ibc.lightclients.wasm.v1.QueryChecksumsResponse", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for SignatureAndData { +impl serde::Serialize for QueryCodeRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2074,61 +1583,29 @@ impl serde::Serialize for SignatureAndData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.signature.is_empty() { - len += 1; - } - if self.data_type != 0 { - len += 1; - } - if !self.data.is_empty() { - len += 1; - } - if self.timestamp != 0 { + if !self.checksum.is_empty() { len += 1; } let mut struct_ser = - serializer.serialize_struct("ibc.lightclients.solomachine.v1.SignatureAndData", len)?; - if !self.signature.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "signature", - pbjson::private::base64::encode(&self.signature).as_str(), - )?; - } - if self.data_type != 0 { - let v = DataType::try_from(self.data_type).map_err(|_| { - serde::ser::Error::custom(format!("Invalid variant {}", self.data_type)) - })?; - struct_ser.serialize_field("dataType", &v)?; - } - if !self.data.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; - } - if self.timestamp != 0 { - #[allow(clippy::needless_borrow)] - struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryCodeRequest", len)?; + if !self.checksum.is_empty() { + struct_ser.serialize_field("checksum", &self.checksum)?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for SignatureAndData { +impl<'de> serde::Deserialize<'de> for QueryCodeRequest { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["signature", "data_type", "dataType", "data", "timestamp"]; + const FIELDS: &[&str] = &["checksum"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - Signature, - DataType, - Data, - Timestamp, + Checksum, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2154,10 +1631,7 @@ impl<'de> serde::Deserialize<'de> for SignatureAndData { E: serde::de::Error, { match value { - "signature" => Ok(GeneratedField::Signature), - "dataType" | "data_type" => Ok(GeneratedField::DataType), - "data" => Ok(GeneratedField::Data), - "timestamp" => Ok(GeneratedField::Timestamp), + "checksum" => Ok(GeneratedField::Checksum), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2167,74 +1641,41 @@ impl<'de> serde::Deserialize<'de> for SignatureAndData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = SignatureAndData; + type Value = QueryCodeRequest; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter.write_str("struct ibc.lightclients.solomachine.v1.SignatureAndData") + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeRequest") } - fn visit_map(self, mut map_: V) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut signature__ = None; - let mut data_type__ = None; - let mut data__ = None; - let mut timestamp__ = None; + let mut checksum__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::Signature => { - if signature__.is_some() { - return Err(serde::de::Error::duplicate_field("signature")); - } - signature__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::DataType => { - if data_type__.is_some() { - return Err(serde::de::Error::duplicate_field("dataType")); - } - data_type__ = Some(map_.next_value::()? as i32); - } - GeneratedField::Data => { - if data__.is_some() { - return Err(serde::de::Error::duplicate_field("data")); + GeneratedField::Checksum => { + if checksum__.is_some() { + return Err(serde::de::Error::duplicate_field("checksum")); } - data__ = Some( - map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? - .0, - ); - } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); + checksum__ = Some(map_.next_value()?); } } } - Ok(SignatureAndData { - signature: signature__.unwrap_or_default(), - data_type: data_type__.unwrap_or_default(), - data: data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), + Ok(QueryCodeRequest { + checksum: checksum__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.SignatureAndData", + "ibc.lightclients.wasm.v1.QueryCodeRequest", FIELDS, GeneratedVisitor, ) } } #[cfg(feature = "serde")] -impl serde::Serialize for TimestampedSignatureData { +impl serde::Serialize for QueryCodeResponse { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result where @@ -2242,44 +1683,31 @@ impl serde::Serialize for TimestampedSignatureData { { use serde::ser::SerializeStruct; let mut len = 0; - if !self.signature_data.is_empty() { - len += 1; - } - if self.timestamp != 0 { + if !self.data.is_empty() { len += 1; } - let mut struct_ser = serializer.serialize_struct( - "ibc.lightclients.solomachine.v1.TimestampedSignatureData", - len, - )?; - if !self.signature_data.is_empty() { - #[allow(clippy::needless_borrow)] - struct_ser.serialize_field( - "signatureData", - pbjson::private::base64::encode(&self.signature_data).as_str(), - )?; - } - if self.timestamp != 0 { + let mut struct_ser = + serializer.serialize_struct("ibc.lightclients.wasm.v1.QueryCodeResponse", len)?; + if !self.data.is_empty() { #[allow(clippy::needless_borrow)] struct_ser - .serialize_field("timestamp", ToString::to_string(&self.timestamp).as_str())?; + .serialize_field("data", pbjson::private::base64::encode(&self.data).as_str())?; } struct_ser.end() } } #[cfg(feature = "serde")] -impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { +impl<'de> serde::Deserialize<'de> for QueryCodeResponse { #[allow(deprecated)] fn deserialize(deserializer: D) -> std::result::Result where D: serde::Deserializer<'de>, { - const FIELDS: &[&str] = &["signature_data", "signatureData", "timestamp"]; + const FIELDS: &[&str] = &["data"]; #[allow(clippy::enum_variant_names)] enum GeneratedField { - SignatureData, - Timestamp, + Data, } #[cfg(feature = "serde")] impl<'de> serde::Deserialize<'de> for GeneratedField { @@ -2305,8 +1733,7 @@ impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { E: serde::de::Error, { match value { - "signatureData" | "signature_data" => Ok(GeneratedField::SignatureData), - "timestamp" => Ok(GeneratedField::Timestamp), + "data" => Ok(GeneratedField::Data), _ => Err(serde::de::Error::unknown_field(value, FIELDS)), } } @@ -2316,52 +1743,37 @@ impl<'de> serde::Deserialize<'de> for TimestampedSignatureData { } struct GeneratedVisitor; impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { - type Value = TimestampedSignatureData; + type Value = QueryCodeResponse; fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - formatter - .write_str("struct ibc.lightclients.solomachine.v1.TimestampedSignatureData") + formatter.write_str("struct ibc.lightclients.wasm.v1.QueryCodeResponse") } - fn visit_map( - self, - mut map_: V, - ) -> std::result::Result + fn visit_map(self, mut map_: V) -> std::result::Result where V: serde::de::MapAccess<'de>, { - let mut signature_data__ = None; - let mut timestamp__ = None; + let mut data__ = None; while let Some(k) = map_.next_key()? { match k { - GeneratedField::SignatureData => { - if signature_data__.is_some() { - return Err(serde::de::Error::duplicate_field("signatureData")); + GeneratedField::Data => { + if data__.is_some() { + return Err(serde::de::Error::duplicate_field("data")); } - signature_data__ = Some( + data__ = Some( map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? .0, ); } - GeneratedField::Timestamp => { - if timestamp__.is_some() { - return Err(serde::de::Error::duplicate_field("timestamp")); - } - timestamp__ = Some( - map_.next_value::<::pbjson::private::NumberDeserialize<_>>()? - .0, - ); - } } } - Ok(TimestampedSignatureData { - signature_data: signature_data__.unwrap_or_default(), - timestamp: timestamp__.unwrap_or_default(), + Ok(QueryCodeResponse { + data: data__.unwrap_or_default(), }) } } deserializer.deserialize_struct( - "ibc.lightclients.solomachine.v1.TimestampedSignatureData", + "ibc.lightclients.wasm.v1.QueryCodeResponse", FIELDS, GeneratedVisitor, ) diff --git a/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.tonic.rs b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.tonic.rs new file mode 100644 index 00000000..937b31dc --- /dev/null +++ b/cosmos-sdk-proto/src/prost/ibc-go/ibc.lightclients.wasm.v1.tonic.rs @@ -0,0 +1,729 @@ +// @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 checksums( + &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("/ibc.lightclients.wasm.v1.Query/Checksums"); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.lightclients.wasm.v1.Query", + "Checksums", + )); + self.inner.unary(req, path, codec).await + } + pub async fn code( + &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("/ibc.lightclients.wasm.v1.Query/Code"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Query", "Code")); + 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 checksums( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn code( + &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() { + "/ibc.lightclients.wasm.v1.Query/Checksums" => { + #[allow(non_camel_case_types)] + struct ChecksumsSvc(pub Arc); + impl tonic::server::UnaryService for ChecksumsSvc { + type Response = super::QueryChecksumsResponse; + 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).checksums(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 = ChecksumsSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Query/Code" => { + #[allow(non_camel_case_types)] + struct CodeSvc(pub Arc); + impl tonic::server::UnaryService for CodeSvc { + type Response = super::QueryCodeResponse; + 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).code(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 = CodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for QueryServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for QueryServer { + const NAME: &'static str = "ibc.lightclients.wasm.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 store_code( + &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("/ibc.lightclients.wasm.v1.Msg/StoreCode"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("ibc.lightclients.wasm.v1.Msg", "StoreCode")); + self.inner.unary(req, path, codec).await + } + pub async fn remove_checksum( + &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( + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.lightclients.wasm.v1.Msg", + "RemoveChecksum", + )); + self.inner.unary(req, path, codec).await + } + pub async fn migrate_contract( + &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( + "/ibc.lightclients.wasm.v1.Msg/MigrateContract", + ); + let mut req = request.into_request(); + req.extensions_mut().insert(GrpcMethod::new( + "ibc.lightclients.wasm.v1.Msg", + "MigrateContract", + )); + 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 store_code( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn remove_checksum( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + async fn migrate_contract( + &self, + request: tonic::Request, + ) -> std::result::Result, tonic::Status>; + } + #[derive(Debug)] + pub struct MsgServer { + inner: _Inner, + accept_compression_encodings: EnabledCompressionEncodings, + send_compression_encodings: EnabledCompressionEncodings, + max_decoding_message_size: Option, + max_encoding_message_size: Option, + } + struct _Inner(Arc); + impl MsgServer { + pub fn new(inner: T) -> Self { + Self::from_arc(Arc::new(inner)) + } + pub fn from_arc(inner: Arc) -> Self { + let inner = _Inner(inner); + Self { + inner, + accept_compression_encodings: Default::default(), + send_compression_encodings: Default::default(), + max_decoding_message_size: None, + max_encoding_message_size: None, + } + } + pub fn with_interceptor(inner: T, interceptor: F) -> InterceptedService + where + F: tonic::service::Interceptor, + { + InterceptedService::new(Self::new(inner), interceptor) + } + /// Enable decompressing requests with the given encoding. + #[must_use] + pub fn accept_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.accept_compression_encodings.enable(encoding); + self + } + /// Compress responses with the given encoding, if the client supports it. + #[must_use] + pub fn send_compressed(mut self, encoding: CompressionEncoding) -> Self { + self.send_compression_encodings.enable(encoding); + self + } + /// Limits the maximum size of a decoded message. + /// + /// Default: `4MB` + #[must_use] + pub fn max_decoding_message_size(mut self, limit: usize) -> Self { + self.max_decoding_message_size = Some(limit); + self + } + /// Limits the maximum size of an encoded message. + /// + /// Default: `usize::MAX` + #[must_use] + pub fn max_encoding_message_size(mut self, limit: usize) -> Self { + self.max_encoding_message_size = Some(limit); + self + } + } + impl tonic::codegen::Service> for MsgServer + where + T: Msg, + B: Body + Send + 'static, + B::Error: Into + Send + 'static, + { + type Response = http::Response; + type Error = std::convert::Infallible; + type Future = BoxFuture; + fn poll_ready( + &mut self, + _cx: &mut Context<'_>, + ) -> Poll> { + Poll::Ready(Ok(())) + } + fn call(&mut self, req: http::Request) -> Self::Future { + let inner = self.inner.clone(); + match req.uri().path() { + "/ibc.lightclients.wasm.v1.Msg/StoreCode" => { + #[allow(non_camel_case_types)] + struct StoreCodeSvc(pub Arc); + impl tonic::server::UnaryService for StoreCodeSvc { + type Response = super::MsgStoreCodeResponse; + 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).store_code(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 = StoreCodeSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/RemoveChecksum" => { + #[allow(non_camel_case_types)] + struct RemoveChecksumSvc(pub Arc); + impl tonic::server::UnaryService for RemoveChecksumSvc { + type Response = super::MsgRemoveChecksumResponse; + 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).remove_checksum(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 = RemoveChecksumSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + "/ibc.lightclients.wasm.v1.Msg/MigrateContract" => { + #[allow(non_camel_case_types)] + struct MigrateContractSvc(pub Arc); + impl tonic::server::UnaryService for MigrateContractSvc { + type Response = super::MsgMigrateContractResponse; + 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).migrate_contract(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 = MigrateContractSvc(inner); + let codec = tonic::codec::ProstCodec::default(); + let mut grpc = tonic::server::Grpc::new(codec) + .apply_compression_config( + accept_compression_encodings, + send_compression_encodings, + ) + .apply_max_message_size_config( + max_decoding_message_size, + max_encoding_message_size, + ); + let res = grpc.unary(method, req).await; + Ok(res) + }; + Box::pin(fut) + } + _ => Box::pin(async move { + Ok(http::Response::builder() + .status(200) + .header("grpc-status", "12") + .header("content-type", "application/grpc") + .body(empty_body()) + .unwrap()) + }), + } + } + } + impl Clone for MsgServer { + fn clone(&self) -> Self { + let inner = self.inner.clone(); + Self { + inner, + accept_compression_encodings: self.accept_compression_encodings, + send_compression_encodings: self.send_compression_encodings, + max_decoding_message_size: self.max_decoding_message_size, + max_encoding_message_size: self.max_encoding_message_size, + } + } + } + impl Clone for _Inner { + fn clone(&self) -> Self { + Self(Arc::clone(&self.0)) + } + } + impl std::fmt::Debug for _Inner { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self.0) + } + } + impl tonic::server::NamedService for MsgServer { + const NAME: &'static str = "ibc.lightclients.wasm.v1.Msg"; + } +} diff --git a/ibc-go b/ibc-go index 8cd96f41..8479edf4 160000 --- a/ibc-go +++ b/ibc-go @@ -1 +1 @@ -Subproject commit 8cd96f4169ebee21d50ef69417203b21cf4238ab +Subproject commit 8479edf4d0d3f93ad5138952ae74859d7ba33f74 diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 90dbc4ab..7f54754c 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -23,7 +23,7 @@ static QUIET: AtomicBool = AtomicBool::new(false); 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"; +const IBC_REV: &str = "v8.4.0"; /// The wasmd commit or tag to be cloned and used to build the proto files const WASMD_REV: &str = "v0.52.0";