@0xpolygonid/js-sdk 1.38.1 → 1.38.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@0xpolygonid/js-sdk",
3
- "version": "1.38.1",
3
+ "version": "1.38.2",
4
4
  "description": "SDK to work with Polygon ID",
5
5
  "source": "./src/index.ts",
6
6
  "exports": {
@@ -386,7 +386,7 @@ export class EthStateStorage implements IStateStorage {
386
386
 
387
387
  /** {@inheritdoc IStateStorage.getGISTRootInfo} */
388
388
  async getGISTRootInfo(root: bigint, id: bigint): Promise<RootInfo> {
389
- const cacheKey = this.getRootCacheKey(root);
389
+ const cacheKey = this.getRootCacheKey(id, root);
390
390
  if (!this._disableCache) {
391
391
  // Check cache first
392
392
  const cachedResult = await this._rootResolveCache?.get(cacheKey);
@@ -454,18 +454,18 @@ export class EthStateStorage implements IStateStorage {
454
454
  }
455
455
 
456
456
  private getGistProofCacheKey(id: bigint): string {
457
- return `gist-${id.toString()}`;
457
+ return `gist:${id.toString()}`;
458
458
  }
459
459
 
460
460
  private getLatestStateCacheKey(id: bigint): string {
461
- return `latest-${id.toString()}`;
461
+ return `latest-state:${id.toString()}`;
462
462
  }
463
463
 
464
464
  private getStateCacheKey(id: bigint, state: bigint): string {
465
- return `${id.toString()}-${state.toString()}`;
465
+ return `state:${id.toString()}-${state.toString()}`;
466
466
  }
467
467
 
468
- private getRootCacheKey(root: bigint): string {
469
- return root.toString();
468
+ private getRootCacheKey(id: bigint, root: bigint): string {
469
+ return `root:${id.toString()}-${root.toString()}`;
470
470
  }
471
471
  }