stop scheduler migration pre/post hooks failing after migration (#7638)

This commit is contained in:
Liam Aharon
2023-08-21 06:55:15 +10:00
committed by GitHub
parent d046324178
commit 9be0b8a31e
@@ -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);
@@ -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,