Skip to content

Conversation

@AxelGes
Copy link
Contributor

@AxelGes AxelGes commented Jan 30, 2026

Summary

Fixes a bug in getQuotes() where assetId and walletAddress were validated to not be empty/whitespace but the untrimmed values were used in the cache key and sent to the API. This could cause issues if values with leading/trailing spaces were passed.

Changes

  • Normalize assetId and walletAddress by trimming them after validation
  • Use normalized values consistently in cache key and params sent to API
  • Add test to verify trimming behavior works correctly

Test plan

  • All existing tests pass
  • New test added to verify assetId and walletAddress are trimmed before being sent to the service

Related

Follow-up fix to #7747


Note

Low Risk
Low risk: small normalization change limited to getQuotes plus a targeted unit test; main impact is cache key/param normalization which could change caching behavior for inputs with whitespace.

Overview
Fixes RampsController.getQuotes to trim assetId and walletAddress after validation and then use the normalized values consistently in the request cacheKey and service params.

Adds a unit test covering whitespace-trim behavior and records the fix in CHANGELOG.md.

Written by Cursor Bugbot for commit d6ec3a2. This will update automatically on new commits. Configure here.

Previously, assetId and walletAddress were validated to not be empty/whitespace
but the untrimmed values were used in the cache key and sent to the API.
This could cause issues if values with leading/trailing spaces were passed.

Changes:
- Normalize assetId and walletAddress by trimming them after validation
- Use normalized values in cache key and params
- Add test to verify trimming behavior
@AxelGes AxelGes requested a review from a team as a code owner January 30, 2026 15:55
@AxelGes AxelGes requested a review from a team as a code owner January 30, 2026 15:59
@AxelGes AxelGes added this pull request to the merge queue Jan 30, 2026
Merged via the queue into main with commit 39fa7cd Jan 30, 2026
306 checks passed
@AxelGes AxelGes deleted the fix/ramps-quotes-trim-params branch January 30, 2026 16:37
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.

3 participants