From 33670b6347cad06dfffb097ea672d7f025a00b99 Mon Sep 17 00:00:00 2001 From: Enrico Marconi Date: Fri, 26 Jan 2024 13:23:54 +0100 Subject: [PATCH] change error name, fix test --- .../src/revocation/status_list_2021/credential.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/identity_credential/src/revocation/status_list_2021/credential.rs b/identity_credential/src/revocation/status_list_2021/credential.rs index d01d28a155..3784358290 100644 --- a/identity_credential/src/revocation/status_list_2021/credential.rs +++ b/identity_credential/src/revocation/status_list_2021/credential.rs @@ -39,7 +39,7 @@ pub enum StatusList2021CredentialError { Unreferenceable, /// Credentials cannot be unrevoked. #[error("A previously revoked credential cannot be unrevoked.")] - UnrevocableCredential, + UnreversibleRevocation, } use crate::credential::Credential; @@ -148,7 +148,7 @@ impl StatusList2021Credential { let mut status_list = self.status_list()?; let entry_status = status_list.get(index)?; if self.purpose() == StatusPurpose::Revocation && !value && entry_status { - return Err(StatusList2021CredentialError::UnrevocableCredential); + return Err(StatusList2021CredentialError::UnreversibleRevocation); } status_list.set(index, value)?; self.subject.encoded_list = status_list.into_encoded_str(); @@ -429,7 +429,7 @@ mod tests { status_list_credential.set_entry(420, true).unwrap(); assert_eq!( status_list_credential.set_entry(420, false), - Err(StatusList2021CredentialError::UnrevocableCredential) + Err(StatusList2021CredentialError::UnreversibleRevocation) ); } #[test] @@ -443,5 +443,7 @@ mod tests { .unwrap(); assert!(status_list_credential.set_entry(420, false).is_ok()); + status_list_credential.set_entry(420, true).unwrap(); + assert!(status_list_credential.set_entry(420, false).is_ok()); } }