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 e3838f2 commit 3c11f6a
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion polkadot/node/malus/src/interceptor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ where
<OutgoingMessage as TryFrom<overseer::AllMessages>>::Error: std::fmt::Debug,
{
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) {
let msg = <
<<Fil as MessageInterceptor<Sender>>::Message as overseer::AssociateOutgoing
>::OutgoingMessages as From<OutgoingMessage>>::from(msg);
Expand All @@ -103,7 +107,14 @@ where
}
}

fn try_send_message(&mut self, msg: OutgoingMessage) -> Result<(), TrySendError<OutgoingMessage>> {
fn try_send_message(
&mut self,
msg: OutgoingMessage,
) -> Result<(), polkadot_node_subsystem_util::metered::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>> {
let msg = <
<<Fil as MessageInterceptor<Sender>>::Message as overseer::AssociateOutgoing
>::OutgoingMessages as From<OutgoingMessage>>::from(msg);
Expand Down

0 comments on commit 3c11f6a

Please sign in to comment.