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

Disable all transfer buttons if amount is not int #1594

Closed
fedekunze opened this issue Nov 19, 2018 · 10 comments · Fixed by #1643
Closed

Disable all transfer buttons if amount is not int #1594

fedekunze opened this issue Nov 19, 2018 · 10 comments · Fixed by #1643
Assignees
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed high priority ❗

Comments

@fedekunze
Copy link
Contributor

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

@fedekunze fedekunze changed the title Disable all transfers buttons if deposit are decimals Disable all transfers buttons if amount is not int Nov 19, 2018
@fedekunze fedekunze changed the title Disable all transfers buttons if amount is not int Disable all transfer buttons if amount is not int Nov 19, 2018
@jbibla
Copy link
Collaborator

jbibla commented Nov 19, 2018

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

@faboweb
Copy link
Collaborator

faboweb commented Nov 19, 2018

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

@fedekunze
Copy link
Contributor Author

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

🤷‍♂️

@faboweb faboweb added the bug 🐛 issues related to unhandled errors in the code that need to be fixed label Nov 20, 2018
@fedekunze fedekunze self-assigned this Nov 20, 2018
@fedekunze fedekunze added discuss and removed discuss labels Nov 20, 2018
@fedekunze
Copy link
Contributor Author

Will report this to the All in Hands

@cwgoes
Copy link

cwgoes commented Nov 20, 2018

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.

@faboweb
Copy link
Collaborator

faboweb commented Nov 20, 2018

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?

@cwgoes
Copy link

cwgoes commented Nov 20, 2018

Sounds good to me.

@faboweb
Copy link
Collaborator

faboweb commented Nov 20, 2018

Thank you @cwgoes for your patience :)

@rigelrozanski
Copy link

rigelrozanski commented Nov 22, 2018

@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

@faboweb
Copy link
Collaborator

faboweb commented Nov 22, 2018

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 issues related to unhandled errors in the code that need to be fixed high priority ❗
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants