mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-06 10:11:44 +00:00
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:
@@ -1246,6 +1246,33 @@ impl ApiTester {
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_beacon_states_pending_consolidations(self) -> Self {
|
||||
for state_id in self.interesting_state_ids() {
|
||||
let mut state_opt = state_id
|
||||
.state(&self.chain)
|
||||
.ok()
|
||||
.map(|(state, _execution_optimistic, _finalized)| state);
|
||||
|
||||
let result = self
|
||||
.client
|
||||
.get_beacon_states_pending_consolidations(state_id.0)
|
||||
.await
|
||||
.unwrap()
|
||||
.map(|res| res.data);
|
||||
|
||||
if result.is_none() && state_opt.is_none() {
|
||||
continue;
|
||||
}
|
||||
|
||||
let state = state_opt.as_mut().expect("result should be none");
|
||||
let expected = state.pending_consolidations().unwrap();
|
||||
|
||||
assert_eq!(result.unwrap(), expected.to_vec());
|
||||
}
|
||||
|
||||
self
|
||||
}
|
||||
|
||||
pub async fn test_beacon_headers_all_slots(self) -> Self {
|
||||
for slot in 0..CHAIN_LENGTH {
|
||||
let slot = Slot::from(slot);
|
||||
@@ -6404,6 +6431,8 @@ async fn beacon_get_state_info_electra() {
|
||||
.test_beacon_states_pending_deposits()
|
||||
.await
|
||||
.test_beacon_states_pending_partial_withdrawals()
|
||||
.await
|
||||
.test_beacon_states_pending_consolidations()
|
||||
.await;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user