From 961fbb63ad2a978c83b6343ed456287ff2e8813a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 13 Aug 2021 20:28:20 +0200 Subject: [PATCH] Remove old and add new migrations (#572) --- polkadot-parachains/statemine/src/lib.rs | 11 +++++++---- polkadot-parachains/westmint/src/lib.rs | 5 +++-- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/polkadot-parachains/statemine/src/lib.rs b/polkadot-parachains/statemine/src/lib.rs index 65e0f1c8c7ba..453266a26667 100644 --- a/polkadot-parachains/statemine/src/lib.rs +++ b/polkadot-parachains/statemine/src/lib.rs @@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen}; use constants::{currency::*, fee::WeightToFee}; use frame_support::{ construct_runtime, match_type, parameter_types, - traits::{Everything, Contains, InstanceFilter}, + traits::{Contains, Everything, InstanceFilter}, weights::{ constants::{BlockExecutionWeight, ExtrinsicBaseWeight}, DispatchClass, IdentityFee, Weight, @@ -145,7 +145,9 @@ parameter_types! { pub struct BaseFilter; impl Contains for BaseFilter { - fn contains(_c: &Call) -> bool { true } + fn contains(_c: &Call) -> bool { + true + } } // Configure FRAME pallets to include in runtime. @@ -739,8 +741,9 @@ pub type Executive = frame_executive::Executive< pub struct OnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade { fn on_runtime_upgrade() -> u64 { - sp_io::storage::set(b":c", &[]); - RocksDbWeight::get().writes(1) + frame_support::migrations::migrate_from_pallet_version_to_storage_version::< + AllPalletsWithSystem, + >(&RocksDbWeight::get()) } } diff --git a/polkadot-parachains/westmint/src/lib.rs b/polkadot-parachains/westmint/src/lib.rs index e22e781e4862..240ee46bb3ee 100644 --- a/polkadot-parachains/westmint/src/lib.rs +++ b/polkadot-parachains/westmint/src/lib.rs @@ -727,8 +727,9 @@ pub type Executive = frame_executive::Executive< pub struct OnRuntimeUpgrade; impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade { fn on_runtime_upgrade() -> u64 { - sp_io::storage::set(b":c", &[]); - RocksDbWeight::get().writes(1) + frame_support::migrations::migrate_from_pallet_version_to_storage_version::< + AllPalletsWithSystem, + >(&RocksDbWeight::get()) } }