mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-31 04:01:02 +00:00
[cumulus] parachains-common testnet constants cleaning (#3134)
The `parachains-common` contains a lots of constants and type definitions which are used for `polkadot-sdk`'s testnet runtimes and also for `polkadot-fellows`'s production [SP runtimes](https://github.com/polkadot-fellows/runtimes/tree/main/system-parachains/constants). This PR cleans `parachains-common` module to contain only common and generic functionality. Testnet-specific constants have been moved to the separate module dedicated just for testnets: `polkadot-sdk/cumulus/parachains/runtimes/constants/` Part of: https://github.com/paritytech/polkadot-sdk/issues/3054 --------- Co-authored-by: georgepisaltu <george.pisaltu@parity.io>
This commit is contained in:
@@ -21,7 +21,6 @@ use super::{
|
||||
XcmpQueue,
|
||||
};
|
||||
use assets_common::{
|
||||
local_and_foreign_assets::MatchesLocalAndForeignAssetsLocation,
|
||||
matching::{FromNetwork, FromSiblingParachain, IsForeignConcreteAsset},
|
||||
TrustBackedAssetsAsLocation,
|
||||
};
|
||||
@@ -36,7 +35,6 @@ use frame_system::EnsureRoot;
|
||||
use pallet_xcm::XcmPassthrough;
|
||||
use parachains_common::{
|
||||
impls::ToStakingPot,
|
||||
rococo::snowbridge::EthereumNetwork,
|
||||
xcm_config::{
|
||||
AllSiblingSystemParachains, AssetFeeAsExistentialDepositMultiplier,
|
||||
ConcreteAssetFromSystem, ParentRelayOrSiblingParachains, RelayOrOtherSystemParachains,
|
||||
@@ -47,6 +45,9 @@ use polkadot_parachain_primitives::primitives::Sibling;
|
||||
use polkadot_runtime_common::xcm_sender::ExponentialPrice;
|
||||
use snowbridge_router_primitives::inbound::GlobalConsensusEthereumConvertsFor;
|
||||
use sp_runtime::traits::{AccountIdConversion, ConvertInto};
|
||||
use testnet_parachains_constants::rococo::snowbridge::{
|
||||
EthereumNetwork, INBOUND_QUEUE_PALLET_INDEX,
|
||||
};
|
||||
use xcm::latest::prelude::*;
|
||||
#[allow(deprecated)]
|
||||
use xcm_builder::CurrencyAdapter;
|
||||
@@ -229,30 +230,6 @@ pub type AssetTransactors = (
|
||||
UniquesTransactor,
|
||||
);
|
||||
|
||||
/// Simple `Location` matcher for Local and Foreign asset `Location`.
|
||||
pub struct LocalAndForeignAssetsLocationMatcher;
|
||||
impl MatchesLocalAndForeignAssetsLocation<xcm::v3::Location>
|
||||
for LocalAndForeignAssetsLocationMatcher
|
||||
{
|
||||
fn is_local(location: &xcm::v3::Location) -> bool {
|
||||
use assets_common::fungible_conversion::MatchesLocation;
|
||||
let latest_location: Location =
|
||||
if let Ok(location) = (*location).try_into() { location } else { return false };
|
||||
TrustBackedAssetsConvertedConcreteId::contains(&latest_location)
|
||||
}
|
||||
fn is_foreign(location: &xcm::v3::Location) -> bool {
|
||||
use assets_common::fungible_conversion::MatchesLocation;
|
||||
let latest_location: Location =
|
||||
if let Ok(location) = (*location).try_into() { location } else { return false };
|
||||
ForeignAssetsConvertedConcreteId::contains(&latest_location)
|
||||
}
|
||||
}
|
||||
impl Contains<xcm::v3::Location> for LocalAndForeignAssetsLocationMatcher {
|
||||
fn contains(location: &xcm::v3::Location) -> bool {
|
||||
Self::is_local(location) || Self::is_foreign(location)
|
||||
}
|
||||
}
|
||||
|
||||
/// This is the type we use to convert an (incoming) XCM origin into a local `Origin` instance,
|
||||
/// ready for dispatching a transaction with Xcm's `Transact`. There is an `OriginKind` which can
|
||||
/// biases the kind of local `Origin` it will become.
|
||||
@@ -875,7 +852,7 @@ pub mod bridging {
|
||||
1,
|
||||
[
|
||||
Parachain(SiblingBridgeHubParaId::get()),
|
||||
PalletInstance(parachains_common::rococo::snowbridge::INBOUND_QUEUE_PALLET_INDEX)
|
||||
PalletInstance(INBOUND_QUEUE_PALLET_INDEX)
|
||||
]
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user