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

Commit

Permalink
Remove old and add new migrations (#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
bkchr committed Aug 16, 2021
1 parent c303ea0 commit 2da4557
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
11 changes: 7 additions & 4 deletions polkadot-parachains/statemine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -145,7 +145,9 @@ parameter_types! {

pub struct BaseFilter;
impl Contains<Call> for BaseFilter {
fn contains(_c: &Call) -> bool { true }
fn contains(_c: &Call) -> bool {
true
}
}

// Configure FRAME pallets to include in runtime.
Expand Down Expand Up @@ -738,8 +740,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())
}
}

Expand Down
5 changes: 3 additions & 2 deletions polkadot-parachains/westmint/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -726,8 +726,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())
}
}

Expand Down

0 comments on commit 2da4557

Please sign in to comment.