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

Commit

Permalink
[frame/im-online] remove ensure from pre_upgrade (#14401)
Browse files Browse the repository at this point in the history
* [frame/im-online] remove ensure from pre_upgrade

modify ensure in post_upgrade to allow for future upgrades
refs #14251 (comment)

* cargo fmt
  • Loading branch information
melekes authored Jun 16, 2023
1 parent e785297 commit 16083b3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions frame/im-online/src/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,6 @@ pub mod v1 {
impl<T: Config> OnRuntimeUpgrade for Migration<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<Vec<u8>, TryRuntimeError> {
ensure!(StorageVersion::get::<Pallet<T>>() == 0, "can only upgrade from version 0");

let count = v0::ReceivedHeartbeats::<T>::iter().count();
log::info!(target: TARGET, "Migrating {} received heartbeats", count);

Expand Down Expand Up @@ -111,7 +109,7 @@ pub mod v1 {
old_received_heartbeats
);
}
ensure!(StorageVersion::get::<Pallet<T>>() == 1, "must upgrade");
ensure!(StorageVersion::get::<Pallet<T>>() >= 1, "must upgrade");

Ok(())
}
Expand Down

0 comments on commit 16083b3

Please sign in to comment.