Lunie: Disable all transfer buttons if amount is not int

Created on 19 Nov 2018  ·  10Comments  ·  Source: luniehq/lunie

Description:

On the newest version I'm getting the following error if I try to delegate/deposit/send an amount with decimals

math/big: cannot unmarshal "1.2" into a *big.Int

bug high priority

All 10 comments

how is it not possible to use decimals if the total value is in decimals?

thank you for asking @jbibla, I find it also very weird

I think we discussed this before but let's pull in @cwgoes and @rigelrozanski for clarification

how is it not possible to use decimals if the total value is in decimals?

🤷‍♂️

Will report this to the All in Hands

Gaia does not support decimal/fractional tokens; all token amounts are positive integers. As far as I know it has never done so. I don't know what Voyager did previously or what might have changed recently.

Likely we will have some "unit denomination" which should be visualized to the user (so all amounts should be divided by 1e18 or something) - that could be configured entirely in Voyager though, the SDK doesn't need to do anything for it.

Validator Tokens are in SDK.Dec and Shares are in SDK.Dec. Calculating tokens from shares will probably produce a decimal.
But I remember that we said a user can only undelegate full tokens from a validator.

So summing up:
We do display only the possible undelegatable amount of tokens (rounded down) as stake per validator. We don't ever show decimals.

Correct?

Sounds good to me.

Thank you @cwgoes for your patience :)

@faboweb "undelegate full tokens" <- this means nano-atoms though! not full atoms! - the base unit for a "whole token" is a nano-atom... it is _nano-atoms_ which can be undelegated

lol

Thank you @rigelrozanski for following up and clarifying. :) We came to the same solution yesterday with Chris. Let's increase the amount of tokens on the next testnet to x * 10^18 to be more representative of the actual values. We will do the same on our local testnet setups.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

faboweb picture faboweb  ·  3Comments

jbibla picture jbibla  ·  4Comments

cwgoes picture cwgoes  ·  4Comments

faboweb picture faboweb  ·  3Comments

fedekunze picture fedekunze  ·  4Comments