Skip to content

Commit 6eafeca

Browse files
authored
fix: remove invalid enclave challenge private key error (#7)
1 parent a718242 commit 6eafeca

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

post-compute/src/compute/errors.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ pub enum ReplicateStatusCause {
1515
PostComputeEncryptionPublicKeyMissing,
1616
#[error("Unexpected error occurred")]
1717
PostComputeFailedUnknownIssue,
18-
#[error("Invalid enclave challenge private key")]
19-
PostComputeInvalidEnclaveChallengePrivateKey,
2018
#[error("Invalid TEE signature")]
2119
PostComputeInvalidTeeSignature,
2220
#[error("Failed to upload to IPFS")]

post-compute/src/compute/signer.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ use alloy_signer_local::PrivateKeySigner;
2727
/// # Errors
2828
///
2929
/// This function will return an error in the following situations:
30-
/// * The provided private key cannot be parsed as a valid `PrivateKeySigner` (returns `PostComputeInvalidEnclaveChallengePrivateKey`)
30+
/// * The provided private key cannot be parsed as a valid `PrivateKeySigner` (returns `PostComputeInvalidTeeSignature`)
3131
/// * The signing operation fails (returns `PostComputeInvalidTeeSignature`)
3232
///
3333
/// # Example
@@ -49,7 +49,7 @@ pub fn sign_enclave_challenge(
4949
) -> Result<String, ReplicateStatusCause> {
5050
let signer: PrivateKeySigner = enclave_challenge_private_key
5151
.parse::<PrivateKeySigner>()
52-
.map_err(|_| ReplicateStatusCause::PostComputeInvalidEnclaveChallengePrivateKey)?;
52+
.map_err(|_| ReplicateStatusCause::PostComputeInvalidTeeSignature)?;
5353

5454
let signature: Signature = signer
5555
.sign_message_sync(&hex_string_to_byte_array(message_hash))
@@ -144,7 +144,7 @@ mod tests {
144144
assert!(
145145
matches!(
146146
result,
147-
Err(err) if err == ReplicateStatusCause::PostComputeInvalidEnclaveChallengePrivateKey
147+
Err(err) if err == ReplicateStatusCause::PostComputeInvalidTeeSignature
148148
),
149149
"Should return missing TEE challenge private key error"
150150
);

0 commit comments

Comments
 (0)