@@ -27,7 +27,8 @@ use frame_support::{
27
27
pallet_prelude:: * ,
28
28
parameter_types,
29
29
traits:: {
30
- ConstU32 , Contains , ContainsPair , Everything , Nothing , OnUnbalanced as OnUnbalancedT , ProcessMessageError ,
30
+ tokens:: ConversionToAssetBalance , ConstU32 , Contains , ContainsPair , Everything , Nothing ,
31
+ OnUnbalanced as OnUnbalancedT , ProcessMessageError ,
31
32
} ,
32
33
weights:: { Weight , WeightToFee as WeightToFeeT } ,
33
34
} ;
@@ -52,8 +53,6 @@ use xcm_executor::{
52
53
traits:: { JustTry , Properties , ShouldExecute , WeightTrader } ,
53
54
AssetsInHolding , XcmExecutor ,
54
55
} ;
55
- use frame_support:: traits:: tokens:: ConversionToAssetBalance ;
56
-
57
56
58
57
// DOT from Polkadot Asset Hub
59
58
const DOT_PER_SECOND_EXECUTION : u128 = 0_2_000_000_000 ; // 0.2 DOT per second of execution time
@@ -319,9 +318,7 @@ impl xcm_executor::Config for XcmConfig {
319
318
// Do not allow any Transact instructions to be executed on our chain.
320
319
type SafeCallFilter = Nothing ;
321
320
type SubscriptionService = PolkadotXcm ;
322
- type Trader = (
323
- AssetTrader < TakeRevenueToTreasury > ,
324
- ) ;
321
+ type Trader = ( AssetTrader < TakeRevenueToTreasury > , ) ;
325
322
type TransactionalProcessor = FrameTransactionalProcessor ;
326
323
type UniversalAliases = Nothing ;
327
324
type UniversalLocation = UniversalLocation ;
@@ -525,7 +522,7 @@ impl<Payee: TakeRevenue> WeightTrader for AssetTrader<Payee> {
525
522
ensure ! ( acceptable_assets. contains( & asset_id. 0 ) , XcmError :: FeesNotMet ) ;
526
523
527
524
// If the trader was used already in this xcm execution, make sure we continue trading with the same asset
528
- let old_amount = if let Some ( asset) =& self . asset_spent {
525
+ let old_amount = if let Some ( asset) = & self . asset_spent {
529
526
ensure ! ( asset. id == * asset_id, XcmError :: FeesNotMet ) ;
530
527
if let Fungibility :: Fungible ( amount) = asset. fun {
531
528
amount
@@ -536,8 +533,8 @@ impl<Payee: TakeRevenue> WeightTrader for AssetTrader<Payee> {
536
533
Zero :: zero ( )
537
534
} ;
538
535
539
- let required_asset_amount =
540
- PLMCToAssetBalance :: to_asset_balance ( native_amount , asset_id . 0 . clone ( ) ) . map_err ( |_| XcmError :: FeesNotMet ) ?;
536
+ let required_asset_amount = PLMCToAssetBalance :: to_asset_balance ( native_amount , asset_id . 0 . clone ( ) )
537
+ . map_err ( |_| XcmError :: FeesNotMet ) ?;
541
538
ensure ! ( * asset_amount >= required_asset_amount, XcmError :: FeesNotMet ) ;
542
539
543
540
let required = ( AssetId ( asset_id. 0 . clone ( ) ) , required_asset_amount) . into ( ) ;
0 commit comments