Fix proposer lookahead endpoint JSON return type (#8970)

Co-Authored-By: Tan Chee Keong <tanck@sigmaprime.io>
This commit is contained in:
chonghe
2026-03-12 09:11:37 +08:00
committed by GitHub
parent a36b7f3ddb
commit e1e97e6df0
4 changed files with 15 additions and 5 deletions

View File

@@ -9,7 +9,7 @@ use crate::version::{
use beacon_chain::{BeaconChain, BeaconChainError, BeaconChainTypes, WhenSlotSkipped};
use eth2::types::{
self as api_types, ValidatorBalancesRequestBody, ValidatorId, ValidatorIdentitiesRequestBody,
ValidatorsRequestBody,
ValidatorIndexData, ValidatorsRequestBody,
};
use ssz::Encode;
use std::sync::Arc;
@@ -213,7 +213,7 @@ pub fn get_beacon_state_proposer_lookahead<T: BeaconChainTypes>(
ResponseIncludesVersion::Yes(fork_name),
execution_optimistic,
finalized,
data,
ValidatorIndexData(data),
)
.map(|res| warp::reply::json(&res).into_response()),
}

View File

@@ -1430,10 +1430,11 @@ impl ApiTester {
}
let state = state_opt.as_mut().expect("result should be none");
let expected = state.proposer_lookahead().unwrap();
let expected = state.proposer_lookahead().unwrap().to_vec();
let response = result.unwrap();
assert_eq!(response.data(), &expected.to_vec());
// Compare Vec<u64> directly, not Vec<String>
assert_eq!(response.data().0, expected);
// Check that the version header is returned in the response
let fork_name = state.fork_name(&self.chain.spec).unwrap();