Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Fix 5247: No rounding if users want to send/swap full token balance #5253

Merged
merged 2 commits into from
Apr 14, 2022

Conversation

nuo-xu
Copy link
Contributor

@nuo-xu nuo-xu commented Apr 13, 2022

Summary of Changes

Fetching token balance with all available decimals.
Displaying all decimals and no rounding if the user decides to send/swap full token balance.
Added unit tests.

This pull request fixes #5247

Submitter Checklist:

  • Unit Tests are updated to cover new or changed functionality
  • User-facing strings use NSLocalizableString()

Test Plan:

  1. send a ERC20 token with full balance
Simulator.Screen.Recording.-.iPhone.13.Pro.-.2022-04-13.at.11.26.17.mp4
  1. swap a ERC20 token with full balance (may require token activation)
Simulator.Screen.Recording.-.iPhone.13.Pro.-.2022-04-13.at.17.25.20.mov

Reviewer Checklist:

  • Issues include necessary QA labels:
    • QA/(Yes|No)
    • bug / enhancement
  • Necessary security reviews have taken place.
  • Adequate unit test coverage exists to prevent regressions.
  • Adequate test plan exists for QA to validate (if applicable).
  • Issue and pull request is assigned to a milestone (should happen at merge time).

…als and do not round if the user chooses full balance to send or swap.
@nuo-xu nuo-xu added this to the 1.38 milestone Apr 13, 2022
@nuo-xu nuo-xu requested review from kylehickinson, StephenHeaps and a team April 13, 2022 21:36
@nuo-xu nuo-xu self-assigned this Apr 13, 2022
Copy link
Contributor

@StephenHeaps StephenHeaps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One suggestion but otherwise LGTM, rounding issue is resolved 👍

BraveWallet/Crypto/Stores/SwapTokenStore.swift Outdated Show resolved Hide resolved
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Only round up token balance or transaction amount for displaying.
3 participants