Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

Commit f0ecc74

Browse files
authored
Remove old and add new migrations (#572)
1 parent 906bf97 commit f0ecc74

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

polkadot-parachains/statemine/src/lib.rs

+7-4
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ use codec::{Decode, Encode, MaxEncodedLen};
4343
use constants::{currency::*, fee::WeightToFee};
4444
use frame_support::{
4545
construct_runtime, match_type, parameter_types,
46-
traits::{Everything, Contains, InstanceFilter},
46+
traits::{Contains, Everything, InstanceFilter},
4747
weights::{
4848
constants::{BlockExecutionWeight, ExtrinsicBaseWeight},
4949
DispatchClass, IdentityFee, Weight,
@@ -145,7 +145,9 @@ parameter_types! {
145145

146146
pub struct BaseFilter;
147147
impl Contains<Call> for BaseFilter {
148-
fn contains(_c: &Call) -> bool { true }
148+
fn contains(_c: &Call) -> bool {
149+
true
150+
}
149151
}
150152

151153
// Configure FRAME pallets to include in runtime.
@@ -739,8 +741,9 @@ pub type Executive = frame_executive::Executive<
739741
pub struct OnRuntimeUpgrade;
740742
impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade {
741743
fn on_runtime_upgrade() -> u64 {
742-
sp_io::storage::set(b":c", &[]);
743-
RocksDbWeight::get().writes(1)
744+
frame_support::migrations::migrate_from_pallet_version_to_storage_version::<
745+
AllPalletsWithSystem,
746+
>(&RocksDbWeight::get())
744747
}
745748
}
746749

polkadot-parachains/westmint/src/lib.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,9 @@ pub type Executive = frame_executive::Executive<
727727
pub struct OnRuntimeUpgrade;
728728
impl frame_support::traits::OnRuntimeUpgrade for OnRuntimeUpgrade {
729729
fn on_runtime_upgrade() -> u64 {
730-
sp_io::storage::set(b":c", &[]);
731-
RocksDbWeight::get().writes(1)
730+
frame_support::migrations::migrate_from_pallet_version_to_storage_version::<
731+
AllPalletsWithSystem,
732+
>(&RocksDbWeight::get())
732733
}
733734
}
734735

0 commit comments

Comments
 (0)