mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 05:51:02 +00:00
XCM v1 (#2815)
* MultiAsset TWO * Draft next MultiAsset API. * XCM core builds * XCM Executor builds * XCM Builder builds * API changes making their way throughout * Some TODOs * Further build fixes * Basic compile builds * First test fixed * All executor tests fixed * Typo * Optimize subsume_assets and add test * Optimize checked_sub * XCM Builder first test fixed * Fix builder tests * Fix doc test * fix some doc tests * spelling * named fields for AllOf * Update xcm/src/v0/multiasset.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update xcm/src/v0/multiasset.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update xcm/src/v0/multiasset.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Update xcm/src/v0/multiasset.rs Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> * Reformat * Move to XCM version 1 * Spelling * warnings * Replace some more v0->v1s * warnings * format * Add max_assets param * building * test fixes * tests * another test * final test * tests * Rename Null -> Here * Introduce * More ergonomics * More ergonomics * test fix * test fixes * docs * BuyExecution includes * Fix XCM extrinsics * fmt * Make Vec<MultiAsset>/MultiAssets conversions safe * More MultiAssets conversion safety * spelling * fix doc test * Apply suggestions from code review Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Apply suggestions from code review Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * fmt * Add v0, remove VersionedMultiAsset * Remove VersionedMultiLocation * Update xcm/src/v1/order.rs Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * Update xcm/src/v1/mod.rs Co-authored-by: Amar Singh <asinghchrony@protonmail.com> * XCM v0 backwards compatibility * Full compatibility * fmt * Update xcm/pallet-xcm/src/lib.rs * Update xcm/src/v0/order.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Tweaks to versioning system * Fixes * fmt * Update xcm/xcm-executor/src/assets.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update xcm/xcm-executor/src/assets.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Grumbles * Update xcm/src/v1/multiasset.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * fmt * Update xcm/src/v1/multiasset.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Update xcm/src/v1/multiasset.rs Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com> * Fixes * Formatting Co-authored-by: Alexander Popiak <alexander.popiak@parity.io> Co-authored-by: Amar Singh <asinghchrony@protonmail.com> Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
This commit is contained in:
@@ -22,7 +22,7 @@ use frame_support::pallet_prelude::*;
|
||||
use primitives::v1::{DownwardMessage, Hash, Id as ParaId, InboundDownwardMessage};
|
||||
use sp_runtime::traits::{BlakeTwo256, Hash as HashT, SaturatedConversion};
|
||||
use sp_std::{fmt, prelude::*};
|
||||
use xcm::v0::Error as XcmError;
|
||||
use xcm::latest::Error as XcmError;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
|
||||
@@ -1007,7 +1007,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
let notification_bytes = {
|
||||
use parity_scale_codec::Encode as _;
|
||||
use xcm::opaque::{v0::Xcm, VersionedXcm};
|
||||
use xcm::opaque::{v1::Xcm, VersionedXcm};
|
||||
|
||||
VersionedXcm::from(Xcm::HrmpNewChannelOpenRequest {
|
||||
sender: u32::from(origin),
|
||||
@@ -1066,7 +1066,7 @@ impl<T: Config> Pallet<T> {
|
||||
|
||||
let notification_bytes = {
|
||||
use parity_scale_codec::Encode as _;
|
||||
use xcm::opaque::{v0::Xcm, VersionedXcm};
|
||||
use xcm::opaque::{v1::Xcm, VersionedXcm};
|
||||
|
||||
VersionedXcm::from(Xcm::HrmpChannelAccepted { recipient: u32::from(origin) }).encode()
|
||||
};
|
||||
@@ -1106,7 +1106,7 @@ impl<T: Config> Pallet<T> {
|
||||
let config = <configuration::Pallet<T>>::config();
|
||||
let notification_bytes = {
|
||||
use parity_scale_codec::Encode as _;
|
||||
use xcm::opaque::{v0::Xcm, VersionedXcm};
|
||||
use xcm::opaque::{v1::Xcm, VersionedXcm};
|
||||
|
||||
VersionedXcm::from(Xcm::HrmpChannelClosing {
|
||||
initiator: u32::from(origin),
|
||||
|
||||
@@ -27,7 +27,7 @@ use sp_std::{
|
||||
marker::PhantomData,
|
||||
prelude::*,
|
||||
};
|
||||
use xcm::v0::Outcome;
|
||||
use xcm::latest::Outcome;
|
||||
|
||||
pub use pallet::*;
|
||||
|
||||
@@ -78,14 +78,14 @@ pub type MessageId = [u8; 32];
|
||||
/// and will be forwarded to the XCM Executor.
|
||||
pub struct XcmSink<XcmExecutor, Config>(PhantomData<(XcmExecutor, Config)>);
|
||||
|
||||
impl<XcmExecutor: xcm::v0::ExecuteXcm<C::Call>, C: Config> UmpSink for XcmSink<XcmExecutor, C> {
|
||||
impl<XcmExecutor: xcm::latest::ExecuteXcm<C::Call>, C: Config> UmpSink for XcmSink<XcmExecutor, C> {
|
||||
fn process_upward_message(
|
||||
origin: ParaId,
|
||||
data: &[u8],
|
||||
max_weight: Weight,
|
||||
) -> Result<Weight, (MessageId, Weight)> {
|
||||
use xcm::{
|
||||
v0::{Error as XcmError, Junction, MultiLocation, Xcm},
|
||||
latest::{Error as XcmError, Junction, MultiLocation, Xcm},
|
||||
VersionedXcm,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user