Remove old and add new migrations (#572)

This commit is contained in:
Bastian Köcher
2021-08-13 20:28:20 +02:00
committed by Bastian Köcher
parent c303ea051f
commit 2da45574b9
2 changed files with 10 additions and 6 deletions
+7 -4
View File
@@ -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<Call> for BaseFilter {
fn contains(_c: &Call) -> bool { true }
fn contains(_c: &Call) -> bool {
true
}
}
// Configure FRAME pallets to include in runtime.
@@ -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())
}
}
+3 -2
View File
@@ -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())
}
}