Skip to content

Commit 8843970

Browse files
committed
address comments
1 parent 5c1c639 commit 8843970

File tree

6 files changed

+18
-10
lines changed

6 files changed

+18
-10
lines changed

bin/bridge/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ reth-tracing = { git = "https://github.com/scroll-tech/reth.git" }
6464
# misc
6565
serde_json = { version = "1.0.94", default-features = false, features = ["alloc"] }
6666

67+
[features]
68+
test-utils = []
6769

6870
[[bin]]
6971
name = "bridge"

bin/bridge/src/import.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ impl BridgeBlockImport {
6060
trace!(target: "bridge::import", peer_id = %peer_id, block = ?block, "Received new block from eth-wire protocol");
6161

6262
// We trigger a new block event to be sent to the rollup node's network manager. If this
63-
// results in an
63+
// results in an error it means the network manager has been dropped.
6464
let _ =
6565
self.to_scroll_network_manager.send(Event::NewBlock { peer_id, block, signature });
6666
} else {

bin/bridge/src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
//! Scroll Network Bridge Components.
2+
3+
mod import;
4+
pub use import::BridgeBlockImport;
5+
6+
mod network;
7+
pub use network::ScrollBridgeNetworkBuilder;

bin/bridge/src/main.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ use network::ScrollBridgeNetworkBuilder;
44
mod import;
55
use import::BridgeBlockImport;
66

7-
#[cfg(test)]
8-
mod test;
9-
107
#[global_allocator]
118
static ALLOC: reth_cli_util::allocator::Allocator = reth_cli_util::allocator::new_allocator();
129

bin/bridge/src/network.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,10 @@ pub struct ScrollBridgeNetworkBuilder {
1616
Option<Box<dyn reth_network::import::BlockImport<reth_scroll_primitives::ScrollBlock>>>,
1717
}
1818

19-
#[cfg(test)]
2019
impl ScrollBridgeNetworkBuilder {
2120
/// Creates a new [`ScrollBridgeNetworkBuilder`] with the provided block import.
22-
pub(crate) fn new(
21+
#[cfg(feature = "test-utils")]
22+
pub fn new(
2323
block_import: Box<
2424
dyn reth_network::import::BlockImport<reth_scroll_primitives::ScrollBlock>,
2525
>,
Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![cfg(feature = "test-utils")]
12

23
use alloy_primitives::B256;
34
use reth_e2e_test_utils::{node::NodeTestContext, NodeHelperType};
@@ -205,7 +206,6 @@ impl BlockImport for TestBlockImport {
205206

206207
// HELPERS
207208
// ---------------------------------------------------------------------------------------------
208-
209209
pub async fn build_bridge_node(
210210
chain_spec: Arc<ScrollChainSpec>,
211211
) -> eyre::Result<(NodeHelperType<ScrollNode>, TaskManager, PeerId)> {
@@ -237,9 +237,11 @@ pub async fn build_bridge_node(
237237
let NodeHandle { node, node_exit_future: _ } = NodeBuilder::new(node_config.clone())
238238
.testing_node(exec.clone())
239239
.with_types_and_provider::<ScrollNode, BlockchainProvider<_>>()
240-
.with_components(node.components_builder().network(super::ScrollBridgeNetworkBuilder::new(
241-
Box::new(ValidRethBlockImport::default()),
242-
)))
240+
.with_components(node.components_builder().network(
241+
scroll_bridge::ScrollBridgeNetworkBuilder::new(Box::new(
242+
ValidRethBlockImport::default(),
243+
)),
244+
))
243245
.with_add_ons(node.add_ons())
244246
.launch()
245247
.await?;

0 commit comments

Comments
 (0)