-
Notifications
You must be signed in to change notification settings - Fork 159
feat: deprecate sepolia for bff balances api #6340
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
WalkthroughAdded SEPOLIA to the hard-coded UNSUPPORTED_BFF_NETWORKS in isBffSupportedNetwork.ts. The function behavior is unchanged except it now treats SEPOLIA as unsupported, alongside existing entries. No API/signature changes. Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (1)
libs/balances-and-allowances/src/utils/isBffSupportedNetwork.ts(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
- GitHub Check: Cypress
- GitHub Check: Setup
| import { SupportedChainId } from '@cowprotocol/cow-sdk' | ||
|
|
||
| const UNSUPPORTED_BFF_NETWORKS = [SupportedChainId.LENS] | ||
| const UNSUPPORTED_BFF_NETWORKS = [SupportedChainId.LENS, SupportedChainId.SEPOLIA] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
LGTM! Change correctly disables BFF for Sepolia.
The addition of SEPOLIA to the unsupported networks list aligns with the PR objective to prevent balances API requests for Sepolia due to Moralis API issues.
Please verify:
- That all call sites of
isBffSupportedNetworkhandle Sepolia being unsupported correctly - That tests are updated to cover Sepolia as an unsupported network
Run the following script to check usage:
🏁 Script executed:
#!/bin/bash
# Description: Find all usages of isBffSupportedNetwork and verify they handle SEPOLIA correctly
# Find all files that import or call isBffSupportedNetwork
rg -n --type=ts --type=tsx -C 3 'isBffSupportedNetwork'
# Find test files that might need updates
fd -e test.ts -e spec.ts -e test.tsx -e spec.tsx -x rg -l 'isBffSupportedNetwork|SEPOLIA'Length of output: 1116
🏁 Script executed:
#!/bin/bash
# 1. Find all call sites of isBffSupportedNetwork
rg -n -C3 'isBffSupportedNetwork'
# 2. Find all references to SEPOLIA in code & tests
rg -n 'SEPOLIA' -g '*.ts' -g '*.tsx' -g '*.test.ts' -g '*.test.tsx' -g '*.spec.ts' -g '*.spec.tsx'Length of output: 28393
Add test coverage for Sepolia unsupported scenario in BFF logic
Cover SupportedChainId.SEPOLIA being excluded by isBffSupportedNetwork in:
- libs/balances-and-allowances/src/hooks/usePersistBalancesFromBff.test.tsx
- apps/cowswap-frontend/src/modules/balancesAndAllowances/updaters/CommonPriorityBalancesAndAllowancesUpdater.tsx
Summary
Fixes issue with Sepolia and Moralis API (details)
Due to incorrect balances list for Sepolia I disabled this API for the network
Switch to Sepolia with enabled ff for Moralis
Summary by CodeRabbit
Bug Fixes
Chores