Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions beacon_node/execution_layer/src/engines.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
}
10 changes: 5 additions & 5 deletions beacon_node/http_api/tests/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
Expand Down Expand Up @@ -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
Expand Down
Loading