diff --git a/Cargo.lock b/Cargo.lock index 18e96326fc..dbd864f1a2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6309,6 +6309,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-utils", + "cw2", "cw4", "nym-contracts-common", "nym-multisig-contract-common", diff --git a/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_query_client.rs b/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_query_client.rs index f299c0ba36..a6b220d4c7 100644 --- a/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_query_client.rs +++ b/common/client-libs/validator-client/src/nyxd/contract_traits/dkg_query_client.rs @@ -135,6 +135,11 @@ pub trait DkgQueryClient { }; self.query_dkg_contract(request).await } + + async fn get_contract_cw2_version(&self) -> Result { + self.query_dkg_contract(DkgQueryMsg::GetCW2ContractVersion {}) + .await + } } // extension trait to the query client to deal with the paged queries @@ -241,6 +246,7 @@ mod tests { } => client .get_vk_shares_paged(epoch_id, start_after, limit) .ignore(), + DkgQueryMsg::GetCW2ContractVersion {} => client.get_contract_cw2_version().ignore(), }; } } diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml index 1779bd32fb..d2a9cbd50f 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml +++ b/common/cosmwasm-smart-contracts/coconut-dkg/Cargo.toml @@ -10,6 +10,7 @@ license.workspace = true cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw-utils = { workspace = true } +cw2 = { workspace = true } cw4 = { workspace = true } contracts-common = { path = "../contracts-common", package = "nym-contracts-common" } diff --git a/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs b/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs index 594875e369..02a39368ac 100644 --- a/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs +++ b/common/cosmwasm-smart-contracts/coconut-dkg/src/msg.rs @@ -120,6 +120,11 @@ pub enum QueryMsg { limit: Option, start_after: Option, }, + + /// Gets the stored contract version information that's required by the CW2 spec interface for migrations. + #[serde(rename = "get_cw2_contract_version")] + #[cfg_attr(feature = "schema", returns(cw2::ContractVersion))] + GetCW2ContractVersion {}, } #[cw_serde] diff --git a/contracts/Cargo.lock b/contracts/Cargo.lock index f9ac94de48..bcd4743994 100644 --- a/contracts/Cargo.lock +++ b/contracts/Cargo.lock @@ -1238,6 +1238,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-utils", + "cw2", "cw4", "nym-contracts-common", "nym-multisig-contract-common", diff --git a/contracts/coconut-dkg/src/contract.rs b/contracts/coconut-dkg/src/contract.rs index 022da6552f..fccfa0562e 100644 --- a/contracts/coconut-dkg/src/contract.rs +++ b/contracts/coconut-dkg/src/contract.rs @@ -159,6 +159,7 @@ pub fn query(deps: Deps<'_>, _env: Env, msg: QueryMsg) -> Result to_binary(&query_vk_shares_paged(deps, epoch_id, start_after, limit)?)?, + QueryMsg::GetCW2ContractVersion {} => to_binary(&cw2::get_contract_version(deps.storage)?), }; Ok(response) diff --git a/nym-connect/desktop/Cargo.lock b/nym-connect/desktop/Cargo.lock index de6e7edcba..d1249c0e25 100644 --- a/nym-connect/desktop/Cargo.lock +++ b/nym-connect/desktop/Cargo.lock @@ -3814,6 +3814,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-utils", + "cw2", "cw4", "nym-contracts-common", "nym-multisig-contract-common", diff --git a/nym-wallet/Cargo.lock b/nym-wallet/Cargo.lock index 62297f25dd..4e47a78311 100644 --- a/nym-wallet/Cargo.lock +++ b/nym-wallet/Cargo.lock @@ -3220,6 +3220,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-utils", + "cw2", "cw4", "nym-contracts-common", "nym-multisig-contract-common",