feat: use address utils to compare addresses#827
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughReplaces ad-hoc lowercasing with centralized helpers Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
📦 GitHub Packages PublishedLast updated: Mar 16, 2026, 12:46:20 PM UTC The following packages have been published to GitHub Packages with pre-release version
InstallationThese packages require authentication to install from GitHub Packages. First, create a # Create .npmrc file in your project root
echo "@cowprotocol:registry=https://npm.pkg.github.com" > .npmrc
echo "//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKEN" >> .npmrcTo get your GitHub token:
Then install any of the packages above, either by exact version (i.e. # Yarn
yarn add npm:@cowprotocol/cow-sdk@pr-827
# pnpm
pnpm install npm:@cowprotocol/cow-sdk@pr-827
# NPM
npm install npm:@cowprotocol/cow-sdk@pr-827Update to the latest version (only if you used the tag)Every commit will publish a new package. To upgrade to the latest version, run: # Yarn
yarn upgrade @cowprotocol/cow-sdk
# pnpm
pnpm update @cowprotocol/cow-sdk
# NPM
npm update @cowprotocol/cow-sdkView PackagesYou can view the published packages at: https://github.com/cowprotocol/cow-sdk/packages |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
packages/bridging/src/BridgingSdk/helpers.ts (1)
14-14: Consider preserving legacy cache-key shape (or versioning cache prefix).This changes persisted key generation for non-EVM/default token values, so existing localStorage entries may become unreachable after rollout.
♻️ Compatibility-preserving option
export const getCacheKey = ({ id, buyChainId, sellChainId = 'noSellChainID', tokenAddress = 'noTokenAddress', }: { id: string buyChainId: string sellChainId?: string tokenAddress?: string }) => { - return `${id}-${buyChainId}-${sellChainId}-${getAddressKey(tokenAddress)}` + const tokenKey = tokenAddress === 'noTokenAddress' ? 'notokenaddress' : getAddressKey(tokenAddress) + return `${id}-${buyChainId}-${sellChainId}-${tokenKey}` }🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@packages/bridging/src/BridgingSdk/helpers.ts` at line 14, The cache key generation change in the return expression that builds `${id}-${buyChainId}-${sellChainId}-${getAddressKey(tokenAddress)}` will break access to existing persisted localStorage entries; either restore the legacy key shape for non-EVM/default token cases or add an explicit versioned prefix to the key so old keys remain reachable. Update the function that constructs this key (the line returning the template string and the helper getAddressKey if it altered behavior) to either (a) detect legacy token types and emit the previous format, or (b) prepend a stable version prefix like `v1:` to new keys so you can migrate/lookup old keys alongside new ones.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/bridging/src/BridgingSdk/tokenPriority.ts`:
- Line 54: The registry contains a mixed-case literal so lookups like return
chainTokens.has(getAddressKey(tokenAddress)) can miss matches; when constructing
or populating chainTokens (the registry/set) normalize each entry using the same
getAddressKey (or a consistent toLowerCase) function used in lookups so the keys
are canonical, or alternatively ensure getAddressKey normalizes both input and
stored registry values; update the code that builds chainTokens to call
getAddressKey on each registry literal so
chainTokens.has(getAddressKey(tokenAddress)) reliably matches.
---
Nitpick comments:
In `@packages/bridging/src/BridgingSdk/helpers.ts`:
- Line 14: The cache key generation change in the return expression that builds
`${id}-${buyChainId}-${sellChainId}-${getAddressKey(tokenAddress)}` will break
access to existing persisted localStorage entries; either restore the legacy key
shape for non-EVM/default token cases or add an explicit versioned prefix to the
key so old keys remain reachable. Update the function that constructs this key
(the line returning the template string and the helper getAddressKey if it
altered behavior) to either (a) detect legacy token types and emit the previous
format, or (b) prepend a stable version prefix like `v1:` to new keys so you can
migrate/lookup old keys alongside new ones.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1ba14ad2-3d17-4b3e-a60c-c7b9ae515d42
⛔ Files ignored due to path filters (1)
packages/contracts-ts/src/generated/packageVersion.tsis excluded by!**/generated/**
📒 Files selected for processing (13)
packages/bridging/src/BridgingSdk/BridgingSdk.tspackages/bridging/src/BridgingSdk/determineIntermediateToken.tspackages/bridging/src/BridgingSdk/helpers.tspackages/bridging/src/BridgingSdk/tokenPriority.tspackages/bridging/src/providers/across/AcrossBridgeProvider.tspackages/bridging/src/providers/across/util.tspackages/bridging/src/providers/bungee/createBungeeDepositCall.tspackages/bridging/src/providers/near-intents/NearIntentsBridgeProvider.tspackages/bridging/src/providers/near-intents/util.tspackages/contracts-ts/src/api.tspackages/providers/ethers-v5-adapter/src/EthersV5SignerAdapter.tspackages/providers/ethers-v6-adapter/src/EthersV6SignerAdapter.tspackages/trading/src/utils/misc.ts
Summary by CodeRabbit