@@ -386,6 +386,30 @@ type Reserves = (
386386 NativeAsset ,
387387) ;
388388
389+
390+ parameter_types ! {
391+ pub NativeAssetFilter : AssetFilter = Wild ( AllOf { fun: WildFungible , id: TokenLocation :: get( ) . into( ) } ) ;
392+ pub AssetHubTrustedTeleporter : ( AssetFilter , Location ) = ( NativeAssetFilter :: get( ) , AssetHubLocation :: get( ) ) ;
393+
394+ }
395+
396+ pub type TrustedTeleporters = ( xcm_builder:: Case < AssetHubTrustedTeleporter > , ) ;
397+
398+ pub struct OnlyTeleportNative ;
399+ impl Contains < ( Location , Vec < Asset > ) > for OnlyTeleportNative {
400+ fn contains ( t : & ( Location , Vec < Asset > ) ) -> bool {
401+ let native = TokenLocation :: get ( ) ;
402+ t. 1 . iter ( ) . all ( |asset| {
403+ log:: trace!( target: "xcm::OnlyTeleportNative" , "Asset to be teleported: {:?}" , asset) ;
404+ if let Asset { id : asset_id, fun : Fungible ( _) } = asset {
405+ asset_id. 0 == native
406+ } else {
407+ false
408+ }
409+ } )
410+ }
411+ }
412+
389413pub struct XcmConfig ;
390414impl xcm_executor:: Config for XcmConfig {
391415 type RuntimeCall = RuntimeCall ;
@@ -394,7 +418,7 @@ impl xcm_executor::Config for XcmConfig {
394418 type AssetTransactor = AssetTransactors ;
395419 type OriginConverter = XcmOriginToTransactDispatchOrigin ;
396420 type IsReserve = Reserves ;
397- type IsTeleporter = ( ) ; // Teleporting is disabled.
421+ type IsTeleporter = TrustedTeleporters ;
398422 type UniversalLocation = UniversalLocation ;
399423 type Barrier = Barrier ;
400424 type Weigher = WeightInfoBounds <
@@ -452,7 +476,7 @@ impl pallet_xcm::Config for Runtime {
452476 // ^ Disable dispatchable execute on the XCM pallet.
453477 // Needs to be `Everything` for local testing.
454478 type XcmExecutor = XcmExecutor < XcmConfig > ;
455- type XcmTeleportFilter = Nothing ;
479+ type XcmTeleportFilter = OnlyTeleportNative ;
456480 type XcmReserveTransferFilter = Everything ;
457481 type Weigher = WeightInfoBounds <
458482 crate :: weights:: xcm:: NeurowebXcmWeight < RuntimeCall > ,
0 commit comments