Skip to content

Commit

Permalink
add WithUniqueTopic wrapper to xcm router (#1602)
Browse files Browse the repository at this point in the history
  • Loading branch information
XY-Wang authored Jan 20, 2025
1 parent d844286 commit c42bc73
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
8 changes: 5 additions & 3 deletions runtime/bifrost-kusama/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ use pallet_xcm::XcmPassthrough;
use parachains_common::message_queue::{NarrowOriginToSibling, ParaIdToSibling};
use polkadot_runtime_common::xcm_sender::NoPriceForMessageDelivery;
use xcm::v4::{prelude::*, Location};
use xcm_builder::{FrameTransactionalProcessor, TrailingSetTopicAsId, WithComputedOrigin};
use xcm_builder::{
FrameTransactionalProcessor, TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic,
};

parameter_types! {
pub RelayChainOrigin: RuntimeOrigin = cumulus_pallet_xcm::Origin::Relay.into();
Expand Down Expand Up @@ -290,12 +292,12 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, K

/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
pub type XcmRouter = (
pub type XcmRouter = WithUniqueTopic<(
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
)>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
Expand Down
6 changes: 3 additions & 3 deletions runtime/bifrost-polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub use xcm_builder::{
};
use xcm_builder::{
DescribeAllTerminal, DescribeFamily, FrameTransactionalProcessor, HashedDescription,
TrailingSetTopicAsId, WithComputedOrigin,
TrailingSetTopicAsId, WithComputedOrigin, WithUniqueTopic,
};

parameter_types! {
Expand Down Expand Up @@ -289,12 +289,12 @@ pub type LocalOriginToLocation = SignedToAccountId32<RuntimeOrigin, AccountId, P

/// The means for routing XCM messages which are not for local execution into the right message
/// queues.
pub type XcmRouter = (
pub type XcmRouter = WithUniqueTopic<(
// Two routers - use UMP to communicate with the relay chain:
cumulus_primitives_utility::ParentAsUmp<ParachainSystem, PolkadotXcm, ()>,
// ..and XCMP to communicate with the sibling chains.
XcmpQueue,
);
)>;

#[cfg(feature = "runtime-benchmarks")]
parameter_types! {
Expand Down

0 comments on commit c42bc73

Please sign in to comment.