difftreelog
fix disable xcm teleports
in: master
1 file changed
runtime/common/config/xcm/foreignassets.rsdiffbeforeafterboth18 traits::{Contains, Get, fungibles},18 traits::{Contains, Get, fungibles},19 parameter_types,19 parameter_types,20};20};21use sp_runtime::traits::{Zero, Convert};21use sp_runtime::traits::Convert;22use xcm::v1::{Junction::*, MultiLocation, Junctions::*};22use xcm::v1::{Junction::*, MultiLocation, Junctions::*};23use xcm::latest::MultiAsset;23use xcm::latest::MultiAsset;24use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};24use xcm_builder::{FungiblesAdapter, ConvertedConcreteAssetId};38 pub CheckingAccount: AccountId = PolkadotXcm::check_account();38 pub CheckingAccount: AccountId = PolkadotXcm::check_account();39}39}404041/// Allow checking in assets that have issuance > 0.41/// No teleports are allowed42pub struct NonZeroIssuance<AccountId, ForeignAssets>(PhantomData<(AccountId, ForeignAssets)>);42pub struct NoTeleports<AccountId, ForeignAssets>(PhantomData<(AccountId, ForeignAssets)>);434344impl<AccountId, ForeignAssets> Contains<<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId>44impl<AccountId, ForeignAssets> Contains<<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId>45 for NonZeroIssuance<AccountId, ForeignAssets>45 for NoTeleports<AccountId, ForeignAssets>46where46where47 ForeignAssets: fungibles::Inspect<AccountId>,47 ForeignAssets: fungibles::Inspect<AccountId>,48{48{49 fn contains(id: &<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId) -> bool {49 fn contains(_id: &<ForeignAssets as fungibles::Inspect<AccountId>>::AssetId) -> bool {50 !ForeignAssets::total_issuance(*id).is_zero()50 false51 }51 }52}52}5353132 LocationToAccountId,132 LocationToAccountId,133 // Our chain's account ID type (we can't get away without mentioning it explicitly):133 // Our chain's account ID type (we can't get away without mentioning it explicitly):134 AccountId,134 AccountId,135 // We only want to allow teleports of known assets. We use non-zero issuance as an indication135 // No teleports are allowed136 // that this asset is known.137 NonZeroIssuance<AccountId, ForeignAssets>,136 NoTeleports<AccountId, ForeignAssets>,138 // The account to use for tracking teleports.137 // The account to use for tracking teleports.139 CheckingAccount,138 CheckingAccount,140>;139>;