Skip to content
Snippets Groups Projects
Unverified Commit 67b23fad authored by Liam Aharon's avatar Liam Aharon
Browse files

finish merging location refactor

parent a2ec1ee6
Branches
No related merge requests found
Pipeline #465674 failed with stages
in 43 minutes and 13 seconds
......@@ -31,8 +31,7 @@ use assets_common::{
foreign_creators::ForeignCreators,
local_and_foreign_assets::{LocalFromLeft, TargetFromLeft},
matching::{FromNetwork, FromSiblingParachain},
AssetIdForPoolAssets, AssetIdForPoolAssetsConvertV3Location,
AssetIdForTrustBackedAssetsConvert,
AssetIdForPoolAssets, AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert,
};
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
use cumulus_primitives_core::AggregateMessageOrigin;
......@@ -346,7 +345,7 @@ pub type NativeAndAllAssets = fungibles::UnionOf<
PoolAssets,
NativeAndNonPoolAssets,
LocalFromLeft<
AssetIdForPoolAssetsConvertV3Location<PoolAssetsPalletLocationV3>,
AssetIdForPoolAssetsConvert<PoolAssetsPalletLocationV3, xcm::v3::Location>,
AssetIdForPoolAssets,
xcm::v3::Location,
>,
......
......@@ -76,6 +76,8 @@ parameter_types! {
pub TrustBackedAssetsPalletIndex: u8 = <Assets as PalletInfoAccess>::index() as u8;
pub TrustBackedAssetsPalletLocationV3: xcm::v3::Location =
xcm::v3::Junction::PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub PoolAssetsPalletLocationV3: xcm::v3::Location =
xcm::v3::Junction::PalletInstance(<PoolAssets as PalletInfoAccess>::index() as u8).into();
pub ForeignAssetsPalletLocation: Location =
PalletInstance(<ForeignAssets as PalletInfoAccess>::index() as u8).into();
pub PoolAssetsPalletLocation: Location =
......
......@@ -29,8 +29,7 @@ pub mod xcm_config;
use assets_common::{
local_and_foreign_assets::{LocalFromLeft, TargetFromLeft},
AssetIdForPoolAssets, AssetIdForPoolAssetsConvertV3Location,
AssetIdForTrustBackedAssetsConvert,
AssetIdForPoolAssets, AssetIdForPoolAssetsConvert, AssetIdForTrustBackedAssetsConvert,
};
use codec::{Decode, Encode, MaxEncodedLen};
use cumulus_pallet_parachain_system::RelayNumberMonotonicallyIncreases;
......@@ -326,7 +325,7 @@ pub type NativeAndAllAssets = fungibles::UnionOf<
PoolAssets,
NativeAndNonPoolAssets,
LocalFromLeft<
AssetIdForPoolAssetsConvertV3Location<PoolAssetsPalletLocationV3>,
AssetIdForPoolAssetsConvert<PoolAssetsPalletLocationV3, xcm::v3::Location>,
AssetIdForPoolAssets,
xcm::v3::Location,
>,
......
......@@ -73,6 +73,8 @@ parameter_types! {
pub TrustBackedAssetsPalletIndex: u8 = <Assets as PalletInfoAccess>::index() as u8;
pub TrustBackedAssetsPalletLocationV3: xcm::v3::Location =
xcm::v3::Junction::PalletInstance(<Assets as PalletInfoAccess>::index() as u8).into();
pub PoolAssetsPalletLocationV3: xcm::v3::Location =
xcm::v3::Junction::PalletInstance(<PoolAssets as PalletInfoAccess>::index() as u8).into();
pub ForeignAssetsPalletLocation: Location =
PalletInstance(<ForeignAssets as PalletInfoAccess>::index() as u8).into();
pub PoolAssetsPalletLocation: Location =
......
......@@ -119,17 +119,10 @@ pub type ForeignAssetsConvertedConcreteId<
>;
pub type AssetIdForPoolAssets = u32;
/// `Location` vs `AssetIdForPoolAssets` converter for `PoolAssets` with explicit `v3 Location`.
pub type AssetIdForPoolAssetsConvertV3Location<PoolAssetsPalletLocation> = AsPrefixedGeneralIndex<
PoolAssetsPalletLocation,
AssetIdForPoolAssets,
JustTry,
xcm::v3::Location,
>;
/// `Location` vs `AssetIdForPoolAssets` converter for `PoolAssets`.
pub type AssetIdForPoolAssetsConvert<PoolAssetsPalletLocation> =
AsPrefixedGeneralIndex<PoolAssetsPalletLocation, AssetIdForPoolAssets, TryConvertInto>;
pub type AssetIdForPoolAssetsConvert<PoolAssetsPalletLocation, L = Location> =
AsPrefixedGeneralIndex<PoolAssetsPalletLocation, AssetIdForPoolAssets, TryConvertInto, L>;
/// [`MatchedConvertedConcreteId`] converter dedicated for `PoolAssets`
pub type PoolAssetsConvertedConcreteId<PoolAssetsPalletLocation, Balance> =
MatchedConvertedConcreteId<
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment