From 3a225f2433e8eb544dc9872cf1dad14c1432e059 Mon Sep 17 00:00:00 2001 From: ron Date: Sat, 28 Dec 2024 18:41:43 +0800 Subject: [PATCH] Global topic ID across multiple chains --- runtime/hydradx/src/xcm.rs | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/runtime/hydradx/src/xcm.rs b/runtime/hydradx/src/xcm.rs index 2bbadaea1..b5bdee2bc 100644 --- a/runtime/hydradx/src/xcm.rs +++ b/runtime/hydradx/src/xcm.rs @@ -32,7 +32,8 @@ use xcm_builder::{ AccountId32Aliases, AllowKnownQueryResponses, AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, DescribeAllTerminal, DescribeFamily, EnsureXcmOrigin, FixedWeightBounds, HashedDescription, ParentIsPreset, RelayChainAsNative, SiblingParachainAsNative, SiblingParachainConvertsVia, SignedAccountId32AsNative, - SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, WithComputedOrigin, + SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId, WithComputedOrigin, + WithUniqueTopic, }; use xcm_executor::{Config, XcmExecutor}; @@ -62,7 +63,7 @@ impl TryFrom for AssetLocation { pub type LocalOriginToLocation = SignedToAccountId32; -pub type Barrier = ( +pub type Barrier = TrailingSetTopicAsId<( TakeWeightCredit, // Expected responses are OK. AllowKnownQueryResponses, @@ -76,7 +77,7 @@ pub type Barrier = ( UniversalLocation, ConstU32<8>, >, -); +)>; parameter_types! { pub const RelayOrigin: AggregateMessageOrigin = AggregateMessageOrigin::Parent; @@ -401,12 +402,12 @@ impl Convert for AccountIdToMultiLocation { /// 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, // ..and XCMP to communicate with the sibling chains. XcmpQueue, -); +)>; /// Type for specifying how a `MultiLocation` can be converted into an `AccountId`. This is used /// when determining ownership of accounts for asset transacting and when attempting to use XCM