chore(deps): rm reth-rpc-types dep from reth-network (#9023)

This commit is contained in:
Matthias Seitz
2024-06-21 23:47:03 +02:00
committed by GitHub
parent 17c5121b50
commit a34e41c275
10 changed files with 24 additions and 21 deletions

View File

@ -14,7 +14,7 @@ workspace = true
[dependencies]
# reth
reth-eth-wire.workspace = true
reth-rpc-types.workspace = true
alloy-rpc-types-admin.workspace = true
reth-network-peers.workspace = true
# ethereum

View File

@ -13,13 +13,13 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]
use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_rpc_types::NetworkStatus;
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};
pub use alloy_rpc_types_admin::EthProtocolInfo;
pub use error::NetworkError;
pub use reputation::{Reputation, ReputationChangeKind};
use reth_eth_wire::{capability::Capabilities, DisconnectReason, EthVersion, Status};
use reth_network_peers::NodeRecord;
use serde::{Deserialize, Serialize};
use std::{future::Future, net::SocketAddr, sync::Arc, time::Instant};
/// The `PeerId` type.
pub type PeerId = alloy_primitives::B512;
@ -215,3 +215,14 @@ impl std::fmt::Display for Direction {
}
}
}
/// The status of the network being ran by the local node.
#[derive(Clone, Debug, Serialize, Deserialize)]
pub struct NetworkStatus {
/// The local node client version.
pub client_version: String,
/// The current ethereum protocol version
pub protocol_version: u64,
/// Information about the Ethereum Wire Protocol.
pub eth_protocol_info: EthProtocolInfo,
}

View File

@ -4,13 +4,13 @@
//! generic over it.
use crate::{
NetworkError, NetworkInfo, PeerId, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind,
NetworkError, NetworkInfo, NetworkStatus, PeerId, PeerInfo, PeerKind, Peers, PeersInfo,
Reputation, ReputationChangeKind,
};
use alloy_rpc_types_admin::EthProtocolInfo;
use enr::{secp256k1::SecretKey, Enr};
use reth_eth_wire::{DisconnectReason, ProtocolVersion};
use reth_network_peers::NodeRecord;
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use std::net::{IpAddr, SocketAddr};
/// A type that implements all network trait that does nothing.