Fix xcmp message processing condition. (#510)

* Fix xcmp message processing condition.

* add a very simple test

* Update Cargo.lock

* remove comment

* remove comment

Co-authored-by: Shawn Tabrizi <shawntabrizi@gmail.com>
Co-authored-by: Alexander Popiak <alexander.popiak@gmail.com>
This commit is contained in:
Shaun Wang
2021-07-07 02:35:59 +12:00
committed by GitHub
parent 9b85b5117e
commit 0966c8a4c3
5 changed files with 221 additions and 2 deletions
+8 -2
View File
@@ -25,6 +25,12 @@
#![cfg_attr(not(feature = "std"), no_std)]
#[cfg(test)]
mod mock;
#[cfg(test)]
mod tests;
use codec::{Decode, Encode};
use cumulus_primitives_core::{
relay_chain::BlockNumber as RelayBlockNumber, ChannelStatus, GetChannelInfo, MessageSendError,
@@ -203,7 +209,7 @@ pub enum ChannelSignal {
}
/// The aggregate XCMP message format.
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode)]
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Encode, Decode, RuntimeDebug)]
pub enum XcmpMessageFormat {
/// Encoded `VersionedXcm` messages, all concatenated.
ConcatenatedVersionedXcm,
@@ -552,7 +558,7 @@ impl<T: Config> Pallet<T> {
// If there are more and we're making progress, we process them after we've given the
// other channels a look in. If we've still not unlocked all weight, then we set them
// up for processing a second time anyway.
if !status[index].2.is_empty() && weight_processed > 0 || weight_available != max_weight
if !status[index].2.is_empty() && (weight_processed > 0 || weight_available != max_weight)
{
if shuffle_index + 1 == shuffled.len() {
// Only this queue left. Just run around this loop once more.