mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2024-12-22 11:41:28 +00:00
validator liveness endpoint should accept string encoded indices (#5184)
* deserialize string indices as u64 * client should send quoted indices
This commit is contained in:
parent
4172d9f75c
commit
e7ef2a3a54
@ -3864,7 +3864,7 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// POST vaidator/liveness/{epoch}
|
// POST validator/liveness/{epoch}
|
||||||
let post_validator_liveness_epoch = eth_v1
|
let post_validator_liveness_epoch = eth_v1
|
||||||
.and(warp::path("validator"))
|
.and(warp::path("validator"))
|
||||||
.and(warp::path("liveness"))
|
.and(warp::path("liveness"))
|
||||||
@ -3875,7 +3875,7 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
.and(chain_filter.clone())
|
.and(chain_filter.clone())
|
||||||
.then(
|
.then(
|
||||||
|epoch: Epoch,
|
|epoch: Epoch,
|
||||||
indices: Vec<u64>,
|
indices: api_types::ValidatorIndexData,
|
||||||
task_spawner: TaskSpawner<T::EthSpec>,
|
task_spawner: TaskSpawner<T::EthSpec>,
|
||||||
chain: Arc<BeaconChain<T>>| {
|
chain: Arc<BeaconChain<T>>| {
|
||||||
task_spawner.blocking_json_task(Priority::P0, move || {
|
task_spawner.blocking_json_task(Priority::P0, move || {
|
||||||
@ -3894,6 +3894,7 @@ pub fn serve<T: BeaconChainTypes>(
|
|||||||
}
|
}
|
||||||
|
|
||||||
let liveness: Vec<api_types::StandardLivenessResponseData> = indices
|
let liveness: Vec<api_types::StandardLivenessResponseData> = indices
|
||||||
|
.0
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|index| {
|
.map(|index| {
|
||||||
|
@ -2258,7 +2258,7 @@ impl BeaconNodeHttpClient {
|
|||||||
pub async fn post_validator_liveness_epoch(
|
pub async fn post_validator_liveness_epoch(
|
||||||
&self,
|
&self,
|
||||||
epoch: Epoch,
|
epoch: Epoch,
|
||||||
indices: &Vec<u64>,
|
indices: &[u64],
|
||||||
) -> Result<GenericResponse<Vec<StandardLivenessResponseData>>, Error> {
|
) -> Result<GenericResponse<Vec<StandardLivenessResponseData>>, Error> {
|
||||||
let mut path = self.eth_path(V1)?;
|
let mut path = self.eth_path(V1)?;
|
||||||
|
|
||||||
@ -2268,7 +2268,11 @@ impl BeaconNodeHttpClient {
|
|||||||
.push("liveness")
|
.push("liveness")
|
||||||
.push(&epoch.to_string());
|
.push(&epoch.to_string());
|
||||||
|
|
||||||
self.post_with_timeout_and_response(path, indices, self.timeouts.liveness)
|
self.post_with_timeout_and_response(
|
||||||
|
path,
|
||||||
|
&ValidatorIndexDataRef(indices),
|
||||||
|
self.timeouts.liveness,
|
||||||
|
)
|
||||||
.await
|
.await
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user