Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(BlockUtils): Fix averageBlockTime #766

Merged
merged 3 commits into from
Nov 8, 2024
Merged

Conversation

nicholaspai
Copy link
Member

I noticed this function is returning 2s average time when passing in a mainnet provider and I think its a simple syntax error. Without these parentheses, the boolean logic is treating blockTimes[chainId] ?? chainIsOPStack(chainId) as the LHS to the ? operator instead of what we want which is blockTimes[chainId] ?? (chainIsOPStack(chainId) ? ...)

I noticed this function is returning 2s average time when passing in a mainnet provider and I think its a simple syntax error. Without these parentheses, the boolean logic is treating `blockTimes[chainId] ?? chainIsOPStack(chainId)` as the LHS to the `?` operator instead of what we want which is `blockTimes[chainId] ?? (chainIsOPStack(chainId) ? ...)`
@nicholaspai nicholaspai merged commit 0a5be3b into master Nov 8, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants