Skip to content

Commit

Permalink
fix(anoncreds): only store the revocation registry definition when th…
Browse files Browse the repository at this point in the history
…e state is finished

Signed-off-by: Berend Sliedrecht <[email protected]>
  • Loading branch information
berendsliedrecht committed Feb 2, 2024
1 parent e4b99a8 commit beebfbd
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/anoncreds/src/AnonCredsApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,10 @@ export class AnonCredsApi {
options: options.options,
})

await this.storeRevocationRegistryDefinitionRecord(result, revocationRegistryDefinitionPrivate)
// To avoid having unregistered revocation registry definitions in the wallet, the revocation registry definition itself are stored only when the revocation registry definition status is finished, meaning that the revocation registry definition has been successfully registered.
if (result.revocationRegistryDefinitionState.state === 'finished') {
await this.storeRevocationRegistryDefinitionRecord(result, revocationRegistryDefinitionPrivate)
}

return {
...result,
Expand Down

0 comments on commit beebfbd

Please sign in to comment.