Expand description
XCM Version 2
Version 2 of the Cross-Consensus Message format data structures. The comprehensive list of changes can be found in this PR description.
Changes to be aware of
The biggest change here is the restructuring of XCM messages: instead of having Order
and
Xcm
types, the Xcm
type now simply wraps a Vec
containing Instruction
s. However, most
changes should still be automatically convertible via the try_from
and from
conversion
functions.
Junction
- No special attention necessary
MultiLocation
- No special attention necessary
MultiAsset
- No special attention necessary
XCM and Order
Xcm
andOrder
variants are now combined under a singleInstruction
enum.Order
is now obsolete and replaced entirely byInstruction
.Xcm
is now a simple wrapper around aVec<Instruction>
.- During conversion from
Order
toInstruction
, we do not handleBuyExecution
s that have nested XCMs, i.e. if theinstructions
field in theBuyExecution
enum struct variant is not empty, then the conversion will fail. To address this, rewrite the XCM usingInstruction
s in chronological order. - During conversion from
Xcm
toInstruction
, we do not handleRelayedFrom
messages at all.
XCM Pallet
- The
Weigher
configuration item must have sensible weights defined forBuyExecution
andDepositAsset
instructions. Failing that, dispatch calls toteleport_assets
andreserve_transfer_assets
will fail withUnweighableMessage
.
Re-exports
pub use super::v1::Ancestor;
pub use super::v1::AncestorThen;
pub use super::v1::AssetId;
pub use super::v1::AssetInstance;
pub use super::v1::BodyId;
pub use super::v1::BodyPart;
pub use super::v1::Fungibility;
pub use super::v1::InteriorMultiLocation;
pub use super::v1::Junction;
pub use super::v1::Junctions;
pub use super::v1::MultiAsset;
pub use super::v1::MultiAssetFilter;
pub use super::v1::MultiAssets;
pub use super::v1::MultiLocation;
pub use super::v1::NetworkId;
pub use super::v1::OriginKind;
pub use super::v1::Parent;
pub use super::v1::ParentThen;
pub use super::v1::WildFungibility;
pub use super::v1::WildMultiAsset;
Modules
- A prelude for importing all types typically used when interacting with XCM messages.
Structs
Enums
- Cross-Consensus Message: A message from one consensus system to another.
- Outcome of an XCM execution.
- Response data to a query.
- Error result value when attempting to send an XCM message.
- An optional weight limit.
Constants
- This module’s XCM version.
Traits
- Type of XCM message executor.
- Utility for sending an XCM message.
Type Definitions
- An identifier for a query.
- Result value when attempting to send an XCM message.
- Local weight type; execution time in picoseconds.