Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Nomination Pools migration v5: RewardPool fix (#6957)
Browse files Browse the repository at this point in the history
* pools migration v5

* Allow deprecated

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Keep old migrations around

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* update lockfile for {"substrate"}

* use master Cargo.lock

* revert Cargo.lock master

* clippy: remove unused parentheses

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Fix parachain config migration

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

* Make tests work

Signed-off-by: Oliver Tale-Yazdi <[email protected]>

---------

Signed-off-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: Oliver Tale-Yazdi <[email protected]>
Co-authored-by: parity-processbot <>
  • Loading branch information
2 people authored and coderobe committed Mar 27, 2023
1 parent a2b62fb commit 9dd4633
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 7 deletions.
8 changes: 7 additions & 1 deletion runtime/kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1465,12 +1465,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
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>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
2 changes: 1 addition & 1 deletion runtime/parachains/src/configuration/migration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ pub mod v4 {
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())
}

Expand Down
7 changes: 6 additions & 1 deletion runtime/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1594,12 +1594,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>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down
5 changes: 3 additions & 2 deletions runtime/rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1469,8 +1469,9 @@ pub type UncheckedExtrinsic =

/// All migrations that will run on the next runtime upgrade.
///
/// Should be cleared after every release.
pub type Migrations = ();
/// 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.
pub type Executive = frame_executive::Executive<
Expand Down
2 changes: 1 addition & 1 deletion runtime/test-runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,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;
}
Expand Down
9 changes: 8 additions & 1 deletion runtime/westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1206,12 +1206,19 @@ 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>,
);

/// Unchecked extrinsic type as expected by this runtime.
Expand Down

0 comments on commit 9dd4633

Please sign in to comment.