mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 19:51: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:
@@ -40,7 +40,7 @@ use parachains_common::{
|
||||
};
|
||||
use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use rococo_runtime_constants::system_parachain::SystemParachains;
|
||||
use rococo_runtime_constants::system_parachain;
|
||||
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
|
||||
use xcm::latest::prelude::*;
|
||||
use xcm_builder::{
|
||||
@@ -76,6 +76,7 @@ parameter_types! {
|
||||
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
|
||||
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
|
||||
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
|
||||
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(rococo_runtime_constants::TREASURY_PALLET_ID)).into();
|
||||
}
|
||||
|
||||
/// Adapter for resolving `NetworkId` based on `pub storage Flavor: RuntimeFlavor`.
|
||||
@@ -497,10 +498,11 @@ 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 BridgeHub get free
|
||||
// execution.
|
||||
// Parent, its pluralities (i.e. governance bodies), relay treasury pallet and
|
||||
// BridgeHub get free execution.
|
||||
AllowExplicitUnpaidExecutionFrom<(
|
||||
ParentOrParentsPlurality,
|
||||
Equals<RelayTreasuryLocation>,
|
||||
Equals<bridging::SiblingBridgeHub>,
|
||||
)>,
|
||||
// Subscriptions for version tracking are OK.
|
||||
@@ -530,22 +532,25 @@ pub type ForeignAssetFeeAsExistentialDepositMultiplierFeeCharger =
|
||||
ForeignAssetsInstance,
|
||||
>;
|
||||
|
||||
parameter_types! {
|
||||
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(rococo_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
|
||||
}
|
||||
match_types! {
|
||||
pub type SystemParachains: impl Contains<MultiLocation> = {
|
||||
MultiLocation {
|
||||
parents: 1,
|
||||
interior: X1(Parachain(
|
||||
system_parachain::ASSET_HUB_ID |
|
||||
system_parachain::BRIDGE_HUB_ID |
|
||||
system_parachain::CONTRACTS_ID |
|
||||
system_parachain::ENCOINTER_ID
|
||||
)),
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
/// 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:
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user