enable event_process for BehaviourEvent
@@ -23,7 +23,7 @@ use tokio::task;
/// Behaviour type.
#[derive(libp2p::NetworkBehaviour)]
-#[behaviour(out_event = "BehaviourEvent")]
+#[behaviour(out_event = "BehaviourEvent", event_process = true)]
pub struct Behaviour<Types: IpfsTypes> {
#[behaviour(ignore)]
repo: Arc<Repo<Types>>,
@@ -467,6 +467,12 @@ impl<Types: IpfsTypes> NetworkBehaviourEventProcess<IdentifyEvent> for Behaviour
}
}
+impl<Types: IpfsTypes> NetworkBehaviourEventProcess<FloodsubEvent> for Behaviour<Types> {
+ fn inject_event(&mut self, event: FloodsubEvent) {
+ trace!("floodsub: {:?}", event);
+ }
+}
+
impl<Types: IpfsTypes> Behaviour<Types> {
/// Create a Kademlia behaviour with the IPFS bootstrap nodes.
pub async fn new(options: SwarmOptions, repo: Arc<Repo<Types>>) -> Self {
