Skip to content

Commit

Permalink
Add impl
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreiEres committed Jun 11, 2024
1 parent 6e8109e commit e3838f2
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions polkadot/node/subsystem-test-helpers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,26 @@ where
OutgoingMessage: Send + 'static,
{
async fn send_message(&mut self, msg: OutgoingMessage) {
self.send_message_with_priority::<overseer::gen::NormalPriority>(msg).await;
}

async fn send_message_with_priority<P: overseer::gen::Priority>(
&mut self,
msg: OutgoingMessage,
) {
self.tx.send(msg.into()).await.expect("test overseer no longer live");
}

fn try_send_message(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>> {
self.try_send_message_with_priority::<overseer::gen::NormalPriority>(msg)
}

fn try_send_message_with_priority<P: overseer::gen::Priority>(
&mut self,
msg: OutgoingMessage,
) -> Result<(), TrySendError<OutgoingMessage>> {
self.tx.unbounded_send(msg.into()).expect("test overseer no longer live");
Ok(())
Expand Down

0 comments on commit e3838f2

Please sign in to comment.