Remove BuyExecution::orders (#3640)

* Remove BuyExecution::orders

* Fixes

* Fixes

* Fixes

* Formatting
This commit is contained in:
Gavin Wood
2021-08-16 12:51:56 +02:00
committed by GitHub
parent 1c039fda48
commit e16c8d9902
8 changed files with 7 additions and 43 deletions
-5
View File
@@ -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::<TestCall>::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::<TestCall>::Transact {
origin_type: OriginKind::Native,
require_weight_at_most: 60,
+1 -6
View File
@@ -80,18 +80,13 @@ impl<T: Get<Weight>, C: Decode + GetDispatchInfo> FixedWeightBounds<T, C> {
}
fn deep_order(order: &mut Order<C>) -> Result<Weight, ()> {
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,