diff --git a/xcm/pallet-xcm/src/lib.rs b/xcm/pallet-xcm/src/lib.rs index 808c4210b040..2ba7e6a68b53 100644 --- a/xcm/pallet-xcm/src/lib.rs +++ b/xcm/pallet-xcm/src/lib.rs @@ -190,7 +190,6 @@ pub mod pallet { weight: 0, debt: dest_weight, halt_on_error: false, - orders: vec![], instructions: vec![], }, DepositAsset { assets: Wild(All), max_assets, beneficiary: *beneficiary }, @@ -259,7 +258,6 @@ pub mod pallet { weight: 0, debt: dest_weight, // covers this, `TransferReserveAsset` xcm, and `DepositAsset` order. halt_on_error: false, - orders: vec![], instructions: vec![], }, DepositAsset { assets: Wild(All), max_assets, beneficiary: *beneficiary }, diff --git a/xcm/pallet-xcm/src/mock.rs b/xcm/pallet-xcm/src/mock.rs index 4dd6537cc1d7..f99c84428319 100644 --- a/xcm/pallet-xcm/src/mock.rs +++ b/xcm/pallet-xcm/src/mock.rs @@ -198,7 +198,6 @@ pub(crate) fn buy_execution(fees: impl Into, debt: Weight) -> Ord weight: 0, debt, halt_on_error: false, - orders: vec![], instructions: vec![], } } diff --git a/xcm/src/v0/order.rs b/xcm/src/v0/order.rs index e51d89f521d7..e414cc27a6e2 100644 --- a/xcm/src/v0/order.rs +++ b/xcm/src/v0/order.rs @@ -194,10 +194,7 @@ impl TryFrom> for Order { }, Order1::QueryHolding { query_id, dest, assets } => QueryHolding { query_id, dest: dest.try_into()?, assets: assets.try_into()? }, - Order1::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => { - if !orders.is_empty() { - return Err(()) - } + Order1::BuyExecution { fees, weight, debt, halt_on_error, instructions } => { let xcm = instructions .into_iter() .map(Xcm::::try_from) diff --git a/xcm/src/v1/order.rs b/xcm/src/v1/order.rs index 3f54cd8ec790..8911c7f5ac13 100644 --- a/xcm/src/v1/order.rs +++ b/xcm/src/v1/order.rs @@ -19,7 +19,7 @@ use super::{ super::v0::Order as Order0, MultiAsset, MultiAssetFilter, MultiAssets, MultiLocation, Xcm, }; -use alloc::{vec, vec::Vec}; +use alloc::vec::Vec; use core::{ convert::{TryFrom, TryInto}, result, @@ -140,8 +140,6 @@ pub enum Order { /// any surrounding operations/orders. /// - `halt_on_error`: If `true`, the execution of the `orders` and `operations` will halt on the first failure. If /// `false`, then execution will continue regardless. - /// - `orders`: Orders to be executed with the existing Holding Register; execution of these orders happens PRIOR to - /// execution of the `operations`. The (shallow) weight for these must be paid for with the `weight` purchased. /// - `instructions`: XCM instructions to be executed outside of the context of the current Holding Register; /// execution of these instructions happens AFTER the execution of the `orders`. The (shallow) weight for these /// must be paid for with the `weight` purchased. @@ -152,7 +150,6 @@ pub enum Order { weight: u64, debt: u64, halt_on_error: bool, - orders: Vec>, instructions: Vec>, }, } @@ -179,10 +176,9 @@ impl Order { InitiateTeleport { assets, dest, effects } => InitiateTeleport { assets, dest, effects }, QueryHolding { query_id, dest, assets } => QueryHolding { query_id, dest, assets }, - BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => { - let orders = orders.into_iter().map(Order::from).collect(); + BuyExecution { fees, weight, debt, halt_on_error, instructions } => { let instructions = instructions.into_iter().map(Xcm::from).collect(); - BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } + BuyExecution { fees, weight, debt, halt_on_error, instructions } }, } } @@ -232,14 +228,7 @@ impl TryFrom> for Order { Order0::BuyExecution { fees, weight, debt, halt_on_error, xcm } => { let instructions = xcm.into_iter().map(Xcm::::try_from).collect::>()?; - BuyExecution { - fees: fees.try_into()?, - weight, - debt, - halt_on_error, - orders: vec![], - instructions, - } + BuyExecution { fees: fees.try_into()?, weight, debt, halt_on_error, instructions } }, }) } diff --git a/xcm/xcm-builder/src/tests.rs b/xcm/xcm-builder/src/tests.rs index 5ed3d3c49600..92c8592f2c99 100644 --- a/xcm/xcm-builder/src/tests.rs +++ b/xcm/xcm-builder/src/tests.rs @@ -51,7 +51,6 @@ fn weigher_should_work() { weight: 0, debt: 30, halt_on_error: true, - orders: vec![], instructions: vec![], }, Order::DepositAsset { assets: All.into(), max_assets: 1, beneficiary: Here.into() }, @@ -139,7 +138,6 @@ fn allow_paid_should_work() { weight: 0, debt: 20, halt_on_error: true, - orders: vec![], instructions: vec![], }, Order::DepositAsset { assets: All.into(), max_assets: 1, beneficiary: Here.into() }, @@ -164,7 +162,6 @@ fn allow_paid_should_work() { weight: 0, debt: 30, halt_on_error: true, - orders: vec![], instructions: vec![], }, Order::DepositAsset { assets: All.into(), max_assets: 1, beneficiary: Here.into() }, @@ -206,7 +203,6 @@ fn paying_reserve_deposit_should_work() { weight: 0, debt: 30, halt_on_error: true, - orders: vec![], instructions: vec![], }, Order::::DepositAsset { @@ -347,7 +343,6 @@ fn paid_transacting_should_refund_payment_for_unused_weight() { weight: 70, debt: 30, halt_on_error: true, - orders: vec![], instructions: vec![Xcm::::Transact { origin_type: OriginKind::Native, require_weight_at_most: 60, diff --git a/xcm/xcm-builder/src/weight.rs b/xcm/xcm-builder/src/weight.rs index 8f0d5b647258..515d7dbf22c4 100644 --- a/xcm/xcm-builder/src/weight.rs +++ b/xcm/xcm-builder/src/weight.rs @@ -80,18 +80,13 @@ impl, C: Decode + GetDispatchInfo> FixedWeightBounds { } fn deep_order(order: &mut Order) -> Result { Ok(match order { - Order::BuyExecution { orders, instructions, .. } => { + Order::BuyExecution { instructions, .. } => { let mut extra = 0; for instruction in instructions.iter_mut() { extra.saturating_accrue( Self::shallow(instruction)?.saturating_add(Self::deep(instruction)?), ); } - for order in orders.iter_mut() { - extra.saturating_accrue( - Self::shallow_order(order)?.saturating_add(Self::deep_order(order)?), - ); - } extra }, _ => 0, diff --git a/xcm/xcm-executor/integration-tests/src/lib.rs b/xcm/xcm-executor/integration-tests/src/lib.rs index 4b4c9d499525..66a997e11a62 100644 --- a/xcm/xcm-executor/integration-tests/src/lib.rs +++ b/xcm/xcm-executor/integration-tests/src/lib.rs @@ -46,7 +46,6 @@ fn execute_within_recursion_limit() { weight: 0, debt: 0, halt_on_error: true, - orders: vec![], // nest `msg` into itself on each iteration. instructions: vec![msg], }], @@ -101,7 +100,6 @@ fn exceed_recursion_limit() { weight: 0, debt: 0, halt_on_error: true, - orders: vec![], // nest `msg` into itself on each iteration. instructions: vec![msg], }], diff --git a/xcm/xcm-executor/src/lib.rs b/xcm/xcm-executor/src/lib.rs index 3306c303e261..e85e211a18d0 100644 --- a/xcm/xcm-executor/src/lib.rs +++ b/xcm/xcm-executor/src/lib.rs @@ -332,7 +332,7 @@ impl XcmExecutor { Xcm::QueryResponse { query_id, response: Response::Assets(assets) }, )?; }, - Order::BuyExecution { fees, weight, debt, halt_on_error, orders, instructions } => { + Order::BuyExecution { fees, weight, debt, halt_on_error, instructions } => { // pay for `weight` using up to `fees` of the holding register. let purchasing_weight = Weight::from(weight.checked_add(debt).ok_or(XcmError::Overflow)?); @@ -342,13 +342,6 @@ impl XcmExecutor { holding.subsume_assets(unspent); let mut remaining_weight = weight; - for order in orders.into_iter() { - match Self::execute_orders(origin, holding, order, trader, num_recursions + 1) { - Err(e) if halt_on_error => return Err(e), - Err(_) => {}, - Ok(surplus) => total_surplus += surplus, - } - } for instruction in instructions.into_iter() { match Self::do_execute_xcm( origin.clone(),