Skip to content

Commit

Permalink
chore(deps): shrink some deps
Browse files Browse the repository at this point in the history
  • Loading branch information
mattsse committed May 23, 2024
1 parent 1287bbc commit 776d03d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 4 additions & 2 deletions crates/net/network-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ rust-version.workspace = true
license.workspace = true
homepage.workspace = true
repository.workspace = true
description = "Network interfaces"
description = "Network interfaces and commonly used types"

[lints]
workspace = true

[dependencies]
# reth
reth-primitives.workspace = true
reth-eth-wire.workspace = true
reth-rpc-types.workspace = true
reth-discv4.workspace = true
reth-network-types.workspace = true

# ethereum
alloy-primitives.workspace = true

# eth
enr = { workspace = true, default-features = false, features = ["rust-secp256k1"] }

Expand Down
11 changes: 6 additions & 5 deletions crates/net/network-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
)]
#![cfg_attr(docsrs, feature(doc_cfg, doc_auto_cfg))]

use reth_eth_wire::{DisconnectReason, EthVersion, Status};
use reth_network_types::PeerId;
use reth_primitives::NodeRecord;
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 error::NetworkError;
pub use reputation::{Reputation, ReputationChangeKind};
use reth_eth_wire::capability::Capabilities;
use reth_rpc_types::NetworkStatus;
use reth_network_types::NodeRecord;

/// The PeerId type.
pub type PeerId = alloy_primitives::B512;

/// Network Error
pub mod error;
Expand Down
8 changes: 4 additions & 4 deletions crates/net/network-api/src/noop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
//! generic over it.
use crate::{
NetworkError, NetworkInfo, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
NetworkError, NetworkInfo, PeerId, PeerInfo, PeerKind, Peers, PeersInfo, Reputation,
ReputationChangeKind,
};
use enr::{secp256k1::SecretKey, Enr};
use reth_discv4::DEFAULT_DISCOVERY_PORT;
use reth_eth_wire::{DisconnectReason, ProtocolVersion};
use reth_network_types::PeerId;
use reth_primitives::{Chain, NodeRecord};
use reth_network_types::NodeRecord;
use reth_rpc_types::{admin::EthProtocolInfo, NetworkStatus};
use std::net::{IpAddr, SocketAddr};

Expand Down Expand Up @@ -42,7 +41,8 @@ impl NetworkInfo for NoopNetwork {
}

fn chain_id(&self) -> u64 {
Chain::mainnet().into()
// mainnet
1
}

fn is_syncing(&self) -> bool {
Expand Down

0 comments on commit 776d03d

Please sign in to comment.