Fix failing tests.

This commit is contained in:
Jimmy Chen 2023-09-26 12:39:58 +10:00
parent 1458394cd9
commit 8f07a96b88
No known key found for this signature in database
GPG Key ID: 7AAEE02659DCF690
2 changed files with 9 additions and 4 deletions

View File

@ -450,14 +450,14 @@ where
} }
pub fn mock_execution_layer(self) -> Self { 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<u128>) -> Self {
let mock = mock_execution_layer_from_parts::<E>( let mock = mock_execution_layer_from_parts::<E>(
self.spec.as_ref().expect("cannot build without spec"), self.spec.as_ref().expect("cannot build without spec"),
self.runtime.task_executor.clone(), self.runtime.task_executor.clone(),
None, builder_threshold,
); );
self.execution_layer = Some(mock.el.clone()); self.execution_layer = Some(mock.el.clone());
self.mock_execution_layer = Some(mock); self.mock_execution_layer = Some(mock);

View File

@ -78,6 +78,7 @@ struct ApiTester {
struct ApiTesterConfig { struct ApiTesterConfig {
spec: ChainSpec, spec: ChainSpec,
retain_historic_states: bool, retain_historic_states: bool,
builder_threshold: Option<u128>,
} }
impl Default for ApiTesterConfig { impl Default for ApiTesterConfig {
@ -87,6 +88,7 @@ impl Default for ApiTesterConfig {
Self { Self {
spec, spec,
retain_historic_states: false, retain_historic_states: false,
builder_threshold: None,
} }
} }
} }
@ -128,7 +130,7 @@ impl ApiTester {
.logger(logging::test_logger()) .logger(logging::test_logger())
.deterministic_keypairs(VALIDATOR_COUNT) .deterministic_keypairs(VALIDATOR_COUNT)
.fresh_ephemeral_store() .fresh_ephemeral_store()
.mock_execution_layer_with_config() .mock_execution_layer_with_config(config.builder_threshold)
.build(); .build();
harness harness
@ -403,6 +405,7 @@ impl ApiTester {
pub async fn new_mev_tester_no_builder_threshold() -> Self { pub async fn new_mev_tester_no_builder_threshold() -> Self {
let mut config = ApiTesterConfig { let mut config = ApiTesterConfig {
builder_threshold: Some(0),
retain_historic_states: false, retain_historic_states: false,
spec: E::default_spec(), spec: E::default_spec(),
}; };
@ -5350,6 +5353,7 @@ async fn builder_payload_chosen_by_profit() {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn builder_works_post_capella() { async fn builder_works_post_capella() {
let mut config = ApiTesterConfig { let mut config = ApiTesterConfig {
builder_threshold: Some(0),
retain_historic_states: false, retain_historic_states: false,
spec: E::default_spec(), spec: E::default_spec(),
}; };
@ -5370,6 +5374,7 @@ async fn builder_works_post_capella() {
#[tokio::test(flavor = "multi_thread", worker_threads = 2)] #[tokio::test(flavor = "multi_thread", worker_threads = 2)]
async fn builder_works_post_deneb() { async fn builder_works_post_deneb() {
let mut config = ApiTesterConfig { let mut config = ApiTesterConfig {
builder_threshold: Some(0),
retain_historic_states: false, retain_historic_states: false,
spec: E::default_spec(), spec: E::default_spec(),
}; };