diff --git a/pallets/foreign-assets/src/lib.rs b/pallets/foreign-assets/src/lib.rs index f503ef3b0b..4d4818d104 100644 --- a/pallets/foreign-assets/src/lib.rs +++ b/pallets/foreign-assets/src/lib.rs @@ -233,8 +233,9 @@ impl Pallet { /// to the collection with the ID equal to ``. The `` must be in the valid range, /// otherwise the `AssetIdConversionFailed` error will be returned. /// - /// If the multilocation doesn't match the patterns listed above, the function returns `Ok(None)`, - /// identifying that the given multilocation doesn't correspond to a local collection. + /// If the multilocation doesn't match the patterns listed above, + /// or the `` points to a foreign collection, + /// the function returns `Ok(None)`, identifying that the given multilocation doesn't correspond to a local collection. fn native_asset_location_to_collection( asset_location: &MultiLocation, ) -> Result, XcmError> { @@ -247,11 +248,19 @@ impl Pallet { .interior .match_and_split(&self_location.interior) { - Some(GeneralIndex(collection_id)) => Ok(Some(CollectionId( - (*collection_id) - .try_into() - .map_err(|_| XcmExecutorError::AssetIdConversionFailed)?, - ))), + Some(GeneralIndex(collection_id)) => { + let collection_id = CollectionId( + (*collection_id) + .try_into() + .map_err(|_| XcmExecutorError::AssetIdConversionFailed)?, + ); + + if Self::collection_to_foreign_reserve_location(collection_id).is_some() { + Ok(None) + } else { + Ok(Some(collection_id)) + } + } _ => Ok(None), } } else {