Skip to content

Commit

Permalink
update migration
Browse files Browse the repository at this point in the history
  • Loading branch information
Chralt98 committed Aug 19, 2024
1 parent ce7cd53 commit d238295
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions zrml/market-commons/src/migrations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<MarketCommons<T>>();
total_weight = total_weight.saturating_add(T::DbWeight::get().writes(1));
Expand Down Expand Up @@ -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::<Runtime>::contains_key(market_id));
}
});
Expand Down

0 comments on commit d238295

Please sign in to comment.