-
Notifications
You must be signed in to change notification settings - Fork 620
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
Enforce displaying Amount with trailing zeros #2604
Enforce displaying Amount with trailing zeros #2604
Conversation
Pull Request Test Coverage Report for Build 8316149718Details
💛 - Coveralls |
The CI failure is real -- you're introducing a dependence on In principle we shouldn't need one. Interestingly my local CI passes -- so we've found a blind spot in it! Let me investigate.. |
Oh, lol, the blind spot is the entire |
I forgot what our consensus was about respecting |
2a4ffb1
to
70c889e
Compare
Yeah! Realized it was an issue with allocation but I was not able to make changes yesterday. Should be fixed now. My tests also passed locally. Not sure why |
What is the current policy on running rustfmt, my editor does auto format but when I do a diff I see so many changes related to formatting |
So I also need to fix it for tests, somehow they succeed locally |
Please do not commit unrelated changes. Usually there should not be very many because we have a weekly bot which does all the formatting changes, but lately we have been skipping the bot because one mantainer claims undue difficulty in rebasing. So you will need to override your editor or be careful about what changes you commit, for now. |
Yes, we "make an effort". But there are some exceptional cases, most notably |
@448-OG, you can use |
It is common to display bitcoins using trailing zeros upto 8 decimals. This commit enforces: - Displaying Amount in BTC with trailing zeroes by eight decimal places if a precision on the Amount is not specified. - Displaying Amount in BTC upto the precision specified truncating the insignificant zeros. - Displaying amount in BTC without any decimals if the remainder of the amount divided by the satoshis in 1 BTC is equal to zero using formula `satoshis.rem_euclid(Amount::ONE_BTC.to_sat()) != 0` These are not breaking changes and all previous tests pass. A testcase is added to for changes introduced. Resolves: rust-bitcoin#2136
70c889e
to
d887423
Compare
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.
ACK d887423
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.
ACK d887423
It is common to display bitcoins using trailing zeros upto 8 decimals. This commit enforces:
satoshis.rem_euclid(Amount::ONE_BTC.to_sat()) != 0
These are not breaking changes and all previous tests pass.
A testcase is added to for changes introduced.
Resolves: #2136