Skip to content

Commit

Permalink
fix(CacheProvider): Exit early if cacheType based on blockNumber of R…
Browse files Browse the repository at this point in the history
…PC response is NONE (#900)
  • Loading branch information
nicholaspai authored Feb 25, 2025
1 parent 80e2ab2 commit 959b3c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@across-protocol/sdk",
"author": "UMA Team",
"version": "4.1.18",
"version": "4.1.19",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down
3 changes: 3 additions & 0 deletions src/providers/cachedProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ export class CacheProvider extends RateLimitedProvider {
if (cacheType === CacheType.DECIDE_TTL_POST_SEND) {
const blockNumber = this.getBlockNumberFromRpcResponse(method, result);
cacheType = await this.cacheTypeForBlock(blockNumber);
if (cacheType === CacheType.NONE) {
return result;
}
}

// Note: use swtich to ensure all enum cases are handled.
Expand Down

0 comments on commit 959b3c3

Please sign in to comment.