refactor(ramp): dedupe hasMinimumRequiredVersion into shared util#31944
refactor(ramp): dedupe hasMinimumRequiredVersion into shared util#31944asalsys wants to merge 1 commit into
Conversation
Remove the unused Ramp-local version check helper and update useDepositEnabled to use the canonical implementation from app/util/remoteFeatureFlag. Co-authored-by: Cursor <cursoragent@cursor.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. |
PR template — items to address before "Ready for review"Warnings — informational, address before merging:
See docs/readme/ready-for-review.md for the full Definition of Ready for Review. |
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
This is a refactoring/consolidation PR that moves the The No other feature areas are impacted — this is isolated to the Ramp/Deposit feature gating logic. Performance Test Selection: |
Description
The Ramp module had a local
hasMinimumRequiredVersionhelper inapp/components/UI/Ramp/utils/that duplicated version-check logic already provided byapp/util/remoteFeatureFlag. The helper was not imported anywhere in production code —useDepositEnabledmaintained its own inline copy of the same logic.This PR removes the unused Ramp utility and updates
useDepositEnabledto use the sharedhasMinimumRequiredVersionimplementation.Reason for change: Avoid maintaining duplicate version-check helpers that can drift over time.
Improvement: Deposit feature gating now uses the same version comparison helper as the rest of the app, with coverage retained in
app/util/remoteFeatureFlag/index.test.tsanduseDepositEnabled.test.ts.Changelog
CHANGELOG entry: null
Related issues
Fixes: MCWP-666
Manual testing steps
N/A — internal refactor with no user-facing behavior change. Verified via unit tests:
yarn jest app/util/remoteFeatureFlag/index.test.tsyarn jest app/components/UI/Ramp/Deposit/hooks/useDepositEnabled.test.tsScreenshots/Recordings
N/A — no UI changes.
Before
N/A
After
N/A
Pre-merge author checklist
Performance checks (if applicable)
trace()for usage andaddTokenfor an exampleFor performance guidelines and tooling, see the Performance Guide.
Pre-merge reviewer checklist
Made with Cursor