From bd81cfd707dbd285c88b3b64f3dd8a46b4e593f2 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 11 Dec 2024 12:01:18 +0100 Subject: [PATCH 1/2] Add storing signature on local store --- .../local-store/local-store-command.js | 29 ++++++------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/src/commands/local-store/local-store-command.js b/src/commands/local-store/local-store-command.js index 57e249026..37ef994ee 100644 --- a/src/commands/local-store/local-store-command.js +++ b/src/commands/local-store/local-store-command.js @@ -55,32 +55,21 @@ class LocalStoreCommand extends Command { ); if (storeType === LOCAL_STORE_TYPES.TRIPLE) { - const storePromises = []; - - // if (cachedData.dataset && cachedData.datasetRoot) { - // storePromises.push( - // this.pendingStorageService.cacheDataset( - // operationId, - // cachedData.datasetRoot, - // cachedData.dataset, - // ), - // ); - // } - // if (cachedData.private?.assertion && cachedData.private?.assertionId) { - // storePromises.push( - // this.pendingStorageService.cacheDataset(operationId, datasetRoot, dataset), - // ); - // } - await Promise.all(storePromises); + this.operationIdService.emitChangeEvent( + OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_PROCESS_RESPONSE_START, + operationId, + blockchain, + ); const identityId = await this.blockchainModuleManager.getIdentityId(blockchain); const signature = await this.blsService.sign(datasetRoot); - this.operationIdService.emitChangeEvent( - OPERATION_ID_STATUS.LOCAL_STORE.LOCAL_STORE_PROCESS_RESPONSE_START, + await this.signatureStorageService.addSignatureToStorage( operationId, - blockchain, + identityId, + signature, ); + await this.operationService.processResponse( command, OPERATION_REQUEST_STATUS.COMPLETED, From feb925b40d69b15605a28d593c67a069a10a4305 Mon Sep 17 00:00:00 2001 From: Mihajlo Pavlovic Date: Wed, 11 Dec 2024 12:03:40 +0100 Subject: [PATCH 2/2] Import signatureStorageService --- src/commands/local-store/local-store-command.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/commands/local-store/local-store-command.js b/src/commands/local-store/local-store-command.js index 37ef994ee..f87077d7f 100644 --- a/src/commands/local-store/local-store-command.js +++ b/src/commands/local-store/local-store-command.js @@ -22,6 +22,7 @@ class LocalStoreCommand extends Command { this.commandExecutor = ctx.commandExecutor; this.repositoryModuleManager = ctx.repositoryModuleManager; this.blsService = ctx.blsService; + this.signatureStorageService = ctx.signatureStorageService; this.errorType = ERROR_TYPE.LOCAL_STORE.LOCAL_STORE_ERROR; }