From 1d0eefca86ef31b9e7727df01a6ed23ad65491e9 Mon Sep 17 00:00:00 2001 From: Mokhtar Naamani Date: Sat, 14 Oct 2023 11:09:31 +0400 Subject: [PATCH] staking pallet migration : remove assertion that old pallet data is removed --- frame/staking/src/migrations.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/frame/staking/src/migrations.rs b/frame/staking/src/migrations.rs index 8a253e1f4f05c..5313d25caccdd 100644 --- a/frame/staking/src/migrations.rs +++ b/frame/staking/src/migrations.rs @@ -209,7 +209,6 @@ pub mod v11 { } move_pallet(old_pallet_name.as_bytes(), new_pallet_name.as_bytes()); - clear_prefix(&twox_128(old_pallet_name.as_bytes()), None, None); ::BlockWeights::get().max_block } else { log!(warn, "v11::migrate should be removed."); @@ -232,11 +231,14 @@ pub mod v11 { return Ok(()) } - let old_pallet_prefix = twox_128(N::get().as_bytes()); - frame_support::ensure!( - sp_io::storage::next_key(&old_pallet_prefix).is_none(), - "old pallet data hasn't been removed" - ); + // https://substrate-developer-hub.github.io/rustdocs/latest/frame_support/storage/migration/fn.move_pallet.html + // "The value at the key twox_128(old_pallet_name) is not moved." + // So this assertion seems incorrect! + // let old_pallet_prefix = twox_128(N::get().as_bytes()); + // frame_support::ensure!( + // sp_io::storage::next_key(&old_pallet_prefix).is_none(), + // "old pallet data hasn't been removed" + // ); let new_pallet_name =

::name(); let new_pallet_prefix = twox_128(new_pallet_name.as_bytes());