diff --git a/polkadot/xcm/xcm-builder/src/location_conversion.rs b/polkadot/xcm/xcm-builder/src/location_conversion.rs index bafec5da4a..a5e6b55824 100644 --- a/polkadot/xcm/xcm-builder/src/location_conversion.rs +++ b/polkadot/xcm/xcm-builder/src/location_conversion.rs @@ -237,18 +237,11 @@ impl>, AccountId: From<[u8; 32]> + Into<[u8; 32]> /// network (provided by `Network`) and the `AccountId`'s `[u8; 32]` datum for the `id`. pub struct AliasesIntoAccountId32(PhantomData<(Network, AccountId)>); impl<'a, Network: Get>, AccountId: Clone + Into<[u8; 32]> + Clone> - Convert<&'a AccountId, MultiLocation> for AliasesIntoAccountId32 + sp_runtime::traits::Convert<&'a AccountId, MultiLocation> + for AliasesIntoAccountId32 { - fn convert(who: &AccountId) -> Result { - Ok(AccountId32 { network: Network::get(), id: who.clone().into() }.into()) - } -} - -impl>, AccountId: Into<[u8; 32]> + Clone> - Convert for AliasesIntoAccountId32 -{ - fn convert(who: AccountId) -> Result { - Ok(AccountId32 { network: Network::get(), id: who.into() }.into()) + fn convert(who: &AccountId) -> MultiLocation { + AccountId32 { network: Network::get(), id: who.clone().into() }.into() } } @@ -313,7 +306,8 @@ impl, AccountId: From<[u8; 32]> + } fn reverse_ref(_: impl Borrow) -> Result { - // if this will be needed, we could implement some kind of guessing, if we have configuration for supported networkId+paraId + // if this is ever be needed, we could implement some kind of guessing, if we have + // configuration for supported networkId+paraId Err(()) } } diff --git a/polkadot/xcm/xcm-builder/src/pay.rs b/polkadot/xcm/xcm-builder/src/pay.rs index e8cd2b2bb2..504ec83775 100644 --- a/polkadot/xcm/xcm-builder/src/pay.rs +++ b/polkadot/xcm/xcm-builder/src/pay.rs @@ -28,8 +28,11 @@ use xcm_executor::traits::{QueryHandler, QueryResponseStatus}; /// Implementation of the `frame_support::traits::tokens::Pay` trait, to allow /// for XCM-based payments of a given `Balance` of some asset ID existing on some chain under /// ownership of some `Interior` location of the local chain to a particular `Beneficiary`. The -/// `AssetKind` value can be converted into both the XCM `AssetId` (via and `Into` bound) and the -/// the destination chain's location, via the `AssetKindToLocatableAsset` type parameter. +/// `AssetKind` value is not itself bounded (to avoid the issue of needing to wrap some preexisting +/// datatype), however a converter type `AssetKindToLocatableAsset` must be provided in order to +/// translate it into a `LocatableAsset`, which comprises both an XCM `MultiLocation` describing +/// the XCM endpoint on which the asset to be paid resides and an XCM `AssetId` to identify the +/// specific asset at that endpoint. /// /// This relies on the XCM `TransferAsset` instruction. A trait `BeneficiaryRefToLocation` must be /// provided in order to convert the `Beneficiary` reference into a location usable by @@ -200,6 +203,3 @@ impl, AssetKind: Into> Convert