@@ -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 } ;
99use serde:: { Deserialize , Serialize } ;
1010
1111use 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