Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use crates directly in eth-wire #12554

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

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

8 changes: 5 additions & 3 deletions crates/net/eth-wire/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ workspace = true
[dependencies]
# reth
reth-codecs.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-ecies.workspace = true
alloy-rlp = { workspace = true, features = ["derive"] }
reth-eth-wire-types.workspace = true
reth-network-peers.workspace = true
reth-ethereum-forks.workspace = true

# ethereum
alloy-primitives.workspace = true
Expand All @@ -45,6 +45,7 @@ arbitrary = { workspace = true, features = ["derive"], optional = true }

[dev-dependencies]
reth-primitives = { workspace = true, features = ["arbitrary"] }
reth-primitives-traits = { workspace = true, features = ["arbitrary"] }
reth-eth-wire-types = { workspace = true, features = ["arbitrary"] }
reth-tracing.workspace = true

Expand All @@ -67,14 +68,15 @@ alloy-eips.workspace = true

[features]
arbitrary = [
"reth-primitives/arbitrary",
"reth-eth-wire-types/arbitrary",
"dep:arbitrary",
"alloy-eips/arbitrary",
"alloy-primitives/arbitrary",
"reth-codecs/arbitrary",
"alloy-chains/arbitrary",
"reth-primitives-traits/arbitrary"
"reth-primitives-traits/arbitrary",
"reth-ethereum-forks/arbitrary",
"reth-primitives/arbitrary"
]
serde = [
"dep:serde",
Expand Down
3 changes: 2 additions & 1 deletion crates/net/eth-wire/src/errors/eth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ use crate::{
use alloy_chains::Chain;
use alloy_primitives::B256;
use reth_eth_wire_types::EthVersion;
use reth_primitives::{GotExpected, GotExpectedBoxed, ValidationError};
use reth_ethereum_forks::ValidationError;
use reth_primitives_traits::{GotExpected, GotExpectedBoxed};
use std::io;

/// Errors when sending/receiving messages
Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire/src/errors/p2p.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use std::io;

use reth_eth_wire_types::{DisconnectReason, UnknownDisconnectReason};
use reth_primitives::GotExpected;
use reth_primitives_traits::GotExpected;

use crate::{capability::SharedCapabilityError, ProtocolVersion};

Expand Down
5 changes: 3 additions & 2 deletions crates/net/eth-wire/src/ethstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ use alloy_primitives::bytes::{Bytes, BytesMut};
use futures::{ready, Sink, SinkExt, StreamExt};
use pin_project::pin_project;
use reth_eth_wire_types::NetworkPrimitives;
use reth_primitives::{ForkFilter, GotExpected};
use reth_ethereum_forks::ForkFilter;
use reth_primitives_traits::GotExpected;
use std::{
pin::Pin,
task::{Context, Poll},
Expand Down Expand Up @@ -370,8 +371,8 @@ mod tests {
use futures::{SinkExt, StreamExt};
use reth_ecies::stream::ECIESStream;
use reth_eth_wire_types::EthNetworkPrimitives;
use reth_ethereum_forks::{ForkFilter, Head};
use reth_network_peers::pk2id;
use reth_primitives::{ForkFilter, Head};
use secp256k1::{SecretKey, SECP256K1};
use std::time::Duration;
use tokio::net::{TcpListener, TcpStream};
Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire/src/multiplex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::{
use bytes::{Bytes, BytesMut};
use futures::{Sink, SinkExt, Stream, StreamExt, TryStream, TryStreamExt};
use reth_eth_wire_types::NetworkPrimitives;
use reth_primitives::ForkFilter;
use reth_ethereum_forks::ForkFilter;
use tokio::sync::{mpsc, mpsc::UnboundedSender};
use tokio_stream::wrappers::UnboundedReceiverStream;

Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire/src/p2pstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use futures::{Sink, SinkExt, StreamExt};
use pin_project::pin_project;
use reth_codecs::add_arbitrary_tests;
use reth_metrics::metrics::counter;
use reth_primitives::GotExpected;
use reth_primitives_traits::GotExpected;
use std::{
collections::VecDeque,
io,
Expand Down
2 changes: 1 addition & 1 deletion crates/net/eth-wire/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ use crate::{
};
use alloy_chains::Chain;
use alloy_primitives::{B256, U256};
use reth_ethereum_forks::{ForkFilter, Head};
use reth_network_peers::pk2id;
use reth_primitives::{ForkFilter, Head};
use secp256k1::{SecretKey, SECP256K1};
use std::net::SocketAddr;
use tokio::net::TcpStream;
Expand Down
Loading