-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4871 from nymtech/chore/remove-another-mixnet-mig…
…ration chore: remove queued migration for adding explicit admin
- Loading branch information
Showing
2 changed files
with
2 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,2 @@ | ||
// Copyright 2022-2023 - Nym Technologies SA <[email protected]> | ||
// Copyright 2022-2024 - Nym Technologies SA <[email protected]> | ||
// 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(()) | ||
} |