mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-23 22:31:06 +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,
|
TechnicalCommitteeStoragePrefixMigration,
|
||||||
TechnicalMembershipStoragePrefixMigration,
|
TechnicalMembershipStoragePrefixMigration,
|
||||||
MigrateTipsPalletPrefix,
|
MigrateTipsPalletPrefix,
|
||||||
|
BountiesPrefixMigration,
|
||||||
StakingBagsListMigrationV8,
|
StakingBagsListMigrationV8,
|
||||||
),
|
),
|
||||||
>;
|
>;
|
||||||
/// The payload being signed in the transactions.
|
/// The payload being signed in the transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
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";
|
const COUNCIL_OLD_PREFIX: &str = "Instance1Collective";
|
||||||
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
||||||
pub struct CouncilStoragePrefixMigration;
|
pub struct CouncilStoragePrefixMigration;
|
||||||
|
|||||||
@@ -1156,6 +1156,7 @@ pub type Executive = frame_executive::Executive<
|
|||||||
Runtime,
|
Runtime,
|
||||||
AllPallets,
|
AllPallets,
|
||||||
(
|
(
|
||||||
|
BountiesPrefixMigration,
|
||||||
CouncilStoragePrefixMigration,
|
CouncilStoragePrefixMigration,
|
||||||
TechnicalCommitteeStoragePrefixMigration,
|
TechnicalCommitteeStoragePrefixMigration,
|
||||||
TechnicalMembershipStoragePrefixMigration,
|
TechnicalMembershipStoragePrefixMigration,
|
||||||
@@ -1165,6 +1166,44 @@ pub type Executive = frame_executive::Executive<
|
|||||||
/// The payload being signed in transactions.
|
/// The payload being signed in transactions.
|
||||||
pub type SignedPayload = generic::SignedPayload<Call, SignedExtra>;
|
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";
|
const COUNCIL_OLD_PREFIX: &str = "Instance1Collective";
|
||||||
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
/// Migrate from `Instance1Collective` to the new pallet prefix `Council`
|
||||||
pub struct CouncilStoragePrefixMigration;
|
pub struct CouncilStoragePrefixMigration;
|
||||||
|
|||||||
Reference in New Issue
Block a user