Skip to content

Commit

Permalink
Merge pull request #57 from PufferFinance/ln-complete-sign-exit-resp
Browse files Browse the repository at this point in the history
Complete `SignExitResponse`
  • Loading branch information
lean-apple authored Mar 13, 2024
2 parents 1363a7c + 4fde0a3 commit b28ba61
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/enclave/guardian/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ fn verify_deposit_message(keygen_payload: &crate::enclave::types::BlsKeygenPaylo
Ok(())
}

fn verify_custody(
pub fn verify_custody(
keygen_payload: &crate::enclave::types::BlsKeygenPayload,
guardian_enclave_sk: &EthSecretKey,
) -> Result<blsttc::SecretKeyShare> {
Expand Down Expand Up @@ -240,14 +240,15 @@ pub fn sign_voluntary_exit_message(
let sk = crate::crypto::bls_keys::fetch_bls_sk(&pk_hex)?.secret_key();

// Sign a VoluntaryExitMessage with Epoch 0
let (sig, _root) = sign_vem(sk, 0, req.validator_index, req.fork_info)?;
let (sig, root) = sign_vem(sk, 0, req.validator_index, req.fork_info)?;

Ok(crate::enclave::types::SignExitResponse {
signature: hex::encode(sig.as_ssz_bytes()),
message: hex::encode(root),
})
}

fn sign_vem(
pub fn sign_vem(
sk_share: blsttc::SecretKey,
epoch: crate::eth2::eth_types::Epoch,
validator_index: crate::eth2::eth_types::ValidatorIndex,
Expand Down
1 change: 1 addition & 0 deletions src/enclave/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,7 @@ impl SignExitRequest {
#[serde(rename_all = "camelCase")]
pub struct SignExitResponse {
pub signature: String,
pub message: String,
}

#[derive(serde::Serialize, serde::Deserialize, Debug)]
Expand Down

0 comments on commit b28ba61

Please sign in to comment.