diff --git a/src/ffi/credential.rs b/src/ffi/credential.rs index eb10d1d3..f69db723 100644 --- a/src/ffi/credential.rs +++ b/src/ffi/credential.rs @@ -12,7 +12,6 @@ use crate::error::Result; use crate::services::{ issuer::create_credential, prover::process_credential, - tails::TailsFileReader, types::{Credential, CredentialRevocationConfig, MakeCredentialValues}, utils::encode_credential_attribute, }; @@ -30,7 +29,6 @@ struct RevocationConfig { reg_def: AnoncredsObject, reg_def_private: AnoncredsObject, reg_idx: u32, - tails_path: String, } impl RevocationConfig { @@ -39,7 +37,6 @@ impl RevocationConfig { reg_def: self.reg_def.cast_ref()?, reg_def_private: self.reg_def_private.cast_ref()?, registry_idx: self.reg_idx, - tails_reader: TailsFileReader::new_tails_reader(self.tails_path.as_str()), }) } } @@ -103,11 +100,6 @@ pub extern "C" fn anoncreds_create_credential( None } else { let revocation = unsafe { &*revocation }; - let tails_path = revocation - .tails_path - .as_opt_str() - .ok_or_else(|| err_msg!("Missing tails file path"))? - .to_string(); Some(RevocationConfig { reg_def: revocation.reg_def.load()?, reg_def_private: revocation.reg_def_private.load()?, @@ -115,7 +107,6 @@ pub extern "C" fn anoncreds_create_credential( .reg_idx .try_into() .map_err(|_| err_msg!("Invalid revocation index"))?, - tails_path, }) }; diff --git a/src/services/types.rs b/src/services/types.rs index fde858f3..945728e9 100644 --- a/src/services/types.rs +++ b/src/services/types.rs @@ -1,4 +1,3 @@ -use super::tails::TailsReader; use crate::cl::{RevocationRegistry as CryptoRevocationRegistry, Witness}; pub use crate::data_types::{ cred_def::{CredentialDefinitionPrivate, CredentialKeyCorrectnessProof, SignatureType}, @@ -219,18 +218,16 @@ pub struct CredentialRevocationConfig<'a> { pub reg_def: &'a RevocationRegistryDefinition, pub reg_def_private: &'a RevocationRegistryDefinitionPrivate, pub registry_idx: u32, - pub tails_reader: TailsReader, } impl<'a> std::fmt::Debug for CredentialRevocationConfig<'a> { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { write!( f, - "CredentialRevocationConfig {{ reg_def: {:?}, private: {:?}, idx: {}, reader: {:?} }}", + "CredentialRevocationConfig {{ reg_def: {:?}, private: {:?}, idx: {} }}", self.reg_def, secret!(self.reg_def_private), secret!(self.registry_idx), - self.tails_reader, ) } } diff --git a/tests/anoncreds_demos.rs b/tests/anoncreds_demos.rs index c4163ea4..f6330bb4 100644 --- a/tests/anoncreds_demos.rs +++ b/tests/anoncreds_demos.rs @@ -4,7 +4,7 @@ use anoncreds::data_types::rev_reg_def::RevocationRegistryDefinitionId; use anoncreds::data_types::schema::SchemaId; use anoncreds::issuer; use anoncreds::prover; -use anoncreds::tails::{TailsFileReader, TailsFileWriter}; +use anoncreds::tails::TailsFileWriter; use anoncreds::types::{CredentialRevocationConfig, PresentCredentials}; use anoncreds::verifier; use serde_json::json; @@ -243,7 +243,6 @@ fn anoncreds_demo_works_with_revocation_for_single_issuer_single_prover() { // Get the location of the tails_file so it can be read let tails_location = gvt_rev_reg_def.value.tails_location.clone(); - let tr = TailsFileReader::new_tails_reader(tails_location.as_str()); let issue_cred = issuer::create_credential( &gvt_cred_def, @@ -257,7 +256,6 @@ fn anoncreds_demo_works_with_revocation_for_single_issuer_single_prover() { reg_def: &gvt_rev_reg_def, reg_def_private: &gvt_rev_reg_def_priv, registry_idx: fixtures::GVT_REV_IDX, - tails_reader: tr, }), ) .expect("Error creating credential"); diff --git a/tests/utils/mock.rs b/tests/utils/mock.rs index e85e3d2e..49de14f9 100644 --- a/tests/utils/mock.rs +++ b/tests/utils/mock.rs @@ -15,7 +15,7 @@ use anoncreds::{ schema::{Schema, SchemaId}, }, issuer, prover, - tails::{TailsFileReader, TailsFileWriter}, + tails::TailsFileWriter, types::{ CredentialDefinitionConfig, CredentialRequest, CredentialRevocationConfig, MakeCredentialValues, PresentCredentials, PresentationRequest, RegistryType, SignatureType, @@ -268,20 +268,14 @@ impl<'a> Mock<'a> { } let (rev_config, rev_id) = match issuer_wallet.rev_defs.get(rev_reg_id) { - Some(stored_rev_def) => { - let tr = TailsFileReader::new_tails_reader( - stored_rev_def.public.value.tails_location.as_str(), - ); - ( - Some(CredentialRevocationConfig { - reg_def: &stored_rev_def.public, - reg_def_private: &stored_rev_def.private, - registry_idx: rev_idx, - tails_reader: tr, - }), - Some(RevocationRegistryId::new_unchecked(rev_reg_id)), - ) - } + Some(stored_rev_def) => ( + Some(CredentialRevocationConfig { + reg_def: &stored_rev_def.public, + reg_def_private: &stored_rev_def.private, + registry_idx: rev_idx, + }), + Some(RevocationRegistryId::new_unchecked(rev_reg_id)), + ), None => (None, None), }; diff --git a/wrappers/python/anoncreds/bindings.py b/wrappers/python/anoncreds/bindings.py index b7ea1233..bdf212fe 100644 --- a/wrappers/python/anoncreds/bindings.py +++ b/wrappers/python/anoncreds/bindings.py @@ -398,7 +398,6 @@ class RevocationConfig(Structure): ("rev_reg_def", ObjectHandle), ("rev_reg_def_private", ObjectHandle), ("rev_reg_index", c_int64), - ("tails_path", c_char_p), ] @classmethod @@ -407,13 +406,11 @@ def create( rev_reg_def: AnoncredsObject, rev_reg_def_private: AnoncredsObject, rev_reg_index: int, - tails_path: str, ) -> "RevocationConfig": config = RevocationConfig( rev_reg_def=rev_reg_def.handle, rev_reg_def_private=rev_reg_def_private.handle, rev_reg_index=rev_reg_index, - tails_path=encode_str(tails_path), ) keepalive(config, rev_reg_def, rev_reg_def_private) return config diff --git a/wrappers/python/anoncreds/types.py b/wrappers/python/anoncreds/types.py index 5b1b4b2a..6dc0ae07 100644 --- a/wrappers/python/anoncreds/types.py +++ b/wrappers/python/anoncreds/types.py @@ -630,7 +630,6 @@ def __init__( rev_reg_def: Union[str, "RevocationRegistryDefinition"], rev_reg_def_private: Union[str, "RevocationRegistryDefinitionPrivate"], rev_reg_index: int, - tails_path: str, ): if not isinstance(rev_reg_def, bindings.AnoncredsObject): rev_reg_def = RevocationRegistryDefinition.load(rev_reg_def) @@ -641,7 +640,6 @@ def __init__( ) self.rev_reg_def_private = rev_reg_def_private self.rev_reg_index = rev_reg_index - self.tails_path = tails_path @property def _native(self) -> bindings.RevocationConfig: @@ -649,7 +647,6 @@ def _native(self) -> bindings.RevocationConfig: self.rev_reg_def, self.rev_reg_def_private, self.rev_reg_index, - self.tails_path, ) class NonrevokedIntervalOverride: diff --git a/wrappers/python/demo/test.py b/wrappers/python/demo/test.py index cf70329f..b2da6d4b 100644 --- a/wrappers/python/demo/test.py +++ b/wrappers/python/demo/test.py @@ -1,5 +1,3 @@ -from time import time - from anoncreds import ( generate_nonce, create_link_secret, @@ -14,7 +12,6 @@ PresentCredentials, RevocationRegistryDefinition, RevocationStatusList, - NonrevokedIntervalOverride, Schema, ) @@ -92,7 +89,6 @@ rev_reg_def_pub, rev_reg_def_private, rev_idx, - rev_reg_def_pub.tails_location, ), )