From d238295e6bcb41873f511b8034235a4c0d427d8f Mon Sep 17 00:00:00 2001 From: Chralt98 Date: Mon, 19 Aug 2024 13:10:00 +0200 Subject: [PATCH] update migration --- zrml/market-commons/src/migrations.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zrml/market-commons/src/migrations.rs b/zrml/market-commons/src/migrations.rs index 3bfaadedb..c532fcab4 100644 --- a/zrml/market-commons/src/migrations.rs +++ b/zrml/market-commons/src/migrations.rs @@ -169,8 +169,9 @@ where } log::info!("RemoveMarkets: Removed markets {:?}.", corrupted_markets); - let count = corrupted_markets.len() as u64; - total_weight = total_weight.saturating_add(T::DbWeight::get().reads_writes(count, count)); + let count = MarketIds::get().len() as u64; + total_weight = total_weight + .saturating_add(T::DbWeight::get().reads_writes(count.saturating_mul(2u64), count)); StorageVersion::new(MARKET_COMMONS_NEXT_STORAGE_VERSION_0).put::>(); total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1)); @@ -428,7 +429,6 @@ mod tests { for market_id in RemovableMarketIds::get().iter() { let market_id = MarketId::from(*market_id); - // all markets still present, because no market was in a corrupted storage layout assert!(!crate::Markets::::contains_key(market_id)); } });