diff --git a/frame/staking/src/migrations.rs b/frame/staking/src/migrations.rs index 8f37ae30dd05..f2ccb4f8b096 100644 --- a/frame/staking/src/migrations.rs +++ b/frame/staking/src/migrations.rs @@ -40,10 +40,14 @@ pub mod v12 { "Expected v11 before upgrading to v12" ); - frame_support::ensure!( - T::HistoryDepth::get() == HistoryDepth::::get(), - "Provided value of HistoryDepth should be same as the existing storage value" - ); + if HistoryDepth::::exists() { + frame_support::ensure!( + T::HistoryDepth::get() == HistoryDepth::::get(), + "Provided value of HistoryDepth should be same as the existing storage value" + ); + } else { + log::info!("No HistoryDepth in storage; nothing to remove"); + } Ok(Default::default()) }