diff --git a/packages/indy-sdk/src/ledger/IndySdkPoolService.ts b/packages/indy-sdk/src/ledger/IndySdkPoolService.ts index 23928fafa5..40bee58457 100644 --- a/packages/indy-sdk/src/ledger/IndySdkPoolService.ts +++ b/packages/indy-sdk/src/ledger/IndySdkPoolService.ts @@ -98,7 +98,9 @@ export class IndySdkPoolService { } const cache = agentContext.dependencyManager.resolve(CacheModuleConfig).cache - const cachedNymResponse = await cache.get(agentContext, `IndySdkPoolService:${did}`) + const cacheKey = `IndySdkPoolService:${did}` + + const cachedNymResponse = await cache.get(agentContext, cacheKey) const pool = this.pools.find((pool) => pool.didIndyNamespace === cachedNymResponse?.indyNamespace) // If we have the nym response with associated pool in the cache, we'll use that @@ -145,7 +147,7 @@ export class IndySdkPoolService { value = productionOrNonProduction[0].value } - await cache.set(agentContext, `IndySdkPoolService:${did}`, { + await cache.set(agentContext, cacheKey, { nymResponse: value.did, indyNamespace: value.pool.didIndyNamespace, } satisfies CachedDidResponse) diff --git a/packages/indy-vdr/src/pool/IndyVdrPoolService.ts b/packages/indy-vdr/src/pool/IndyVdrPoolService.ts index d8e31f72a7..95194dc8da 100644 --- a/packages/indy-vdr/src/pool/IndyVdrPoolService.ts +++ b/packages/indy-vdr/src/pool/IndyVdrPoolService.ts @@ -73,9 +73,10 @@ export class IndyVdrPoolService { ) } - const didCache = agentContext.dependencyManager.resolve(CacheModuleConfig).cache + const cache = agentContext.dependencyManager.resolve(CacheModuleConfig).cache + const cacheKey = `IndyVdrPoolService:${did}` - const cachedNymResponse = await didCache.get(agentContext, `IndyVdrPoolService:${did}`) + const cachedNymResponse = await cache.get(agentContext, cacheKey) const pool = this.pools.find((pool) => pool.indyNamespace === cachedNymResponse?.indyNamespace) // If we have the nym response with associated pool in the cache, we'll use that @@ -122,7 +123,7 @@ export class IndyVdrPoolService { value = productionOrNonProduction[0].value } - await didCache.set(agentContext, did, { + await cache.set(agentContext, cacheKey, { nymResponse: { did: value.did.nymResponse.did, verkey: value.did.nymResponse.verkey,