Skip to content

Commit 93f136b

Browse files
committed
[FeeManager] fix for XcmFeesToAccount
1 parent c1cec95 commit 93f136b

File tree

7 files changed

+40
-19
lines changed

7 files changed

+40
-19
lines changed

relay/kusama/src/xcm_config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use xcm_builder::{
4242
DescribeFamily, HashedDescription, IsChildSystemParachain, IsConcrete, MintLocation,
4343
OriginToPluralityVoice, SignedAccountId32AsNative, SignedToAccountId32,
4444
SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, UsingComponents,
45-
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
45+
WeightInfoBounds, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
4646
};
4747
use xcm_executor::traits::WithOriginFilter;
4848

@@ -355,7 +355,10 @@ impl xcm_executor::Config for XcmConfig {
355355
type SubscriptionService = XcmPallet;
356356
type PalletInstancesInfo = AllPalletsWithSystem;
357357
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
358-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
358+
type FeeManager = XcmFeeManagerFromComponents<
359+
WaivedLocations,
360+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
361+
>;
359362
// No bridges yet...
360363
type MessageExporter = ();
361364
type UniversalAliases = Nothing;

relay/polkadot/src/xcm_config.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ use xcm_builder::{
4747
DescribeFamily, HashedDescription, IsConcrete, MintLocation, OriginToPluralityVoice,
4848
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
4949
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
50-
XcmFeesToAccount,
50+
XcmFeeManagerFromComponents, XcmFeeToAccount,
5151
};
5252
use xcm_executor::traits::WithOriginFilter;
5353

@@ -359,7 +359,10 @@ impl xcm_executor::Config for XcmConfig {
359359
type SubscriptionService = XcmPallet;
360360
type PalletInstancesInfo = AllPalletsWithSystem;
361361
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
362-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
362+
type FeeManager = XcmFeeManagerFromComponents<
363+
WaivedLocations,
364+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
365+
>;
363366
// No bridges yet...
364367
type MessageExporter = ();
365368
type UniversalAliases = Nothing;

system-parachains/asset-hubs/asset-hub-kusama/src/xcm_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ use xcm_builder::{
5151
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
5252
SignedToAccountId32, SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus,
5353
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
54-
WithUniqueTopic, XcmFeesToAccount,
54+
WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
5555
};
5656
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
5757

@@ -75,7 +75,7 @@ parameter_types! {
7575
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
7676
pub const FellowshipLocation: MultiLocation = MultiLocation::parent();
7777
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(kusama_runtime_constants::TREASURY_PALLET_ID)).into();
78-
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
78+
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
7979
}
8080

8181
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -595,7 +595,10 @@ impl xcm_executor::Config for XcmConfig {
595595
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
596596
type AssetLocker = ();
597597
type AssetExchanger = ();
598-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
598+
type FeeManager = XcmFeeManagerFromComponents<
599+
WaivedLocations,
600+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
601+
>;
599602
type MessageExporter = ();
600603
type UniversalAliases = bridging::to_polkadot::UniversalAliases;
601604
type CallDispatcher = WithOriginFilter<SafeCallFilter>;

system-parachains/asset-hubs/asset-hub-polkadot/src/xcm_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ use xcm_builder::{
4848
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
4949
SignedToAccountId32, SovereignSignedViaLocation, StartsWith, StartsWithExplicitGlobalConsensus,
5050
TakeWeightCredit, TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin,
51-
WithUniqueTopic, XcmFeesToAccount,
51+
WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
5252
};
5353
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
5454

@@ -65,7 +65,7 @@ parameter_types! {
6565
pub FellowshipLocation: MultiLocation = MultiLocation::new(1, Parachain(1001));
6666
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
6767
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into();
68-
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
68+
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
6969
}
7070

7171
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -517,7 +517,10 @@ impl xcm_executor::Config for XcmConfig {
517517
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
518518
type AssetLocker = ();
519519
type AssetExchanger = ();
520-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
520+
type FeeManager = XcmFeeManagerFromComponents<
521+
WaivedLocations,
522+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
523+
>;
521524
type MessageExporter = ();
522525
type UniversalAliases = bridging::to_kusama::UniversalAliases;
523526
type CallDispatcher = WithOriginFilter<SafeCallFilter>;

system-parachains/bridge-hubs/bridge-hub-kusama/src/xcm_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use xcm_builder::{
4545
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
4646
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
4747
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
48-
XcmFeesToAccount,
48+
XcmFeeManagerFromComponents, XcmFeeToAccount,
4949
};
5050
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
5151

@@ -60,7 +60,7 @@ parameter_types! {
6060
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
6161
pub const FellowshipLocation: MultiLocation = MultiLocation::parent();
6262
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(kusama_runtime_constants::TREASURY_PALLET_ID)).into();
63-
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
63+
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
6464
}
6565

6666
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -275,7 +275,10 @@ impl xcm_executor::Config for XcmConfig {
275275
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
276276
type AssetLocker = ();
277277
type AssetExchanger = ();
278-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
278+
type FeeManager = XcmFeeManagerFromComponents<
279+
WaivedLocations,
280+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
281+
>;
279282
type MessageExporter = ToBridgeHubPolkadotHaulBlobExporter;
280283
type UniversalAliases = Nothing;
281284
type CallDispatcher = WithOriginFilter<SafeCallFilter>;

system-parachains/bridge-hubs/bridge-hub-polkadot/src/xcm_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ use xcm_builder::{
4545
RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia,
4646
SignedAccountId32AsNative, SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit,
4747
TrailingSetTopicAsId, UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
48-
XcmFeesToAccount,
48+
XcmFeeManagerFromComponents, XcmFeeToAccount,
4949
};
5050
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
5151

@@ -60,7 +60,7 @@ parameter_types! {
6060
pub FellowshipLocation: MultiLocation = MultiLocation::new(1, Parachain(1001));
6161
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
6262
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into();
63-
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
63+
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
6464
}
6565

6666
/// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used
@@ -282,7 +282,10 @@ impl xcm_executor::Config for XcmConfig {
282282
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
283283
type AssetLocker = ();
284284
type AssetExchanger = ();
285-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
285+
type FeeManager = XcmFeeManagerFromComponents<
286+
WaivedLocations,
287+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
288+
>;
286289
type MessageExporter = ToBridgeHubKusamaHaulBlobExporter;
287290
type UniversalAliases = Nothing;
288291
type CallDispatcher = WithOriginFilter<SafeCallFilter>;

system-parachains/collectives/collectives-polkadot/src/xcm_config.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ use xcm_builder::{
4242
OriginToPluralityVoice, ParentAsSuperuser, ParentIsPreset, RelayChainAsNative,
4343
SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative,
4444
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
45-
UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeesToAccount,
45+
UsingComponents, WithComputedOrigin, WithUniqueTopic, XcmFeeManagerFromComponents, XcmFeeToAccount,
4646
};
4747
use xcm_executor::{traits::WithOriginFilter, XcmExecutor};
4848

@@ -56,7 +56,7 @@ parameter_types! {
5656
pub CheckingAccount: AccountId = PolkadotXcm::check_account();
5757
pub const GovernanceLocation: MultiLocation = MultiLocation::parent();
5858
pub RelayTreasuryLocation: MultiLocation = (Parent, PalletInstance(polkadot_runtime_constants::TREASURY_PALLET_ID)).into();
59-
pub TreasuryAccount: Option<AccountId> = Some(TREASURY_PALLET_ID.into_account_truncating());
59+
pub TreasuryAccount: AccountId = TREASURY_PALLET_ID.into_account_truncating();
6060
pub const TreasurerBodyId: BodyId = BodyId::Index(xcm_constants::body::TREASURER_INDEX);
6161
}
6262

@@ -301,7 +301,10 @@ impl xcm_executor::Config for XcmConfig {
301301
type MaxAssetsIntoHolding = MaxAssetsIntoHolding;
302302
type AssetLocker = ();
303303
type AssetExchanger = ();
304-
type FeeManager = XcmFeesToAccount<Self, WaivedLocations, AccountId, TreasuryAccount>;
304+
type FeeManager = XcmFeeManagerFromComponents<
305+
WaivedLocations,
306+
XcmFeeToAccount<Self::AssetTransactor, AccountId, TreasuryAccount>,
307+
>;
305308
type MessageExporter = ();
306309
type UniversalAliases = Nothing;
307310
type CallDispatcher = WithOriginFilter<SafeCallFilter>;

0 commit comments

Comments
 (0)