Skip to content

Commit 0be3ff7

Browse files
committed
add test for asset destination-reserve while teleporting fees
1 parent ae8575b commit 0be3ff7

2 files changed

Lines changed: 272 additions & 49 deletions

File tree

polkadot/xcm/pallet-xcm/src/mock.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,7 @@ impl pallet_assets::Config for Test {
276276
}
277277

278278
// This child parachain acts as trusted reserve for its assets in tests.
279+
// USDT allowed to teleport to/from here.
279280
pub const FOREIGN_ASSET_RESERVE_PARA_ID: u32 = 2001;
280281
// Inner junction of reserve asset on `FOREIGN_ASSET_RESERVE_PARA_ID`.
281282
pub const FOREIGN_ASSET_INNER_JUNCTION: Junction = GeneralIndex(1234567);
@@ -379,6 +380,7 @@ parameter_types! {
379380
pub CurrencyPerSecondPerByte: (AssetId, u128, u128) = (Concrete(RelayLocation::get()), 1, 1);
380381
pub TrustedLocal: (MultiAssetFilter, MultiLocation) = (All.into(), Here.into());
381382
pub TrustedUsdt: (MultiAssetFilter, MultiLocation) = (vec![Usdt::get()].into(), UsdtTeleportLocation::get());
383+
pub TeleportUsdtToForeign: (MultiAssetFilter, MultiLocation) = (vec![Usdt::get()].into(), ForeignReserveLocation::get());
382384
pub TrustedForeign: (MultiAssetFilter, MultiLocation) = (vec![ForeignAsset::get()].into(), ForeignReserveLocation::get());
383385
pub TrustedUsdc: (MultiAssetFilter, MultiLocation) = (vec![Usdc::get()].into(), UsdcReserveLocation::get());
384386
pub const MaxInstructions: u32 = 100;
@@ -399,7 +401,7 @@ impl xcm_executor::Config for XcmConfig {
399401
type AssetTransactor = AssetTransactors;
400402
type OriginConverter = LocalOriginConverter;
401403
type IsReserve = (Case<TrustedForeign>, Case<TrustedUsdc>);
402-
type IsTeleporter = (Case<TrustedLocal>, Case<TrustedUsdt>);
404+
type IsTeleporter = (Case<TrustedLocal>, Case<TrustedUsdt>, Case<TeleportUsdtToForeign>);
403405
type UniversalLocation = UniversalLocation;
404406
type Barrier = Barrier;
405407
type Weigher = FixedWeightBounds<BaseXcmWeight, RuntimeCall, MaxInstructions>;

0 commit comments

Comments
 (0)