Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Polkadot gets topic-based message IDs (#7301)
Browse files Browse the repository at this point in the history
* Polkadot gets topics

* Formatting

* Fixes

---------

Co-authored-by: Keith Yeung <kungfukeith11@gmail.com>
  • Loading branch information
gavofyork and KiChjang authored Aug 17, 2023
1 parent d74c60b commit eb7078c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
12 changes: 6 additions & 6 deletions runtime/polkadot/src/xcm_config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ use xcm_builder::{
AllowSubscriptionsFrom, AllowTopLevelPaidExecutionFrom, BackingToPlurality,
ChildParachainAsNative, ChildParachainConvertsVia, CurrencyAdapter as XcmCurrencyAdapter,
IsConcrete, MintLocation, OriginToPluralityVoice, SignedAccountId32AsNative,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, UsingComponents,
WeightInfoBounds, WithComputedOrigin,
SignedToAccountId32, SovereignSignedViaLocation, TakeWeightCredit, TrailingSetTopicAsId,
UsingComponents, WeightInfoBounds, WithComputedOrigin, WithUniqueTopic,
};
use xcm_executor::traits::WithOriginFilter;

Expand Down Expand Up @@ -120,14 +120,14 @@ parameter_types! {

/// The XCM router. When we want to send an XCM message, we use this type. It amalgamates all of our
/// individual routers.
pub type XcmRouter = (
pub type XcmRouter = WithUniqueTopic<(
// Only one router so far - use DMP to communicate with child parachains.
ChildParachainRouter<
Runtime,
XcmPallet,
ExponentialPrice<FeeAssetId, BaseDeliveryFee, TransactionByteFee, Dmp>,
>,
);
)>;

parameter_types! {
pub const Dot: MultiAssetFilter = Wild(AllOf { fun: WildFungible, id: Concrete(TokenLocation::get()) });
Expand All @@ -153,7 +153,7 @@ match_types! {
}

/// The barriers one of which must be passed for an XCM message to be executed.
pub type Barrier = (
pub type Barrier = TrailingSetTopicAsId<(
// Weight that is paid for may be consumed.
TakeWeightCredit,
// Expected responses are OK.
Expand All @@ -170,7 +170,7 @@ pub type Barrier = (
UniversalLocation,
ConstU32<8>,
>,
);
)>;

/// A call filter for the XCM Transact instruction. This is a temporary measure until we
/// properly account for proof size weights.
Expand Down
1 change: 1 addition & 0 deletions xcm/src/v3/junction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ pub enum Junction {
/// An instanced, indexed pallet that forms a constituent part of the context.
///
/// Generally used when the context is a Frame-based chain.
// TODO XCMv4 inner should be `Compact<u32>`.
PalletInstance(u8),
/// A non-descript index within the context location.
///
Expand Down

0 comments on commit eb7078c

Please sign in to comment.