Commit Graph

6640 Commits

Author SHA1 Message Date
Andrew Poelstra fbb0e4004f
Merge rust-bitcoin/rust-bitcoin#4628: Use new type names instead of deprecated aliases
f746aecb61 Use NumberOfBlocks in rustdoc (Tobin C. Harding)
dc5249aae6 Use new type names instead of deprecated aliases (Tobin C. Harding)

Pull request description:

  Recently we changed the names of some locktime types but kept aliases to the original names. To assist with ongoing maintenance lets use the new names already.
  
  ~Internal change only.~
  
  Added a patch that does the same in some rustdocs.


ACKs for top commit:
  jamillambert:
    ACK f746aecb61
  apoelstra:
    ACK f746aecb61456f1eb97280e1d091434250832e72; successfully ran local tests


Tree-SHA512: f3304fcc62069f72fa6c49b4aee5579e4ef6e81cb466b9c7e79ddd1a04b63f2f4d3f0ffdcb9303c3bee2501beead3fceb9be79cefe35d7615223738291535152
2025-06-21 18:03:55 +00:00
Andrew Poelstra ea731947b1
Merge rust-bitcoin/rust-bitcoin#4625: units: Fix up the api test
2b07f59545 units: Fix up the api test (Tobin C. Harding)
a6ab5c9fd0 Implement Arbitrary for result types (Tobin C. Harding)

Pull request description:

  A lot has changed over the last few months. Fix up the API integration test to match the current state of the crate.
  
  Includes a patch to implement `Arbitrary` for types from the new private `result` module.


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


Tree-SHA512: fa9bd5b67ea6217cfb11a985183d2d83ae126678fa9fbe5b540fcec31efc0fbafb3e6010c7e831c84c9161300ad5ccc771f848875fdcfe09e072bb0d2881a104
2025-06-20 23:01:29 +00:00
Tobin C. Harding 2b07f59545
units: Fix up the api test
A lot has changed over the last few months. Fix up the API integration
test to match the current state of the crate.
2025-06-20 09:00:29 +10:00
Tobin C. Harding a6ab5c9fd0
Implement Arbitrary for result types
Implement `Arbitrary` for the `NumOpResult` and `MathOp` types from the
`result` module.
2025-06-20 09:00:25 +10:00
merge-script 5743a81128
Merge rust-bitcoin/rust-bitcoin#4589: Move `bitcoin::p2p` into `p2p`
d9cf7270eb Move `bitcoin/p2p` into `p2p` (rustaceanrob)

Pull request description:

  Could use a rebase on #4568

  Somehow lost the branch of my original draft so some of the review context is removed, but all comments were addressed in separate PRs.

  First commit moves everything required to implement encoding within `p2p`, so we have a reference for functions to add to future moves to `internals`. Second commit does the relocation and third commit removes the `bitcoin/p2p` module.

ACKs for top commit:
  apoelstra:
    ACK d9cf7270eb457fd660fa505701895ab4756e394d; successfully ran local tests
  tcharding:
    ACK d9cf7270eb

Tree-SHA512: 31bf960788f45bb60b04dd73793a06828a5540e1e6118376776494bad9330dc8ebcb57749bc84b70a00e4d1d2a5686506e089269833ed99c4f9fa0c3e3b2e5b7
2025-06-19 17:00:08 +00:00
merge-script 886c6667a8
Merge rust-bitcoin/rust-bitcoin#4627: units: Make error constructor private
f6dea36e31 units: Make error constructor private (Tobin C. Harding)

Pull request description:

  We typically do not want to have public constructors on error types. Currently we do on the `TimeOverflowError` so that we can call it in `primitives` but it turns out we can just use `NumberOf512Seconds` constructors instead.

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

Tree-SHA512: f8d4615f2adb506278f20352c97e2b6698d3f81fe27d5204f215faeb8fe208fc849ad6c82cd40963736e85e669287d2f0f0c2cbc0a0d5858c2677e693c1582ae
2025-06-19 16:15:58 +00:00
Tobin C. Harding f746aecb61
Use NumberOfBlocks in rustdoc 2025-06-19 14:04:55 +10:00
Tobin C. Harding dc5249aae6
Use new type names instead of deprecated aliases
Recently we changed the names of some locktime types but kept aliases to
the original names. To assist with ongoing maintenance lets use the new
names already.

Internal change only.
2025-06-19 13:19:12 +10:00
Tobin C. Harding f6dea36e31
units: Make error constructor private
We typically do not want to have public constructors on error types.
Currently we do on the `TimeOverflowError` so that we can call it in
`primitives` but it turns out we can just use `NumberOf512Seconds`
constructors instead.
2025-06-19 13:13:37 +10:00
merge-script c36d295836
Merge rust-bitcoin/rust-bitcoin#4624: impl LowerHex, UpperHex, Octal, and Binary for ChildNumber
7dc66e3476 impl LowerHex, UpperHex, Octal, and Binary for ChildNumber (vicjuma)

Pull request description:

  apoelstra Each trait forwards formatting to the inner u32 index. For Hardened variants, a suffix is appended based on whether alternate formatting is used per the discussion.

  See discussion: https://github.com/rust-bitcoin/rust-bitcoin/pull/4620#issuecomment-2974023604

ACKs for top commit:
  tcharding:
    ACK 7dc66e3476
  apoelstra:
    ACK 7dc66e3476c3ba08eb341a09f3c85a795b005159; successfully ran local tests

Tree-SHA512: 49e4acc82198d3a2c807bf8977413dd260a7081b83e8ad2c2b97d8fcaf85b78a54552098a5fe3020c78fe7b908d90a3bab86be20f330d3de569b5eba69e23348
2025-06-18 16:58:37 +00:00
rustaceanrob d9cf7270eb
Move `bitcoin/p2p` into `p2p`
Moves all of the content from `bitcoin/p2p` into `p2p`.

`TryFrom<Network>` must be implemented for `Network -> Magic` now that
`Network` is a foreign, non-exhaustive type. Ser/de test is updated
accordingly, as well as the `Magic::from_network` constructor, which I
have opted to return an `Option<Self>`. The `TryFrom` implementation
uses a new `UnknownNetworkError(Network)` that mirrors the `Magic ->
Network` error.

The example handshake does not generate a random nonce for the version
message, as there is no `rand` dependency in this crate and the program
only makes a single, user-defined connection.

It appears we can do better than copying and pasting the consensus
encoding macros and functions from `bitcoin` without doing weird
cross-crate macros that require some special knowledge of the crate to
know when they will compile.
2025-06-18 14:11:35 +01:00
vicjuma 7dc66e3476 impl LowerHex, UpperHex, Octal, and Binary for ChildNumber
Each trait forwards to the inner u32 index and formatting done based on the variant used with the alternate path

See discussion: https://github.com/rust-bitcoin/rust-bitcoin/pull/4620#issuecomment-2974023604
2025-06-18 01:44:45 +03:00
merge-script f034367bbc
Merge rust-bitcoin/rust-bitcoin#4620: Add alternate print format to DerivationPath using 'h' suffix
4284deed29 DerivationPath: support 'h' in Display output for hardened components (vicjuma)

Pull request description:

  DerivationPath now supports a display format using both 'h' a single quote (') to indicate hardened components.

  This aligns it with its ChildNumber's output style.

  Resolves: #4618

ACKs for top commit:
  apoelstra:
    ACK 4284deed29114c5e31ef7c29e28e352b860f74e7; successfully ran local tests
  tcharding:
    ACK 4284deed29

Tree-SHA512: 24e053c22ec94b851935debbab83d15ad9f41ccfca0a7c34a061450989b176295512e8ffb187b2a54c6c6926f82ec7e4a4186ccdba2ec2616a6e0603d90d2a9b
2025-06-16 21:55:20 +00:00
merge-script 1fee075502
Merge rust-bitcoin/rust-bitcoin#4616: units: Improve the fee calculation functions
0ff8d82193 Make FeeRate from sat constructors infallible (Tobin C. Harding)
3b0286bd56 Return NumOpResult for FeeRate and Weight (Tobin C. Harding)
15065b78c7 Return NumOpResult when calculating fee on Amount (Tobin C. Harding)
75106e6d82 Remove checked_ prefix from fee functions (Tobin C. Harding)

Pull request description:

  This was 14dc950b54 from #4610.

  Remove the `checked_` prefix from `fee` functions then make them all return `NumOpResult`.

ACKs for top commit:
  apoelstra:
    ACK 0ff8d82193ef562c1aedabe98a6283d09f803c0c; successfully ran local tests; nice!

Tree-SHA512: 62f2af6701f2a0e17b9f0a0ee132ca4a9289fe00e22c94f746602ed3c1f3758bb22323b224362cb659432ff5297391f3106ee460e9a8f65a39f904d72bc98aeb
2025-06-16 19:47:31 +00:00
Tobin C. Harding 0ff8d82193
Make FeeRate from sat constructors infallible
We now have constructors that take an arbitrary size fee
rate (`Amount`). The `from_sat_per_foo` constructors can be made
infallible by taking a `u32` instead of `u64`. This makes the API more
ergonomic but limits the fee rate to just under 42 BTC which is plenty.

Note we just delete the `from_sat_per_vb_u32` function because it is
unreleased, in the past we had `from_sat_per_vb_unchecked` so we could
put that back in if we wanted to be a bit more kind to downstream. Can
be done later, we likely want to go over the public API before release
and add a few things back in that we forgot to deprecate or could not
for some reason during dev.

Fuzz with a new function that consumes a `u32`.
2025-06-16 09:56:42 +10:00
Tobin C. Harding 3b0286bd56
Return NumOpResult for FeeRate and Weight
As we did for `Amount` change the fee functions on `FeeRate` and
`Weight` to return `NumOpResult`.

This change does not add that much value but it does not make things
worse and it makes the API more uniform. Also reduces lines of code.
2025-06-16 08:48:12 +10:00
Tobin C. Harding 15065b78c7
Return NumOpResult when calculating fee on Amount
Currently we call the `Amount` fee calculation functions `div_by_foo`
and return an `Option` to indicate error. We have the `NumOpResult`
type that better indicates the error case.

Includes a bunch of changes to the `psbt` tests because extracting the
transaction from a PSBT has a bunch of overflow paths that need testing
caused by fee calculation.
2025-06-16 08:48:05 +10:00
Tobin C. Harding 75106e6d82
Remove checked_ prefix from fee functions
The `Amount` and `FeeRate` types are not simple int wrappers, as such we
do not need to mimic the stdlib too closely. Having the `checked_`
prefix to the functions that do fee calcualtions adds no additional
meaning. Note that I'm about to change the return type to use
`NumOpResult` further justifying this change.

Note we leave the 'Checked foo' in the functions docs title because
the functions are  still checked.
2025-06-16 08:47:49 +10:00
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