Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
KiChjang committed Sep 6, 2022
1 parent c2d9753 commit 4c3015e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pallets/dmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ pub mod pallet {
Err((message_id, required_weight)) =>
// Too much weight required right now.
{
if required_weight > config.max_individual {
if required_weight.any_gt(config.max_individual) {
// overweight - add to overweight queue and continue with
// message execution.
let overweight_index = page_index.overweight_count;
Expand Down
6 changes: 3 additions & 3 deletions pallets/xcmp-queue/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -808,7 +808,7 @@ impl<T: Config> Pallet<T> {

let mut shuffle_index = 0;
while shuffle_index < shuffled.len() &&
max_weight.saturating_sub(weight_used) >= threshold_weight
max_weight.saturating_sub(weight_used).all_gte(threshold_weight)
{
let index = shuffled[shuffle_index];
let sender = status[index].sender;
Expand All @@ -831,7 +831,7 @@ impl<T: Config> Pallet<T> {
if shuffle_index < status.len() {
weight_available +=
(max_weight - weight_available) / (weight_restrict_decay.ref_time() + 1);
if weight_available + threshold_weight > max_weight {
if (weight_available + threshold_weight).all_gt(max_weight) {
weight_available = max_weight;
}
} else {
Expand Down Expand Up @@ -871,7 +871,7 @@ impl<T: Config> Pallet<T> {
// 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].message_metadata.is_empty() &&
(weight_processed > Weight::zero() || weight_available != max_weight)
(weight_processed.all_gt(Weight::zero()) || weight_available != max_weight)
{
if shuffle_index + 1 == shuffled.len() {
// Only this queue left. Just run around this loop once more.
Expand Down

0 comments on commit 4c3015e

Please sign in to comment.