Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit decimals for amounts in input fields based on the token #20596

Closed
onyb opened this issue Jan 20, 2022 · 1 comment · Fixed by brave/brave-core#11948
Closed

Limit decimals for amounts in input fields based on the token #20596

onyb opened this issue Jan 20, 2022 · 1 comment · Fixed by brave/brave-core#11948

Comments

@onyb
Copy link
Member

onyb commented Jan 20, 2022

Use BlockchainToken.decimals to limit the number of decimals an amount can have in an input field. Currently, there's no validation done on decimals, which results in hex-encoded values like 0x0.004816f0068db8bac711, subsequently failing in the transaction creation step without any indication.

@srirambv
Copy link
Contributor

Brave 1.36.93 Chromium: 98.0.4758.87 (Official Build) beta (64-bit)
Revision e4cd00f135fb4d8edc64c8aa6ecbe7cc79ebb3b2-refs/branch-heads/4758@{#1002}
OS ☑️ Linux ☑️ Windows 11 Version Dev
(Build 22523.1000)
☑️ macOS Version 12.0.1
(Build 21C52)
  • Verified steps from brave/brave-core#11948
  • Verified Too many decimals error is shown when decimal value is exceeded the limit
  • Verified Send/ Swap button is disabled when decimal value is exceeded the limit
20596-Linux.mp4
20596-Windows.mov
20596-macOS.mov

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants