Skip to content

Commit

Permalink
[pallet-message-queue] Implement impl_trait_for_tuples for QueuePause…
Browse files Browse the repository at this point in the history
…dQuery (paritytech#2227)

These changes are required so that the bridgehub system runtimes can
more easily be configured with multiple message processors

Example usage:

```rust
use frame_support::traits::QueuePausedQuery;

impl pallet_message_queue::Config for Runtime {
    type QueuePausedQuery = (A, B, C)
}
  • Loading branch information
vgeddes authored Nov 10, 2023
1 parent 9561e8e commit ad302e7
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions substrate/frame/support/src/traits/messages.rs
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,14 @@ pub trait QueuePausedQuery<Origin> {
fn is_paused(origin: &Origin) -> bool;
}

impl<Origin> QueuePausedQuery<Origin> for () {
fn is_paused(_: &Origin) -> bool {
#[impl_trait_for_tuples::impl_for_tuples(8)]
impl<Origin> QueuePausedQuery<Origin> for Tuple {
fn is_paused(origin: &Origin) -> bool {
for_tuples!( #(
if Tuple::is_paused(origin) {
return true;
}
)* );
false
}
}

0 comments on commit ad302e7

Please sign in to comment.