Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
svyatonik committed Nov 3, 2023
1 parent f8fd5c7 commit 1674ba7
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 10 deletions.
15 changes: 13 additions & 2 deletions system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ pub use sp_runtime::BuildStorage;
// Polkadot imports
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use xcm::latest::BodyId;
use xcm::prelude::*;
use xcm_executor::XcmExecutor;

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

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -645,7 +656,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
>;
type ControllerOriginConverter = xcm_config::XcmOriginToTransactDispatchOrigin;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down
15 changes: 13 additions & 2 deletions system-parachains/asset-hubs/asset-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ pub use sp_runtime::BuildStorage;
// Polkadot imports
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use xcm::latest::BodyId;
use xcm::prelude::*;
use xcm_executor::XcmExecutor;

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

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type RuntimeEvent = RuntimeEvent;
Expand All @@ -581,7 +592,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
EnsureXcm<IsVoiceOfBody<FellowshipLocation, FellowsBodyId>>,
>;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down
15 changes: 13 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-kusama/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ use parachains_common::{
};

// XCM Imports
use xcm::latest::prelude::BodyId;
use xcm::prelude::*;
use xcm_executor::XcmExecutor;

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

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

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -339,7 +350,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOrigin = RootOrFellows;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down
15 changes: 13 additions & 2 deletions system-parachains/bridge-hubs/bridge-hub-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ use parachains_common::{
HOURS, MAXIMUM_BLOCK_WEIGHT, NORMAL_DISPATCH_RATIO, SLOT_DURATION,
};
// XCM Imports
use xcm::latest::prelude::BodyId;
use xcm::prelude::*;
use xcm_executor::XcmExecutor;

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

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

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -314,7 +325,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOrigin = RootOrFellows;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down
18 changes: 16 additions & 2 deletions system-parachains/collectives/collectives-polkadot/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ pub use sp_runtime::BuildStorage;
// Polkadot imports
use pallet_xcm::{EnsureXcm, IsVoiceOfBody};
use polkadot_runtime_common::{BlockHashCount, SlowAdjustingFeeUpdate};
use xcm::latest::BodyId;
use xcm::prelude::*;
use xcm_executor::XcmExecutor;

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

impl cumulus_pallet_aura_ext::Config for Runtime {}

parameter_types! {
/// The asset ID for the asset that we use to pay for message delivery fees.
pub FeeAssetId: AssetId = Concrete(xcm_config::DotLocation::get());
/// The base fee for the message delivery fees.
pub const BaseDeliveryFee: u128 = CENTS.saturating_mul(3); // TODO: proper price
}

pub type PriceForSiblingParachainDelivery = polkadot_runtime_common::xcm_sender::ExponentialPrice<
FeeAssetId,
BaseDeliveryFee,
TransactionByteFee,
XcmpQueue,
>;

impl cumulus_pallet_xcmp_queue::Config for Runtime {
type RuntimeEvent = RuntimeEvent;
type XcmExecutor = XcmExecutor<XcmConfig>;
Expand All @@ -391,7 +405,7 @@ impl cumulus_pallet_xcmp_queue::Config for Runtime {
type ControllerOrigin = EitherOfDiverse<EnsureRoot<AccountId>, Fellows>;
type ControllerOriginConverter = XcmOriginToTransactDispatchOrigin;
type WeightInfo = weights::cumulus_pallet_xcmp_queue::WeightInfo<Runtime>;
type PriceForSiblingDelivery = ();
type PriceForSiblingDelivery = PriceForSiblingParachainDelivery;
}

impl cumulus_pallet_dmp_queue::Config for Runtime {
Expand Down

0 comments on commit 1674ba7

Please sign in to comment.