mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
* runtime migrations * clean up * cargo fmt * companion * add _ to satisfy trait * fix try-runtime * update substrate Co-authored-by: thiolliere <gui.thiolliere@gmail.com>
This commit is contained in:
Generated
+157
-154
File diff suppressed because it is too large
Load Diff
@@ -1555,12 +1555,50 @@ pub type Executive = frame_executive::Executive<
|
||||
TechnicalCommitteeStoragePrefixMigration,
|
||||
TechnicalMembershipStoragePrefixMigration,
|
||||
MigrateTipsPalletPrefix,
|
||||
BountiesPrefixMigration,
|
||||
StakingBagsListMigrationV8,
|
||||
),
|
||||
>;
|
||||
/// The payload being signed in the transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
const BOUNTIES_OLD_PREFIX: &str = "Treasury";
|
||||
|
||||
/// Migrate from 'Treasury' to the new prefix 'Bounties'
|
||||
pub struct BountiesPrefixMigration;
|
||||
|
||||
impl OnRuntimeUpgrade for BountiesPrefixMigration {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::migrate::<Runtime, Bounties, _>(BOUNTIES_OLD_PREFIX, name)
|
||||
}
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::pre_migration::<Runtime, Bounties, _>(
|
||||
BOUNTIES_OLD_PREFIX,
|
||||
name,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade() -> Result<(), &'static str> {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::post_migration::<Runtime, Bounties, _>(
|
||||
BOUNTIES_OLD_PREFIX,
|
||||
name,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
const COUNCIL_OLD_PREFIX: &str = "Instance1Collective";
|
||||
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
||||
pub struct CouncilStoragePrefixMigration;
|
||||
|
||||
@@ -1156,6 +1156,7 @@ pub type Executive = frame_executive::Executive<
|
||||
Runtime,
|
||||
AllPallets,
|
||||
(
|
||||
BountiesPrefixMigration,
|
||||
CouncilStoragePrefixMigration,
|
||||
TechnicalCommitteeStoragePrefixMigration,
|
||||
TechnicalMembershipStoragePrefixMigration,
|
||||
@@ -1165,6 +1166,44 @@ pub type Executive = frame_executive::Executive<
|
||||
/// The payload being signed in transactions.
|
||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
||||
|
||||
const BOUNTIES_OLD_PREFIX: &str = "Treasury";
|
||||
|
||||
/// Migrate from 'Treasury' to the new prefix 'Bounties'
|
||||
pub struct BountiesPrefixMigration;
|
||||
|
||||
impl OnRuntimeUpgrade for BountiesPrefixMigration {
|
||||
fn on_runtime_upgrade() -> frame_support::weights::Weight {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::migrate::<Runtime, Bounties, _>(BOUNTIES_OLD_PREFIX, name)
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn pre_upgrade() -> Result<(), &'static str> {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::pre_migration::<Runtime, Bounties, _>(
|
||||
BOUNTIES_OLD_PREFIX,
|
||||
name,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
#[cfg(feature = "try-runtime")]
|
||||
fn post_upgrade() -> Result<(), &'static str> {
|
||||
use frame_support::traits::PalletInfo;
|
||||
let name = <Runtime as frame_system::Config>::PalletInfo::name::<Bounties>()
|
||||
.expect("Bounties is part of runtime, so it has a name; qed");
|
||||
pallet_bounties::migrations::v4::post_migration::<Runtime, Bounties, _>(
|
||||
BOUNTIES_OLD_PREFIX,
|
||||
name,
|
||||
);
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
const COUNCIL_OLD_PREFIX: &str = "Instance1Collective";
|
||||
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
||||
pub struct CouncilStoragePrefixMigration;
|
||||
|
||||
Reference in New Issue
Block a user