MetaMask / metamask-mobile

Mobile web browser providing access to websites that use the Ethereum blockchain
https://metamask.io
Other
2.04k stars 1.06k forks source link

fix: swaps android swap allowance error #10127

Open infiniteflower opened 4 days ago

infiniteflower commented 4 days ago

Description

This PR fixes an issue only on Android, where if you had infinite (or very large) allowance on an ERC20 token this would result in a swaps-allowance-error being shown despite the API replying properly with a list of quotes.

Related issues

Fixes:

10037

Related to https://github.com/MetaMask/swaps-controller/issues/258, https://github.com/MetaMask/swaps-controller/pull/259

Manual testing steps

  1. Start MM app on Android
  2. Set allowance on ERC20 very high (or select a token for which you have prior max allowance)
  3. Go to Swaps
  4. Fetch a quote where the ERC20 token is the From token
  5. Observe quote being fetched properly with no errors

Screenshots/Recordings

Before

After

https://github.com/MetaMask/metamask-mobile/assets/139582705/22ce441f-0710-496c-b25d-4c17ec725cf3

Pre-merge author checklist

Pre-merge reviewer checklist

github-actions[bot] commented 4 days ago

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.

sonarcloud[bot] commented 4 days ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud