From f9383578daeaf873ed413ebb46b77d77e7bf8203 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C4=99drzej=20Stuczy=C5=84ski?= Date: Thu, 12 Sep 2024 11:03:51 +0100 Subject: [PATCH] chore: remove queued migration for adding explicit admin --- contracts/mixnet/src/contract.rs | 4 +--- contracts/mixnet/src/queued_migrations.rs | 20 +------------------- 2 files changed, 2 insertions(+), 22 deletions(-) diff --git a/contracts/mixnet/src/contract.rs b/contracts/mixnet/src/contract.rs index 99ade0ff72..cda8264afa 100644 --- a/contracts/mixnet/src/contract.rs +++ b/contracts/mixnet/src/contract.rs @@ -538,15 +538,13 @@ pub fn query( #[entry_point] pub fn migrate( - mut deps: DepsMut<'_>, + deps: DepsMut<'_>, _env: Env, msg: MigrateMsg, ) -> Result { set_build_information!(deps.storage)?; cw2::ensure_from_older_version(deps.storage, CONTRACT_NAME, CONTRACT_VERSION)?; - crate::queued_migrations::explicit_contract_admin(deps.branch())?; - // due to circular dependency on contract addresses (i.e. mixnet contract requiring vesting contract address // and vesting contract requiring the mixnet contract address), if we ever want to deploy any new fresh // environment, one of the contracts will HAVE TO go through a migration diff --git a/contracts/mixnet/src/queued_migrations.rs b/contracts/mixnet/src/queued_migrations.rs index 3f704917bd..a0273196be 100644 --- a/contracts/mixnet/src/queued_migrations.rs +++ b/contracts/mixnet/src/queued_migrations.rs @@ -1,20 +1,2 @@ -// Copyright 2022-2023 - Nym Technologies SA +// Copyright 2022-2024 - Nym Technologies SA // SPDX-License-Identifier: Apache-2.0 - -use crate::mixnet_contract_settings::storage as mixnet_params_storage; -use cosmwasm_std::DepsMut; -use mixnet_contract_common::error::MixnetContractError; - -pub(crate) fn explicit_contract_admin(deps: DepsMut) -> Result<(), MixnetContractError> { - // we need to read the deprecated field to migrate it over - #[allow(deprecated)] - // SAFETY: this value should ALWAYS exist on the first execution of this migration; - // as a matter of fact, it should ALWAYS continue existing until another migration - #[allow(clippy::expect_used)] - let existing_admin = mixnet_params_storage::CONTRACT_STATE - .load(deps.storage)? - .owner - .expect("the contract state is corrupt - there's no admin set"); - mixnet_params_storage::ADMIN.set(deps, Some(existing_admin))?; - Ok(()) -}