From ea322d65017ae40b8566afbc525598e6725c3fc9 Mon Sep 17 00:00:00 2001 From: Bogdan Mircea Date: Wed, 20 Sep 2023 20:07:45 +0300 Subject: [PATCH] Add back needed changes to credx issuer_create_credential Signed-off-by: Bogdan Mircea --- aries_vcx_core/src/anoncreds/credx_anoncreds.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/aries_vcx_core/src/anoncreds/credx_anoncreds.rs b/aries_vcx_core/src/anoncreds/credx_anoncreds.rs index 13e0cb452b..e4c6a3a180 100644 --- a/aries_vcx_core/src/anoncreds/credx_anoncreds.rs +++ b/aries_vcx_core/src/anoncreds/credx_anoncreds.rs @@ -504,6 +504,20 @@ impl BaseAnonCreds for IndyCredxAnonCreds { Some((rev_reg_def, rev_reg_def_priv, rev_reg, rev_reg_info)) => { rev_reg_info.curr_id += 1; + let RevocationRegistryDefinition::RevocationRegistryDefinitionV1(rev_reg_def_v1) = + rev_reg_def; + + if rev_reg_info.curr_id > rev_reg_def_v1.value.max_cred_num { + return Err(AriesVcxCoreError::from_msg( + AriesVcxCoreErrorKind::ActionNotSupported, + "The revocation registry is full", + )); + } + + if rev_reg_def_v1.value.issuance_type == IssuanceType::ISSUANCE_ON_DEMAND { + rev_reg_info.used_ids.insert(rev_reg_info.curr_id); + } + let revocation_config = CredentialRevocationConfig { reg_def: rev_reg_def, reg_def_private: rev_reg_def_priv,