mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Fix migrations and add CI check for new system chains (#2336)
Westend Collectives migration CI check can be fixed once we have https://github.com/paritytech/try-runtime-cli/pull/58, will open another PR once it is available. - [x] Remove deprecated `DmpQueue` pallet from Rococo Contracts, the migration is complete - [x] Fix Asset Hub Rococo storage versions - [x] Add migration check CI for Asset Hub Rococo and Westend Bridge Hub
This commit is contained in:
@@ -39,7 +39,9 @@ use sp_api::impl_runtime_apis;
|
||||
use sp_core::{crypto::KeyTypeId, OpaqueMetadata};
|
||||
use sp_runtime::{
|
||||
create_runtime_str, generic, impl_opaque_keys,
|
||||
traits::{AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Verify},
|
||||
traits::{
|
||||
AccountIdConversion, AccountIdLookup, BlakeTwo256, Block as BlockT, Saturating, Verify,
|
||||
},
|
||||
transaction_validity::{TransactionSource, TransactionValidity},
|
||||
ApplyExtrinsicResult, Permill,
|
||||
};
|
||||
@@ -959,7 +961,60 @@ pub type SignedExtra = (
|
||||
pub type UncheckedExtrinsic =
|
||||
generic::UncheckedExtrinsic<Address, RuntimeCall, Signature, SignedExtra>;
|
||||
/// Migrations to apply on runtime upgrade.
|
||||
pub type Migrations = (pallet_collator_selection::migration::v1::MigrateToV1<Runtime>,);
|
||||
pub type Migrations =
|
||||
(pallet_collator_selection::migration::v1::MigrateToV1<Runtime>, InitStorageVersions);
|
||||
|
||||
/// Migration to initialize storage versions for pallets added after genesis.
|
||||
///
|
||||
/// This is now done automatically (see <https://github.com/paritytech/polkadot-sdk/pull/1297>),
|
||||
/// but some pallets had made it in and had storage set in them for this parachain before it was
|
||||
/// merged.
|
||||
pub struct InitStorageVersions;
|
||||
|
||||
impl frame_support::traits::OnRuntimeUpgrade for InitStorageVersions {
|
||||
fn on_runtime_upgrade() -> Weight {
|
||||
use frame_support::traits::{GetStorageVersion, StorageVersion};
|
||||
|
||||
let mut writes = 0;
|
||||
|
||||
if PolkadotXcm::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
PolkadotXcm::current_storage_version().put::<PolkadotXcm>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if Multisig::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
Multisig::current_storage_version().put::<Multisig>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if Assets::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
Assets::current_storage_version().put::<Assets>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if Uniques::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
Uniques::current_storage_version().put::<Uniques>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if Nfts::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
Nfts::current_storage_version().put::<Nfts>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if ForeignAssets::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
ForeignAssets::current_storage_version().put::<ForeignAssets>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
if PoolAssets::on_chain_storage_version() == StorageVersion::new(0) {
|
||||
PoolAssets::current_storage_version().put::<PoolAssets>();
|
||||
writes.saturating_inc();
|
||||
}
|
||||
|
||||
<Runtime as frame_system::Config>::DbWeight::get().reads_writes(7, writes)
|
||||
}
|
||||
}
|
||||
|
||||
/// Executive: handles dispatch to the various modules.
|
||||
pub type Executive = frame_executive::Executive<
|
||||
|
||||
@@ -405,7 +405,6 @@ construct_runtime!(
|
||||
XcmpQueue: cumulus_pallet_xcmp_queue::{Pallet, Call, Storage, Event<T>} = 30,
|
||||
PolkadotXcm: pallet_xcm::{Pallet, Call, Storage, Event<T>, Origin, Config<T>} = 31,
|
||||
CumulusXcm: cumulus_pallet_xcm::{Pallet, Event<T>, Origin} = 32,
|
||||
DmpQueue: cumulus_pallet_dmp_queue::{Pallet, Call, Storage, Event<T>} = 33,
|
||||
MessageQueue: pallet_message_queue::{Pallet, Call, Storage, Event<T>} = 34,
|
||||
|
||||
// Smart Contracts.
|
||||
|
||||
@@ -304,9 +304,3 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
|
||||
parameter_types! {
|
||||
pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent;
|
||||
}
|
||||
|
||||
impl cumulus_pallet_dmp_queue::Config for Runtime {
|
||||
type WeightInfo = cumulus_pallet_dmp_queue::weights::SubstrateWeight<Runtime>;
|
||||
type RuntimeEvent = crate::RuntimeEvent;
|
||||
type DmpSink = frame_support::traits::EnqueueWithOrigin<crate::MessageQueue, RelayOrigin>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user