Nomination Pools migration v5: RewardPool fix (#6957)

* pools migration v5

* Allow deprecated

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Keep old migrations around

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* update lockfile for {"substrate"}

* use master Cargo.lock

* revert Cargo.lock master

* clippy: remove unused parentheses

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Fix parachain config migration

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

* Make tests work

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>

---------

Signed-off-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: Oliver Tale-Yazdi <oliver.tale-yazdi@parity.io>
Co-authored-by: parity-processbot <>
This commit is contained in:
Ross Bulat
2023-03-27 19:03:49 +01:00
committed by GitHub
parent 01c820005e
commit 96ed979732
7 changed files with 204 additions and 189 deletions
+183 -183
View File
File diff suppressed because it is too large Load Diff
+6 -1
View File
@@ -1475,12 +1475,17 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);
@@ -143,7 +143,7 @@ pub mod v5 {
fn pre_upgrade() -> Result<Vec<u8>, &'static str> {
log::trace!(target: crate::configuration::LOG_TARGET, "Running pre_upgrade()");
ensure!(StorageVersion::get::<Pallet<T>>() == 3, "The migration requires version 3");
ensure!(StorageVersion::get::<Pallet<T>>() == 4, "The migration requires version 4");
Ok(Vec::new())
}
+5 -1
View File
@@ -1412,12 +1412,16 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);
+2 -1
View File
@@ -1493,7 +1493,8 @@ pub type UncheckedExtrinsic =
/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
pub type Migrations = parachains_configuration::migration::v5::MigrateToV5<Runtime>;
/// Executive: handles dispatch to the various modules.
+1 -1
View File
@@ -202,7 +202,7 @@ impl pallet_indices::Config for Runtime {
}
parameter_types! {
pub storage ExistentialDeposit: Balance = 1 * CENTS;
pub const ExistentialDeposit: Balance = 1 * CENTS;
pub storage MaxLocks: u32 = 50;
pub const MaxReserves: u32 = 50;
}
+6 -1
View File
@@ -1207,13 +1207,18 @@ impl Get<Perbill> for NominationPoolsMigrationV4OldPallet {
/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
/// This contains the combined migrations of the last 10 releases. It allows to skip runtime
/// upgrades in case governance decides to do so.
#[allow(deprecated)]
pub type Migrations = (
// 0.9.40
clean_state_migration::CleanMigrate,
pallet_nomination_pools::migration::v4::MigrateToV4<
Runtime,
NominationPoolsMigrationV4OldPallet,
>,
// Unreleased - add new migrations here:
pallet_nomination_pools::migration::v5::MigrateToV5<Runtime>,
parachains_configuration::migration::v5::MigrateToV5<Runtime>,
);