rust-lightning
rust-lightning copied to clipboard
Rename `Htlc::to_bitcoin_amount` to `satoshi_amount`
Per https://github.com/lightningdevkit/rust-lightning/pull/3063#discussion_r1622867330 .
I believe it's soon enough after the method was first introduced that renaming it should not have big negative impact, if any.
Codecov Report
Attention: Patch coverage is 91.66667% with 1 line in your changes missing coverage. Please review.
Project coverage is 89.96%. Comparing base (
e5b7402) to head (ae59eec). Report is 4 commits behind head on main.
| Files | Patch % | Lines |
|---|---|---|
| lightning/src/ln/chan_utils.rs | 80.00% | 1 Missing :warning: |
:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@ Coverage Diff @@
## main #3099 +/- ##
==========================================
+ Coverage 89.86% 89.96% +0.09%
==========================================
Files 119 119
Lines 97507 98177 +670
Branches 97507 98177 +670
==========================================
+ Hits 87629 88324 +695
+ Misses 7307 7291 -16
+ Partials 2571 2562 -9
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
@tnull , I called it amount at first (https://github.com/lightningdevkit/rust-lightning/pull/3063#discussion_r1599060322) but I agree with Matt that it might be confusing, given that amount of HTLC has diferent meaning.
The 'satoshi' part should invoke that there will be some rounding happening.
@tnull , I called it
amountat first (#3063 (comment)) but I agree with Matt that it might be confusing, given that amount of HTLC has diferent meaning.The 'satoshi' part should invoke that there will be some rounding happening.
Ah, I had forgotten about that. Given that it really just performs integer division, should we be explicit here and call it floor_amount or amount_floor, similar to, e.g., u32::div_floor?
Naming is hard :). I'm a bit meh on floor_amount because it doesn't mention the unit being floor'd to, which I think substantially improves readability of callsites.
I believe it's soon enough after the method was first introduced that renaming it should not have big negative impact, if any.
Its not in a release, so there's no impact :)
Naming is hard :). I'm a bit meh on
floor_amountbecause it doesn't mention the unit being floor'd to, which I think substantially improves readability of callsites.
So floor_sats_amount or amount_floor_sats?
That would be good with me, or amount_sats_floor or any other permutation :)
amount_sats :)