From 1417a0263da6e90d91a4e418e587c61e24e2a135 Mon Sep 17 00:00:00 2001 From: Francisco Aguirre Date: Tue, 23 Jan 2024 09:05:21 +0100 Subject: [PATCH] Add unit impl for XcmAssetTransfers trait (#3022) If an Executor is required in some pallet's config, a mock might be provided where `Executor = ()`. `()` already implements `ExecuteXcm`, but not `XcmAssetTransfers`, which is also related. This PR just fixes that so you can skip having to create a whole xcm configuration, which is non-trivial right now. --- polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs b/polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs index 1fca84f36e..5da3d1da37 100644 --- a/polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs +++ b/polkadot/xcm/xcm-executor/src/traits/asset_transfer.rs @@ -85,3 +85,12 @@ pub trait XcmAssetTransfers { } } } + +impl XcmAssetTransfers for () { + type IsReserve = (); + type IsTeleporter = (); + type AssetTransactor = (); + fn determine_for(_: &Asset, _: &Location) -> Result { + return Err(Error::UnknownReserve); + } +}