Skip to content

Commit

Permalink
Remove old migration (#349)
Browse files Browse the repository at this point in the history
* Remove old migration

* Remove migration_add_schedule_to_task benchmarking
  • Loading branch information
imstar15 committed Apr 13, 2023
1 parent 7d44984 commit 98f80bd
Show file tree
Hide file tree
Showing 11 changed files with 3 additions and 35 deletions.
28 changes: 0 additions & 28 deletions pallets/automation-time/src/benchmarking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -558,34 +558,6 @@ benchmarks! {
schedule_notify_tasks::<T>(caller.clone(), vec![new_time_slot], T::MaxTasksPerSlot::get());
}: { AutomationTime::<T>::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::<T>::generate_task_id(account_id.clone(), vec![0]);
let task = OldTask::<T> {
owner_id: account_id.clone(),
provided_id: vec![1],
execution_times: vec![10].try_into().unwrap(),
executions_left: 1,
action: OldAction::<T>::AutoCompoundDelegatedStake {
delegator: account_id.clone(),
collator: account_id.clone(),
account_minimum: 100u32.into(),
frequency: 11,
},
};
OldAccountTasks::<T>::insert(account_id.clone(), task_id, task);
}
}: { AddScheduleToTask::<T>::on_runtime_upgrade() }
verify {
assert_eq!(v, crate::AccountTasks::<T>::iter().count() as u32);
}

impl_benchmark_test_suite!(
AutomationTime,
crate::mock::new_test_ext(crate::tests::START_BLOCK_TIME),
Expand Down
2 changes: 0 additions & 2 deletions pallets/automation-time/src/migrations/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Migrations

// mod old;

pub mod add_schedule_to_task;
1 change: 1 addition & 0 deletions pallets/automation-time/src/migrations/old/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
// Excluded from the module tree to avoid warnings and errors on dead code

mod v4;
mod add_schedule_to_task;
2 changes: 0 additions & 2 deletions pallets/xcmp-handler/src/migrations/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Migrations

// mod old;

pub mod add_flow_to_currency_data;
1 change: 1 addition & 0 deletions pallets/xcmp-handler/src/migrations/old/mod.rs
Original file line number Diff line number Diff line change
@@ -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;
1 change: 0 additions & 1 deletion runtime/turing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPalletsWithSystem,
pallet_xcmp_handler::migrations::add_flow_to_currency_data::AddFlowToCurrencyData<Runtime>,
>;

/// Opaque types. These are used by the CLI to instantiate machinery that don't need to know
Expand Down
2 changes: 0 additions & 2 deletions runtime/turing/src/migrations/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// Runtime Migrations

// mod old;

pub mod register_shiden_asset;
1 change: 1 addition & 0 deletions runtime/turing/src/migrations/old/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
// Excluded from the module tree to avoid warnings and errors on dead code

mod assets;
mod register_shiden_asset;

0 comments on commit 98f80bd

Please sign in to comment.