mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-06 13:47:22 +00:00
769595eea5
* Create a README for XCMv1 detailing notable changes * Update xcm/src/v1/README.md Co-authored-by: Gavin Wood <gavin@parity.io> * Update xcm/src/v1/README.md Co-authored-by: David <dvdplm@gmail.com> * Update xcm/src/v1/README.md Co-authored-by: David <dvdplm@gmail.com> * Update xcm/src/v1/README.md Co-authored-by: David <dvdplm@gmail.com> * Update xcm/src/v1/README.md Co-authored-by: David <dvdplm@gmail.com> * Link to relevant PR for a full list of changes * Typo * Add notable changes to top-level XCM rustdoc * Appease spellchecker Co-authored-by: Gavin Wood <gavin@parity.io> Co-authored-by: David <dvdplm@gmail.com>
XCM Version 1
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::Parentcannot be converted to v1, because the way we represent parents in v1 has changed - instead of being a property of the junction, v1 MultiLocations now have an extra field representing the number of parents that the MultiLocation contains.
MultiLocation
- The
try_fromconversion method will always canonicalize the v0 MultiLocation before attempting to do the proper conversion. Since canonicalization is not a fallible operation, we do not expect v0 MultiLocation to ever fail to be upgraded to v1.
MultiAsset
- Stronger typing to differentiate between a single class of
MultiAssetand several classes ofMultiAssetsis introduced. As the name suggests, aVec<MultiAsset>that is used on all APIs will instead be using a new type calledMultiAssets(note thes). - All
MultiAssetvariants whose name contains "All" in it, namelyv0::MultiAsset::All,v0::MultiAsset::AllFungible,v0::MultiAsset::AllNonFungible,v0::MultiAsset::AllAbstractFungible,v0::MultiAsset::AllAbstractNonFungible,v0::MultiAsset::AllConcreteFungibleandv0::MultiAsset::AllConcreteNonFungible, will fail to convert to v1 MultiAsset, since v1 does not contain these variants. - Similarly, all
MultiAssetvariants whose name contains "All" in it can be converted into aWildMultiAsset. v0::MultiAsset::Noneis not represented at all in v1.
XCM
- No special attention necessary
Order
v1::Order::DepositAssetandv1::Order::DepositReserveAssetboth introduced a newmax_assetfield that limits the maximum classes of assets that can be deposited. During conversion from v0, themax_assetfield defaults to 1.- v1 Orders that contain
MultiAssetas argument(s) will need to explicitly specify the amount and details of assets. This is to prevent accidental misuse ofAllto possibly transfer, spend or otherwise perform unintended operations onAllassets. - v1 Orders that do allow the notion of
Allto be used as wildcards, will instead use a new type calledMultiAssetFilter.