From f2a0a5a0e9f305babdb58bffd027f2f94c1b9b93 Mon Sep 17 00:00:00 2001 From: j75689 Date: Mon, 15 Jul 2024 20:02:06 +0800 Subject: [PATCH] chore: fix ut --- crates/engine/tree/Cargo.toml | 2 ++ crates/engine/tree/src/download.rs | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/crates/engine/tree/Cargo.toml b/crates/engine/tree/Cargo.toml index e2a1c462d..33ea676b8 100644 --- a/crates/engine/tree/Cargo.toml +++ b/crates/engine/tree/Cargo.toml @@ -76,3 +76,5 @@ test-utils = [ "reth-stages/test-utils", "reth-tracing" ] + +bsc = [] \ No newline at end of file diff --git a/crates/engine/tree/src/download.rs b/crates/engine/tree/src/download.rs index b8ebb8415..40e2a28ee 100644 --- a/crates/engine/tree/src/download.rs +++ b/crates/engine/tree/src/download.rs @@ -271,6 +271,7 @@ mod tests { use super::*; use crate::test_utils::insert_headers_into_client; use assert_matches::assert_matches; + #[cfg(not(feature = "bsc"))] use reth_beacon_consensus::EthBeaconConsensus; use reth_chainspec::{ChainSpecBuilder, MAINNET}; use reth_network_p2p::test_utils::TestFullBlockClient; @@ -301,6 +302,10 @@ mod tests { .seal_slow(); insert_headers_into_client(&client, header, 0..total_blocks); + + #[cfg(feature = "bsc")] + let consensus = Arc::new(reth_consensus::test_utils::TestConsensus::default()); + #[cfg(not(feature = "bsc"))] let consensus = Arc::new(EthBeaconConsensus::new(chain_spec)); let block_downloader = BasicBlockDownloader::new(client.clone(), consensus);