From e3d1f4fd91a5f077fda8a1976e194c378ee166d0 Mon Sep 17 00:00:00 2001 From: hozan23 Date: Mon, 24 Jun 2024 13:25:39 +0200 Subject: p2p/monitor: use struct instead of enum for monitor events --- p2p/src/discovery/lookup.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'p2p/src/discovery/lookup.rs') diff --git a/p2p/src/discovery/lookup.rs b/p2p/src/discovery/lookup.rs index 677bad7..a941986 100644 --- a/p2p/src/discovery/lookup.rs +++ b/p2p/src/discovery/lookup.rs @@ -20,7 +20,7 @@ use crate::{ get_msg_payload, FindPeerMsg, NetMsg, NetMsgCmd, PeerMsg, PeersMsg, PingMsg, PongMsg, ShutdownMsg, }, - monitor::{ConnEvent, DiscoveryEvent, Monitor}, + monitor::{ConnEvent, DiscvEvent, Monitor}, routing_table::RoutingTable, slots::ConnectionSlots, version::version_match, @@ -131,7 +131,7 @@ impl LookupService { pub async fn start_lookup(&self, endpoint: &Endpoint, peer_id: Option) -> Result<()> { trace!("Lookup started {endpoint}"); self.monitor - .notify(DiscoveryEvent::LookupStarted(endpoint.clone())) + .notify(DiscvEvent::LookupStarted(endpoint.clone())) .await; let mut random_peers = vec![]; @@ -140,7 +140,7 @@ impl LookupService { .await { self.monitor - .notify(DiscoveryEvent::LookupFailed(endpoint.clone())) + .notify(DiscvEvent::LookupFailed(endpoint.clone())) .await; return Err(err); }; @@ -161,7 +161,7 @@ impl LookupService { } self.monitor - .notify(DiscoveryEvent::LookupSucceeded( + .notify(DiscvEvent::LookupSucceeded( endpoint.clone(), peer_buffer.len(), )) -- cgit v1.2.3