minter-go-node icon indicating copy to clipboard operation
minter-go-node copied to clipboard

Specify cause of insufficient funds

Open shrpne opened this issue 6 years ago • 2 comments

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

shrpne avatar Mar 19 '19 14:03 shrpne

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 avatar Mar 22 '19 08:03 danil-lashin

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

shrpne avatar Mar 22 '19 10:03 shrpne