git.delta.rocks / unique-network / refs/commits / a6465aad3e62

difftreelog

Add a few missing types.

Ilja Khabarov2022-08-19parent: #d59d471.patch.diff
in: master

1 file changed

modifiedruntime/common/config/xcm.rsdiffbeforeafterboth
35 Fungibility::Fungible as XcmFungible,35 Fungibility::Fungible as XcmFungible,
36 MultiAsset, Error as XcmError,36 MultiAsset, Error as XcmError,
37};37};
38use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader};
39use xcm_builder::{38use xcm_builder::{
40 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,39 AccountId32Aliases, AllowTopLevelPaidExecutionFrom, CurrencyAdapter, EnsureXcmOrigin,
41 FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative,40 FixedWeightBounds, FungiblesAdapter, LocationInverter, NativeAsset, ParentAsSuperuser, RelayChainAsNative,
42 SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,41 SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
43 SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset,42 SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, ParentIsPreset,
44};43};
45use xcm_executor::{Config, XcmExecutor, Assets};44use xcm_executor::{Config, XcmExecutor, Assets};
45use xcm_executor::traits::{Convert as ConvertXcm, MatchesFungible, WeightTrader, FilterAssetLocation};
46use pallet_foreing_assets::{46use pallet_foreing_assets::{
47 AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency,47 AssetIds, AssetIdMapping, XcmForeignAssetIdMapping, CurrencyId, NativeCurrency,
48 UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId,48 UsingAnyCurrencyComponents, TryAsForeing, ForeignAssetId,
356#[cfg(not(feature = "foreign-assets"))]356#[cfg(not(feature = "foreign-assets"))]
357pub type AssetTransactors = LocalAssetTransactor;357pub type AssetTransactors = LocalAssetTransactor;
358
359#[cfg(feature = "foreign-assets")]
360pub struct AllAsset;
361#[cfg(feature = "foreign-assets")]
362impl FilterAssetLocation for AllAsset {
363 fn filter_asset_location(asset: &MultiAsset, origin: &MultiLocation) -> bool {
364 true
365 }
366}
367
368#[cfg(feature = "foreign-assets")]
369pub type IsReserve = AllAsset;
370#[cfg(not(feature = "foreign-assets"))]
371pub type IsReserve = NativeAsset;
372
373#[cfg(feature = "foreign-assets")]
374type Trader<T> =
375 UsingAnyCurrencyComponents<
376 pallet_configuration::WeightToFee<T, Balance>,
377 RelayLocation, AccountId, Balances, ()>;
378#[cfg(not(feature = "foreign-assets"))]
379type Trader<T> = UsingOnlySelfCurrencyComponents<
380 pallet_configuration::WeightToFee<T, Balance>,
381 RelayLocation,
382 AccountId,
383 Balances,
384 (),
385>;
358386
359pub struct XcmConfig<T>(PhantomData<T>);387pub struct XcmConfig<T>(PhantomData<T>);
360impl<T> Config for XcmConfig<T>388impl<T> Config for XcmConfig<T>
366 // How to withdraw and deposit an asset.394 // How to withdraw and deposit an asset.
367 type AssetTransactor = LocalAssetTransactor;395 type AssetTransactor = LocalAssetTransactor;
368 type OriginConverter = XcmOriginToTransactDispatchOrigin;396 type OriginConverter = XcmOriginToTransactDispatchOrigin;
369 type IsReserve = NativeAsset;397 type IsReserve = IsReserve;
370 type IsTeleporter = (); // Teleportation is disabled398 type IsTeleporter = (); // Teleportation is disabled
371 type LocationInverter = LocationInverter<Ancestry>;399 type LocationInverter = LocationInverter<Ancestry>;
372 type Barrier = Barrier;400 type Barrier = Barrier;
373 type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;401 type Weigher = FixedWeightBounds<UnitWeightCost, Call, MaxInstructions>;
374 type Trader = UsingOnlySelfCurrencyComponents<402 type Trader = Trader<T>;
375 pallet_configuration::WeightToFee<T, Balance>,
376 RelayLocation,
377 AccountId,
378 Balances,
379 (),
380 >;
381 type ResponseHandler = (); // Don't handle responses for now.403 type ResponseHandler = (); // Don't handle responses for now.
382 type SubscriptionService = PolkadotXcm;404 type SubscriptionService = PolkadotXcm;