From 98f80bd36869ee56b9a60daceedb9fb2a9075eb0 Mon Sep 17 00:00:00 2001 From: imstar15 Date: Thu, 13 Apr 2023 13:02:18 +0800 Subject: [PATCH] Remove old migration (#349) * Remove old migration * Remove migration_add_schedule_to_task benchmarking --- pallets/automation-time/src/benchmarking.rs | 28 ------------------- pallets/automation-time/src/migrations/mod.rs | 2 -- .../{ => old}/add_schedule_to_task.rs | 0 .../automation-time/src/migrations/old/mod.rs | 1 + pallets/xcmp-handler/src/migrations/mod.rs | 2 -- .../{ => old}/add_flow_to_currency_data.rs | 0 .../xcmp-handler/src/migrations/old/mod.rs | 1 + runtime/turing/src/lib.rs | 1 - runtime/turing/src/migrations/mod.rs | 2 -- runtime/turing/src/migrations/old/mod.rs | 1 + .../{ => old}/register_shiden_asset.rs | 0 11 files changed, 3 insertions(+), 35 deletions(-) rename pallets/automation-time/src/migrations/{ => old}/add_schedule_to_task.rs (100%) rename pallets/xcmp-handler/src/migrations/{ => old}/add_flow_to_currency_data.rs (100%) rename runtime/turing/src/migrations/{ => old}/register_shiden_asset.rs (100%) diff --git a/pallets/automation-time/src/benchmarking.rs b/pallets/automation-time/src/benchmarking.rs index e47515164..82412c7b7 100644 --- a/pallets/automation-time/src/benchmarking.rs +++ b/pallets/automation-time/src/benchmarking.rs @@ -558,34 +558,6 @@ benchmarks! { schedule_notify_tasks::(caller.clone(), vec![new_time_slot], T::MaxTasksPerSlot::get()); }: { AutomationTime::::shift_missed_tasks(last_time_slot, diff) } - migration_add_schedule_to_task { - let v in 1..100; - - use migrations::add_schedule_to_task::{AccountTasks as OldAccountTasks, AddScheduleToTask, OldAction, OldTask}; - use frame_support::traits::OnRuntimeUpgrade; - - for i in 0..v { - let account_id: T::AccountId = account("Account", 0, i); - let task_id = Pallet::::generate_task_id(account_id.clone(), vec![0]); - let task = OldTask:: { - owner_id: account_id.clone(), - provided_id: vec![1], - execution_times: vec![10].try_into().unwrap(), - executions_left: 1, - action: OldAction::::AutoCompoundDelegatedStake { - delegator: account_id.clone(), - collator: account_id.clone(), - account_minimum: 100u32.into(), - frequency: 11, - }, - }; - OldAccountTasks::::insert(account_id.clone(), task_id, task); - } - }: { AddScheduleToTask::::on_runtime_upgrade() } - verify { - assert_eq!(v, crate::AccountTasks::::iter().count() as u32); - } - impl_benchmark_test_suite!( AutomationTime, crate::mock::new_test_ext(crate::tests::START_BLOCK_TIME), diff --git a/pallets/automation-time/src/migrations/mod.rs b/pallets/automation-time/src/migrations/mod.rs index 03ae37981..dc5645873 100644 --- a/pallets/automation-time/src/migrations/mod.rs +++ b/pallets/automation-time/src/migrations/mod.rs @@ -1,5 +1,3 @@ // Migrations // mod old; - -pub mod add_schedule_to_task; diff --git a/pallets/automation-time/src/migrations/add_schedule_to_task.rs b/pallets/automation-time/src/migrations/old/add_schedule_to_task.rs similarity index 100% rename from pallets/automation-time/src/migrations/add_schedule_to_task.rs rename to pallets/automation-time/src/migrations/old/add_schedule_to_task.rs diff --git a/pallets/automation-time/src/migrations/old/mod.rs b/pallets/automation-time/src/migrations/old/mod.rs index 598ea58a0..1eaf07eae 100644 --- a/pallets/automation-time/src/migrations/old/mod.rs +++ b/pallets/automation-time/src/migrations/old/mod.rs @@ -2,3 +2,4 @@ // Excluded from the module tree to avoid warnings and errors on dead code mod v4; +mod add_schedule_to_task; diff --git a/pallets/xcmp-handler/src/migrations/mod.rs b/pallets/xcmp-handler/src/migrations/mod.rs index f0ca46328..dc5645873 100644 --- a/pallets/xcmp-handler/src/migrations/mod.rs +++ b/pallets/xcmp-handler/src/migrations/mod.rs @@ -1,5 +1,3 @@ // Migrations // mod old; - -pub mod add_flow_to_currency_data; diff --git a/pallets/xcmp-handler/src/migrations/add_flow_to_currency_data.rs b/pallets/xcmp-handler/src/migrations/old/add_flow_to_currency_data.rs similarity index 100% rename from pallets/xcmp-handler/src/migrations/add_flow_to_currency_data.rs rename to pallets/xcmp-handler/src/migrations/old/add_flow_to_currency_data.rs diff --git a/pallets/xcmp-handler/src/migrations/old/mod.rs b/pallets/xcmp-handler/src/migrations/old/mod.rs index b6f97c73e..1a3bb664e 100644 --- a/pallets/xcmp-handler/src/migrations/old/mod.rs +++ b/pallets/xcmp-handler/src/migrations/old/mod.rs @@ -1,2 +1,3 @@ /// Migrations that have already been run pub mod add_mgx_tur_chain_currency_combo; +pub mod add_flow_to_currency_data; diff --git a/runtime/turing/src/lib.rs b/runtime/turing/src/lib.rs index fe525f84e..34c151991 100644 --- a/runtime/turing/src/lib.rs +++ b/runtime/turing/src/lib.rs @@ -137,7 +137,6 @@ pub type Executive = frame_executive::Executive< frame_system::ChainContext, Runtime, AllPalletsWithSystem, - pallet_xcmp_handler::migrations::add_flow_to_currency_data::AddFlowToCurrencyData, >; /// Opaque types. These are used by the CLI to instantiate machinery that don't need to know diff --git a/runtime/turing/src/migrations/mod.rs b/runtime/turing/src/migrations/mod.rs index b577586a9..185fab8cf 100644 --- a/runtime/turing/src/migrations/mod.rs +++ b/runtime/turing/src/migrations/mod.rs @@ -1,5 +1,3 @@ // Runtime Migrations // mod old; - -pub mod register_shiden_asset; diff --git a/runtime/turing/src/migrations/old/mod.rs b/runtime/turing/src/migrations/old/mod.rs index 484f6cd40..ad8e94a29 100644 --- a/runtime/turing/src/migrations/old/mod.rs +++ b/runtime/turing/src/migrations/old/mod.rs @@ -2,3 +2,4 @@ // Excluded from the module tree to avoid warnings and errors on dead code mod assets; +mod register_shiden_asset; diff --git a/runtime/turing/src/migrations/register_shiden_asset.rs b/runtime/turing/src/migrations/old/register_shiden_asset.rs similarity index 100% rename from runtime/turing/src/migrations/register_shiden_asset.rs rename to runtime/turing/src/migrations/old/register_shiden_asset.rs