Expand description
XCM Version 1
Version 1 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
Most changes should automatically be resolved via the conversion traits (i.e. TryFrom
and
From
). The list here is mostly for incompatible changes that result in an Err(())
when
attempting to convert XCM objects from v0.
Junction
v0::Junction::Parent
cannot be converted to v1, because the way we represent parents in v1 has changed - instead of being a property of the junction, v1MultiLocation
s now have an extra field representing the number of parents that theMultiLocation
contains.
MultiLocation
- The
try_from
conversion method will always canonicalize the v0MultiLocation
before attempting to do the proper conversion. Since canonicalization is not a fallible operation, we do not expect v0MultiLocation
to ever fail to be upgraded to v1.
MultiAsset
- Stronger typing to differentiate between a single class of
MultiAsset
and several classes ofMultiAssets
is introduced. As the name suggests, aVec<MultiAsset>
that is used on all APIs will instead be using a new type calledMultiAssets
(note thes
). - All
MultiAsset
variants whose name contains “All” in it, namelyv0::MultiAsset::All
,v0::MultiAsset::AllFungible
,v0::MultiAsset::AllNonFungible
,v0::MultiAsset::AllAbstractFungible
,v0::MultiAsset::AllAbstractNonFungible
,v0::MultiAsset::AllConcreteFungible
andv0::MultiAsset::AllConcreteNonFungible
, will fail to convert to v1MultiAsset
, since v1 does not contain these variants. - Similarly, all
MultiAsset
variants whose name contains “All” in it can be converted into aWildMultiAsset
. v0::MultiAsset::None
is not represented at all in v1.
XCM
- No special attention necessary
Order
v1::Order::DepositAsset
andv1::Order::DepositReserveAsset
both introduced a newmax_asset
field that limits the maximum classes of assets that can be deposited. During conversion from v0, themax_asset
field defaults to 1.- v1 Orders that contain
MultiAsset
as argument(s) will need to explicitly specify the amount and details of assets. This is to prevent accidental misuse ofAll
to possibly transfer, spend or otherwise perform unintended operations onAll
assets. - v1 Orders that do allow the notion of
All
to be used as wildcards, will instead use a new type calledMultiAssetFilter
.
Re-exports
pub use super::v0::OriginKind;
Modules
Structs
A unit struct which can be converted into a
MultiLocation
of the inner parents
value.A unit struct which can be converted into a
MultiLocation
of the inner parents
value and the inner interior.A
Vec
of MultiAsset
s. There may be no duplicate fungible items in here and when decoding, they must be sorted.A relative path between state-bearing consensus systems.
A unit struct which can be converted into a
MultiLocation
of parents
value 1.A tuple struct which can be converted into a
MultiLocation
of parents
value 1 with the inner interior.Enums
Classification of an asset being concrete or abstract.
A general identifier for an instance of a non-fungible asset class.
An identifier of a pluralistic body.
A part of a pluralistic body.
Classification of whether an asset is fungible or not, along with a mandatory amount or instance.
A single item in a path to describe the relative location of a consensus system.
Non-parent junctions that can be constructed, up to the length of 8. This specific
Junctions
implementation uses a Rust enum
in order to make pattern matching easier.MultiAsset
collection, either MultiAssets
or a single wildcard.A global identifier of an account-bearing consensus system.
An instruction to be executed on some or all of the assets in holding, used by asset-related XCM messages.
Outcome of an XCM execution.
Response data to a query.
Classification of whether an asset is fungible or not.
A wildcard representing a set of assets.
Cross-Consensus Message: A message from one consensus system to another.
Traits
Type of XCM message executor.
Utility for sending an XCM message.
Type Definitions
A relative location which is constrained to be an interior location of the context.