Skip to content

Commit dfd5110

Browse files
committed
feat: lints and formatting
1 parent f58ae56 commit dfd5110

File tree

9 files changed

+20
-30
lines changed

9 files changed

+20
-30
lines changed

bin/bridge/src/import.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,12 @@ impl RethBlockImport<reth_scroll_primitives::ScrollBlock> for BridgeBlockImport
100100
Ok(BlockValidation::ValidBlock { ref block }) |
101101
Ok(BlockValidation::ValidHeader { ref block }) => {
102102
self.bridge_new_block_to_scroll_wire(outcome.peer, block.block.clone());
103-
return Poll::Ready(outcome)
103+
Poll::Ready(outcome)
104104
}
105105
Err(_) => Poll::Ready(outcome),
106106
}
107107
} else {
108-
return Poll::Pending;
108+
Poll::Pending
109109
}
110110
}
111111
}

bin/bridge/src/network.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ where
5959
network_mode: NetworkMode::Work,
6060
block_import: Box::new(super::BridgeBlockImport::new(
6161
new_block_tx,
62-
self.block_import.unwrap_or_else(|| config.block_import),
62+
self.block_import.unwrap_or(config.block_import),
6363
)),
6464
..config
6565
};

bin/bridge/src/test.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
use alloy_primitives::B256;
32
use reth_e2e_test_utils::{node::NodeTestContext, NodeHelperType};
43
use reth_network::{NetworkConfigBuilder, PeersInfo};

crates/engine/Cargo.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ alloy-rpc-types-engine.workspace = true
1717

1818
# reth
1919
reth-engine-primitives = { git = "https://github.com/scroll-tech/reth.git", default-features = false, features = ["scroll"] }
20-
reth-primitives = { workspace = true }
20+
reth-primitives.workspace = true
2121
reth-rpc-api = { git = "https://github.com/scroll-tech/reth.git", default-features = false, features = ["client"] }
2222

2323
# reth-scroll
24-
reth-scroll-primitives = { workspace = true, features = ["serde"] }
24+
reth-scroll-primitives = { workspace = true, features = ["serde", "scroll", "reth-codec"] }
2525

2626
# misc
2727
eyre.workspace = true
@@ -38,10 +38,10 @@ reth-testing-utils = { git = "https://github.com/scroll-tech/reth.git" }
3838

3939
[features]
4040
arbitrary = [
41-
"alloy-primitives/arbitrary",
42-
"reth-primitives/arbitrary",
43-
"alloy-eips/arbitrary",
44-
"reth-scroll-primitives/arbitrary"
41+
"alloy-primitives/arbitrary",
42+
"reth-primitives/arbitrary",
43+
"alloy-eips/arbitrary",
44+
"reth-scroll-primitives/arbitrary"
4545
]
4646
test_utils = [
4747
"arbitrary",

crates/network/Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,20 @@ alloy-primitives = { workspace = true, features = [
1313
] }
1414

1515
# reth
16-
reth-discv5 = { git = "https://github.com/scroll-tech/reth.git" }
17-
reth-eth-wire-types.workspace = true
1816
reth-network.workspace = true
1917
reth-network-api.workspace = true
20-
reth-network-types = { git = "https://github.com/scroll-tech/reth.git" }
2118
reth-network-peers.workspace = true
2219
reth-primitives.workspace = true
2320
reth-storage-api = { git = "https://github.com/scroll-tech/reth.git" }
24-
reth-tasks.workspace = true
2521

2622
# scroll
2723
reth-scroll-chainspec.workspace = true
28-
reth-scroll-node = { workspace = true, features = ["skip-state-root-validation"] }
24+
reth-scroll-node = { workspace = true, features = ["skip-state-root-validation", "scroll"] }
2925
reth-scroll-primitives.workspace = true
3026
scroll-wire.workspace = true
3127

3228
# misc
3329
futures.workspace = true
34-
parking_lot = "0.12"
3530
secp256k1 = { workspace = true, features = ["global-context", "rand-std", "recovery"] }
3631
tokio = { workspace = true, features = ["full"] }
3732
tokio-stream.workspace = true

crates/network/src/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use secp256k1::{ecdsa::Signature, SecretKey};
66
use std::sync::Arc;
77
use tokio::sync::{mpsc::UnboundedSender, oneshot};
88

9-
/// A handle used to communicate with the [`NetworkManager`].
9+
/// A handle used to communicate with the [`super::NetworkManager`].
1010
#[derive(Debug, Clone)]
1111
pub struct NetworkHandle {
1212
/// A reference to the inner network handle.
@@ -28,7 +28,7 @@ impl NetworkHandle {
2828
/// The inner state of the [`NetworkHandle`].
2929
#[derive(Debug)]
3030
pub struct NetworkInner {
31-
/// The sender half of the channel set up between this type and the [`NetworkManager`].
31+
/// The sender half of the channel set up between this type and the [`super::NetworkManager`].
3232
pub(crate) to_manager_tx: UnboundedSender<NetworkHandleMessage>,
3333
/// Inner network handle which is used to communicate with the inner network.
3434
pub inner_network_handle: RethNetworkHandle<ScrollNetworkPrimitives>,

crates/network/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ mod import;
22
pub use import::{BlockImport, BlockImportOutcome, BlockValidation, NoopBlockImport};
33

44
mod handle;
5-
use handle::{NetworkHandle, NetworkHandleMessage};
5+
pub use handle::{NetworkHandle, NetworkHandleMessage};
66

77
mod manager;
88
pub use manager::NetworkManager;

crates/scroll-wire/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,11 @@ alloy-rlp = { version = "0.3.10", default-features = false }
2020
reth-eth-wire = { git = "https://github.com/scroll-tech/reth.git" }
2121
reth-network.workspace = true
2222
reth-network-api.workspace = true
23-
reth-primitives.workspace = true
24-
reth-provider = { workspace = true, features = ["test-utils"] }
2523

2624
# scroll
27-
reth-scroll-chainspec.workspace = true
28-
reth-scroll-primitives.workspace = true
25+
reth-scroll-primitives = { workspace = true, features = ["serde"] }
2926

3027
# misc
31-
eyre.workspace = true
3228
futures.workspace = true
3329
secp256k1 = { workspace = true, features = [
3430
"global-context",

crates/scroll-wire/src/protocol/handler.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ use reth_network::protocol::ProtocolHandler as ProtocolHandlerTrait;
44
use reth_network_api::PeerId;
55
use tokio::sync::mpsc;
66

7-
/// A Receiver for `ScrollWireEvents`.
7+
/// A Receiver for [`Event`].
88
pub(super) type ScrollWireEventReceiver = mpsc::UnboundedReceiver<Event>;
99

10-
/// A Sender for `ScrollWireEvents`.
10+
/// A Sender for [`Event`].
1111
pub(super) type ScrollWireEventSender = mpsc::UnboundedSender<Event>;
1212

1313
/// The state of the protocol.
@@ -20,15 +20,15 @@ pub struct ProtocolState {
2020
}
2121

2222
impl ProtocolState {
23-
/// Returns a reference to the sender for emitting [`ScrollWireEvent`]s.
23+
/// Returns a reference to the sender for emitting [`Event`]s.
2424
pub const fn event_sender(&self) -> &ScrollWireEventSender {
2525
&self.event_sender
2626
}
2727
}
2828

2929
/// A handler for the `ScrollWire` protocol.
3030
///
31-
/// This handler contains the state of the protocol ([`ProtocolState`]) and protocol configuration.
31+
/// This handler contains the state of the protocol and protocol configuration.
3232
/// This type is responsible for handling incoming and outgoing connections. It would typically be
3333
/// used for protocol negotiation, but currently we do not have any.
3434
#[derive(Debug)]
@@ -38,8 +38,8 @@ pub struct ProtocolHandler {
3838
}
3939

4040
impl ProtocolHandler {
41-
/// Creates a tuple of ([`ProtocolHandler`], [`ScrollWireEventReceiver`]) from the provided
42-
/// configuration.
41+
/// Creates a tuple of ([`ProtocolHandler`], [`mpsc::UnboundedReceiver<Event>`]) from the
42+
/// provided configuration.
4343
pub fn new(config: ScrollWireConfig) -> (Self, ScrollWireEventReceiver) {
4444
let (events_tx, events_rx) = mpsc::unbounded_channel();
4545
let state = ProtocolState { event_sender: events_tx };

0 commit comments

Comments
 (0)