mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 14:01:02 +00:00
Companion for substrate#9115 (#3265)
* runtime(kusama/polkadot): migrations for collective storage prefix Signed-off-by: koushiro <koushiro.cqx@gmail.com> * fix * fix migration * spelling * Fix Signed-off-by: koushiro <koushiro.cqx@gmail.com> * Fix Signed-off-by: koushiro <koushiro.cqx@gmail.com> * update Substrate * fix unused Co-authored-by: thiolliere <gui.thiolliere@gmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> Co-authored-by: parity-processbot <>
This commit is contained in:
@@ -1505,11 +1505,66 @@ pub type Executive = frame_executive::Executive<
|
||||
frame_system::ChainContext<Runtime>,
|
||||
Runtime,
|
||||
AllPallets,
|
||||
(TechnicalMembershipStoragePrefixMigration, MigrateTipsPalletPrefix),
|
||||
(
|
||||
CouncilStoragePrefixMigration,
|
||||
TechnicalCommitteeStoragePrefixMigration,
|
||||
TechnicalMembershipStoragePrefixMigration,
|
||||
MigrateTipsPalletPrefix,
|
||||
),
|
||||
>;
|
||||
/// The payload being signed in the transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
const COUNCIL_OLD_PREFIX: &str = "Instance1Collective";
|
||||
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
||||
pub struct CouncilStoragePrefixMigration;
|
||||
|
||||
impl OnRuntimeUpgrade for CouncilStoragePrefixMigration {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
pallet_collective::migrations::v4::migrate::<Runtime, Council, _>(COUNCIL_OLD_PREFIX)
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
pallet_collective::migrations::v4::pre_migrate::<Council, _>(COUNCIL_OLD_PREFIX);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade() -> Result<(), &'static str> {
|
||||
pallet_collective::migrations::v4::post_migrate::<Council, _>(COUNCIL_OLD_PREFIX);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
const TECHNICAL_COMMITTEE_OLD_PREFIX: &str = "Instance2Collective";
|
||||
/// Migrate from `Instance2Collective` to the new pallet prefix `TechnicalCommittee`
|
||||
pub struct TechnicalCommitteeStoragePrefixMigration;
|
||||
|
||||
impl OnRuntimeUpgrade for TechnicalCommitteeStoragePrefixMigration {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
pallet_collective::migrations::v4::migrate::<Runtime, TechnicalCommittee, _>(
|
||||
TECHNICAL_COMMITTEE_OLD_PREFIX,
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
pallet_collective::migrations::v4::pre_migrate::<TechnicalCommittee, _>(
|
||||
TECHNICAL_COMMITTEE_OLD_PREFIX,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade() -> Result<(), &'static str> {
|
||||
pallet_collective::migrations::v4::post_migrate::<TechnicalCommittee, _>(
|
||||
TECHNICAL_COMMITTEE_OLD_PREFIX,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
const TECHNICAL_MEMBERSHIP_OLD_PREFIX: &str = "Instance1Membership";
|
||||
/// Migrate from `Instance1Membership` to the new pallet prefix `TechnicalMembership`
|
||||
pub struct TechnicalMembershipStoragePrefixMigration;
|
||||
|
||||
Reference in New Issue
Block a user