From: Alekos Filini Date: Tue, 2 Aug 2022 09:26:18 +0000 (+0200) Subject: Merge bitcoindevkit/bdk#694: Add assertions in the FeeRate constructor X-Git-Tag: v0.21.0~12 X-Git-Url: http://internal-gitweb-vhost/script/%22https:/struct.CommandString.html?a=commitdiff_plain;h=8e0d00a3ea231b8a8ba6bca75095acdd4ed8d23f;p=bdk Merge bitcoindevkit/bdk#694: Add assertions in the FeeRate constructor 235011feef8a6faadc08b814e199e5d5ced2f3a0 Add assertions in the FeeRate constructor (Alekos Filini) Pull request description: ### Description Disallow negative, NaN, infinite or subnormal fee rate values. ### Notes to the reviewers This commit is technically an API break because it makes the `FeeRate::from_sat_per_vb` function non-const. I think it's worth it compared to the risk of having completely nonsensical fee rates (that can break the coin selection in interesting ways). EDIT: it's also a breaking change because our code can now panic in scenarios where it didn't before. Again, I think it's worth it. ### Checklists #### All Submissions: * [x] I've signed all my commits * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk/blob/master/CONTRIBUTING.md) * [x] I ran `cargo fmt` and `cargo clippy` before committing #### Bugfixes: * [x] This pull request breaks the existing API * [x] I've added tests to reproduce the issue which are now passing * [ ] I'm linking the issue being fixed by this PR ACKs for top commit: danielabrozzoni: re-ACK 235011feef8a6faadc08b814e199e5d5ced2f3a0 Tree-SHA512: c9432956162fadfd255edf20b825635a487adb29c88d791e18f170da79a2aac6f8e745b5e5be09be3c211697d0b1f4bddc1da75c181e8f9fc4fddf566a7a3e5c --- 8e0d00a3ea231b8a8ba6bca75095acdd4ed8d23f