perf: Avoid full token catalog for non-withdraw flows#27728
Conversation
Signed-off-by: dan437 <80175477+dan437@users.noreply.github.com>
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: What changed: The hook now conditionally loads the full token catalog (includeNoBalance/includeAllTokens) only when: (1) it's a withdraw transaction AND (2) an allowlist is present. Previously it always loaded the full catalog. This is both a performance optimization and a correctness fix. Impact analysis:
Risk: Medium - the logic change could affect which tokens appear in the withdraw token selector. If Performance Test Selection: |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27728 +/- ##
========================================
Coverage 82.34% 82.35%
========================================
Files 4787 4796 +9
Lines 123646 123803 +157
Branches 27511 27550 +39
========================================
+ Hits 101822 101962 +140
- Misses 14779 14785 +6
- Partials 7045 7056 +11 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
|
✅ E2E Fixture Validation — Schema is up to date |



Description
Avoids full token catalog for non-withdraw flows.
Changelog
CHANGELOG entry: null
Related issues
Fixes: https://consensyssoftware.atlassian.net/browse/CONF-1067
Manual testing steps
Note
Low Risk
Low risk: this only changes when
useSendTokensloads the full token catalog, and is gated to withdraw flows with an allowlist; main risk is missing allowlisted tokens if the gating condition is wrong.Overview
Improves token list performance for non-withdraw flows by avoiding loading the full token catalog via
useSendTokensunless the current transaction is a pay-withdraw and a withdraw allowlist (config.tokens) is configured.Updates
useWithdrawTokenFilterto conditionally enableincludeNoBalance/includeAllTokens, and extends tests to assert the newuseSendTokenscall behavior (including clearing mocks between cases).Written by Cursor Bugbot for commit 82a19fc. This will update automatically on new commits. Configure here.