diff --git a/beacon_node/execution_layer/src/engines.rs b/beacon_node/execution_layer/src/engines.rs index b9e030703d9..c46a94c5af2 100644 --- a/beacon_node/execution_layer/src/engines.rs +++ b/beacon_node/execution_layer/src/engines.rs @@ -26,8 +26,8 @@ const CACHED_RESPONSE_AGE_LIMIT: Duration = Duration::from_secs(900); // 15 minu /// Stores the remembered state of a engine. #[derive(Copy, Clone, PartialEq, Debug, Eq, Default)] enum EngineStateInternal { - Synced, #[default] + Synced, Offline, Syncing, AuthFailed, @@ -403,12 +403,17 @@ mod tests { async fn test_state_notifier() { let mut state = State::default(); let initial_state: EngineState = state.state.into(); - assert_eq!(initial_state, EngineState::Offline); - state.update(EngineStateInternal::Synced); + // default state is online + assert_eq!(initial_state, EngineState::Online); // a watcher that arrives after the first update. let mut watcher = state.watch(); let new_state = watcher.next().await.expect("Last state is always present"); assert_eq!(new_state, EngineState::Online); + + // update to offline + state.update(EngineStateInternal::Offline); + let new_state = watcher.next().await.expect("Last state is always present"); + assert_eq!(new_state, EngineState::Offline); } } diff --git a/beacon_node/http_api/tests/tests.rs b/beacon_node/http_api/tests/tests.rs index 5c9504d4a58..b2b9ab8d093 100644 --- a/beacon_node/http_api/tests/tests.rs +++ b/beacon_node/http_api/tests/tests.rs @@ -2475,7 +2475,7 @@ impl ApiTester { is_syncing: false, is_optimistic: false, // these tests run without the Bellatrix fork enabled - el_offline: true, + el_offline: false, head_slot, sync_distance, }; @@ -2539,11 +2539,11 @@ impl ApiTester { pub async fn test_get_node_health(self) -> Self { let status = self.client.get_node_health().await; match status { - Ok(_) => { - panic!("should return 503 error status code"); + Ok(status) => { + assert_eq!(status, 200); } - Err(e) => { - assert_eq!(e.status().unwrap(), 503); + Err(_) => { + panic!("should return valid status"); } } self