Companion for substrate#9711 (#3801)

* Companion for substrate#9711

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

* Fix

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

* update Substrate

* cargo +nightly fmt

Co-authored-by: parity-processbot <>
Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
Qinxuan Chen
2021-09-14 16:17:30 +08:00
committed by GitHub
parent 09ecdf6f4a
commit 61ec3578f0
3 changed files with 205 additions and 211 deletions
+23 -1
View File
@@ -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 {