mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 15:11:02 +00:00
[testnet] Align testnet system parachain runtimes using RelayTreasuryLocation and SystemParachains in the same way (#2023)
This PR addresses several issues: - simplify referencing `RelayTreasuryLocation` without needing additional `RelayTreasury` struct - fix for referencing `SystemParachains` from parachain with `parents: 1` instead of `parents: 0` - removed hard-coded constants and fix tests for `asset-hub-rococo` which was merged to master after https://github.com/paritytech/polkadot-sdk/pull/1726 --------- Co-authored-by: command-bot <>
This commit is contained in:
@@ -26,7 +26,7 @@ use assets_common::{
|
||||
};
|
||||
use frame_support::{
|
||||
match_types, parameter_types,
|
||||
traits::{ConstU32, Contains, Everything, Nothing, PalletInfoAccess},
|
||||
traits::{ConstU32, Contains, Equals, Everything, Nothing, PalletInfoAccess},
|
||||
};
|
||||
use frame_system::EnsureRoot;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
@@ -74,6 +74,7 @@ parameter_types! {
|
||||
PalletInstance(<PoolAssets as PalletInfoAccess>::index() as u8).into();
|
||||
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
|
||||
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
|
||||
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(westend_runtime_constants::TREASURY_PALLET_ID)).into();
|
||||
}
|
||||
|
||||
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
|
||||
@@ -157,7 +158,7 @@ pub type ForeignFungiblesTransactor = FungiblesAdapter<
|
||||
CheckingAccount,
|
||||
>;
|
||||
|
||||
/// `AssetId/Balance` converter for `PoolAssets`
|
||||
/// `AssetId`/`Balance` converter for `PoolAssets`.
|
||||
pub type PoolAssetsConvertedConcreteId =
|
||||
assets_common::PoolAssetsConvertedConcreteId<PoolAssetsPalletLocation, Balance>;
|
||||
|
||||
@@ -236,9 +237,6 @@ match_types! {
|
||||
MultiLocation { parents: 1, interior: Here } |
|
||||
MultiLocation { parents: 1, interior: X1(Plurality { .. }) }
|
||||
};
|
||||
pub type TreasuryPallet: impl Contains<MultiLocation> = {
|
||||
MultiLocation { parents: 1, interior: X1(PalletInstance(37)) }
|
||||
};
|
||||
}
|
||||
|
||||
/// A call filter for the XCM Transact instruction. This is a temporary measure until we properly
|
||||
@@ -466,9 +464,12 @@ pub type Barrier = TrailingSetTopicAsId<
|
||||
// If the message is one that immediately attempts to pay for execution, then
|
||||
// allow it.
|
||||
AllowTopLevelPaidExecutionFrom<Everything>,
|
||||
// Parent, its pluralities (i.e. governance bodies) and treasury pallet get
|
||||
// free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(ParentOrParentsPlurality, TreasuryPallet)>,
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pallet and
|
||||
// BridgeHub get free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(
|
||||
ParentOrParentsPlurality,
|
||||
Equals<RelayTreasuryLocation>,
|
||||
)>,
|
||||
// Subscriptions for version tracking are OK.
|
||||
AllowSubscriptionsFrom<Everything>,
|
||||
),
|
||||
@@ -504,22 +505,11 @@ match_types! {
|
||||
};
|
||||
}
|
||||
|
||||
parameter_types! {
|
||||
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(westend_runtime_constants::TREASURY_PALLET_ID)).into();
|
||||
}
|
||||
|
||||
pub struct RelayTreasury;
|
||||
impl Contains<MultiLocation> for RelayTreasury {
|
||||
fn contains(location: &MultiLocation) -> bool {
|
||||
let relay_treasury_location = RelayTreasuryLocation::get();
|
||||
*location == relay_treasury_location
|
||||
}
|
||||
}
|
||||
|
||||
/// Locations that will not be charged fees in the executor,
|
||||
/// either execution or delivery.
|
||||
/// We only waive fees for system functions, which these locations represent.
|
||||
pub type WaivedLocations = (RelayOrOtherSystemParachains<SystemParachains, Runtime>, RelayTreasury);
|
||||
pub type WaivedLocations =
|
||||
(RelayOrOtherSystemParachains<SystemParachains, Runtime>, Equals<RelayTreasuryLocation>);
|
||||
|
||||
/// Cases where a remote origin is accepted as trusted Teleporter for a given asset:
|
||||
///
|
||||
@@ -550,6 +540,8 @@ impl xcm_executor::Config for XcmConfig {
|
||||
>;
|
||||
type Trader = (
|
||||
UsingComponents<WeightToFee, WestendLocation, AccountId, Balances, ToStakingPot<Runtime>>,
|
||||
// This trader allows to pay with `is_sufficient=true` "Trust Backed" assets from dedicated
|
||||
// `pallet_assets` instance - `Assets`.
|
||||
cumulus_primitives_utility::TakeFirstAssetTrader<
|
||||
AccountId,
|
||||
AssetFeeAsExistentialDepositMultiplierFeeCharger,
|
||||
|
||||
Reference in New Issue
Block a user