From 363eaafe2123797160cb9b7c58d78a6867b66967 Mon Sep 17 00:00:00 2001 From: "Tony Arcieri (iqlusion)" Date: Wed, 14 Aug 2024 14:10:03 -0600 Subject: [PATCH] wasmd: bump to v0.52.0 (#489) --- cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT | 2 +- .../src/prost/wasmd/cosmos.query.v1.rs | 2 + .../src/prost/wasmd/cosmwasm.wasm.v1.rs | 32 ++ .../src/prost/wasmd/cosmwasm.wasm.v1.serde.rs | 353 ++++++++++++++++++ .../src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs | 18 + proto-build/src/main.rs | 2 +- wasmd | 2 +- 7 files changed, 408 insertions(+), 3 deletions(-) create mode 100644 cosmos-sdk-proto/src/prost/wasmd/cosmos.query.v1.rs diff --git a/cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT b/cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT index a8672915..c182623d 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT +++ b/cosmos-sdk-proto/src/prost/wasmd/WASMD_COMMIT @@ -1 +1 @@ -v0.45.0 \ No newline at end of file +v0.52.0 \ No newline at end of file diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmos.query.v1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmos.query.v1.rs new file mode 100644 index 00000000..8e2ac1be --- /dev/null +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmos.query.v1.rs @@ -0,0 +1,2 @@ +// @generated +// @@protoc_insertion_point(module) diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs index 207bf584..19421d43 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.rs @@ -376,6 +376,10 @@ pub struct MsgIbcSendResponse { #[prost(uint64, tag = "1")] pub sequence: u64, } +/// MsgIBCWriteAcknowledgementResponse +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct MsgIbcWriteAcknowledgementResponse {} /// MsgIBCCloseChannel port and channel need to be owned by the contract #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] @@ -960,6 +964,34 @@ pub struct QueryContractsByCreatorResponse { pub pagination: ::core::option::Option, } +/// QueryBuildAddressRequest is the request type for the Query/BuildAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBuildAddressRequest { + /// CodeHash is the hash of the code + #[prost(string, tag = "1")] + pub code_hash: ::prost::alloc::string::String, + /// CreatorAddress is the address of the contract instantiator + #[prost(string, tag = "2")] + pub creator_address: ::prost::alloc::string::String, + /// Salt is a hex encoded salt + #[prost(string, tag = "3")] + pub salt: ::prost::alloc::string::String, + /// InitArgs are optional json encoded init args to be used in contract address + /// building if provided + #[prost(bytes = "vec", tag = "4")] + pub init_args: ::prost::alloc::vec::Vec, +} +/// QueryBuildAddressResponse is the response type for the Query/BuildAddress RPC +/// method. +#[allow(clippy::derive_partial_eq_without_eq)] +#[derive(Clone, PartialEq, ::prost::Message)] +pub struct QueryBuildAddressResponse { + /// Address is the contract address + #[prost(string, tag = "1")] + pub address: ::prost::alloc::string::String, +} /// MsgStoreCode submit Wasm code to the system #[allow(clippy::derive_partial_eq_without_eq)] #[derive(Clone, PartialEq, ::prost::Message)] diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs index 083658b3..26a94792 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.serde.rs @@ -5036,6 +5036,88 @@ impl<'de> serde::Deserialize<'de> for MsgIbcSendResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for MsgIbcWriteAcknowledgementResponse { + #[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("cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", len)?; + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for MsgIbcWriteAcknowledgementResponse { + #[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 = MsgIbcWriteAcknowledgementResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse") + } + + 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(MsgIbcWriteAcknowledgementResponse {}) + } + } + deserializer.deserialize_struct( + "cosmwasm.wasm.v1.MsgIBCWriteAcknowledgementResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for MsgInstantiateContract { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result @@ -9243,6 +9325,277 @@ impl<'de> serde::Deserialize<'de> for QueryAllContractStateResponse { } } #[cfg(feature = "serde")] +impl serde::Serialize for QueryBuildAddressRequest { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.code_hash.is_empty() { + len += 1; + } + if !self.creator_address.is_empty() { + len += 1; + } + if !self.salt.is_empty() { + len += 1; + } + if !self.init_args.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryBuildAddressRequest", len)?; + if !self.code_hash.is_empty() { + struct_ser.serialize_field("codeHash", &self.code_hash)?; + } + if !self.creator_address.is_empty() { + struct_ser.serialize_field("creatorAddress", &self.creator_address)?; + } + if !self.salt.is_empty() { + struct_ser.serialize_field("salt", &self.salt)?; + } + if !self.init_args.is_empty() { + #[allow(clippy::needless_borrow)] + struct_ser.serialize_field( + "initArgs", + pbjson::private::base64::encode(&self.init_args).as_str(), + )?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBuildAddressRequest { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &[ + "code_hash", + "codeHash", + "creator_address", + "creatorAddress", + "salt", + "init_args", + "initArgs", + ]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + CodeHash, + CreatorAddress, + Salt, + InitArgs, + } + #[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 { + "codeHash" | "code_hash" => Ok(GeneratedField::CodeHash), + "creatorAddress" | "creator_address" => { + Ok(GeneratedField::CreatorAddress) + } + "salt" => Ok(GeneratedField::Salt), + "initArgs" | "init_args" => Ok(GeneratedField::InitArgs), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryBuildAddressRequest; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryBuildAddressRequest") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut code_hash__ = None; + let mut creator_address__ = None; + let mut salt__ = None; + let mut init_args__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::CodeHash => { + if code_hash__.is_some() { + return Err(serde::de::Error::duplicate_field("codeHash")); + } + code_hash__ = Some(map_.next_value()?); + } + GeneratedField::CreatorAddress => { + if creator_address__.is_some() { + return Err(serde::de::Error::duplicate_field("creatorAddress")); + } + creator_address__ = Some(map_.next_value()?); + } + GeneratedField::Salt => { + if salt__.is_some() { + return Err(serde::de::Error::duplicate_field("salt")); + } + salt__ = Some(map_.next_value()?); + } + GeneratedField::InitArgs => { + if init_args__.is_some() { + return Err(serde::de::Error::duplicate_field("initArgs")); + } + init_args__ = Some( + map_.next_value::<::pbjson::private::BytesDeserialize<_>>()? + .0, + ); + } + } + } + Ok(QueryBuildAddressRequest { + code_hash: code_hash__.unwrap_or_default(), + creator_address: creator_address__.unwrap_or_default(), + salt: salt__.unwrap_or_default(), + init_args: init_args__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmwasm.wasm.v1.QueryBuildAddressRequest", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] +impl serde::Serialize for QueryBuildAddressResponse { + #[allow(deprecated)] + fn serialize(&self, serializer: S) -> std::result::Result + where + S: serde::Serializer, + { + use serde::ser::SerializeStruct; + let mut len = 0; + if !self.address.is_empty() { + len += 1; + } + let mut struct_ser = + serializer.serialize_struct("cosmwasm.wasm.v1.QueryBuildAddressResponse", len)?; + if !self.address.is_empty() { + struct_ser.serialize_field("address", &self.address)?; + } + struct_ser.end() + } +} +#[cfg(feature = "serde")] +impl<'de> serde::Deserialize<'de> for QueryBuildAddressResponse { + #[allow(deprecated)] + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + const FIELDS: &[&str] = &["address"]; + + #[allow(clippy::enum_variant_names)] + enum GeneratedField { + Address, + } + #[cfg(feature = "serde")] + impl<'de> serde::Deserialize<'de> for GeneratedField { + fn deserialize(deserializer: D) -> std::result::Result + where + D: serde::Deserializer<'de>, + { + struct GeneratedVisitor; + + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = GeneratedField; + + fn expecting( + &self, + formatter: &mut std::fmt::Formatter<'_>, + ) -> std::fmt::Result { + write!(formatter, "expected one of: {:?}", &FIELDS) + } + + #[allow(unused_variables)] + fn visit_str(self, value: &str) -> std::result::Result + where + E: serde::de::Error, + { + match value { + "address" => Ok(GeneratedField::Address), + _ => Err(serde::de::Error::unknown_field(value, FIELDS)), + } + } + } + deserializer.deserialize_identifier(GeneratedVisitor) + } + } + struct GeneratedVisitor; + impl<'de> serde::de::Visitor<'de> for GeneratedVisitor { + type Value = QueryBuildAddressResponse; + + fn expecting(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + formatter.write_str("struct cosmwasm.wasm.v1.QueryBuildAddressResponse") + } + + fn visit_map( + self, + mut map_: V, + ) -> std::result::Result + where + V: serde::de::MapAccess<'de>, + { + let mut address__ = None; + while let Some(k) = map_.next_key()? { + match k { + GeneratedField::Address => { + if address__.is_some() { + return Err(serde::de::Error::duplicate_field("address")); + } + address__ = Some(map_.next_value()?); + } + } + } + Ok(QueryBuildAddressResponse { + address: address__.unwrap_or_default(), + }) + } + } + deserializer.deserialize_struct( + "cosmwasm.wasm.v1.QueryBuildAddressResponse", + FIELDS, + GeneratedVisitor, + ) + } +} +#[cfg(feature = "serde")] impl serde::Serialize for QueryCodeRequest { #[allow(deprecated)] fn serialize(&self, serializer: S) -> std::result::Result diff --git a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs index 54bf671d..769b8801 100644 --- a/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs +++ b/cosmos-sdk-proto/src/prost/wasmd/cosmwasm.wasm.v1.tonic.rs @@ -300,6 +300,24 @@ pub mod query_client { )); self.inner.unary(req, path, codec).await } + pub async fn build_address( + &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("/cosmwasm.wasm.v1.Query/BuildAddress"); + let mut req = request.into_request(); + req.extensions_mut() + .insert(GrpcMethod::new("cosmwasm.wasm.v1.Query", "BuildAddress")); + self.inner.unary(req, path, codec).await + } } } /// Generated client implementations. diff --git a/proto-build/src/main.rs b/proto-build/src/main.rs index 4d1f113d..c3816aa3 100644 --- a/proto-build/src/main.rs +++ b/proto-build/src/main.rs @@ -26,7 +26,7 @@ const COSMOS_SDK_REV: &str = "v0.50.9"; const IBC_REV: &str = "v6.3.1"; /// The wasmd commit or tag to be cloned and used to build the proto files -const WASMD_REV: &str = "v0.45.0"; +const WASMD_REV: &str = "v0.52.0"; // All paths must end with a / and either be absolute or include a ./ to reference the current // working directory. diff --git a/wasmd b/wasmd index 7165e41c..1ff81880 160000 --- a/wasmd +++ b/wasmd @@ -1 +1 @@ -Subproject commit 7165e41cbf14d60a9fef4fb1e04c2c2e5e4e0cf4 +Subproject commit 1ff818801d4aa5dd6f483571ac7a38660c59c671