nano-wallet-company/nano-wallet-desktop

Amounts over 1000 seem to be considered invalid

Closed this issue · 2 comments

Describe the bug
It seems any amount over 999 (1000+) triggers an invalid amount error, even if the selected account has enough funds: Invalid amount

Amounts 999 and below react normally - triggering the error Amount is greater than total account balance

To Reproduce
Steps to reproduce the behavior:

  1. Try to send from an account with more than 1000 balance.

Platform (please complete the following information):

  • Linux (Beta network, in Chrome)
  • 1.0.3 (master)

Additional context
Another note is that changing the account doesn't seem to trigger a refresh of the input field / re-check.

So having 999 in the send field, then changing to an account with only 300 in it doesn't trigger any update / warning. It does change the max value for the input field, so when focusing again it requires a change to register that there is an issue.

It is line 33 of account-send/component.js

intl.formatNumber(amount) will return 1,000 if input 1000 which bricks BigNumber.

Removing it solves the problem, but not sure if there's a small chance it would have a flow on affect down at toAmount - looking at it there was a chance it would have thrown a bug in future with conversions to/from raw

    const intl = this.get('intl');
    const number = BigNumber(amount);
    if (number.isNaN() || number.isNegative()) {
      changeset.pushErrors('amount', intl.t('wallets.accounts.send.invalidAmount'));
      return false;
    }

The NanoWalletCompany is no longer supporting this app. See https://nanowalletcompany.com/ for details. Closing.