diff --git a/communities/src/migrations.rs b/communities/src/migrations.rs index 7a8c7c59..a78cdb33 100644 --- a/communities/src/migrations.rs +++ b/communities/src/migrations.rs @@ -154,7 +154,7 @@ pub mod v2 { impl OnRuntimeUpgrade for MigrateV0orV1toV2 { #[cfg(feature = "try-runtime")] fn pre_upgrade() -> Result, sp_runtime::DispatchError> { - let current_version = Pallet::::current_storage_version(); + let current_version = Pallet::::in_code_storage_version(); let onchain_version = Pallet::::on_chain_storage_version(); ensure!( onchain_version < 2 && current_version == 2, @@ -180,7 +180,7 @@ pub mod v2 { count <= T::MaxCommunityIdentifiersPerGeohash::get(), "too many cids per geohash" ); - cids_by_geohash_count = cids_by_geohash_count + count; + cids_by_geohash_count += count; } log::info!( target: TARGET, @@ -196,7 +196,7 @@ pub mod v2 { count <= T::MaxLocationsPerGeohash::get(), "too many locations per geohash" ); - locations_by_geohash_count = locations_by_geohash_count + count; + locations_by_geohash_count += count; } log::info!( target: TARGET, @@ -209,7 +209,7 @@ pub mod v2 { for bs in bootstrappers { let count = bs.1.len() as u32; ensure!(count <= T::MaxBootstrappers::get(), "too many bootstrappers"); - bootstrappers_count = bootstrappers_count + count + bootstrappers_count += count } log::info!(target: TARGET, "{} bootstrappers will be migrated.", bootstrappers_count,); @@ -229,7 +229,7 @@ pub mod v2 { /// 0->1 was a noop as long as no values exceeded bounds /// there is no problem if we enforce bounds again if the onchain_version is already v1 fn on_runtime_upgrade() -> Weight { - let current_version = Pallet::::current_storage_version(); + let current_version = Pallet::::in_code_storage_version(); let onchain_version = Pallet::::on_chain_storage_version(); log::info!(