Add pending_consolidations Beacon API endpoint (#7290)

#7282


  Adds the missing `beacon/states/{state_id}/pending_consolidations` Beacon API endpoint along with related tests.
This commit is contained in:
Mac L
2025-04-10 11:21:01 +10:00
committed by GitHub
parent ec643843e0
commit 7534f5752d
3 changed files with 83 additions and 0 deletions

View File

@@ -821,6 +821,26 @@ impl BeaconNodeHttpClient {
self.get_opt(path).await
}
/// `GET beacon/states/{state_id}/pending_consolidations`
///
/// Returns `Ok(None)` on a 404 error.
pub async fn get_beacon_states_pending_consolidations(
&self,
state_id: StateId,
) -> Result<Option<ExecutionOptimisticFinalizedResponse<Vec<PendingConsolidation>>>, Error>
{
let mut path = self.eth_path(V1)?;
path.path_segments_mut()
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
.push("beacon")
.push("states")
.push(&state_id.to_string())
.push("pending_consolidations");
self.get_opt(path).await
}
/// `GET beacon/light_client/updates`
///
/// Returns `Ok(None)` on a 404 error.