Commit Graph

6672 Commits

Author SHA1 Message Date
merge-script 9852732311
Merge rust-bitcoin/rust-bitcoin#4621: Automated nightly rustfmt (2025-06-15)
81dbfae0a8 2025-06-15 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 81dbfae0a8acf77bf7dce155872c7be828540573; successfully ran local tests

Tree-SHA512: 25afa058f7edff906fc43f5f5c900a76397bbc8f9fba723fb02e88d215692e5098ce0adabc67954a8466da5f28eaa672c94905e4aa5f0890930b8fabda8f15e4
2025-06-15 13:35:12 +00:00
Fmt Bot 81dbfae0a8 2025-06-15 automated rustfmt nightly 2025-06-15 01:46:36 +00:00
vicjuma 4284deed29 DerivationPath: support 'h' in Display output for hardened components
Aligns with ChildNumber’s format and improves consistency when debugging or comparing derivation paths.

Resolves: #4618
2025-06-14 16:33:06 +03:00
merge-script 052514e6ff
Merge rust-bitcoin/rust-bitcoin#4615: Remove reachable unreachable call in psbt
e7c90c57e7 Remove reachable unreachable call in psbt (Tobin C. Harding)
c736e73ae0 Add unwrap_or and unwrap_or_else to NumOpResult (Tobin C. Harding)

Pull request description:

  A bunch of changes have been implemented lately in the fee calculation logic. As a result of this a at once time `unreachable` statement is now reachable - bad rust-bitcoin devs, no biscuit.

  Saturate to `FeeRate::MAX` when calculating the fee rate, check against the limit arg, and win.

  (Patch 1 adds the new combinators to `NumOpResult`. This was pulled out of #4610.)

ACKs for top commit:
  apoelstra:
    ACK e7c90c57e7b5ee20a2c523706cc4ea9957594857; successfully ran local tests

Tree-SHA512: d33b3d5d4442fb17cae4c52880bc5dafdd611d686c6923744bc5f218761e8bff32fc5ab169af9f2ed2f02011516ed850ac8c6bd4ce1d6de40c0ac0b17486bbb4
2025-06-13 18:04:41 +00:00
merge-script 1e4f018838
Merge rust-bitcoin/rust-bitcoin#4613: Inline `fee` functions back into their respective modules
20c84ce444 units: Make fee module public (Tobin C. Harding)
251e6a85da Inline checked mul function back into weight module (Tobin C. Harding)
a8610a937b Inline checked mul / to fee back into fee_rate module (Tobin C. Harding)
e17c391a3c Inline checked div functions back into unsigned module (Tobin C. Harding)

Pull request description:

  Move all the `fee` functions back onto the respective impl blocks for the associated type.

  Finally, make the `fee` module public so users get the docs. If this is not like we can drop the last patch.

  Close: #4609

ACKs for top commit:
  apoelstra:
    ACK 20c84ce444fe68577bf14842ebaffd796572d91f; successfully ran local tests

Tree-SHA512: e4c9701245fcd0c7881baaf01a7f9d0be1ed80bc3fa848a289fbc6104375d8db5a2a092e9f1aa0b556dcc45349d053418cff8d1c281dda3cefc1e38c6ac2ba85
2025-06-13 17:12:17 +00:00
Tobin C. Harding 20c84ce444
units: Make fee module public
The `fee` module is now empty as far as API surface. It still holds the
`core::ops` impls for fee calculation. It also does have useful
rustdocs which are not currently visible online because module is
private.

Make the module public. Functionally all this does is provide a place
for the module level docs under a discoverable name.

Improve the docs by adding a bunch of links to fee related functions.
2025-06-13 08:47:19 +10:00
Tobin C. Harding 251e6a85da
Inline checked mul function back into weight module
A while back we move all the 'fee' stuff into a separate module
because I thought it would help with clarity - I was wrong.

Move the checked mul function back into the `weight` module on the main
`Weight` impl block.

Internal change only - code move.
2025-06-13 08:47:16 +10:00
Tobin C. Harding a8610a937b
Inline checked mul / to fee back into fee_rate module
A while back we move all the 'fee' stuff into a separate module
because I thought it would help with clarity - I was wrong.

Move the checked mul and to fee functions back into the `fee_rate`
module on the main `FeeRate` impl block.

Internal change only - code move.
2025-06-13 08:47:15 +10:00
Tobin C. Harding e17c391a3c
Inline checked div functions back into unsigned module
A while back we move all the 'fee' stuff into a separate module
because I thought it would help with clarity - I was wrong.

Move the checked div functions back into the `unsigned` module on the
main `Amount` impl block.

Internal change only - code move.
2025-06-13 08:45:57 +10:00
merge-script aab9c2dfca
Merge rust-bitcoin/rust-bitcoin#4614: Add fee rate constructors that take `Amount` as arg
6ed3fd6234 Add fee rate constructors that take Amount as arg (Tobin C. Harding)
c1a760bf60 units: Use singular in rustdoc (Tobin C. Harding)

Pull request description:

  Some users may find it more ergonomic to pass in an `Amount` when constructing fee rates. Also the strong type adds some semantic meaning as well as imposes the `Amount::MAX` limit.

  Add an equivalent constructor for each of the existing ones that uses an argument of type `Amount` instead of `u64` sats.

  (This was pulled out of #4610.)

  Close: #4734

ACKs for top commit:
  apoelstra:
    ACK 6ed3fd6234a6d9e44d2cf187108cc22955471d27; successfully ran local tests

Tree-SHA512: 92609457ba181370e1484c08028cec9158d6e1fb2ee984e4e8caeacc5c9828bc70febeb4fd3601d9a2fee57c65d5cee0af0ef95ea15e2387d5fd886879c2afb1
2025-06-12 21:27:32 +00:00
Tobin C. Harding e7c90c57e7
Remove reachable unreachable call in psbt
A bunch of changes have been implemented lately in the fee calculation
logic. As a result of this a at once time `unreachable` statement is now
reachable - bad rust-bitcoin devs, no biscuit.

Saturate to `FeeRate::MAX` when calculating the fee rate, check against
the limit arg, and win.

Co-developed-by: Andrew Poelstra <apoelstra@wpsoftware.net>
2025-06-12 11:33:17 +10:00
Tobin C. Harding c736e73ae0
Add unwrap_or and unwrap_or_else to NumOpResult
Two useful combinators, add them.

I copied the function signature and docs from stdlib and wrote the
functions myself - thereby operating within licensing requirements.
2025-06-12 11:33:16 +10:00
Tobin C. Harding 6ed3fd6234
Add fee rate constructors that take Amount as arg
Some users may find it more ergonomic to pass in an `Amount` when
constructing fee rates. Also the strong type adds some semantic meaning
as well as imposes the `Amount::MAX` limit.

Add an equivalent constructor for each of the existing ones that uses an
argument of type `Amount` instead of `u64` sats.
2025-06-12 10:45:18 +10:00
Tobin C. Harding c1a760bf60
units: Use singular in rustdoc
Satoshis per virtual byte is grammatically better than satoshis per
virtual bytes - I think.
2025-06-12 10:44:53 +10:00
merge-script 9b88d87020
Merge rust-bitcoin/rust-bitcoin#4606: units: Improve docs
7fbe07a6e0 Use uniform docs for overflow (Tobin C. Harding)
153a6a2f3c Make Weight docs uniform with FeeRate (Tobin C. Harding)
c87f7292be Fix rustdocs on Weight (Tobin C. Harding)
02b523a8ad Remove whitespace from encapsulate module (Tobin C. Harding)

Pull request description:

  Make a sweep of the `units` crate's rustdocs.

ACKs for top commit:
  apoelstra:
    ACK 7fbe07a6e0b3e398aca845d64ec86f3f0068edf4; successfully ran local tests

Tree-SHA512: ba50f3afb94dda43f89d04eb53c6e85df302292d4647fe81a20e3f7d1ca75e8ee8cdf6548864b2f3c33ed661205d109dbd763db1061ea45a59eab25f134191f8
2025-06-10 19:41:46 +00:00
merge-script b7b9d42b4a
Merge rust-bitcoin/rust-bitcoin#4604: units: Access with getters instead of inner field
b843f1356d units: Access with getters instead of inner field (Tobin C. Harding)

Pull request description:

  The `block` module does not follow the `encapsulate` pattern but we can still use the getters instead of accessing the inner field directly.

  Refactor, no logic change.

ACKs for top commit:
  apoelstra:
    ACK b843f1356ddfb2f23e6715708f99d40b82dce17a; successfully ran local tests

Tree-SHA512: 79bc1a8722987ca08d2ce33737a9b24998d7ee5d54b3fb065b906b64e33565eca5d5c35836cc029355c47037945cf43f6151374a8cb3ddd222991345aa41819f
2025-06-10 15:18:37 +00:00
merge-script f2c6ec3b8c
Merge rust-bitcoin/rust-bitcoin#4569: bitcoin: secp256k1 global-context feature re-export
aa76108315 bitcoin: secp256k1 global-context feature re-export (Jose Storopoli)

Pull request description:

  Often we want to have the `global-context` feature in `secp256k1` without having to add manually the `secp256k1` dependency and enabling the `global-context` feature.

  Having the ability to do that directly from `bitcoin` without having to add `secp256k1` and do the whole tango of tightly coupling the two dependecies versions together, e.g. `bitcoin` `0.32.x` and `secp256k1` `0.29.x` would be really nice and would also simplify a lot code maintainability for anyone who depends on bitcoin.

  This needs to be backported to `0.32.x`, which I'll gladly do as well.

ACKs for top commit:
  luisschwab:
    ACK aa76108315
  tcharding:
    ACK aa76108315

Tree-SHA512: ff0e0016a6bf7cadf42cb40857393acace538fc3fb5214b89d4222a2fe570e9ae79617ae276273eefc34c3b68a64100bb22a9c01f9075cc3ed0705d7a264b9b3
2025-06-10 12:32:08 +00:00
merge-script 502a9d1ec4
Merge rust-bitcoin/rust-bitcoin#4607: Manual update to rustc (to nightly-2025-06-06)
47c07c39fb Manual update to rustc (to nightly-2025-06-06) (Jamil Lambert, PhD)
69ce8f448b Remove unneeded return statement (Jamil Lambert, PhD)
8e60711265 Use the anonymous lifetime for paths (Jamil Lambert, PhD)

Pull request description:

  Automated daily update to rustc #4598 failed CI due to new clipply lints. Fix the lints and update nightly:
  - Use the anonymous lifetime for paths.
  - Remove the unneeded return statement.
  - Update to `nightly-2025-06-06`

ACKs for top commit:
  tcharding:
    ACK 47c07c39fb
  apoelstra:
    ACK 47c07c39fb2af99c348124d45a3cb8f92deb60dd; successfully ran local tests

Tree-SHA512: 22e9e7809c20f864233c12c0cb096cd1e1c364161b769b6905c1b0a8ed03409c59a48c058dbd05e0dc064f7caff82d3e61f57d5b49df94ea86d09e54441fe380
2025-06-09 20:59:30 +00:00
Tobin C. Harding 7fbe07a6e0
Use uniform docs for overflow
Trivial change but make all the docs (rustdocs and code comments) use
the same phrase when describing overflow.
2025-06-10 06:43:52 +10:00
Tobin C. Harding 153a6a2f3c
Make Weight docs uniform with FeeRate 2025-06-10 06:39:30 +10:00
Tobin C. Harding c87f7292be
Fix rustdocs on Weight
There is no point linking to `Weight` in the rustdocs of `Weight`. Also
`wu` does not exist in this context, prefer 'weight units'.
2025-06-10 06:39:30 +10:00
Tobin C. Harding 02b523a8ad
Remove whitespace from encapsulate module
Whitespace here is unnecessary. Whitespace only, no logic change.
2025-06-10 06:39:30 +10:00
Tobin C. Harding b843f1356d
units: Access with getters instead of inner field
The `block` module does not follow the `encapsulate` pattern but we can
still use the getters instead of accessing the inner field directly.

Refactor, no logic change.
2025-06-10 06:38:08 +10:00
merge-script 40c5d96055
Merge rust-bitcoin/rust-bitcoin#4605: Remove _all_ the trailing whitespace
6cb4e298c8 Remove _all_ the trailing whitespace (Tobin C. Harding)

Pull request description:

  Recently we tried to make the rustfmt bot remove trailing whitespace but wrote the `sed` command incorrectly - it only removes a single character.

  Tested by running the new command on #4600.

ACKs for top commit:
  jamillambert:
    ACK 6cb4e298c8
  apoelstra:
    ACK 6cb4e298c8a7496f4b12b34a6c524db18d56d949; successfully ran local tests

Tree-SHA512: dd5c4ad3b38848ff5603e5b7077a9b3b62e6e3b232583ac62a486ba3ee71e27d3fe0d404c53110c484d44ca98dee9013be5ff232f4705e9c2ed6be04705395d0
2025-06-09 18:55:47 +00:00
merge-script c6c690a8f0
Merge rust-bitcoin/rust-bitcoin#4603: units: Add `must_use` to checked arithmetic functions
afc0ce6175 units: Add must_use to checked arithmetic functions (Tobin C. Harding)

Pull request description:

  The checked arithmetic functions all consume self so we use `must_use` to help users not miss this point.

  Most are done, add the missing ones.

ACKs for top commit:
  apoelstra:
    ACK afc0ce617554303d7fd25e052b039af44b6efc1c; successfully ran local tests

Tree-SHA512: 7105affff43827ed47a1c0b6e41a996aa538c7d53b891faf03e79a83164706d7e86db5fb184ac740fdf57bb43f8401a496cc64ea4da0da71eaa8c8cca16444c7
2025-06-09 12:36:54 +00:00
Jamil Lambert, PhD 47c07c39fb
Manual update to rustc (to nightly-2025-06-06)
Automated daily update failed due to the new lints.

Update the nightly version now lints are fixed.
2025-06-09 09:38:36 +01:00
Jamil Lambert, PhD 69ce8f448b
Remove unneeded return statement
New clipply lint in rustc nightly "unneeded `return` statement".

Remove it.
2025-06-09 09:35:44 +01:00
Jamil Lambert, PhD 8e60711265
Use the anonymous lifetime for paths
New clippy lint in rustc nightly "lifetime flowing from input to output
with different syntax can be confusing".

Apply the suggested fix and use the anonymous lifetime for paths.
2025-06-09 09:31:55 +01:00
Tobin C. Harding 6cb4e298c8
Remove _all_ the trailing whitespace
Recently we tried to make the rustfmt bot remove trailing whitespace but
wrote the `sed` command incorrectly - it only removes a single
character.

Tested by running the new command on #4600.
2025-06-09 08:58:52 +10:00
merge-script 17cd382327
Merge rust-bitcoin/rust-bitcoin#4599: Add backticks around OPCodes
ebb9861c58 Add backticks around OPCodes (yancy)

Pull request description:

  Item in documentation is missing backticks

ACKs for top commit:
  tcharding:
    ACK ebb9861c58
  apoelstra:
    ACK ebb9861c58419c1f2e3cce2ef4ecdfa1dee144e0; successfully ran local tests

Tree-SHA512: 1a06db90c026544efda2b248d2e1fd2ca49af9e9828c52b427077edf65e8a6fa789b691e9411d704459a55aae7f28b4bd784a493e89506b83c872b4ecbb9fe1e
2025-06-08 18:44:43 +00:00
merge-script 68981c6ab5
Merge rust-bitcoin/rust-bitcoin#4600: Automated nightly rustfmt (2025-06-08)
4b5c6dd547 2025-06-08 automated rustfmt nightly (Fmt Bot)

Pull request description:

  Automated nightly `rustfmt` changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  apoelstra:
    ACK 4b5c6dd54748eca214a0e2fce33d9f4a354b394a; successfully ran local tests

Tree-SHA512: 2459cab9fcc329136846dff463c3405b6b55e64e20294c860df6d6d7e81ef8292dacf70a54cad2b7ceb127b486406cf4164687a0294290e2a83581d06524ded0
2025-06-08 16:12:38 +00:00
Tobin C. Harding afc0ce6175
units: Add must_use to checked arithmetic functions
The checked arithmetic functions all consume self so we use `must_use`
to help users not miss this point.

Most are done, add the missing ones.
2025-06-09 00:09:46 +10:00
Fmt Bot 4b5c6dd547 2025-06-08 automated rustfmt nightly 2025-06-08 01:44:53 +00:00
yancy ebb9861c58 Add backticks around OPCodes
Item in documentation is missing backticks
2025-06-07 12:10:24 -05:00
merge-script a1be2fdf73
Merge rust-bitcoin/rust-bitcoin#4593: units: Add `is_satisfied_by` locktime tests
2fa5c062d5 Add is_satisfied_by locktime tests (Jamil Lambert, PhD)

Pull request description:

  Weekly mutation testing found new mutants in both `Height::is_satisfied_by` and `MedianTimePast::is_satisfied_by` functions.

  Test these two functions and kill the mutants.

  Closes #4587

ACKs for top commit:
  tcharding:
    ACK 2fa5c062d5
  apoelstra:
    ACK 2fa5c062d5e07580bdb7ea5e4c58e4607c716ecc; successfully ran local tests

Tree-SHA512: 28d69cdf575bb17eff6d685b1fee05e3f9a821c8796c82655b2d2eda6ee1d9dc79043853fbe0475f6bdb548cef52ac710b3c632f7784788035392e29e70ce48e
2025-06-06 18:25:58 +00:00
merge-script 9d586a982b
Merge rust-bitcoin/rust-bitcoin#4590: Clean up `bip32` test
dd3f3e44bc Split into_derivation_path tests out (Tobin C. Harding)
0c9dd31f53 Test with m prefix (Tobin C. Harding)
c5073f4c51 Refactor simple valid path tests into a loop (Tobin C. Harding)
3e7fdad5fd Split empty master test out (Tobin C. Harding)
ed36a980f8 Refactor invalid derivation path tests (jamillambert)
015fb1be3b Split invalid derivation path test (jamillambert)
76dd6100a2 Split derivation path test into valid and invalid (jamillambert)

Pull request description:

  Refactor tests like its our job.

  Co-developed-by: Jamil Lambert <jamil.lambert@proton.me>

ACKs for top commit:
  apoelstra:
    ACK dd3f3e44bc3329830aacacb252162c57858b0029; successfully ran local tests

Tree-SHA512: 8907ff127c11767a600cf856fb34645eb78392c755998565675a026dc4ddd9db00083963414f7e45fc7a2194ad3c5f251f7249bc7d7a2150a5840d1ec8b5d4da
2025-06-06 15:51:02 +00:00
merge-script c0d51ed9dc
Merge rust-bitcoin/rust-bitcoin#4591: chore: add missing backticks
3dd538d04b chore: add missing backticks (findmyhappy)

Pull request description:

  Add missing backtick in comment.

ACKs for top commit:
  tcharding:
    ACK 3dd538d04b
  apoelstra:
    ACK 3dd538d04bad6e07b04cd8c2b3fb14d09625389f; successfully ran local tests

Tree-SHA512: ae36752c1c097e3b72d59e6e77f45f0474c7703d0eb32f4df434b0a7bb1e037e4415cf385ef22e20f86ebb407d42bdd35b26fd7f7029a6210be29bc434231eb7
2025-06-05 15:49:42 +00:00
merge-script 02e857582c
Merge rust-bitcoin/rust-bitcoin#4596: Correct hash algorithm name in RIPEMD160 documentation
e9f7ae4b74 Correct hash algorithm name in RIPEMD160 documentation (David Klank)

Pull request description:

  Corrected the documentation comment for the `new()` method in the RIPEMD160 `HashEngine` struct. The comment incorrectly stated it constructs a "SHA256 hash engine" when it actually constructs a RIPEMD160 hash engine.

ACKs for top commit:
  tcharding:
    ACK e9f7ae4b74
  apoelstra:
    ACK e9f7ae4b74a4d2728b4b64bbb8fc2db92fefec3a; successfully ran local tests

Tree-SHA512: 3935f502709dc8ec570d7f112efbc4d55349f7072342ad0278ee2525bbf39ca1d7f60bcef0ad0a3bdcf3e67b2548d89bc01435532d848595a9824f4ec9e74bb7
2025-06-05 14:33:49 +00:00
Jamil Lambert, PhD 2fa5c062d5
Add is_satisfied_by locktime tests
Weekly mutation testing found new mutants in both height and median time
past `is_satisfied_by` functions.

Test these two functions and kill the mutants.
2025-06-05 11:27:25 +01:00
David Klank e9f7ae4b74
Correct hash algorithm name in RIPEMD160 documentation 2025-06-05 12:09:34 +03:00
merge-script 4213d4a9d3
Merge rust-bitcoin/rust-bitcoin#4592: Remove unnecessary closure
a1e8fabbbe Remove unnecessary closure (Tobin C. Harding)

Pull request description:

  We can just pass the function directly. Found by clippy bizarrely after running `rustfmt` (in bot-created PR #4586).

  Internal change only, no logic change.

ACKs for top commit:
  yancyribbens:
    cr ACK a1e8fabbbe
  apoelstra:
    ACK a1e8fabbbe26cbe62e1a966cc0c760407bfb063f; successfully ran local tests

Tree-SHA512: 19d5ee65da7cfdae82a9a6609afac6d6b03d1c44c0c5bed21916ec31665e76adfc836ac6a1980251db2b9d5704baa577783dc967b1f0035cf662389c87fc6a0a
2025-06-04 21:00:30 +00:00
merge-script a746456601
Merge rust-bitcoin/rust-bitcoin#4568: Remove conversion impl macro for `Magic`/`Network`
028a0d6558 Remove conversion impl macro for `Magic`/`Network` (rustaceanrob)

Pull request description:

  Closes #4560 (or at least one way to close it)

  Handle the coversion of new networks directly in the `From` and `TryFrom` implementations, as new networks are added infrequently.

ACKs for top commit:
  tcharding:
    ACK 028a0d6558
  apoelstra:
    ACK 028a0d6558129f554de8c4247481bc0ad80f1c27; successfully ran local tests

Tree-SHA512: 07b768e229305878849f23e54d3fb4940a736ce44122950e4f4bf68ddeb4f82f2d35020840e8176bd7b562726e46055650ba6de8559bae7559c881b64a437169
2025-06-04 18:17:25 +00:00
merge-script fa07198f21
Merge rust-bitcoin/rust-bitcoin#4511: Modify `locktime` `serde` implementations
4621d2bde1 Modify locktime serde implemenations (Tobin C. Harding)
200c276315 bitcoin: Make test code spacing uniform (Tobin C. Harding)

Pull request description:

  Patch 1 is preparatory clean up. Patch 2 is the meat and potatoes. See commit log there for full explanation.

  Briefly:

      - Remove `serde` stuff from `units::locktime`
      - Manually implement `serde` traits on `relative::LockTime`
      - Fix the regression test to use the new format

ACKs for top commit:
  apoelstra:
    ACK 4621d2bde14d71b3d6ef0b14258a7479c049ba3b; successfully ran local tests

Tree-SHA512: bc96d79dd4d9f5a124c22f0d3be4750cb7b6e86ba448b31e233982567578337d331b2582c6e1f953c00e8393c4a4552c4b574fe8a55323c911115b269b24090e
2025-06-04 17:32:02 +00:00
merge-script a13ba99c11
Merge rust-bitcoin/rust-bitcoin#4534: Make `FeeRate` use MvB internally
56516757ad Add code comment to amount calculation (Tobin C. Harding)
8cf1dc39b5 Fix incorrect code comment (Tobin C. Harding)
7c186e6081 Refactor fee functions (Tobin C. Harding)
bf0776e3dd Remove panic using checked arithmetic (Tobin C. Harding)
b65860067f Make fee functions const (Tobin C. Harding)
9b2fc021b2 Improve rustdocs on FeeRate (Tobin C. Harding)
1bd1e89458 Re-introduce FeeRate encapsulate module (Tobin C. Harding)
b27d8e5819 Change the internal representation of FeeRate (Tobin C. Harding)
2e0b88ba76 bitcoin: Fix dust 'fee' identifiers (Tobin C. Harding)
399bca531c Reduce the FeeRate::MAX value (Tobin C. Harding)
d174c06a4a Saturate to_fee to Amount::MAX (Tobin C. Harding)
64ac33754f Add missing argument docs (Tobin C. Harding)
fe0a448e78 Temporarily remove const from fee calc function (Tobin C. Harding)
b929022d56 Add floor/ceil versions of to_sat_per_kwu (Tobin C. Harding)
64098e4578 Remove encapsulate module from fee rate (Tobin C. Harding)

Pull request description:

  The `FeeRate` is a bit entangled with amount and weight.  Also we have an off-by-one bug caused by rounding errors and the fact that we use kwu internally.

  We can get more precision in the fee rate by internally using per million virtual bytes.

  - Fix: #4516
  - Fix: #4497
  - Fix: #3806

ACKs for top commit:
  apoelstra:
    ACK 56516757ad8874d8121dba468946546bb8fd7d4e; successfully ran local tests

Tree-SHA512: 0c6e7e2c9420886d5332e32519838d6ea415d269abda916e51d5847aa2475c87fa4abfc29b5f75e8b10c44df67ae29d823aa93f7cfabbc89eb27f2173b103242
2025-06-04 16:42:55 +00:00
findmyhappy 3dd538d04b chore: add missing backticks
Signed-off-by: findmyhappy <findhappy@sohu.com>
2025-06-04 14:51:10 +08:00
Tobin C. Harding a1e8fabbbe
Remove unnecessary closure
We can just pass the function directly. Found by clippy bizarrely after
running `rustfmt` (in bot-created PR #4586).

Internal change only, no logic change.
2025-06-04 07:36:52 +01:00
Tobin C. Harding dd3f3e44bc
Split into_derivation_path tests out
The test _still_ tests multiple things.

Move the `into_derivation_path` calls into a separate test.
2025-06-03 12:05:03 +01:00
Tobin C. Harding 0c9dd31f53
Test with m prefix
We have a single test case that tests for the m prefix while all the
others do not.

Move one test case into the loop and then test on each iteration the
path with m prefix added.
2025-06-03 12:03:06 +01:00
Tobin C. Harding c5073f4c51
Refactor simple valid path tests into a loop
The test is still doing a bunch of stuff.

Pull the simple test cases into a loop.
2025-06-03 11:51:48 +01:00
Tobin C. Harding 3e7fdad5fd
Split empty master test out
The valid derivation test is doing a whole bunch of things.

Split out the empty master path assertions into a separate test.
2025-06-03 11:37:12 +01:00