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

Specify cause of insufficient funds #219

Open
shrpne opened this issue Mar 19, 2019 · 2 comments
Open

Specify cause of insufficient funds #219

shrpne opened this issue Mar 19, 2019 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@shrpne
Copy link
Member

shrpne commented Mar 19, 2019

Describe the bug
"Insufficient funds for sender account" error occurs when sender doesn't have enough coins to spend and to pay fee.
For now, it's impossible to understand what exactly was a reason for this error, lack of coins to spend or to pay fee.

Expected behavior
I think error message about lack of funds to pay fee can be described more precise.
For example: "Insufficient funds to pay fee for sender account"

Additional context
A lot of UI doesn't provide an option to specify gas coin and it can be hard for user to realize that error message "Insufficient funds" refers to fee

@danil-lashin
Copy link
Contributor

The problem is that sometimes we don't know what part of the transaction causes "Insufficient funds" error.

For example, if we want to change ABC coin to MNT coin and pay a fee with ABC coin then a fee will depend on the amount of ABC coins we want to change. In some cases, it can lead to ambiguous situations, where we can not decide if we need more coins to pay a fee, or more coins to make an actual "change" operation.

@danil-lashin danil-lashin added the help wanted Extra attention is needed label Mar 22, 2019
@shrpne
Copy link
Member Author

shrpne commented Mar 22, 2019

As I understand it, the check happens in one step: sum ABC value with ABC fee and try to exchange.

What if we divide it into steps?

  • Try to exchange ABC value
  • If it is ok, calculate new total ABC emission (previous ABC emission minus exchanged ABC value )
  • Try to exchange ABC fee considering calculated ABC emission

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants