Ran
|
Files
39
|
Run time
1s
|
Badge
Embed ▾
README BADGES
|
push
github
Merge bitcoindevkit/bdk#1216: Migrate to bitcoin::FeeRate 475a77219 refactor(bdk)!: Remove trait Vbytes (vmammal) 0d64beb04 chore: organize some imports (vmammal) 89608ddd0 refactor(bdk): display CreateTxError::FeeRateTooLow in sat/vb (vmammal) 09bd86e2d test(bdk): initialize all feerates from `u64` (vmammal) 004957dc2 refactor(bdk)!: drop FeeRate from bdk::types (vmammal) Pull request description: ### Description This follows a similar approach to #1141 namely to remove `FeeRate` from `bdk::types` and instead defer to the upstream implementation for all fee rates. The idea is that making the switch allows BDK to benefit from a higher level abstraction, leaving the implementation details largely hidden. As noted in #774, we should avoid extraneous conversions that can result in deviations in estimated transaction size and calculated fee amounts, etc. This would happen for example whenever calling a method like `FeeRate::to_sat_per_vb_ceil`. The only exception I would make is if we must return a fee rate error to the user, we might prefer to display it in the more familiar sats/vb, but this would only be useful if the rate can be expressed as a float. ### Notes to the reviewers `bitcoin::FeeRate` is an integer whose native unit is sats per kilo-weight unit. In order to facilitate the change, a helper method `feerate_unchecked` is added and used only in wallet tests and psbt tests as necessary to convert existing fee rates to the new type. It's "unchecked" in the sense that we're not checking for integer overflow, because it's assumed we're passing a valid fee rate in a unit test. Potential follow-ups can include: - [x] Constructing a proper `FeeRate` from a `u64` in all unit tests, and thus obviating the need for the helper `feerate_unchecked` going forward. - [x] Remove trait... (continued)
9095 of 11160 relevant lines covered (81.5%)
5715.45 hits per line
Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line |
---|