From 8f07a96b88447c8e6fa3c4a23bdf3134d6b9a760 Mon Sep 17 00:00:00 2001 From: Jimmy Chen Date: Tue, 26 Sep 2023 12:39:58 +1000 Subject: [PATCH] Fix failing tests. --- beacon_node/beacon_chain/src/test_utils.rs | 6 +++--- beacon_node/http_api/tests/tests.rs | 7 ++++++- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/beacon_node/beacon_chain/src/test_utils.rs b/beacon_node/beacon_chain/src/test_utils.rs index 4048058fb..11bb35620 100644 --- a/beacon_node/beacon_chain/src/test_utils.rs +++ b/beacon_node/beacon_chain/src/test_utils.rs @@ -450,14 +450,14 @@ where } pub fn mock_execution_layer(self) -> Self { - self.mock_execution_layer_with_config() + self.mock_execution_layer_with_config(None) } - pub fn mock_execution_layer_with_config(mut self) -> Self { + pub fn mock_execution_layer_with_config(mut self, builder_threshold: Option) -> Self { let mock = mock_execution_layer_from_parts::( self.spec.as_ref().expect("cannot build without spec"), self.runtime.task_executor.clone(), - None, + builder_threshold, ); self.execution_layer = Some(mock.el.clone()); self.mock_execution_layer = Some(mock); diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 8a6634f80..a1576d33d 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -78,6 +78,7 @@ struct ApiTester { struct ApiTesterConfig { spec: ChainSpec, retain_historic_states: bool, + builder_threshold: Option, } impl Default for ApiTesterConfig { @@ -87,6 +88,7 @@ impl Default for ApiTesterConfig { Self { spec, retain_historic_states: false, + builder_threshold: None, } } } @@ -128,7 +130,7 @@ impl ApiTester { .logger(logging::test_logger()) .deterministic_keypairs(VALIDATOR_COUNT) .fresh_ephemeral_store() - .mock_execution_layer_with_config() + .mock_execution_layer_with_config(config.builder_threshold) .build(); harness @@ -403,6 +405,7 @@ impl ApiTester { pub async fn new_mev_tester_no_builder_threshold() -> Self { let mut config = ApiTesterConfig { + builder_threshold: Some(0), retain_historic_states: false, spec: E::default_spec(), }; @@ -5350,6 +5353,7 @@ async fn builder_payload_chosen_by_profit() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn builder_works_post_capella() { let mut config = ApiTesterConfig { + builder_threshold: Some(0), retain_historic_states: false, spec: E::default_spec(), }; @@ -5370,6 +5374,7 @@ async fn builder_works_post_capella() { #[tokio::test(flavor = "multi_thread", worker_threads = 2)] async fn builder_works_post_deneb() { let mut config = ApiTesterConfig { + builder_threshold: Some(0), retain_historic_states: false, spec: E::default_spec(), };