mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-26 16:57:58 +00:00
re add the migration checks for staking (#12330)
Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -35,6 +35,11 @@ pub mod v12 {
|
||||
impl<T: Config> OnRuntimeUpgrade for MigrateToV12<T> {
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
|
||||
frame_support::ensure!(
|
||||
StorageVersion::<T>::get() == Releases::V11_0_0,
|
||||
"Expected v11 before upgrading to v12"
|
||||
);
|
||||
|
||||
frame_support::ensure!(
|
||||
T::HistoryDepth::get() == HistoryDepth::<T>::get(),
|
||||
"Provided value of HistoryDepth should be same as the existing storage value"
|
||||
@@ -129,6 +134,11 @@ pub mod v11 {
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade(_state: Vec<u8>) -> Result<(), &'static str> {
|
||||
frame_support::ensure!(
|
||||
StorageVersion::<T>::get() == crate::Releases::V11_0_0,
|
||||
"wrong version after the upgrade"
|
||||
);
|
||||
|
||||
let old_pallet_name = N::get();
|
||||
let new_pallet_name = <P as PalletInfoAccess>::name();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user