Skip to content

Commit

Permalink
Create a README for XCMv2 detailing notable changes (paritytech#4059)
Browse files Browse the repository at this point in the history
* Create a README for XCMv2 detailing notable changes

* Typo

* Appease spellcheck and cargo fmt

* Add XCM pallet item to be aware of

* cargo fmt

* Remove all XCM README.md
  • Loading branch information
KiChjang authored and Wizdave97 committed Feb 3, 2022
1 parent 97ec5c5 commit c9184a6
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 26 deletions.
25 changes: 0 additions & 25 deletions xcm/src/v1/README.md

This file was deleted.

36 changes: 35 additions & 1 deletion xcm/src/v2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,41 @@
// You should have received a copy of the GNU General Public License
// along with Cumulus. If not, see <http://www.gnu.org/licenses/>.

//! Version 1 of the Cross-Consensus Message format data structures.
//! # 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](https://github.com/paritytech/polkadot/pull/3629#issue-968428279).
//!
//! ## 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` and `Order` variants are now combined under a single `Instruction` enum.
//! - `Order` is now obsolete and replaced entirely by `Instruction`.
//! - `Xcm` is now a simple wrapper around a `Vec<Instruction>`.
//! - During conversion from `Order` to `Instruction`, we do not handle `BuyExecution`s that have
//! nested XCMs, i.e. if the `instructions` field in the `BuyExecution` enum struct variant is
//! not empty, then the conversion will fail. To address this, rewrite the XCM using
//! `Instruction`s in chronological order.
//! - During conversion from `Xcm` to `Instruction`, we do not handle `RelayedFrom` messages at
//! all.
//!
//! ### XCM Pallet
//! - The `Weigher` configuration item must have sensible weights defined for `BuyExecution` and
//! `DepositAsset` instructions. Failing that, dispatch calls to `teleport_assets` and
//! `reserve_transfer_assets` will fail with `UnweighableMessage`.

use super::v1::{Order as OldOrder, Response as OldResponse, Xcm as OldXcm};
use crate::{DoubleEncoded, GetWeight};
Expand Down

0 comments on commit c9184a6

Please sign in to comment.