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

Commit

Permalink
stop scheduler migration pre/post hooks failing after migration (#7638)
Browse files Browse the repository at this point in the history
  • Loading branch information
liamaharon authored Aug 20, 2023
1 parent 53957c4 commit aba8bee
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions runtime/parachains/src/scheduler/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,10 +109,6 @@ pub mod v1 {
"Scheduled before migration: {}",
v0::Scheduled::<T>::get().len()
);
ensure!(
StorageVersion::get::<Pallet<T>>() == 0,
"Storage version should be less than `1` before the migration",
);

let bytes = u32::to_be_bytes(v0::Scheduled::<T>::get().len() as u32);

Expand All @@ -123,8 +119,8 @@ pub mod v1 {
fn post_upgrade(state: Vec<u8>) -> Result<(), sp_runtime::DispatchError> {
log::trace!(target: crate::scheduler::LOG_TARGET, "Running post_upgrade()");
ensure!(
StorageVersion::get::<Pallet<T>>() == 1,
"Storage version should be `1` after the migration"
StorageVersion::get::<Pallet<T>>() >= 1,
"Storage version should be at least `1` after the migration"
);
ensure!(
v0::Scheduled::<T>::get().len() == 0,
Expand Down

0 comments on commit aba8bee

Please sign in to comment.