From d28ea7ecf8c01a1fbbb983aefa693755c253a4a0 Mon Sep 17 00:00:00 2001 From: Alexander Popiak Date: Wed, 24 Nov 2021 21:15:47 +0100 Subject: [PATCH] Backport Fix use of weight limit errors (#791) (#795) * Fix use of weight limit errors (#791) * cargo +nightly fmt Co-authored-by: Gavin Wood --- pallets/xcmp-queue/src/lib.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pallets/xcmp-queue/src/lib.rs b/pallets/xcmp-queue/src/lib.rs index 378bfe383e0..4ef989dae43 100644 --- a/pallets/xcmp-queue/src/lib.rs +++ b/pallets/xcmp-queue/src/lib.rs @@ -382,7 +382,9 @@ impl Pallet { let weight = max_weight - weight_used; match Self::handle_xcm_message(sender, sent_at, xcm, weight) { Ok(used) => weight_used = weight_used.saturating_add(used), - Err(XcmError::TooMuchWeightRequired) => { + Err(XcmError::WeightLimitReached(required)) + if required <= max_weight => + { // That message didn't get processed this time because of being // too heavy. We leave it around for next time and bail. remaining_fragments = last_remaining_fragments;