mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 21:01:02 +00:00
Ensure all StorageVersions on Polkadot/Kusama are correct (#7199)
* Yeah * Fix all the migrations for Kusama & Polkadot --------- Co-authored-by: Liam Aharon <liam.aharon@hotmail.com>
This commit is contained in:
@@ -1468,6 +1468,7 @@ pub type Migrations =
|
||||
#[allow(deprecated, missing_docs)]
|
||||
pub mod migrations {
|
||||
use super::*;
|
||||
use frame_support::traits::{GetStorageVersion, OnRuntimeUpgrade, StorageVersion};
|
||||
|
||||
pub type V0940 = (
|
||||
pallet_nomination_pools::migration::v4::MigrateToV4<
|
||||
@@ -1484,7 +1485,29 @@ pub mod migrations {
|
||||
);
|
||||
|
||||
/// Unreleased migrations. Add new ones here:
|
||||
pub type Unreleased = ();
|
||||
pub type Unreleased = SetStorageVersions;
|
||||
|
||||
/// Migrations that set `StorageVersion`s we missed to set.
|
||||
pub struct SetStorageVersions;
|
||||
|
||||
impl OnRuntimeUpgrade for SetStorageVersions {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
// The `NisCounterpartBalances` pallet was added to the chain after/with the migration.
|
||||
// So, the migration never needed to be executed, but we also did not set the proper `StorageVersion`.
|
||||
let storage_version = NisCounterpartBalances::on_chain_storage_version();
|
||||
if storage_version < 1 {
|
||||
StorageVersion::new(1).put::<NisCounterpartBalances>();
|
||||
}
|
||||
|
||||
// Was missed as part of: `runtime_common::session::migration::ClearOldSessionStorage<Runtime>`.
|
||||
let storage_version = Historical::on_chain_storage_version();
|
||||
if storage_version < 1 {
|
||||
StorageVersion::new(1).put::<Historical>();
|
||||
}
|
||||
|
||||
RocksDbWeight::get().reads_writes(2, 2)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Unchecked extrinsic type as expected by this runtime.
|
||||
|
||||
Reference in New Issue
Block a user