Skip to content

Commit e280079

Browse files
committed
Funding Rounds Simplification
1 parent 5e31004 commit e280079

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -247,4 +247,4 @@ cumulus-pallet-session-benchmarking = { version = "16.0.0", default-features = f
247247
# Runtimes
248248
polimec-runtime = { path = "runtimes/polimec" }
249249
rococo-runtime-constants = { version = "14.0.0" }
250-
rococo-runtime = { version = "14.0.0" }
250+
rococo-runtime = { version = "14.0.0" }

runtimes/polimec/src/xcm_config.rs

+6-9
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ use frame_support::{
2727
pallet_prelude::*,
2828
parameter_types,
2929
traits::{
30-
ConstU32, Contains, ContainsPair, Everything, Nothing, OnUnbalanced as OnUnbalancedT, ProcessMessageError,
30+
tokens::ConversionToAssetBalance, ConstU32, Contains, ContainsPair, Everything, Nothing,
31+
OnUnbalanced as OnUnbalancedT, ProcessMessageError,
3132
},
3233
weights::{Weight, WeightToFee as WeightToFeeT},
3334
};
@@ -52,8 +53,6 @@ use xcm_executor::{
5253
traits::{JustTry, Properties, ShouldExecute, WeightTrader},
5354
AssetsInHolding, XcmExecutor,
5455
};
55-
use frame_support::traits::tokens::ConversionToAssetBalance;
56-
5756

5857
// DOT from Polkadot Asset Hub
5958
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 {
319318
// Do not allow any Transact instructions to be executed on our chain.
320319
type SafeCallFilter = Nothing;
321320
type SubscriptionService = PolkadotXcm;
322-
type Trader = (
323-
AssetTrader<TakeRevenueToTreasury>,
324-
);
321+
type Trader = (AssetTrader<TakeRevenueToTreasury>,);
325322
type TransactionalProcessor = FrameTransactionalProcessor;
326323
type UniversalAliases = Nothing;
327324
type UniversalLocation = UniversalLocation;
@@ -525,7 +522,7 @@ impl<Payee: TakeRevenue> WeightTrader for AssetTrader<Payee> {
525522
ensure!(acceptable_assets.contains(&asset_id.0), XcmError::FeesNotMet);
526523

527524
// 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 {
529526
ensure!(asset.id == *asset_id, XcmError::FeesNotMet);
530527
if let Fungibility::Fungible(amount) = asset.fun {
531528
amount
@@ -536,8 +533,8 @@ impl<Payee: TakeRevenue> WeightTrader for AssetTrader<Payee> {
536533
Zero::zero()
537534
};
538535

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)?;
541538
ensure!(*asset_amount >= required_asset_amount, XcmError::FeesNotMet);
542539

543540
let required = (AssetId(asset_id.0.clone()), required_asset_amount).into();

0 commit comments

Comments
 (0)