mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-03 00:31:50 +00:00
Add version to the response of beacon API getPendingConsolidations (#8251)
* #7440 Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
This commit is contained in:
@@ -1369,12 +1369,14 @@ impl ApiTester {
|
||||
.ok()
|
||||
.map(|(state, _execution_optimistic, _finalized)| state);
|
||||
|
||||
let result = self
|
||||
let result = match self
|
||||
.client
|
||||
.get_beacon_states_pending_consolidations(state_id.0)
|
||||
.await
|
||||
.unwrap()
|
||||
.map(|res| res.data);
|
||||
{
|
||||
Ok(response) => response,
|
||||
Err(e) => panic!("query failed incorrectly: {e:?}"),
|
||||
};
|
||||
|
||||
if result.is_none() && state_opt.is_none() {
|
||||
continue;
|
||||
@@ -1383,7 +1385,12 @@ impl ApiTester {
|
||||
let state = state_opt.as_mut().expect("result should be none");
|
||||
let expected = state.pending_consolidations().unwrap();
|
||||
|
||||
assert_eq!(result.unwrap(), expected.to_vec());
|
||||
let response = result.unwrap();
|
||||
assert_eq!(response.data(), &expected.to_vec());
|
||||
|
||||
// Check that the version header is returned in the response
|
||||
let fork_name = state.fork_name(&self.chain.spec).unwrap();
|
||||
assert_eq!(response.version(), Some(fork_name),);
|
||||
}
|
||||
|
||||
self
|
||||
|
||||
Reference in New Issue
Block a user