Skip to content

Commit

Permalink
fix: remove unused derive
Browse files Browse the repository at this point in the history
Signed-off-by: Simon Paitrault <[email protected]>
  • Loading branch information
Freyskeyd committed Mar 25, 2024
1 parent 226da89 commit 6b0aeaa
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 2 deletions.
1 change: 0 additions & 1 deletion crates/topos-p2p/src/behaviour/grpc/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use tonic::transport::Channel;

use super::{OutboundError, RequestId};

#[allow(unused)]
#[derive(Debug)]
pub enum Event {
OutboundFailure {
Expand Down
44 changes: 43 additions & 1 deletion crates/topos-p2p/src/runtime/handle_event/grpc.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,52 @@
use tracing::debug;

use crate::{behaviour::grpc, Runtime};

use super::{EventHandler, EventResult};

#[async_trait::async_trait]
impl EventHandler<grpc::Event> for Runtime {
async fn handle(&mut self, _event: grpc::Event) -> EventResult {
async fn handle(&mut self, event: grpc::Event) -> EventResult {
match event {
grpc::Event::OutboundFailure {
peer_id,
request_id,
error,
} => {
debug!(
"Outbound connection failure to peer {} for request {}: {}",
peer_id, request_id, error
);
}
grpc::Event::OutboundSuccess {
peer_id,
request_id,
..
} => {
debug!(
"Outbound connection success to peer {} for request {}",
peer_id, request_id
);
}
grpc::Event::InboundNegotiatedConnection {
request_id,
connection_id,
} => {
debug!(
"Inbound connection negotiated for request {} with connection {}",
request_id, connection_id
);
}
grpc::Event::OutboundNegotiatedConnection {
peer_id,
request_id,
} => {
debug!(
"Outbound connection negotiated to peer {} for request {}",
peer_id, request_id
);
}
}
Ok(())
}
}

0 comments on commit 6b0aeaa

Please sign in to comment.