Skip to content

Commit

Permalink
refactor: rename failure to failed
Browse files Browse the repository at this point in the history
Signed-off-by: Gustavo Inacio <[email protected]>
  • Loading branch information
gusinacio committed Aug 16, 2024
1 parent d2dfaf2 commit 3d88232
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions tap_core/src/manager/context/memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ pub mod checks {
{
Ok(())
} else {
Err(CheckError::Failure(
Err(CheckError::Failed(
ReceiptError::InvalidAllocationID {
received_allocation_id,
}
Expand All @@ -328,7 +328,7 @@ pub mod checks {
.signed_receipt()
.recover_signer(&self.domain_separator)
.map_err(|e| {
CheckError::Failure(
CheckError::Failed(
ReceiptError::InvalidSignature {
source_error_message: e.to_string(),
}
Expand All @@ -337,7 +337,7 @@ pub mod checks {
})?;

if !self.valid_signers.contains(&recovered_address) {
Err(CheckError::Failure(
Err(CheckError::Failed(
ReceiptError::InvalidSignature {
source_error_message: "Invalid signer".to_string(),
}
Expand Down
4 changes: 2 additions & 2 deletions tap_core/src/receipt/checks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ pub enum CheckError {
#[error(transparent)]
Retryable(anyhow::Error),
#[error(transparent)]
Failure(anyhow::Error),
Failed(anyhow::Error),
}

/// CheckList is a NewType pattern to store a list of checks.
Expand Down Expand Up @@ -123,7 +123,7 @@ impl Check for StatefulTimestampCheck {
let min_timestamp_ns = *self.min_timestamp_ns.read().unwrap();
let signed_receipt = receipt.signed_receipt();
if signed_receipt.message.timestamp_ns <= min_timestamp_ns {
return Err(CheckError::Failure(
return Err(CheckError::Failed(
ReceiptError::InvalidTimestamp {
received_timestamp: signed_receipt.message.timestamp_ns,
timestamp_min: min_timestamp_ns,
Expand Down
2 changes: 1 addition & 1 deletion tap_core/src/receipt/received_receipt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ impl ReceiptWithState<Checking> {
// return early on an error
check.check(self).await.map_err(|e| match e {
CheckError::Retryable(e) => ReceiptError::RetryableCheck(e.to_string()),
CheckError::Failure(e) => ReceiptError::CheckFailure(e.to_string()),
CheckError::Failed(e) => ReceiptError::CheckFailure(e.to_string()),
})?;
}
Ok(())
Expand Down

0 comments on commit 3d88232

Please sign in to comment.