don't panic if already migrated (#10141)

* don't panic if already migrated

* remove condition
This commit is contained in:
Albrecht
2021-11-02 10:27:44 +01:00
committed by GitHub
parent bba9cfd8a2
commit 098815948a
+5 -1
View File
@@ -181,7 +181,11 @@ pub mod pallet {
impl<T: Config> Hooks<BlockNumberFor<T>> for Pallet<T> {
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
migrations::v1::pre_migrate::<T>()
if StorageVersion::<T>::get() == Releases::V0 {
migrations::v1::pre_migrate::<T>()
} else {
Ok(())
}
}
fn on_runtime_upgrade() -> Weight {