Use FeeRate type in TxDetails fee_rate field#933
Use FeeRate type in TxDetails fee_rate field#933thunderbiscuit wants to merge 2 commits intobitcoindevkit:masterfrom
Conversation
54d30ab to
ea491a8
Compare
|
cc @AlexBrou |
|
I’m new to the project and wanted to help test this change locally. I confirmed that TxDetails now uses the FeeRate type instead of an integer, which fixes the rounding issue on the Rust side. |
In theory I do like this and wish that rust-bitcoin had more utilities to work with sats/vb, but the design of the type was chosen because they wanted to circumvent dealing with floating-point arithmetic completely (pushing that complexity onto the user instead of within the @ItoroD thanks for the review! Just FYI I think those 3.0 PRs will sit here for a while before we start merging breaking changes on |
Makes sense to keep this aligned with the Rust APIs and avoid floating-point handling. Thanks for the explanation. |
Fixes #932.
The current implementation doesn't allow to calculate more precise versions of the feerate and always gives back the ceiling version of the feerate integer in sat/vb. This lets users do the calculations they need on the type.
It's too bad but this is actually a breaking change, so can only ship with 3.0.
Documentation
bdk_wallethttps://docs.rs/bdk_wallet/2.3.0/bdk_wallet/struct.TxDetails.html
Checklists
All Submissions:
cargo fmtandcargo clippybefore committingNew Features: