Skip to content

Commit 1674ba7

Browse files
committed
1 parent f8fd5c7 commit 1674ba7

File tree

5 files changed

+68
-10
lines changed
  • system-parachains
    • asset-hubs
    • bridge-hubs
    • collectives/collectives-polkadot/src

5 files changed

+68
-10
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ pub use sp_runtime::BuildStorage;
8787
// Polkadot imports
8888
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
8989
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
90-
use xcm::latest::BodyId;
90+
use xcm::prelude::*;
9191
use xcm_executor::XcmExecutor;
9292

9393
use crate::xcm_config::{
@@ -631,8 +631,19 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
631631
parameter_types! {
632632
// Fellows pluralistic body.
633633
pub const FellowsBodyId: BodyId = BodyId::Technical;
634+
/// The asset ID for the asset that we use to pay for message delivery fees.
635+
pub FeeAssetId: AssetId = Concrete(xcm_config::KsmLocation::get());
636+
/// The base fee for the message delivery fees.
637+
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
634638
}
635639

640+
pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
641+
FeeAssetId,
642+
BaseDeliveryFee,
643+
TransactionByteFee,
644+
XcmpQueue,
645+
>;
646+
636647
impl cumulus_pallet_xcmp_queue::Config for Runtime {
637648
type RuntimeEvent = RuntimeEvent;
638649
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -645,7 +656,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
645656
>;
646657
type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin;
647658
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
648-
type PriceForSiblingDelivery = ();
659+
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
649660
}
650661

651662
impl cumulus_pallet_dmp_queue::Config for Runtime {

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ pub use sp_runtime::BuildStorage;
117117
// Polkadot imports
118118
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
119119
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
120-
use xcm::latest::BodyId;
120+
use xcm::prelude::*;
121121
use xcm_executor::XcmExecutor;
122122

123123
use crate::xcm_config::ForeignCreatorsSovereignAccountOf;
@@ -567,8 +567,19 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
567567
parameter_types! {
568568
// Fellows pluralistic body.
569569
pub const FellowsBodyId: BodyId = BodyId::Technical;
570+
/// The asset ID for the asset that we use to pay for message delivery fees.
571+
pub FeeAssetId: AssetId = Concrete(xcm_config::DotLocation::get());
572+
/// The base fee for the message delivery fees.
573+
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
570574
}
571575

576+
pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
577+
FeeAssetId,
578+
BaseDeliveryFee,
579+
TransactionByteFee,
580+
XcmpQueue,
581+
>;
582+
572583
impl cumulus_pallet_xcmp_queue::Config for Runtime {
573584
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
574585
type RuntimeEvent = RuntimeEvent;
@@ -581,7 +592,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
581592
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
582593
>;
583594
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
584-
type PriceForSiblingDelivery = ();
595+
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
585596
}
586597

587598
impl cumulus_pallet_dmp_queue::Config for Runtime {

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ use parachains_common::{
7474
};
7575

7676
// XCM Imports
77-
use xcm::latest::prelude::BodyId;
77+
use xcm::prelude::*;
7878
use xcm_executor::XcmExecutor;
7979

8080
/// The address format for describing accounts.
@@ -322,6 +322,10 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
322322
parameter_types! {
323323
// Fellows pluralistic body.
324324
pub const FellowsBodyId: BodyId = BodyId::Technical;
325+
/// The asset ID for the asset that we use to pay for message delivery fees.
326+
pub FeeAssetId: AssetId = Concrete(xcm_config::KsmRelayLocation::get());
327+
/// The base fee for the message delivery fees.
328+
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
325329
}
326330

327331
/// Privileged origin that represents Root or Fellows pluralistic body.
@@ -330,6 +334,13 @@ pub type RootOrFellows = EitherOfDiverse<
330334
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
331335
>;
332336

337+
pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
338+
FeeAssetId,
339+
BaseDeliveryFee,
340+
TransactionByteFee,
341+
XcmpQueue,
342+
>;
343+
333344
impl cumulus_pallet_xcmp_queue::Config for Runtime {
334345
type RuntimeEvent = RuntimeEvent;
335346
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -339,7 +350,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
339350
type ControllerOrigin = RootOrFellows;
340351
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
341352
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
342-
type PriceForSiblingDelivery = ();
353+
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
343354
}
344355

345356
impl cumulus_pallet_dmp_queue::Config for Runtime {

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ use parachains_common::{
7474
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
7575
};
7676
// XCM Imports
77-
use xcm::latest::prelude::BodyId;
77+
use xcm::prelude::*;
7878
use xcm_executor::XcmExecutor;
7979

8080
/// The address format for describing accounts.
@@ -297,6 +297,10 @@ impl cumulus_pallet_aura_ext::Config for Runtime {}
297297
parameter_types! {
298298
// Fellows pluralistic body.
299299
pub const FellowsBodyId: BodyId = BodyId::Technical;
300+
/// The asset ID for the asset that we use to pay for message delivery fees.
301+
pub FeeAssetId: AssetId = Concrete(xcm_config::DotRelayLocation::get());
302+
/// The base fee for the message delivery fees.
303+
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
300304
}
301305

302306
/// Privileged origin that represents Root or Fellows.
@@ -305,6 +309,13 @@ pub type RootOrFellows = EitherOfDiverse<
305309
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
306310
>;
307311

312+
pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
313+
FeeAssetId,
314+
BaseDeliveryFee,
315+
TransactionByteFee,
316+
XcmpQueue,
317+
>;
318+
308319
impl cumulus_pallet_xcmp_queue::Config for Runtime {
309320
type RuntimeEvent = RuntimeEvent;
310321
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -314,7 +325,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
314325
type ControllerOrigin = RootOrFellows;
315326
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
316327
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
317-
type PriceForSiblingDelivery = ();
328+
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
318329
}
319330

320331
impl cumulus_pallet_dmp_queue::Config for Runtime {

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

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub use sp_runtime::BuildStorage;
9292
// Polkadot imports
9393
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
9494
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
95-
use xcm::latest::BodyId;
95+
use xcm::prelude::*;
9696
use xcm_executor::XcmExecutor;
9797

9898
use weights::{BlockExecutionWeight, ExtrinsicBaseWeight, RocksDbWeight};
@@ -382,6 +382,20 @@ impl parachain_info::Config for Runtime {}
382382

383383
impl cumulus_pallet_aura_ext::Config for Runtime {}
384384

385+
parameter_types! {
386+
/// The asset ID for the asset that we use to pay for message delivery fees.
387+
pub FeeAssetId: AssetId = Concrete(xcm_config::DotLocation::get());
388+
/// The base fee for the message delivery fees.
389+
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
390+
}
391+
392+
pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
393+
FeeAssetId,
394+
BaseDeliveryFee,
395+
TransactionByteFee,
396+
XcmpQueue,
397+
>;
398+
385399
impl cumulus_pallet_xcmp_queue::Config for Runtime {
386400
type RuntimeEvent = RuntimeEvent;
387401
type XcmExecutor = XcmExecutor<XcmConfig>;
@@ -391,7 +405,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
391405
type ControllerOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Fellows>;
392406
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
393407
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
394-
type PriceForSiblingDelivery = ();
408+
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
395409
}
396410

397411
impl cumulus_pallet_dmp_queue::Config for Runtime {

0 commit comments

Comments
 (0)