Use #[pallet::storage_version] for pallet staking (#12728)

* delete releases

* use standard pallet storage version

* migrate to standard storage version for staking

* not compiling

* keep old releases enum around for decoding

* fix releases

* rename old releases

* retriggering ci

* fix migration comments

* doc update

Co-authored-by: parity-processbot <>
This commit is contained in:
Ankan
2023-01-03 20:45:58 +01:00
committed by GitHub
parent 5af801ce60
commit 169cbc69c5
3 changed files with 115 additions and 62 deletions
-25
View File
@@ -881,31 +881,6 @@ impl Default for Forcing {
}
}
// A value placed in storage that represents the current version of the Staking storage. This value
// is used by the `on_runtime_upgrade` logic to determine whether we run storage migration logic.
// This should match directly with the semantic versions of the Rust crate.
#[derive(Encode, Decode, Clone, Copy, PartialEq, Eq, RuntimeDebug, TypeInfo, MaxEncodedLen)]
enum Releases {
V1_0_0Ancient,
V2_0_0,
V3_0_0,
V4_0_0,
V5_0_0, // blockable validators.
V6_0_0, // removal of all storage associated with offchain phragmen.
V7_0_0, // keep track of number of nominators / validators in map
V8_0_0, // populate `VoterList`.
V9_0_0, // inject validators into `VoterList` as well.
V10_0_0, // remove `EarliestUnappliedSlash`.
V11_0_0, // Move pallet storage prefix, e.g. BagsList -> VoterBagsList
V12_0_0, // remove `HistoryDepth`.
}
impl Default for Releases {
fn default() -> Self {
Releases::V11_0_0
}
}
/// A `Convert` implementation that finds the stash of the given controller account,
/// if any.
pub struct StashOf<T>(sp_std::marker::PhantomData<T>);