Skip to content

Commit

Permalink
fix(BlockUtils): Fix averageBlockTime (#766)
Browse files Browse the repository at this point in the history
Co-authored-by: Paul <[email protected]>
  • Loading branch information
nicholaspai and pxrl authored Nov 8, 2024
1 parent b43acb8 commit 0a5be3b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
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": "3.2.11",
"version": "3.2.12",
"license": "AGPL-3.0",
"homepage": "https://docs.across.to/reference/sdk",
"files": [
Expand Down
6 changes: 1 addition & 5 deletions src/utils/BlockUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,7 @@ export async function averageBlockTime(
const { chainId } = await provider.getNetwork();

// OP stack chains inherit Optimism block times, but can be overridden.
// prettier-ignore
const cache = blockTimes[chainId]
?? chainIsOPStack(chainId)
? blockTimes[CHAIN_IDs.OPTIMISM]
: undefined;
const cache = blockTimes[chainId] ?? (chainIsOPStack(chainId) ? blockTimes[CHAIN_IDs.OPTIMISM] : undefined);

const now = getCurrentTime();
if (isDefined(cache) && now < cache.timestamp + cacheTTL) {
Expand Down

0 comments on commit 0a5be3b

Please sign in to comment.