diff --git a/anoncreds/src/data_types/anoncreds/rev_reg.rs b/anoncreds/src/data_types/anoncreds/rev_reg.rs index c4ff356f..c4f20fa0 100644 --- a/anoncreds/src/data_types/anoncreds/rev_reg.rs +++ b/anoncreds/src/data_types/anoncreds/rev_reg.rs @@ -55,7 +55,7 @@ pub struct RevocationRegistryDeltaV1 { #[derive(Clone, Debug, Serialize, Deserialize)] #[serde(rename_all = "camelCase")] -pub struct RevocationList { +pub struct RevocationStatusList { rev_reg_id: RevocationRegistryId, #[serde(with = "serde_revocation_list")] revocation_list: bitvec::vec::BitVec, @@ -64,13 +64,13 @@ pub struct RevocationList { timestamp: u64, } -impl From<&RevocationList> for ursa::cl::RevocationRegistry { - fn from(rev_reg_list: &RevocationList) -> ursa::cl::RevocationRegistry { +impl From<&RevocationStatusList> for ursa::cl::RevocationRegistry { + fn from(rev_reg_list: &RevocationStatusList) -> ursa::cl::RevocationRegistry { rev_reg_list.registry.clone() } } -impl RevocationList { +impl RevocationStatusList { pub(crate) fn timestamp(&self) -> u64 { self.timestamp } @@ -89,7 +89,7 @@ impl RevocationList { registry: ursa::cl::RevocationRegistry, timestamp: u64, ) -> Result { - Ok(RevocationList { + Ok(RevocationStatusList { rev_reg_id: RevocationRegistryId::new(rev_reg_id)?, revocation_list, registry, @@ -165,16 +165,16 @@ mod tests { #[test] fn json_rev_list_can_be_deserialized() { - let des = serde_json::from_str::(REVOCATION_LIST).unwrap(); + let des = serde_json::from_str::(REVOCATION_LIST).unwrap(); let expected_state = bitvec![1;4]; assert_eq!(des.state(), &expected_state); } #[test] fn test_revocation_list_roundtrip_serde() { - let des_from_json = serde_json::from_str::(REVOCATION_LIST).unwrap(); + let des_from_json = serde_json::from_str::(REVOCATION_LIST).unwrap(); let ser = serde_json::to_string(&des_from_json).unwrap(); - let des = serde_json::from_str::(&ser).unwrap(); + let des = serde_json::from_str::(&ser).unwrap(); let ser2 = serde_json::to_string(&des).unwrap(); assert_eq!(ser, ser2) } diff --git a/anoncreds/src/ffi/revocation.rs b/anoncreds/src/ffi/revocation.rs index db304ced..9b908d26 100644 --- a/anoncreds/src/ffi/revocation.rs +++ b/anoncreds/src/ffi/revocation.rs @@ -16,8 +16,9 @@ use crate::services::{ prover::create_or_update_revocation_state, tails::{TailsFileReader, TailsFileWriter}, types::{ - CredentialRevocationState, IssuanceType, RegistryType, RevocationList, RevocationRegistry, + CredentialRevocationState, IssuanceType, RegistryType, RevocationRegistry, RevocationRegistryDefinition, RevocationRegistryDefinitionPrivate, RevocationRegistryDelta, + RevocationStatusList, }, }; @@ -239,8 +240,8 @@ impl_anoncreds_object_from_json!( anoncreds_revocation_registry_delta_from_json ); -impl_anoncreds_object!(RevocationList, "RevocationList"); -impl_anoncreds_object_from_json!(RevocationList, anoncreds_revocation_list_from_json); +impl_anoncreds_object!(RevocationStatusList, "RevocationStatusList"); +impl_anoncreds_object_from_json!(RevocationStatusList, anoncreds_revocation_list_from_json); #[no_mangle] pub extern "C" fn anoncreds_create_or_update_revocation_state( diff --git a/anoncreds/src/services/prover.rs b/anoncreds/src/services/prover.rs index ff0e0344..c826f068 100644 --- a/anoncreds/src/services/prover.rs +++ b/anoncreds/src/services/prover.rs @@ -14,7 +14,7 @@ use crate::data_types::anoncreds::{ AttributeValue, Identifier, RequestedProof, RevealedAttributeGroupInfo, RevealedAttributeInfo, SubProofReferent, }, - rev_reg::RevocationList, + rev_reg::RevocationStatusList, schema::{Schema, SchemaId}, }; use crate::error::{Error, Result}; @@ -254,10 +254,10 @@ pub fn create_presentation( pub fn create_or_update_revocation_state( tails_reader: TailsReader, revoc_reg_def: &RevocationRegistryDefinition, - rev_reg_list: &RevocationList, + rev_reg_list: &RevocationStatusList, rev_reg_idx: u32, rev_state: Option<&CredentialRevocationState>, // for witness update - old_rev_reg_list: Option<&RevocationList>, // for witness update + old_rev_reg_list: Option<&RevocationStatusList>, // for witness update ) -> Result { trace!( "create_or_update_revocation_state >>> , tails_reader: {:?}, revoc_reg_def: {:?}, \ diff --git a/anoncreds/src/services/types.rs b/anoncreds/src/services/types.rs index d1bb3320..3f4e1036 100644 --- a/anoncreds/src/services/types.rs +++ b/anoncreds/src/services/types.rs @@ -9,7 +9,7 @@ pub use crate::data_types::anoncreds::{ master_secret::MasterSecret, pres_request::PresentationRequest, presentation::Presentation, - rev_reg::{RevocationList, RevocationRegistry, RevocationRegistryDelta}, + rev_reg::{RevocationRegistry, RevocationRegistryDelta, RevocationStatusList}, rev_reg_def::{ IssuanceType, RegistryType, RevocationRegistryDefinition, RevocationRegistryDefinitionPrivate, diff --git a/anoncreds/tests/anoncreds_demos.rs b/anoncreds/tests/anoncreds_demos.rs index 93699151..7c984d19 100644 --- a/anoncreds/tests/anoncreds_demos.rs +++ b/anoncreds/tests/anoncreds_demos.rs @@ -16,7 +16,7 @@ use anoncreds::{ types::{ CredentialDefinitionConfig, CredentialRevocationConfig, CredentialRevocationState, IssuanceType, MakeCredentialValues, PresentCredentials, PresentationRequest, RegistryType, - RevocationList, RevocationRegistry, RevocationRegistryDefinition, SignatureType, + RevocationRegistry, RevocationRegistryDefinition, RevocationStatusList, SignatureType, }, verifier, }; @@ -469,7 +469,7 @@ fn anoncreds_with_revocation_works_for_single_issuer_single_prover() { }; let revocation_list = - RevocationList::new(REV_REG_ID, list, ursa_rev_reg, prover_timestamp).unwrap(); + RevocationStatusList::new(REV_REG_ID, list, ursa_rev_reg, prover_timestamp).unwrap(); let new_rev_state = prover::create_or_update_revocation_state( tr, &rev_reg_def_pub,