From c1f190126a30626d53936f90de88843ac26efe6c Mon Sep 17 00:00:00 2001 From: Bryan Chen Date: Sat, 23 Oct 2021 19:04:17 +1300 Subject: [PATCH] set xcm version to 2 upon upgrade --- runtime/karura/src/lib.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/runtime/karura/src/lib.rs b/runtime/karura/src/lib.rs index cd5c5dead9..4a1e53c571 100644 --- a/runtime/karura/src/lib.rs +++ b/runtime/karura/src/lib.rs @@ -1879,9 +1879,18 @@ pub type Executive = frame_executive::Executive< TechnicalCommitteeStoragePrefixMigration, MigrateTipsPalletPrefix, BountiesPrefixMigration, + SetXcmVersion, ), >; +pub struct SetXcmVersion; +impl OnRuntimeUpgrade for SetXcmVersion { + fn on_runtime_upgrade() -> u64 { + let _ = PolkadotXcm::force_default_xcm_version(Origin::root(), Some(2)); + RocksDbWeight::get().writes(1) + } +} + const GENERAL_COUNCIL_MEMBERSHIP_OLD_PREFIX: &str = "Instance1Membership"; /// Migrate from `Instance1Membership` to the new pallet prefix `GeneralCouncilMembership` pub struct GeneralCouncilMembershipStoragePrefixMigration;