Skip to content
Merged
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: 0 additions & 2 deletions post-compute/src/compute/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ pub enum ReplicateStatusCause {
PostComputeEncryptionPublicKeyMissing,
#[error("Unexpected error occurred")]
PostComputeFailedUnknownIssue,
#[error("Invalid enclave challenge private key")]
PostComputeInvalidEnclaveChallengePrivateKey,
#[error("Invalid TEE signature")]
PostComputeInvalidTeeSignature,
#[error("Failed to upload to IPFS")]
Expand Down
6 changes: 3 additions & 3 deletions post-compute/src/compute/signer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ use alloy_signer_local::PrivateKeySigner;
/// # Errors
///
/// This function will return an error in the following situations:
/// * The provided private key cannot be parsed as a valid `PrivateKeySigner` (returns `PostComputeInvalidEnclaveChallengePrivateKey`)
/// * The provided private key cannot be parsed as a valid `PrivateKeySigner` (returns `PostComputeInvalidTeeSignature`)
/// * The signing operation fails (returns `PostComputeInvalidTeeSignature`)
///
/// # Example
Expand All @@ -49,7 +49,7 @@ pub fn sign_enclave_challenge(
) -> Result<String, ReplicateStatusCause> {
let signer: PrivateKeySigner = enclave_challenge_private_key
.parse::<PrivateKeySigner>()
.map_err(|_| ReplicateStatusCause::PostComputeInvalidEnclaveChallengePrivateKey)?;
.map_err(|_| ReplicateStatusCause::PostComputeInvalidTeeSignature)?;

let signature: Signature = signer
.sign_message_sync(&hex_string_to_byte_array(message_hash))
Expand Down Expand Up @@ -144,7 +144,7 @@ mod tests {
assert!(
matches!(
result,
Err(err) if err == ReplicateStatusCause::PostComputeInvalidEnclaveChallengePrivateKey
Err(err) if err == ReplicateStatusCause::PostComputeInvalidTeeSignature
),
"Should return missing TEE challenge private key error"
);
Expand Down