Skip to content

Commit

Permalink
fix blocking call filters (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
salman01zp authored Mar 20, 2024
1 parent 761e04b commit 7389279
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
7 changes: 4 additions & 3 deletions runtime/mainnet/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ impl Contains<RuntimeCall> for MainnetCallFilter {
return true;
}

let is_paused = <pallet_tx_pause::Pallet<Runtime> as Contains<RuntimeCall>>::contains(call);
if is_paused {
// no paused call
let is_allowed_to_dispatch =
<pallet_tx_pause::Pallet<Runtime> as Contains<RuntimeCall>>::contains(call);
if !is_allowed_to_dispatch {
// tx is paused and not allowed to dispatch.
return false;
}

Expand Down
7 changes: 4 additions & 3 deletions runtime/testnet/src/filters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,10 @@ impl Contains<RuntimeCall> for TestnetCallFilter {
return true;
}

let is_paused = <pallet_tx_pause::Pallet<Runtime> as Contains<RuntimeCall>>::contains(call);
if is_paused {
// no paused call
let is_allowed_to_dispatch =
<pallet_tx_pause::Pallet<Runtime> as Contains<RuntimeCall>>::contains(call);
if !is_allowed_to_dispatch {
// tx is paused and not allowed to dispatch.
return false;
}

Expand Down

0 comments on commit 7389279

Please sign in to comment.