mirror of
https://github.com/sigp/lighthouse.git
synced 2026-03-22 06:14:38 +00:00
@@ -701,6 +701,29 @@ impl BeaconNodeHttpClient {
|
||||
self.post_with_opt_response(path, &request).await
|
||||
}
|
||||
|
||||
/// `POST beacon/states/{state_id}/validator_identities`
|
||||
///
|
||||
/// Returns `Ok(None)` on a 404 error.
|
||||
pub async fn post_beacon_states_validator_identities(
|
||||
&self,
|
||||
state_id: StateId,
|
||||
ids: Vec<ValidatorId>,
|
||||
) -> Result<Option<ExecutionOptimisticFinalizedResponse<Vec<ValidatorIdentityData>>>, 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("validator_identities");
|
||||
|
||||
let request = ValidatorIdentitiesRequestBody { ids };
|
||||
|
||||
self.post_with_opt_response(path, &request).await
|
||||
}
|
||||
|
||||
/// `GET beacon/states/{state_id}/validators?id,status`
|
||||
///
|
||||
/// Returns `Ok(None)` on a 404 error.
|
||||
|
||||
@@ -349,6 +349,14 @@ pub struct ValidatorBalanceData {
|
||||
pub balance: u64,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||
pub struct ValidatorIdentityData {
|
||||
#[serde(with = "serde_utils::quoted_u64")]
|
||||
pub index: u64,
|
||||
pub pubkey: PublicKeyBytes,
|
||||
pub activation_epoch: Epoch,
|
||||
}
|
||||
|
||||
// Implemented according to what is described here:
|
||||
//
|
||||
// https://hackmd.io/ofFJ5gOmQpu1jjHilHbdQQ
|
||||
@@ -694,6 +702,12 @@ pub struct ValidatorBalancesRequestBody {
|
||||
pub ids: Vec<ValidatorId>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Default, Serialize, Deserialize)]
|
||||
#[serde(transparent)]
|
||||
pub struct ValidatorIdentitiesRequestBody {
|
||||
pub ids: Vec<ValidatorId>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Deserialize)]
|
||||
#[serde(deny_unknown_fields)]
|
||||
pub struct BlobIndicesQuery {
|
||||
|
||||
Reference in New Issue
Block a user