Skip to content

Commit aecfa4d

Browse files
committed
add health to diagnostics
1 parent ab59c23 commit aecfa4d

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

server/src/http/routes/admin/eoa_diagnostics.rs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use axum::{
55
http::StatusCode,
66
response::{IntoResponse, Json},
77
};
8-
use engine_executors::eoa::store::{EoaExecutorStore, TransactionData};
8+
use engine_executors::eoa::store::{EoaExecutorStore, EoaHealth, TransactionData};
99
use serde::{Deserialize, Serialize};
1010

1111
use crate::http::{
@@ -27,6 +27,7 @@ pub struct EoaStateResponse {
2727
pub borrowed_count: u64,
2828
pub recycled_nonces_count: u64,
2929
pub recycled_nonces: Vec<u64>,
30+
pub health: Option<EoaHealth>,
3031
}
3132

3233
#[derive(Debug, Serialize)]
@@ -139,6 +140,12 @@ pub async fn get_eoa_state(
139140
})?;
140141
let recycled_nonces_count = recycled_nonces.len() as u64;
141142

143+
let health = store.get_eoa_health().await.map_err(|e| {
144+
ApiEngineError(engine_core::error::EngineError::InternalError {
145+
message: format!("Failed to get EOA health: {e}"),
146+
})
147+
})?;
148+
142149
let response = EoaStateResponse {
143150
eoa: eoa_address.to_string(),
144151
chain_id,
@@ -149,6 +156,7 @@ pub async fn get_eoa_state(
149156
borrowed_count,
150157
recycled_nonces_count,
151158
recycled_nonces,
159+
health,
152160
};
153161

154162
Ok((StatusCode::OK, Json(SuccessResponse::new(response))))

0 commit comments

Comments
 (0)