-
Notifications
You must be signed in to change notification settings - Fork 168
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
cmd, eth: fix floating point math for eth<=>wei conversions #1243
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yondonfu
requested changes
Dec 10, 2019
yondonfu
requested changes
Dec 12, 2019
submitted fixups, I'll reword the commit messages during rebase |
yondonfu
requested changes
Dec 13, 2019
yondonfu
reviewed
Dec 13, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good! Let's rebase
2cda6e5
to
91e892d
Compare
rebased !
…On Fri, Dec 13, 2019 at 4:21 PM Yondon Fu ***@***.***> wrote:
***@***.**** commented on this pull request.
Changes look good! Let's rebase
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#1243?email_source=notifications&email_token=AFJZZWRWMBHSQ73RLWB7AETQYOSAJA5CNFSM4JVHZEY2YY3PNVWWK3TUL52HS4DFWFIHK3DMKJSXC5LFON2FEZLWNFSXPKTDN5WW2ZLOORPWSZGOCPEO7IA#pullrequestreview-331935648>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFJZZWX4HLCKNPU6RCZLPPTQYOSAJANCNFSM4JVHZEYQ>
.
|
yondonfu
approved these changes
Dec 13, 2019
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🚢
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this pull request do? Explain your changes. (required)
This PR attempts to fix floating point math rounding errors caused when depositing broadcasting funds with the CLI. To fix this we are no longer using floating point math but arbitrary-precision fixed-point decimal numbers instead (up to 2^31 decimals).
Specific updates (required)
eth.FromBaseUnit
andeth.ToBaseUnit
github.com/shopspring/decimal
third-party libraryeth.WeiToEth(interface{}) decimal.Decimal
andeth.EthToWei(interface{}) *big.Int
How did you test each of these updates (required)
0.1 ETH
to reserve it no longer results in0.100000000000000005 ETH
being taken.Does this pull request close any open issues?
Fixes #1211
Checklist:
./test.sh
pass