Skip to content

Commit

Permalink
Add back needed changes to credx issuer_create_credential
Browse files Browse the repository at this point in the history
Signed-off-by: Bogdan Mircea <mirceapetrebogdan@gmail.com>
  • Loading branch information
bobozaur committed Sep 20, 2023
1 parent e9eb1b0 commit ea322d6
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions aries_vcx_core/src/anoncreds/credx_anoncreds.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit ea322d6

Please sign in to comment.