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

DecCoin bugs #4050

Closed
jaekwon opened this issue Apr 4, 2019 · 4 comments
Closed

DecCoin bugs #4050

jaekwon opened this issue Apr 4, 2019 · 4 comments
Assignees
Labels

Comments

@jaekwon
Copy link
Contributor

jaekwon commented Apr 4, 2019

MulDec can cause a product to be zero due to rounding. MulDecTruncate, QuoDec, and QuoDecTruncated as well. ParseDecCoin can return a zero coin but ParseDecCoins should not, so ParseDecCoins also has a bug

@rigelrozanski
Copy link
Contributor

Oh I understand - various dec operations returning 0 due to rounding is expected behaviour, but the presence of 0 denoms within DecCoins is a bug, thus we need to check for introduction of 0 coins after dec operations on deccoins... correct?

@alexanderbez
Copy link
Contributor

alexanderbez commented Apr 5, 2019

ParseDecCoins: I don't see how this is broken. It calls IsValid on the final result and returns an error if invalid. It's the exact same logic as ParseCoins. Is ParseCoins also broken?

The rest, I'll address: QuoDecTruncate, QuoDec, MulDecTruncate

@jaekwon
Copy link
Contributor Author

jaekwon commented Apr 10, 2019

parsedeccoins, i dunno about parsecoins, maybe, but parsedeccoins should remove zero any deccoins before returning.

a zero deccoin is valid but not in a deccoins.

@alexanderbez
Copy link
Contributor

parsedeccoins, i dunno about parsecoins, maybe, but parsedeccoins should remove zero any deccoins before returning.

a zero deccoin is valid but not in a deccoins.

Ref: #4095

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants