Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Update the voluntary exit endpoint to comply with the key manager specification #4679

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion common/eth2/src/lighthouse_vc/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,7 @@ impl ValidatorClientHttpClient {
&self,
pubkey: &PublicKeyBytes,
epoch: Option<Epoch>,
) -> Result<SignedVoluntaryExit, Error> {
) -> Result<GenericResponse<SignedVoluntaryExit>, Error> {
let mut path = self.server.full.clone();

path.path_segments_mut()
Expand Down
5 changes: 3 additions & 2 deletions validator_client/src/http_api/create_signed_voluntary_exit.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use crate::validator_store::ValidatorStore;
use bls::{PublicKey, PublicKeyBytes};
use eth2::types::GenericResponse;
use slog::{info, Logger};
use slot_clock::SlotClock;
use std::sync::Arc;
Expand All @@ -11,7 +12,7 @@ pub async fn create_signed_voluntary_exit<T: 'static + SlotClock + Clone, E: Eth
validator_store: Arc<ValidatorStore<T, E>>,
slot_clock: T,
log: Logger,
) -> Result<SignedVoluntaryExit, warp::Rejection> {
) -> Result<GenericResponse<SignedVoluntaryExit>, warp::Rejection> {
let epoch = match maybe_epoch {
Some(epoch) => epoch,
None => get_current_epoch::<T, E>(slot_clock).ok_or_else(|| {
Expand Down Expand Up @@ -60,7 +61,7 @@ pub async fn create_signed_voluntary_exit<T: 'static + SlotClock + Clone, E: Eth
))
})?;

Ok(signed_voluntary_exit)
Ok(GenericResponse::from(signed_voluntary_exit))
}

/// Calculates the current epoch from the genesis time and current time.
Expand Down
2 changes: 1 addition & 1 deletion validator_client/src/http_api/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ impl ApiTester {
.await;

assert!(resp.is_ok());
assert_eq!(resp.unwrap().message.epoch, expected_exit_epoch);
assert_eq!(resp.unwrap().data.message.epoch, expected_exit_epoch);

self
}
Expand Down