Skip to content

Commit

Permalink
remove dead variant
Browse files Browse the repository at this point in the history
  • Loading branch information
iduartgomez committed Jun 2, 2024
1 parent 883e06c commit 0a7bd58
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 9 deletions.
3 changes: 0 additions & 3 deletions crates/core/src/message.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,8 +304,6 @@ pub(crate) trait InnerMessage: Into<NetMessage> {
/// Internal node events emitted to the event loop.
#[derive(Debug, Clone)]
pub(crate) enum NodeEvent {
/// For unspecified reasons the node is gracefully shutting down.
ShutdownNode,
/// Drop the given peer connection.
DropConnection(PeerId),
// Try connecting to the given peer.
Expand All @@ -321,7 +319,6 @@ pub(crate) enum NodeEvent {
impl Display for NodeEvent {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
match self {
NodeEvent::ShutdownNode => f.write_str("ShutdownNode"),
NodeEvent::DropConnection(peer) => {
write!(f, "DropConnection (from {peer})")
}
Expand Down
4 changes: 0 additions & 4 deletions crates/core/src/node/network_bridge/p2p_protoc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,6 @@ impl P2pConnManager {
}
}
}
Ok(Right(NodeAction(NodeEvent::ShutdownNode))) => {
tracing::info!("Shutting down message loop gracefully");
break;
}
Ok(Right(NodeAction(NodeEvent::ConnectPeer { peer, callback }))) => {
tracing::info!(remote = %peer, this_peer = ?op_manager.ring.get_peer_key().unwrap(), "Connecting to peer");
let mut ob = outbound_conn_handler.clone();
Expand Down
1 change: 0 additions & 1 deletion crates/core/src/node/testing_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,6 @@ where
let msg = match msg {
Ok(Either::Left(msg)) => msg,
Ok(Either::Right(action)) => match action {
NodeEvent::ShutdownNode => break Ok(()),
NodeEvent::DropConnection(peer) => {
tracing::info!("Dropping connection to {peer}");
event_register
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/transport/crypto.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pkcs1::EncodeRsaPrivateKey;
use pkcs1::{EncodeRsaPrivateKey, EncodeRsaPublicKey};
use rand::rngs::OsRng;
use rsa::{Pkcs1v15Encrypt, RsaPrivateKey, RsaPublicKey};
use serde::{Deserialize, Serialize};
Expand Down

0 comments on commit 0a7bd58

Please sign in to comment.