Unverified Commit 77e92caa authored by Qinxuan Chen's avatar Qinxuan Chen Committed by GitHub
Browse files

Companion for substrate#9711 (#3801)



* Companion for substrate#9711

Signed-off-by: default avatarkoushiro <koushiro.cqx@gmail.com>

* Fix

Signed-off-by: default avatarkoushiro <koushiro.cqx@gmail.com>

* update Substrate

* cargo +nightly fmt

Co-authored-by: parity-processbot <>
Co-authored-by: Shawn Tabrizi's avatarShawn Tabrizi <shawntabrizi@gmail.com>
parent c56ef44d
Pipeline #156984 passed with stages
in 41 minutes and 49 seconds
This diff is collapsed.
......@@ -1505,7 +1505,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
TechnicalMembershipStoragePrefixMigration,
(TechnicalMembershipStoragePrefixMigration, MigrateTipsPalletPrefix),
>;
/// The payload being signed in the transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
......@@ -1550,6 +1550,28 @@ impl OnRuntimeUpgrade for TechnicalMembershipStoragePrefixMigration {
}
}
const TIPS_OLD_PREFIX: &str = "Treasury";
/// Migrate pallet-tips from `Treasury` to the new pallet prefix `Tips`
pub struct MigrateTipsPalletPrefix;
impl OnRuntimeUpgrade for MigrateTipsPalletPrefix {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
pallet_tips::migrations::v4::migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX)
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
pallet_tips::migrations::v4::pre_migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX);
Ok(())
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
pallet_tips::migrations::v4::post_migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX);
Ok(())
}
}
#[cfg(not(feature = "disable-runtime-api"))]
sp_api::impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
......
......@@ -1131,7 +1131,7 @@ pub type Executive = frame_executive::Executive<
frame_system::ChainContext<Runtime>,
Runtime,
AllPallets,
TechnicalMembershipStoragePrefixMigration,
(TechnicalMembershipStoragePrefixMigration, MigrateTipsPalletPrefix),
>;
/// The payload being signed in transactions.
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
......@@ -1176,6 +1176,28 @@ impl OnRuntimeUpgrade for TechnicalMembershipStoragePrefixMigration {
}
}
const TIPS_OLD_PREFIX: &str = "Treasury";
/// Migrate pallet-tips from `Treasury` to the new pallet prefix `Tips`
pub struct MigrateTipsPalletPrefix;
impl OnRuntimeUpgrade for MigrateTipsPalletPrefix {
fn on_runtime_upgrade() -> frame_support::weights::Weight {
pallet_tips::migrations::v4::migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX)
}
#[cfg(feature = "try-runtime")]
fn pre_upgrade() -> Result<(), &'static str> {
pallet_tips::migrations::v4::pre_migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX);
Ok(())
}
#[cfg(feature = "try-runtime")]
fn post_upgrade() -> Result<(), &'static str> {
pallet_tips::migrations::v4::post_migrate::<Runtime, Tips, _>(TIPS_OLD_PREFIX);
Ok(())
}
}
#[cfg(not(feature = "disable-runtime-api"))]
sp_api::impl_runtime_apis! {
impl sp_api::Core<Block> for Runtime {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment