mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 09:21:04 +00:00
Reanchor should return canonical location (#4470)
* Reanchor should return canonical * Formatting * Formatting * Update xcm/src/v1/multilocation.rs * Formatting * Fixes * Don't discard unreanchorable assets * Formatting * Docs * Fixes * Fixes * tidy
This commit is contained in:
@@ -777,13 +777,12 @@ pub mod pallet {
|
||||
let value = (origin_location, assets.drain());
|
||||
ensure!(T::XcmReserveTransferFilter::contains(&value), Error::<T>::Filtered);
|
||||
let (origin_location, assets) = value;
|
||||
let inv_dest = T::LocationInverter::invert_location(&dest)
|
||||
.map_err(|()| Error::<T>::DestinationNotInvertible)?;
|
||||
let ancestry = T::LocationInverter::ancestry();
|
||||
let fees = assets
|
||||
.get(fee_asset_item as usize)
|
||||
.ok_or(Error::<T>::Empty)?
|
||||
.clone()
|
||||
.reanchored(&inv_dest)
|
||||
.reanchored(&dest, &ancestry)
|
||||
.map_err(|_| Error::<T>::CannotReanchor)?;
|
||||
let max_assets = assets.len() as u32;
|
||||
let assets: MultiAssets = assets.into();
|
||||
@@ -835,13 +834,12 @@ pub mod pallet {
|
||||
let value = (origin_location, assets.drain());
|
||||
ensure!(T::XcmTeleportFilter::contains(&value), Error::<T>::Filtered);
|
||||
let (origin_location, assets) = value;
|
||||
let inv_dest = T::LocationInverter::invert_location(&dest)
|
||||
.map_err(|()| Error::<T>::DestinationNotInvertible)?;
|
||||
let ancestry = T::LocationInverter::ancestry();
|
||||
let fees = assets
|
||||
.get(fee_asset_item as usize)
|
||||
.ok_or(Error::<T>::Empty)?
|
||||
.clone()
|
||||
.reanchored(&inv_dest)
|
||||
.reanchored(&dest, &ancestry)
|
||||
.map_err(|_| Error::<T>::CannotReanchor)?;
|
||||
let max_assets = assets.len() as u32;
|
||||
let assets: MultiAssets = assets.into();
|
||||
|
||||
Reference in New Issue
Block a user