mirror of
https://github.com/sigp/lighthouse.git
synced 2026-04-19 22:08:30 +00:00
Implement expected withdrawals endpoint (#4390)
## Issue Addressed [#4029](https://github.com/sigp/lighthouse/issues/4029) ## Proposed Changes implement expected_withdrawals HTTP API per the spec https://github.com/ethereum/beacon-APIs/pull/304 ## Additional Info
This commit is contained in:
@@ -1261,6 +1261,23 @@ impl BeaconNodeHttpClient {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
// GET builder/states/{state_id}/expected_withdrawals
|
||||
pub async fn get_expected_withdrawals(
|
||||
&self,
|
||||
state_id: &StateId,
|
||||
) -> Result<ExecutionOptimisticFinalizedResponse<Vec<Withdrawal>>, Error> {
|
||||
let mut path = self.eth_path(V1)?;
|
||||
|
||||
path.path_segments_mut()
|
||||
.map_err(|()| Error::InvalidUrl(self.server.clone()))?
|
||||
.push("builder")
|
||||
.push("states")
|
||||
.push(&state_id.to_string())
|
||||
.push("expected_withdrawals");
|
||||
|
||||
self.get(path).await
|
||||
}
|
||||
|
||||
/// `POST validator/contribution_and_proofs`
|
||||
pub async fn post_validator_contribution_and_proofs<T: EthSpec>(
|
||||
&self,
|
||||
|
||||
@@ -581,6 +581,11 @@ pub struct SyncingData {
|
||||
pub sync_distance: Slot,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct ExpectedWithdrawalsQuery {
|
||||
pub proposal_slot: Option<Slot>,
|
||||
}
|
||||
|
||||
#[derive(Clone, PartialEq, Debug, Deserialize)]
|
||||
#[serde(try_from = "String", bound = "T: FromStr")]
|
||||
pub struct QueryVec<T: FromStr> {
|
||||
|
||||
Reference in New Issue
Block a user