From bc5e19514e09a1abbc110ec1faee73eaf5865440 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bogdan-=C8=98tefan=20Neac=C5=9Fu?= Date: Thu, 13 Jan 2022 12:59:56 +0200 Subject: [PATCH] Remove migration code (#1027) --- contracts/mixnet/src/contract.rs | 56 +------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/contracts/mixnet/src/contract.rs b/contracts/mixnet/src/contract.rs index badd8d12c6..eaff16f8ce 100644 --- a/contracts/mixnet/src/contract.rs +++ b/contracts/mixnet/src/contract.rs @@ -291,61 +291,7 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> Result Result { - #[derive(serde::Serialize, serde::Deserialize, Clone)] - pub struct StoredMixnodeBondOld { - pub pledge_amount: mixnet_contract_common::Coin, - pub owner: Addr, - pub layer: mixnet_contract_common::Layer, - pub block_height: u64, - pub mix_node: mixnet_contract_common::MixNode, - pub profit_margin_percent: Option, - pub proxy: Option, - } - pub struct MixnodeBondIndexOld<'a> { - pub owner: cw_storage_plus::UniqueIndex<'a, Addr, StoredMixnodeBondOld>, - } - impl<'a> cw_storage_plus::IndexList for MixnodeBondIndexOld<'a> { - fn get_indexes( - &'_ self, - ) -> Box> + '_> - { - let v: Vec<&dyn cw_storage_plus::Index> = vec![&self.owner]; - Box::new(v.into_iter()) - } - } - pub(crate) fn mixnodes_old<'a>() -> cw_storage_plus::IndexedMap< - 'a, - mixnet_contract_common::IdentityKeyRef<'a>, - StoredMixnodeBondOld, - MixnodeBondIndexOld<'a>, - > { - let indexes = MixnodeBondIndexOld { - owner: cw_storage_plus::UniqueIndex::new(|d| d.owner.clone(), "mno"), - }; - cw_storage_plus::IndexedMap::new("mno", indexes) - } - - let stored_mixnode_bonds: Vec<_> = mixnodes_old() - .range(deps.storage, None, None, cosmwasm_std::Order::Ascending) - .flatten() - .map(|record| crate::mixnodes::storage::StoredMixnodeBond { - pledge_amount: record.1.pledge_amount, - owner: record.1.owner, - layer: record.1.layer, - block_height: record.1.block_height, - mix_node: record.1.mix_node, - proxy: record.1.proxy, - }) - .collect(); - for stored_mixnode_bond in stored_mixnode_bonds { - crate::mixnodes::storage::mixnodes().save( - deps.storage, - stored_mixnode_bond.identity(), - &stored_mixnode_bond, - )?; - } - +pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> Result { Ok(Default::default()) }