Skip to content

Commit

Permalink
OnDemandRename - first try
Browse files Browse the repository at this point in the history
  • Loading branch information
tdimitrov committed Jul 30, 2024
1 parent 4727265 commit a274576
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion relay/polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1212,7 +1212,8 @@ impl InstanceFilter<RuntimeCall> for ProxyType {
matches!(
c,
RuntimeCall::Staking(..) |
RuntimeCall::Session(..) | RuntimeCall::Utility(..) |
RuntimeCall::Session(..) |
RuntimeCall::Utility(..) |
RuntimeCall::FastUnstake(..) |
RuntimeCall::VoterList(..) |
RuntimeCall::NominationPools(..)
Expand Down Expand Up @@ -1786,6 +1787,7 @@ pub type Migrations = (migrations::Unreleased, migrations::Permanent);
/// The runtime migrations per release.
#[allow(deprecated, missing_docs)]
pub mod migrations {
use frame_support::migration::move_storage_from_pallet;
use polkadot_runtime_common::traits::Leaser;

use super::*;
Expand Down Expand Up @@ -1841,8 +1843,27 @@ pub mod migrations {
}
}

// Migrate storage for pallet rename `OnDemandAssignmentProvider` -> `OnDemand`
pub struct OnDemandRename;
impl OnRuntimeUpgrade for OnDemandRename {
fn on_runtime_upgrade() -> Weight {
move_storage_from_pallet(b"Pallet", b"OnDemandAssignmentProvider", b"OnDemand");
move_storage_from_pallet(b"ParaIdAffinity", b"OnDemandAssignmentProvider", b"OnDemand");
move_storage_from_pallet(b"QueueStatus", b"OnDemandAssignmentProvider", b"OnDemand");
move_storage_from_pallet(b"FreeEntries", b"OnDemandAssignmentProvider", b"OnDemand");
move_storage_from_pallet(
b"AffinityEntries",
b"OnDemandAssignmentProvider",
b"OnDemand",
);
move_storage_from_pallet(b"Revenue", b"OnDemandAssignmentProvider", b"OnDemand");
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(0, 0) //todo
}
}

/// Unreleased migrations. Add new ones here:
pub type Unreleased = (
OnDemandRename,
parachains_configuration::migration::v12::MigrateToV12<Runtime>,
parachains_inclusion::migration::MigrateToV1<Runtime>,
pallet_staking::migrations::v15::MigrateV14ToV15<Runtime>,
Expand Down

0 comments on commit a274576

Please sign in to comment.