diff --git a/multihop.patch b/multihop.patch new file mode 100644 index 0000000..5271531 --- /dev/null +++ b/multihop.patch @@ -0,0 +1,137 @@ +diff --git a/proto/ibc/core/channel/v1/channel.proto b/proto/ibc/core/channel/v1/channel.proto +index 44c3240e2..b7596c72b 100644 +--- a/proto/ibc/core/channel/v1/channel.proto ++++ b/proto/ibc/core/channel/v1/channel.proto +@@ -71,10 +71,12 @@ + // A channel has been closed and can no longer be used to send or receive + // packets. + STATE_CLOSED = 4 [(gogoproto.enumvalue_customname) = "CLOSED"]; ++ // A channel has been forced closed due to a frozen client in the connection path. ++ STATE_FROZEN = 5 [(gogoproto.enumvalue_customname) = "FROZEN"]; + // A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. +- STATE_FLUSHING = 5 [(gogoproto.enumvalue_customname) = "FLUSHING"]; ++ STATE_FLUSHING = 6 [(gogoproto.enumvalue_customname) = "FLUSHING"]; + // A channel has just completed flushing any in-flight packets. +- STATE_FLUSHCOMPLETE = 6 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; ++ STATE_FLUSHCOMPLETE = 7 [(gogoproto.enumvalue_customname) = "FLUSHCOMPLETE"]; + } + + // Order defines if a channel is ORDERED or UNORDERED +diff --git a/proto/ibc/core/channel/v1/tx.proto b/proto/ibc/core/channel/v1/tx.proto +index 4b9ad3d75..07ee7f08d 100644 +--- a/proto/ibc/core/channel/v1/tx.proto ++++ b/proto/ibc/core/channel/v1/tx.proto +@@ -9,6 +9,7 @@ + import "ibc/core/client/v1/client.proto"; + import "ibc/core/channel/v1/channel.proto"; + import "ibc/core/channel/v1/upgrade.proto"; ++import "ibc/core/commitment/v1/commitment.proto"; + + // Msg defines the ibc/channel Msg service. + service Msg { +@@ -33,6 +34,9 @@ + // MsgChannelCloseConfirm. + rpc ChannelCloseConfirm(MsgChannelCloseConfirm) returns (MsgChannelCloseConfirmResponse); + ++ // ChannelCloseFrozen defines a rpc handler method for MsgChannelCloseFrozen. ++ rpc ChannelCloseFrozen(MsgChannelCloseFrozen) returns (MsgChannelCloseFrozenResponse); ++ + // RecvPacket defines a rpc handler method for MsgRecvPacket. + rpc RecvPacket(MsgRecvPacket) returns (MsgRecvPacketResponse); + +@@ -208,6 +212,25 @@ + // type. + message MsgChannelCloseConfirmResponse {} + ++// MsgChannelCloseFrozen defines a msg sent by a Relayer to force close ++// a channel due to a frozen client in a multi-hop channel path. ++message MsgChannelCloseFrozen { ++ option (gogoproto.equal) = false; ++ option (gogoproto.goproto_getters) = false; ++ ++ string port_id = 1 [(gogoproto.moretags) = "yaml:\"port_id\""]; ++ string channel_id = 2 [(gogoproto.moretags) = "yaml:\"channel_id\""]; ++ bytes proof_connection = 3 [(gogoproto.moretags) = "yaml:\"proof_connection\""]; ++ bytes proof_client_state = 4 [(gogoproto.moretags) = "yaml:\"proof_client_state\""]; ++ ibc.core.client.v1.Height proof_height = 5 ++ [(gogoproto.moretags) = "yaml:\"proof_height\"", (gogoproto.nullable) = false]; ++ string signer = 6; ++} ++ ++// MsgChannelCloseFrozenResponse defines the Msg/ChannelFrozenConfirm response ++// type. ++message MsgChannelCloseFrozenResponse {} ++ + // MsgRecvPacket receives incoming IBC packet + message MsgRecvPacket { + option (cosmos.msg.v1.signer) = "signer"; +@@ -467,3 +490,23 @@ + // Number of sequences left after pruning. + uint64 total_remaining_sequences = 2; + } ++ ++// MultihopProof holds the information necessary to prove a multihop message ++message MultihopProof { ++ option (gogoproto.equal) = false; ++ option (gogoproto.goproto_getters) = false; ++ ++ bytes proof = 2; ++ bytes value = 3; ++ ibc.core.commitment.v1.MerklePath prefixed_key = 4; ++} ++ ++// MsgMultihopProofs holds the proof information for each intermediary hop for a multihop message ++message MsgMultihopProofs { ++ option (gogoproto.equal) = false; ++ option (gogoproto.goproto_getters) = false; ++ ++ MultihopProof key_proof = 2; ++ repeated MultihopProof connection_proofs = 3; ++ repeated MultihopProof consensus_proofs = 4; ++} +diff --git a/proto/ibc/core/client/v1/query.proto b/proto/ibc/core/client/v1/query.proto +index 0032306ec..4bd66bfee 100644 +--- a/proto/ibc/core/client/v1/query.proto ++++ b/proto/ibc/core/client/v1/query.proto +@@ -36,6 +36,14 @@ service Query { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}"; + } + ++ // NextConsensusStateHeight queries for a consensus state height associated with ++ // a client state at a minimum height greater than a given height. ++ rpc NextConsensusStateHeight(QueryNextConsensusStateHeightRequest) returns (QueryNextConsensusStateHeightResponse) { ++ option (google.api.http).get = "/ibc/core/client/v1/next_height/consensus_states/" ++ "{client_id}/revision/{revision_number}/" ++ "height/{revision_height}"; ++ } ++ + // ConsensusStateHeights queries the height of every consensus states associated with a given client. + rpc ConsensusStateHeights(QueryConsensusStateHeightsRequest) returns (QueryConsensusStateHeightsResponse) { + option (google.api.http).get = "/ibc/core/client/v1/consensus_states/{client_id}/heights"; +@@ -142,6 +150,26 @@ message QueryConsensusStatesResponse { + cosmos.base.query.v1beta1.PageResponse pagination = 2; + } + ++// QueryNextConsensusStateRequest is the request type for the Query/ConsensusState ++// RPC method. Besides the consensus state, it includes a proof and the height ++// from which the proof was retrieved. ++message QueryNextConsensusStateHeightRequest { ++ // client identifier ++ string client_id = 1; ++ // consensus state revision number ++ uint64 revision_number = 2; ++ // consensus state revision height ++ uint64 revision_height = 3; ++} ++ ++// QueryNextConsensusStateResponse is the response type for the Query/ConsensusState ++// RPC method ++message QueryNextConsensusStateHeightResponse { ++ // minimum consensus state height associated with the client identifier larger ++ // than the query height ++ ibc.core.client.v1.Height consensus_height = 1 [(gogoproto.nullable) = false]; ++} ++ + // QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights + // RPC method. + message QueryConsensusStateHeightsRequest { diff --git a/scripts/sync-protobuf.sh b/scripts/sync-protobuf.sh index 4620075..0b0bde6 100755 --- a/scripts/sync-protobuf.sh +++ b/scripts/sync-protobuf.sh @@ -172,6 +172,8 @@ cd proto buf export -v -o ../proto-include popd +patch -d "$IBC_GO_DIR/proto-include" -p2 < multihop.patch + NFT_TRANSFER_DIR=$(mktemp -d /tmp/nft-transfer-XXXXXXXX) pushd "$NFT_TRANSFER_DIR" diff --git a/src/prost/google.api.rs b/src/prost/google.api.rs index 08318f4..1e50e6f 100644 --- a/src/prost/google.api.rs +++ b/src/prost/google.api.rs @@ -29,7 +29,7 @@ impl ::prost::Name for Http { "/google.api.Http".into() } } -/// # gRPC Transcoding +/// gRPC Transcoding /// /// gRPC Transcoding is a feature for mapping between a gRPC method and one or /// more HTTP REST endpoints. It allows developers to build a single API service @@ -70,9 +70,8 @@ impl ::prost::Name for Http { /// /// This enables an HTTP REST to gRPC mapping as below: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456` | `GetMessage(name: "messages/123456")` +/// - HTTP: `GET /v1/messages/123456` +/// - gRPC: `GetMessage(name: "messages/123456")` /// /// Any fields in the request message which are not bound by the path template /// automatically become HTTP query parameters if there is no HTTP request body. @@ -96,11 +95,9 @@ impl ::prost::Name for Http { /// /// This enables a HTTP JSON to RPC mapping as below: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | -/// `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: -/// "foo"))` +/// - HTTP: `GET /v1/messages/123456?revision=2&sub.subfield=foo` +/// - gRPC: `GetMessage(message_id: "123456" revision: 2 sub: +/// SubMessage(subfield: "foo"))` /// /// Note that fields which are mapped to URL query parameters must have a /// primitive type or a repeated primitive type or a non-repeated message type. @@ -130,10 +127,8 @@ impl ::prost::Name for Http { /// representation of the JSON in the request body is determined by /// protos JSON encoding: /// -/// HTTP | gRPC -/// -----|----- -/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -/// "123456" message { text: "Hi!" })` +/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +/// - gRPC: `UpdateMessage(message_id: "123456" message { text: "Hi!" })` /// /// The special name `*` can be used in the body mapping to define that /// every field not bound by the path template should be mapped to the @@ -156,10 +151,8 @@ impl ::prost::Name for Http { /// /// The following HTTP JSON to RPC mapping is enabled: /// -/// HTTP | gRPC -/// -----|----- -/// `PATCH /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: -/// "123456" text: "Hi!")` +/// - HTTP: `PATCH /v1/messages/123456 { "text": "Hi!" }` +/// - gRPC: `UpdateMessage(message_id: "123456" text: "Hi!")` /// /// Note that when using `*` in the body mapping, it is not possible to /// have HTTP parameters, as all fields not bound by the path end in @@ -187,13 +180,13 @@ impl ::prost::Name for Http { /// /// This enables the following two alternative HTTP JSON to RPC mappings: /// -/// HTTP | gRPC -/// -----|----- -/// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")` -/// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: -/// "123456")` +/// - HTTP: `GET /v1/messages/123456` +/// - gRPC: `GetMessage(message_id: "123456")` /// -/// ## Rules for HTTP mapping +/// - HTTP: `GET /v1/users/me/messages/123456` +/// - gRPC: `GetMessage(user_id: "me" message_id: "123456")` +/// +/// Rules for HTTP mapping /// /// 1. Leaf request fields (recursive expansion nested messages in the request /// message) are classified into three categories: @@ -212,7 +205,7 @@ impl ::prost::Name for Http { /// request body, all /// fields are passed via URL path and URL query parameters. /// -/// ### Path template syntax +/// Path template syntax /// /// Template = "/" Segments \[ Verb \] ; /// Segments = Segment { "/" Segment } ; @@ -251,7 +244,7 @@ impl ::prost::Name for Http { /// Document]() as /// `{+var}`. /// -/// ## Using gRPC API Service Configuration +/// Using gRPC API Service Configuration /// /// gRPC API Service Configuration (service config) is a configuration language /// for configuring a gRPC service to become a user-facing product. The @@ -266,15 +259,14 @@ impl ::prost::Name for Http { /// specified in the service config will override any matching transcoding /// configuration in the proto. /// -/// Example: +/// The following example selects a gRPC method and applies an `HttpRule` to it: /// /// http: /// rules: -/// # Selects a gRPC method and applies HttpRule to it. /// - selector: example.v1.Messaging.GetMessage /// get: /v1/messages/{message_id}/{sub.subfield} /// -/// ## Special notes +/// Special notes /// /// When gRPC Transcoding is used to map a gRPC to JSON REST endpoints, the /// proto to JSON conversion must follow the [proto3 diff --git a/src/prost/ibc.core.channel.v1.rs b/src/prost/ibc.core.channel.v1.rs index 684f59b..906b0dc 100644 --- a/src/prost/ibc.core.channel.v1.rs +++ b/src/prost/ibc.core.channel.v1.rs @@ -298,10 +298,12 @@ pub enum State { /// A channel has been closed and can no longer be used to send or receive /// packets. Closed = 4, + /// A channel has been forced closed due to a frozen client in the connection path. + Frozen = 5, /// A channel has just accepted the upgrade handshake attempt and is flushing in-flight packets. - Flushing = 5, + Flushing = 6, /// A channel has just completed flushing any in-flight packets. - Flushcomplete = 6, + Flushcomplete = 7, } impl State { /// String value of the enum field names used in the ProtoBuf definition. @@ -315,6 +317,7 @@ impl State { State::Tryopen => "STATE_TRYOPEN", State::Open => "STATE_OPEN", State::Closed => "STATE_CLOSED", + State::Frozen => "STATE_FROZEN", State::Flushing => "STATE_FLUSHING", State::Flushcomplete => "STATE_FLUSHCOMPLETE", } @@ -327,6 +330,7 @@ impl State { "STATE_TRYOPEN" => Some(Self::Tryopen), "STATE_OPEN" => Some(Self::Open), "STATE_CLOSED" => Some(Self::Closed), + "STATE_FROZEN" => Some(Self::Frozen), "STATE_FLUSHING" => Some(Self::Flushing), "STATE_FLUSHCOMPLETE" => Some(Self::Flushcomplete), _ => None, @@ -754,6 +758,49 @@ impl ::prost::Name for MsgChannelCloseConfirmResponse { "/ibc.core.channel.v1.MsgChannelCloseConfirmResponse".into() } } +/// MsgChannelCloseFrozen defines a msg sent by a Relayer to force close +/// a channel due to a frozen client in a multi-hop channel path. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgChannelCloseFrozen { + #[prost(string, tag = "1")] + pub port_id: ::prost::alloc::string::String, + #[prost(string, tag = "2")] + pub channel_id: ::prost::alloc::string::String, + #[prost(bytes = "vec", tag = "3")] + pub proof_connection: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "4")] + pub proof_client_state: ::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, +} +impl ::prost::Name for MsgChannelCloseFrozen { + const NAME: &'static str = "MsgChannelCloseFrozen"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.channel.v1.MsgChannelCloseFrozen".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseFrozen".into() + } +} +/// MsgChannelCloseFrozenResponse defines the Msg/ChannelFrozenConfirm response +/// type. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct MsgChannelCloseFrozenResponse {} +impl ::prost::Name for MsgChannelCloseFrozenResponse { + const NAME: &'static str = "MsgChannelCloseFrozenResponse"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.channel.v1.MsgChannelCloseFrozenResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgChannelCloseFrozenResponse".into() + } +} /// MsgRecvPacket receives incoming IBC packet #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -1324,6 +1371,48 @@ impl ::prost::Name for MsgPruneAcknowledgementsResponse { "/ibc.core.channel.v1.MsgPruneAcknowledgementsResponse".into() } } +/// MultihopProof holds the information necessary to prove a multihop message +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MultihopProof { + #[prost(bytes = "vec", tag = "2")] + pub proof: ::prost::alloc::vec::Vec, + #[prost(bytes = "vec", tag = "3")] + pub value: ::prost::alloc::vec::Vec, + #[prost(message, optional, tag = "4")] + pub prefixed_key: ::core::option::Option, +} +impl ::prost::Name for MultihopProof { + const NAME: &'static str = "MultihopProof"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.channel.v1.MultihopProof".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MultihopProof".into() + } +} +/// MsgMultihopProofs holds the proof information for each intermediary hop for a multihop message +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgMultihopProofs { + #[prost(message, optional, tag = "2")] + pub key_proof: ::core::option::Option, + #[prost(message, repeated, tag = "3")] + pub connection_proofs: ::prost::alloc::vec::Vec, + #[prost(message, repeated, tag = "4")] + pub consensus_proofs: ::prost::alloc::vec::Vec, +} +impl ::prost::Name for MsgMultihopProofs { + const NAME: &'static str = "MsgMultihopProofs"; + const PACKAGE: &'static str = "ibc.core.channel.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.channel.v1.MsgMultihopProofs".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.channel.v1.MsgMultihopProofs".into() + } +} /// ResponseResultType defines the possible outcomes of the execution of a message #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord, ::prost::Enumeration)] #[repr(i32)] @@ -1609,6 +1698,34 @@ pub mod msg_client { ); self.inner.unary(req, path, codec).await } + /// ChannelCloseFrozen defines a rpc handler method for MsgChannelCloseFrozen. + pub async fn channel_close_frozen( + &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/ChannelCloseFrozen", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new("ibc.core.channel.v1.Msg", "ChannelCloseFrozen"), + ); + self.inner.unary(req, path, codec).await + } /// RecvPacket defines a rpc handler method for MsgRecvPacket. pub async fn recv_packet( &mut self, @@ -2020,6 +2137,14 @@ pub mod msg_server { tonic::Response, tonic::Status, >; + /// ChannelCloseFrozen defines a rpc handler method for MsgChannelCloseFrozen. + async fn channel_close_frozen( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// RecvPacket defines a rpc handler method for MsgRecvPacket. async fn recv_packet( &self, @@ -2464,6 +2589,51 @@ pub mod msg_server { }; Box::pin(fut) } + "/ibc.core.channel.v1.Msg/ChannelCloseFrozen" => { + #[allow(non_camel_case_types)] + struct ChannelCloseFrozenSvc(pub Arc); + impl< + T: Msg, + > tonic::server::UnaryService + for ChannelCloseFrozenSvc { + type Response = super::MsgChannelCloseFrozenResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::channel_close_frozen(&inner, request).await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = ChannelCloseFrozenSvc(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/RecvPacket" => { #[allow(non_camel_case_types)] struct RecvPacketSvc(pub Arc); diff --git a/src/prost/ibc.core.channel.v1.serde.rs b/src/prost/ibc.core.channel.v1.serde.rs index abb6af8..7645365 100644 --- a/src/prost/ibc.core.channel.v1.serde.rs +++ b/src/prost/ibc.core.channel.v1.serde.rs @@ -1485,6 +1485,264 @@ impl<'de> serde::Deserialize<'de> for MsgChannelCloseConfirmResponse { deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseConfirmResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MsgChannelCloseFrozen { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseFrozen", len)?; + if true { + struct_ser.serialize_field("portId", &self.port_id)?; + } + if true { + struct_ser.serialize_field("channelId", &self.channel_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofConnection", pbjson::private::base64::encode(&self.proof_connection).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proofClientState", pbjson::private::base64::encode(&self.proof_client_state).as_str())?; + } + if let Some(v) = self.proof_height.as_ref() { + struct_ser.serialize_field("proofHeight", v)?; + } + if true { + struct_ser.serialize_field("signer", &self.signer)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseFrozen { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "port_id", + "portId", + "channel_id", + "channelId", + "proof_connection", + "proofConnection", + "proof_client_state", + "proofClientState", + "proof_height", + "proofHeight", + "signer", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + PortId, + ChannelId, + ProofConnection, + ProofClientState, + ProofHeight, + Signer, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "portId" | "port_id" => Ok(GeneratedField::PortId), + "channelId" | "channel_id" => Ok(GeneratedField::ChannelId), + "proofConnection" | "proof_connection" => Ok(GeneratedField::ProofConnection), + "proofClientState" | "proof_client_state" => Ok(GeneratedField::ProofClientState), + "proofHeight" | "proof_height" => Ok(GeneratedField::ProofHeight), + "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 = MsgChannelCloseFrozen; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseFrozen") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut port_id__ = None; + let mut channel_id__ = None; + let mut proof_connection__ = None; + let mut proof_client_state__ = None; + let mut proof_height__ = None; + let mut signer__ = 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::ProofConnection => { + if proof_connection__.is_some() { + return Err(serde::de::Error::duplicate_field("proofConnection")); + } + proof_connection__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::ProofClientState => { + if proof_client_state__.is_some() { + return Err(serde::de::Error::duplicate_field("proofClientState")); + } + proof_client_state__ = + 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(MsgChannelCloseFrozen { + port_id: port_id__.unwrap_or_default(), + channel_id: channel_id__.unwrap_or_default(), + proof_connection: proof_connection__.unwrap_or_default(), + proof_client_state: proof_client_state__.unwrap_or_default(), + proof_height: proof_height__, + signer: signer__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseFrozen", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for MsgChannelCloseFrozenResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let len = 0; + let struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgChannelCloseFrozenResponse", len)?; + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgChannelCloseFrozenResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + Err(serde::de::Error::unknown_field(value, FIELDS)) + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgChannelCloseFrozenResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgChannelCloseFrozenResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + while map_.next_key::()?.is_some() { + let _ = map_.next_value::()?; + } + Ok(MsgChannelCloseFrozenResponse { + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelCloseFrozenResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for MsgChannelCloseInit { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -4773,6 +5031,134 @@ impl<'de> serde::Deserialize<'de> for MsgChannelUpgradeTryResponse { deserializer.deserialize_struct("ibc.core.channel.v1.MsgChannelUpgradeTryResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MsgMultihopProofs { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MsgMultihopProofs", len)?; + if let Some(v) = self.key_proof.as_ref() { + struct_ser.serialize_field("keyProof", v)?; + } + if true { + struct_ser.serialize_field("connectionProofs", &self.connection_proofs)?; + } + if true { + struct_ser.serialize_field("consensusProofs", &self.consensus_proofs)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MsgMultihopProofs { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "key_proof", + "keyProof", + "connection_proofs", + "connectionProofs", + "consensus_proofs", + "consensusProofs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + KeyProof, + ConnectionProofs, + ConsensusProofs, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "keyProof" | "key_proof" => Ok(GeneratedField::KeyProof), + "connectionProofs" | "connection_proofs" => Ok(GeneratedField::ConnectionProofs), + "consensusProofs" | "consensus_proofs" => Ok(GeneratedField::ConsensusProofs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MsgMultihopProofs; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MsgMultihopProofs") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut key_proof__ = None; + let mut connection_proofs__ = None; + let mut consensus_proofs__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::KeyProof => { + if key_proof__.is_some() { + return Err(serde::de::Error::duplicate_field("keyProof")); + } + key_proof__ = map_.next_value()?; + } + GeneratedField::ConnectionProofs => { + if connection_proofs__.is_some() { + return Err(serde::de::Error::duplicate_field("connectionProofs")); + } + connection_proofs__ = Some(map_.next_value()?); + } + GeneratedField::ConsensusProofs => { + if consensus_proofs__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusProofs")); + } + consensus_proofs__ = Some(map_.next_value()?); + } + } + } + Ok(MsgMultihopProofs { + key_proof: key_proof__, + connection_proofs: connection_proofs__.unwrap_or_default(), + consensus_proofs: consensus_proofs__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MsgMultihopProofs", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for MsgPruneAcknowledgements { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -6019,6 +6405,138 @@ impl<'de> serde::Deserialize<'de> for MsgUpdateParamsResponse { deserializer.deserialize_struct("ibc.core.channel.v1.MsgUpdateParamsResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for MultihopProof { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.channel.v1.MultihopProof", len)?; + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("proof", pbjson::private::base64::encode(&self.proof).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("value", pbjson::private::base64::encode(&self.value).as_str())?; + } + if let Some(v) = self.prefixed_key.as_ref() { + struct_ser.serialize_field("prefixedKey", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for MultihopProof { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "proof", + "value", + "prefixed_key", + "prefixedKey", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Proof, + Value, + PrefixedKey, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "proof" => Ok(GeneratedField::Proof), + "value" => Ok(GeneratedField::Value), + "prefixedKey" | "prefixed_key" => Ok(GeneratedField::PrefixedKey), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = MultihopProof; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.channel.v1.MultihopProof") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut proof__ = None; + let mut value__ = None; + let mut prefixed_key__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Proof => { + if proof__.is_some() { + return Err(serde::de::Error::duplicate_field("proof")); + } + proof__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::Value => { + if value__.is_some() { + return Err(serde::de::Error::duplicate_field("value")); + } + value__ = + Some(map_.next_value::<::pbjson::private::BytesDeserialize<_>>()?.0) + ; + } + GeneratedField::PrefixedKey => { + if prefixed_key__.is_some() { + return Err(serde::de::Error::duplicate_field("prefixedKey")); + } + prefixed_key__ = map_.next_value()?; + } + } + } + Ok(MultihopProof { + proof: proof__.unwrap_or_default(), + value: value__.unwrap_or_default(), + prefixed_key: prefixed_key__, + }) + } + } + deserializer.deserialize_struct("ibc.core.channel.v1.MultihopProof", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for Order { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result @@ -11056,6 +11574,7 @@ impl serde::Serialize for State { Self::Tryopen => "STATE_TRYOPEN", Self::Open => "STATE_OPEN", Self::Closed => "STATE_CLOSED", + Self::Frozen => "STATE_FROZEN", Self::Flushing => "STATE_FLUSHING", Self::Flushcomplete => "STATE_FLUSHCOMPLETE", }; @@ -11074,6 +11593,7 @@ impl<'de> serde::Deserialize<'de> for State { "STATE_TRYOPEN", "STATE_OPEN", "STATE_CLOSED", + "STATE_FROZEN", "STATE_FLUSHING", "STATE_FLUSHCOMPLETE", ]; @@ -11121,6 +11641,7 @@ impl<'de> serde::Deserialize<'de> for State { "STATE_TRYOPEN" => Ok(State::Tryopen), "STATE_OPEN" => Ok(State::Open), "STATE_CLOSED" => Ok(State::Closed), + "STATE_FROZEN" => Ok(State::Frozen), "STATE_FLUSHING" => Ok(State::Flushing), "STATE_FLUSHCOMPLETE" => Ok(State::Flushcomplete), _ => Err(serde::de::Error::unknown_variant(value, FIELDS)), diff --git a/src/prost/ibc.core.client.v1.rs b/src/prost/ibc.core.client.v1.rs index c7176a4..2281a53 100644 --- a/src/prost/ibc.core.client.v1.rs +++ b/src/prost/ibc.core.client.v1.rs @@ -1522,6 +1522,52 @@ impl ::prost::Name for QueryConsensusStatesResponse { "/ibc.core.client.v1.QueryConsensusStatesResponse".into() } } +/// QueryNextConsensusStateRequest is the request type for the Query/ConsensusState +/// RPC method. Besides the consensus state, it includes a proof and the height +/// from which the proof was retrieved. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryNextConsensusStateHeightRequest { + /// client identifier + #[prost(string, tag = "1")] + pub client_id: ::prost::alloc::string::String, + /// consensus state revision number + #[prost(uint64, tag = "2")] + pub revision_number: u64, + /// consensus state revision height + #[prost(uint64, tag = "3")] + pub revision_height: u64, +} +impl ::prost::Name for QueryNextConsensusStateHeightRequest { + const NAME: &'static str = "QueryNextConsensusStateHeightRequest"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.client.v1.QueryNextConsensusStateHeightRequest".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryNextConsensusStateHeightRequest".into() + } +} +/// QueryNextConsensusStateResponse is the response type for the Query/ConsensusState +/// RPC method +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, Copy, PartialEq, ::prost::Message)] +pub struct QueryNextConsensusStateHeightResponse { + /// minimum consensus state height associated with the client identifier larger + /// than the query height + #[prost(message, optional, tag = "1")] + pub consensus_height: ::core::option::Option, +} +impl ::prost::Name for QueryNextConsensusStateHeightResponse { + const NAME: &'static str = "QueryNextConsensusStateHeightResponse"; + const PACKAGE: &'static str = "ibc.core.client.v1"; + fn full_name() -> ::prost::alloc::string::String { + "ibc.core.client.v1.QueryNextConsensusStateHeightResponse".into() + } + fn type_url() -> ::prost::alloc::string::String { + "/ibc.core.client.v1.QueryNextConsensusStateHeightResponse".into() + } +} /// QueryConsensusStateHeightsRequest is the request type for Query/ConsensusStateHeights /// RPC method. #[allow(clippy::derive_partial_eq_without_eq)] @@ -1906,6 +1952,38 @@ pub mod query_client { .insert(GrpcMethod::new("ibc.core.client.v1.Query", "ConsensusStates")); self.inner.unary(req, path, codec).await } + /// NextConsensusStateHeight queries for a consensus state height associated with + /// a client state at a minimum height greater than a given height. + pub async fn next_consensus_state_height( + &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.client.v1.Query/NextConsensusStateHeight", + ); + let mut req = request.into_request(); + req.extensions_mut() + .insert( + GrpcMethod::new( + "ibc.core.client.v1.Query", + "NextConsensusStateHeight", + ), + ); + self.inner.unary(req, path, codec).await + } /// ConsensusStateHeights queries the height of every consensus states associated with a given client. pub async fn consensus_state_heights( &mut self, @@ -2086,6 +2164,15 @@ pub mod query_server { tonic::Response, tonic::Status, >; + /// NextConsensusStateHeight queries for a consensus state height associated with + /// a client state at a minimum height greater than a given height. + async fn next_consensus_state_height( + &self, + request: tonic::Request, + ) -> std::result::Result< + tonic::Response, + tonic::Status, + >; /// ConsensusStateHeights queries the height of every consensus states associated with a given client. async fn consensus_state_heights( &self, @@ -2384,6 +2471,55 @@ pub mod query_server { }; Box::pin(fut) } + "/ibc.core.client.v1.Query/NextConsensusStateHeight" => { + #[allow(non_camel_case_types)] + struct NextConsensusStateHeightSvc(pub Arc); + impl< + T: Query, + > tonic::server::UnaryService< + super::QueryNextConsensusStateHeightRequest, + > for NextConsensusStateHeightSvc { + type Response = super::QueryNextConsensusStateHeightResponse; + type Future = BoxFuture< + tonic::Response, + tonic::Status, + >; + fn call( + &mut self, + request: tonic::Request< + super::QueryNextConsensusStateHeightRequest, + >, + ) -> Self::Future { + let inner = Arc::clone(&self.0); + let fut = async move { + ::next_consensus_state_height(&inner, request) + .await + }; + Box::pin(fut) + } + } + let accept_compression_encodings = self.accept_compression_encodings; + let send_compression_encodings = self.send_compression_encodings; + let max_decoding_message_size = self.max_decoding_message_size; + let max_encoding_message_size = self.max_encoding_message_size; + let inner = self.inner.clone(); + let fut = async move { + let method = NextConsensusStateHeightSvc(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.Query/ConsensusStateHeights" => { #[allow(non_camel_case_types)] struct ConsensusStateHeightsSvc(pub Arc); diff --git a/src/prost/ibc.core.client.v1.serde.rs b/src/prost/ibc.core.client.v1.serde.rs index f3491f5..a045852 100644 --- a/src/prost/ibc.core.client.v1.serde.rs +++ b/src/prost/ibc.core.client.v1.serde.rs @@ -3996,6 +3996,232 @@ impl<'de> serde::Deserialize<'de> for QueryConsensusStatesResponse { deserializer.deserialize_struct("ibc.core.client.v1.QueryConsensusStatesResponse", FIELDS, GeneratedVisitor) } } +impl serde::Serialize for QueryNextConsensusStateHeightRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + if true { + len += 1; + } + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.QueryNextConsensusStateHeightRequest", len)?; + if true { + struct_ser.serialize_field("clientId", &self.client_id)?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionNumber", ::alloc::string::ToString::to_string(&self.revision_number).as_str())?; + } + if true { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field("revisionHeight", ::alloc::string::ToString::to_string(&self.revision_height).as_str())?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextConsensusStateHeightRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "client_id", + "clientId", + "revision_number", + "revisionNumber", + "revision_height", + "revisionHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ClientId, + RevisionNumber, + RevisionHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "clientId" | "client_id" => Ok(GeneratedField::ClientId), + "revisionNumber" | "revision_number" => Ok(GeneratedField::RevisionNumber), + "revisionHeight" | "revision_height" => Ok(GeneratedField::RevisionHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextConsensusStateHeightRequest; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryNextConsensusStateHeightRequest") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut client_id__ = None; + let mut revision_number__ = None; + let mut revision_height__ = 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::RevisionNumber => { + if revision_number__.is_some() { + return Err(serde::de::Error::duplicate_field("revisionNumber")); + } + 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(QueryNextConsensusStateHeightRequest { + client_id: client_id__.unwrap_or_default(), + revision_number: revision_number__.unwrap_or_default(), + revision_height: revision_height__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryNextConsensusStateHeightRequest", FIELDS, GeneratedVisitor) + } +} +impl serde::Serialize for QueryNextConsensusStateHeightResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> core::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if true { + len += 1; + } + let mut struct_ser = serializer.serialize_struct("ibc.core.client.v1.QueryNextConsensusStateHeightResponse", len)?; + if let Some(v) = self.consensus_height.as_ref() { + struct_ser.serialize_field("consensusHeight", v)?; + } + struct_ser.end() + } +} +impl<'de> serde::Deserialize<'de> for QueryNextConsensusStateHeightResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "consensus_height", + "consensusHeight", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + ConsensusHeight, + } + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> core::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> core::result::Result + where + E: serde::de::Error, + { + match value { + "consensusHeight" | "consensus_height" => Ok(GeneratedField::ConsensusHeight), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryNextConsensusStateHeightResponse; + + fn expecting(&self, formatter: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + formatter.write_str("struct ibc.core.client.v1.QueryNextConsensusStateHeightResponse") + } + + fn visit_map(self, mut map_: V) -> core::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut consensus_height__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::ConsensusHeight => { + if consensus_height__.is_some() { + return Err(serde::de::Error::duplicate_field("consensusHeight")); + } + consensus_height__ = map_.next_value()?; + } + } + } + Ok(QueryNextConsensusStateHeightResponse { + consensus_height: consensus_height__, + }) + } + } + deserializer.deserialize_struct("ibc.core.client.v1.QueryNextConsensusStateHeightResponse", FIELDS, GeneratedVisitor) + } +} impl serde::Serialize for QueryUpgradedClientStateRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> core::result::Result diff --git a/src/prost/proto_descriptor.bin b/src/prost/proto_descriptor.bin index 7a44e26..6bf1c56 100644 Binary files a/src/prost/proto_descriptor.bin and b/src/prost/proto_descriptor.bin differ