diff --git a/crates/chia-client/src/error.rs b/crates/chia-client/src/error.rs index 44382c6b8..7c3cc3052 100644 --- a/crates/chia-client/src/error.rs +++ b/crates/chia-client/src/error.rs @@ -1,31 +1,12 @@ -use std::net::IpAddr; - use chia_protocol::ProtocolMessageTypes; -use semver::Version; use thiserror::Error; -use tokio::sync::mpsc::error::SendError; use tokio::sync::oneshot::error::RecvError; -use tokio::time::error::Elapsed; - -use crate::Event; #[derive(Debug, Error)] pub enum Error { #[error("Peer is missing certificate")] MissingCertificate, - #[error("Handshake not received")] - ExpectedHandshake, - - #[error("Invalid protocol version {0}")] - InvalidProtocolVersion(String), - - #[error("Wrong network id {0}")] - WrongNetworkId(String), - - #[error("Outdated protocol version {0}, expected {1}")] - OutdatedProtocolVersion(Version, Version), - #[error("Streamable error: {0}")] Streamable(#[from] chia_traits::Error), @@ -35,9 +16,6 @@ pub enum Error { #[error("TLS error: {0}")] Tls(#[from] native_tls::Error), - #[error("Banned peer: {0}")] - BannedPeer(IpAddr), - #[error("Unexpected message received with type {0:?}")] UnexpectedMessage(ProtocolMessageTypes), @@ -47,18 +25,9 @@ pub enum Error { #[error("Failed to send event")] EventNotSent, - #[error("Failed to send message")] - Send(#[from] SendError), - #[error("Failed to receive message")] Recv(#[from] RecvError), - #[error("Connection timeout: {0}")] - ConnectionTimeout(Elapsed), - - #[error("Handshake timeout: {0}")] - HandshakeTimeout(Elapsed), - #[error("IO error: {0}")] Io(#[from] std::io::Error), } diff --git a/crates/chia-client/src/event.rs b/crates/chia-client/src/event.rs deleted file mode 100644 index 056999e55..000000000 --- a/crates/chia-client/src/event.rs +++ /dev/null @@ -1,13 +0,0 @@ -use std::net::{IpAddr, SocketAddr}; - -use chia_protocol::Message; - -use crate::PeerId; - -#[derive(Debug, Clone)] -pub enum Event { - Message(PeerId, Message), - Connected(PeerId, SocketAddr), - Disconnected(SocketAddr), - Banned(IpAddr), -} diff --git a/crates/chia-client/src/lib.rs b/crates/chia-client/src/lib.rs index a3fd2d1bc..363affdf5 100644 --- a/crates/chia-client/src/lib.rs +++ b/crates/chia-client/src/lib.rs @@ -1,12 +1,10 @@ mod error; -mod event; mod network; mod peer; mod request_map; mod tls; pub use error::*; -pub use event::*; pub use network::*; pub use peer::*; pub use tls::*;