Rename Statemint to Asset Hub (#2633)

* change dir names

* cargo toml updates

* fix crate imports for build

* change chain spec names and PR review rule

* update cli to accept asset-hub

* find/replace benchmark commands

* integration tests

* bridges docs

* more integration tests

* AuraId

* other statemint tidying

* rename statemint mod

* chain spec mod

* rename e2e test dirs

* one more Runtime::Statemine

* benchmark westmint

* rename chain spec name and id

* rename chain spec files

* more tidying in scripts/docs/tests

* rename old dir if exists

* Force people to manually do the move.

(Safer as there could be additional considerations with their setup)

* review touchups

* more renaming

* Update polkadot-parachain/src/command.rs

Co-authored-by: Bastian Köcher <git@kchr.de>

* better error message

* do not break on-chain spec_name

* log info message that path has been renamed

* better penpal docs

---------

Co-authored-by: gilescope <gilescope@gmail.com>
Co-authored-by: Bastian Köcher <git@kchr.de>
Co-authored-by: parity-processbot <>
This commit is contained in:
joe petrowski
2023-06-02 11:58:19 +02:00
committed by GitHub
parent cad48b7136
commit 6007549589
161 changed files with 1123 additions and 1025 deletions
@@ -1,4 +1,4 @@
// Copyright 2019-2022 Parity Technologies (UK) Ltd.
// Copyright 2019-2023 Parity Technologies (UK) Ltd.
// This file is part of Cumulus.
// Cumulus is free software: you can redistribute it and/or modify
@@ -14,11 +14,13 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.
//! The Penpal runtime is designed as a test runtime that can be created using an arbitrary parachain id.
//! (and as such multiple parachains can be on the same relay node - though make sure you have enough relay
//! nodes running to support this or you will get the not scheduled on a core error message.)
//! The PenPal runtime is designed as a test runtime that can be created with an arbitrary `ParaId`,
//! such that multiple instances of the parachain can be on the same parent relay. Ensure that you
//! have enough nodes running to support this or you will get scheduling errors.
//!
//! The penpal runtime's primary use is as a partner when testing statemine/t with reserve asset transfers.
//! The PenPal runtime's primary use is for testing interactions between System parachains and
//! other chains that are not trusted teleporters.
#![cfg_attr(not(feature = "std"), no_std)]
// `construct_runtime!` does a lot of recursion and requires us to increase the limit to 256.
#![recursion_limit = "256"]
@@ -19,8 +19,8 @@
//! This configuration dictates how the Penpal chain will communicate with other chains.
//!
//! One of the main uses of the penpal chain will be to be a benefactor of reserve asset transfers
//! with statemine as the reserve. At present no derivative tokens are minted on receipt of a
//! ReserveAssetTransferDeposited message but that will but the intension will be to support this soon.
//! with Asset Hub as the reserve. At present no derivative tokens are minted on receipt of a
//! `ReserveAssetTransferDeposited` message but that will but the intension will be to support this soon.
use super::{
AccountId, AllPalletsWithSystem, AssetId as AssetIdPalletAssets, Assets, Balance, Balances,
ParachainInfo, ParachainSystem, PolkadotXcm, Runtime, RuntimeCall, RuntimeEvent, RuntimeOrigin,
@@ -94,7 +94,7 @@ pub type FungiblesTransactor = FungiblesAdapter<
ConvertedConcreteId<
AssetIdPalletAssets,
Balance,
AsPrefixedGeneralIndex<CommonGoodAssetsPalletLocation, AssetIdPalletAssets, JustTry>,
AsPrefixedGeneralIndex<SystemAssetHubAssetsPalletLocation, AssetIdPalletAssets, JustTry>,
JustTry,
>,
// Convert an XCM MultiLocation into a local account id:
@@ -256,15 +256,16 @@ impl ContainsPair<MultiAsset, MultiLocation> for MultiNativeAsset {
}
parameter_types! {
pub CommonGoodAssetsLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000)));
/// The location that this chain recognizes as the Relay network's Asset Hub.
pub SystemAssetHubLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000)));
// ALWAYS ensure that the index in PalletInstance stays up-to-date with
// Statemint's Assets pallet index
pub CommonGoodAssetsPalletLocation: MultiLocation =
// the Relay Chain's Asset Hub's Assets pallet index
pub SystemAssetHubAssetsPalletLocation: MultiLocation =
MultiLocation::new(1, X2(Parachain(1000), PalletInstance(50)));
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
}
pub type Reserves = (NativeAsset, AssetsFrom<CommonGoodAssetsLocation>);
pub type Reserves = (NativeAsset, AssetsFrom<SystemAssetHubLocation>);
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {
@@ -321,7 +321,11 @@ pub type FungiblesTransactor = FungiblesAdapter<
ConvertedConcreteId<
AssetIdForTrustBackedAssets,
u64,
AsPrefixedGeneralIndex<StatemintAssetsPalletLocation, AssetIdForTrustBackedAssets, JustTry>,
AsPrefixedGeneralIndex<
SystemAssetHubAssetsPalletLocation,
AssetIdForTrustBackedAssets,
JustTry,
>,
JustTry,
>,
// Convert an XCM MultiLocation into a local account id:
@@ -370,11 +374,13 @@ parameter_types! {
}
match_types! {
// The parent or the parent's unit plurality.
pub type ParentOrParentsUnitPlurality: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: Here } |
MultiLocation { parents: 1, interior: X1(Plurality { id: BodyId::Unit, .. }) }
};
pub type Statemint: impl Contains<MultiLocation> = {
// The location recognized as the Relay network's Asset Hub.
pub type AssetHub: impl Contains<MultiLocation> = {
MultiLocation { parents: 1, interior: X1(Parachain(1000)) }
};
}
@@ -382,9 +388,10 @@ match_types! {
pub type Barrier = (
TakeWeightCredit,
AllowTopLevelPaidExecutionFrom<Everything>,
// Parent & its unit plurality gets free execution.
AllowExplicitUnpaidExecutionFrom<ParentOrParentsUnitPlurality>,
// ^^^ Parent & its unit plurality gets free execution
AllowExplicitUnpaidExecutionFrom<Statemint>,
// The network's Asset Hub gets free execution.
AllowExplicitUnpaidExecutionFrom<AssetHub>,
// Expected responses are OK.
AllowKnownQueryResponses<PolkadotXcm>,
// Subscriptions for version tracking are OK.
@@ -393,14 +400,14 @@ pub type Barrier = (
parameter_types! {
pub MaxAssetsIntoHolding: u32 = 64;
pub StatemintLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000)));
pub SystemAssetHubLocation: MultiLocation = MultiLocation::new(1, X1(Parachain(1000)));
// ALWAYS ensure that the index in PalletInstance stays up-to-date with
// Statemint's Assets pallet index
pub StatemintAssetsPalletLocation: MultiLocation =
// the Relay Chain's Asset Hub's Assets pallet index
pub SystemAssetHubAssetsPalletLocation: MultiLocation =
MultiLocation::new(1, X2(Parachain(1000), PalletInstance(50)));
}
pub type Reserves = (NativeAsset, AssetsFrom<StatemintLocation>);
pub type Reserves = (NativeAsset, AssetsFrom<SystemAssetHubLocation>);
pub struct XcmConfig;
impl xcm_executor::Config for XcmConfig {