From f7785c52b814dfa01c6d16dbecfcc937d533b710 Mon Sep 17 00:00:00 2001 From: Berend Sliedrecht <61358536+berendsliedrecht@users.noreply.github.com> Date: Sat, 3 Feb 2024 11:45:52 +0100 Subject: [PATCH] fix(anoncreds): only store the revocation registry definition when the state is finished (#1735) --- packages/anoncreds/src/AnonCredsApi.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/anoncreds/src/AnonCredsApi.ts b/packages/anoncreds/src/AnonCredsApi.ts index a71c64f441..13ccc3b27a 100644 --- a/packages/anoncreds/src/AnonCredsApi.ts +++ b/packages/anoncreds/src/AnonCredsApi.ts @@ -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,