Commit Graph

5846 Commits

Author SHA1 Message Date
Tobin C. Harding 2d6ee57d9c
Grab missing changelog
We release `v0.32.4` and `v0.32.5` already but forgot to merge the
changelog entries back into master.

Grab the missing changelog entries from the `0.32.x` release branch.
2025-02-25 19:35:43 +11:00
merge-script 5a0d5d7b79
Merge rust-bitcoin/rust-bitcoin#4105: Automated nightly rustfmt (2025-02-23)
0596867048 2025-02-23 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 0596867048be131f3af26f5f8be4b36f1fe186b0; successfully ran local tests

Tree-SHA512: 84a3b7c79939c1bcd0c3e30b117e0f681923a8c0825ee8852845abc0ec0677f3a6033c6133eba7742b9bb4e67d635614be5cd2d983d07c5866396142a8d8c3bc
2025-02-24 17:31:28 +00:00
merge-script 81deddd0a9
Merge rust-bitcoin/rust-bitcoin#4099: Make transaction::Version field private
cb270eae8e Make transaction::Version field private (jrakibi)
6c69b66b0d Use Version constant (jrakibi)

Pull request description:

  This commit addresses #4041 by making the `transaction::Version` field private.

  This forces people to either use the associated constants (`Version::ONE/TWO/THREE`) or the `non_standard`/`from_consensus` methods for any other transaction version.

  This aligns with our approach to `block::Version`

ACKs for top commit:
  tcharding:
    ACK cb270eae8e
  Kixunil:
    ACK cb270eae8e

Tree-SHA512: dcf5b50dfeda04e56fec350acd735dcb7099989b552afce4261d559a8a846c0eb3705369ad635ef9bbbfb2373d203a2c3641178925de6685426aa91245db9a8c
2025-02-24 16:37:16 +00:00
merge-script 76a511dfb2
Merge rust-bitcoin/rust-bitcoin#4107: sighash: Document `witness_script` in p2wsh
82a8aefc53 sighash: Document witness_script in p2wsh (Jose Storopoli)

Pull request description:

  A note suggestion for the `p2wsh_signature_hash` in the same vein as the one in the "sister" function `p2wpkh_signature_hash`: 33f5e5a6ac/bitcoin/src/crypto/sighash.rs (L863-L867)

  Any better wordings are welcomed. Not married to my sentences.

ACKs for top commit:
  luisschwab:
    ACK 82a8aefc53
  Kixunil:
    ACK 82a8aefc53

Tree-SHA512: 1ba5f9b7c287b5c1494ba9ab03c146ff99fa8be791397b61ff4609a8dbab5be5c1376d9f401b56ec4a94196eec5a96ba140965a5a8178938a2c293994e71dbfe
2025-02-24 15:28:18 +00:00
Jose Storopoli 82a8aefc53
sighash: Document witness_script in p2wsh 2025-02-24 08:15:42 -03:00
jrakibi cb270eae8e Make transaction::Version field private
This commit addresses #4041 by making the transaction::Version field private

Changes:
- Make the `Version` field private with `pub(crate)`
- Rename `non_standard` to `maybe_non_standard` for clarity since it accepts both standard and non-standard versions
- Add `#[inline]` attributes to small, frequently used methods:
  - `as_u32`
  - `maybe_non_standard`

Users now must use either:
- Constants (`Version::ONE/TWO/THREE`) for standard versions
- `maybe_non_standard` method for any version (standard or non-standard)
2025-02-24 06:54:21 +07:00
merge-script 0157dc21c3
Merge rust-bitcoin/rust-bitcoin#4088: Abstract out "debug-print hex fields" using WrapDebug
4eb3177fab Abstract out "debug-print hex fields" using WrapDebug (Erick Cestari)

Pull request description:

  This pr introduces `WrapDebug` in `internals` and updates `Witness` debug implementation to use it. The previous `DebugElements` struct has been removed in favor of an ad-hoc closure inside `WrapDebug`, which formats witness elements as a debug list of hex-encoded values.

  By abstracting out the "debug-print hex fields" pattern, we reduce code duplication and improve maintainability.

  Closes #4074

ACKs for top commit:
  Kixunil:
    ACK 4eb3177fab
  apoelstra:
    ACK 4eb3177fab0655457a8a6d1556fd7eba54459250; successfully ran local tests

Tree-SHA512: 533ab10a8ca2be891c0f9e374bdb990cff941e332414a345ba6573d03cca19595a840d818eb24947c8b8bf88512532eed395adbc0dd3a7bb66ffb4cc641cbf21
2025-02-23 17:45:38 +00:00
merge-script 38e9bf841e
Merge rust-bitcoin/rust-bitcoin#4084: documentation: update instructions for building lock files
948647a9dd update documentation for changing lockfiles; change script to support mac nanaive cp function (jeremiah)

Pull request description:

  1. Updates `CONTRIBUTING.md` with latest instructions on using `just` to create new lock files. See discussion [here](https://github.com/rust-bitcoin/rust-bitcoin/pull/4045/files).
  2. For the command `cp`,  `--force` is not an option on the Mac. Changed to `-f` which as far as I can tell is equivalent.

  ```
  ➜  rust-bitcoin git:(jr_update_contrib) ✗ cp --force
  cp: illegal option -- -
  ```

ACKs for top commit:
  tcharding:
    ACK 948647a9dd
  Kixunil:
    ACK 948647a9dd
  apoelstra:
    ACK 948647a9dd95bedbb8c34f0b9548e859bfc723b1; successfully ran local tests

Tree-SHA512: a9486ec323b15a9cfa78cd70332e153881537ec8fd26e6e23f8b61ed2272251271299723e9aa390542044588357ec072eb1559cd5e32cb707757f58361a6fb05
2025-02-23 14:39:44 +00:00
Fmt Bot 0596867048 2025-02-23 automated rustfmt nightly 2025-02-23 01:21:34 +00:00
jrakibi 6c69b66b0d Use Version constant
Replace Version(2) with predefined Version::TWO constant
2025-02-23 04:19:48 +07:00
merge-script d1171381bc
Merge rust-bitcoin/rust-bitcoin#4095: Automated weekly update to rustc stable (to 1.85.0)
2349e5be73 Automated update to Github CI to rustc stable-1.85.0 (Update Stable Rustc Bot)

Pull request description:

  Automated update to Github CI workflow `semver-checks.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  tcharding:
    ACK 2349e5be73

Tree-SHA512: 49d78997ea252b1a98844fe6ab7a98b798e464c6a99f7346e13611c567c7bb8abea618de00dd92fb945e84dc01d8a44d10d659ca3ef175460a534288e35e6b0e
2025-02-21 15:46:16 +11:00
Update Stable Rustc Bot 2349e5be73 Automated update to Github CI to rustc stable-1.85.0 2025-02-21 00:56:08 +00:00
Erick Cestari 4eb3177fab Abstract out "debug-print hex fields" using WrapDebug
This commit introduces `WrapDebug` in `internals` and updates `Witness`
debug implementation to use it. The previous `DebugElements` struct has
been removed in favor of an ad-hoc closure inside `WrapDebug`, which
formats witness elements as a debug list of hex-encoded values.

By abstracting out the "debug-print hex fields" pattern, we reduce
code duplication and improve maintainability.
2025-02-20 10:56:12 -03:00
jeremiah 948647a9dd update documentation for changing lockfiles; change script to support mac nanaive cp function 2025-02-19 18:26:12 -05:00
merge-script e487618503
Merge rust-bitcoin/rust-bitcoin#4071: chacha20: add benchmarks
e41653d188 add chacha20 benchmarks (jeremiah)

Pull request description:

  Add benchmarks for chacha20. These could be useful to understand future improvements.

  I copied the same 10, 1k and 64k sizes as used in the sha256 benchmark. Some of the lines changed here, such as in `Config.toml`, are a little mysterious to me as I am new to rust, so please check.

  ```
  ➜  chacha20_poly1305 git:(jr_chachabench) RUSTFLAGS='--cfg=bench' cargo +nightly bench
  ...
  test benches::chacha20_10  ... bench:         188.67 ns/iter (+/- 2.70) = 53 MB/s
  test benches::chacha20_1k  ... bench:       2,885.83 ns/iter (+/- 90.06) = 354 MB/s
  test benches::chacha20_64k ... bench:     186,493.88 ns/iter (+/- 5,074.53) = 351 MB/s
  ```

ACKs for top commit:
  apoelstra:
    ACK e41653d18838e0d6e157db475b7b034b2456c924; successfully ran local tests; nice!
  Kixunil:
    ACK e41653d188

Tree-SHA512: fa37a4b6842ab78edc32726b22410d9769c1f03e1bc3488517e1e59e17388cabb63e58eb6ea6f112cb27ff1015296f356275ddee12d261c848050e98e3c6eed6
2025-02-19 19:35:32 +00:00
merge-script f71e28eea2
Merge rust-bitcoin/rust-bitcoin#4047: Properly deprecate `Hash::from_slice`
f61e93ccf1 Properly deprecate Hash::from_slice (Tobin C. Harding)
50c0af7138 Stop using Hash::from_slice (Tobin C. Harding)

Pull request description:

  The `hashes::error::FromSliceError` error is only returned from `from_slice`. We attempted to deprecate this function but it seems we only did half a job at it.

  - deprecate _all_ instances of the method/function
  - deprecate the error type
  - stop using the deprecated functions in `bitcoin`

  Close: #4053

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

Tree-SHA512: 61a0e5127019859776ffac66bd4d320c86b8462bb1e908127d0bf42896aaa8df85fd2b06850342b694ca1cd68ed50355c81cad6ae3e9a5fd6e3933efe85498ad
2025-02-19 15:36:40 +00:00
merge-script c0073eb10d
Merge rust-bitcoin/rust-bitcoin#4069: Update to latest maintainer-tools
cdece244d5 Update to latest maintainer-tools (Tobin C. Harding)

Pull request description:

  We have made a couple of improvements to the `run_task` script lately (*cough* actually test code with `--all-features`).

  Lets update to use it.

  This PR explicitly tests https://github.com/rust-bitcoin/rust-bitcoin-maintainer-tools/pull/20 because it uses the commit hash created in that PR.

ACKs for top commit:
  apoelstra:
    ACK cdece244d5b660c658461e58093090d982e4835e; successfully ran local tests; will one-ack merge this since it is trivial

Tree-SHA512: 97597d01beb3b0a87fb0c279ba0e57093f4898a38e7373040cfa18b16c62f9cbceb41ac53429a2e05f70f2ea9fdd7d409e9925131575b3f66d00c5395ba6bfc1
2025-02-19 13:28:36 +00:00
merge-script 38c8c90765
Merge rust-bitcoin/rust-bitcoin#4065: locktimes: Remove `PartialOrd` and `ArbitraryOrd`
4259dab93a Remove rust-ordered dependency (Tobin C. Harding)
d392cdbd7d Remove PartialOrd from locktimes (Tobin C. Harding)

Pull request description:

  These two things are related so we remove them both in the same PR. Please see commit logs for full explanation.

  For more context see discussion below and also:

  - #2500
  - #4002
  - #3881

  Close: #4029

ACKs for top commit:
  Kixunil:
    ACK 4259dab93a
  apoelstra:
    ACK 4259dab93ab52795305db4b889b9151595bcee51; successfully ran local tests

Tree-SHA512: 7526d4faaa9edf8017d2af412c41a33f33d851ad5130c9a745bba86d9c71dc1db7f20d07377aaf3a25fec2c0de79f3ffabc2c538a5a366e415c7a6eaa730153c
2025-02-18 19:55:40 +00:00
merge-script dfe69354f5
Merge rust-bitcoin/rust-bitcoin#4046: hashes: Add `Copy`, `Clone`, and `Debug` imlps for `Hkdf`
da8b85ed7c Implement Debug for Hkdf (Tobin C. Harding)
85652359e8 hashes: Derive Copy and Clone for Hkdf (Tobin C. Harding)

Pull request description:

  Currently the `Hkdf` type does not derive any traits.

  Derive `Copy` and `Clone` and implement `Debug` based on secret obfuscation algo in `rust-secp` (in the `secret` module).

ACKs for top commit:
  apoelstra:
    ACK da8b85ed7cf34c0510c0b64c67477d3819bee369; successfully ran local tests
  Kixunil:
    ACK da8b85ed7c

Tree-SHA512: 8ae0e8857ea0e32ad5ef8f544979eeb9d530beb1b6f046ce28a286ca2231f8f696a9f4f8d9ea219d3389c4216d6b69766dbd96edbb27e7489803ac583bf3b200
2025-02-18 14:14:13 +00:00
Tobin C. Harding f61e93ccf1
Properly deprecate Hash::from_slice
The `hashes::error::FromSliceError` error is only returned from
`from_slice`. We attempted to deprecate this function but it seems we
only did half a job at it.

- deprecate _all_ instances of the method/function
- deprecate the error type
2025-02-18 19:27:30 +11:00
Tobin C. Harding cdece244d5
Update to latest maintainer-tools
We have made a couple of improvements to the `run_task` script
lately (*cough* actually test code with `--all-features`).

Lets update to use it.
2025-02-18 18:55:15 +11:00
Tobin C. Harding da8b85ed7c
Implement Debug for Hkdf
We would like to implement `Debug` for `Hkdf` but the inner field is
secret so we cannot derive an impl.

Use a tagged hash engine to hash the secret.
2025-02-18 13:42:46 +11:00
Tobin C. Harding 4259dab93a
Remove rust-ordered dependency
It has turned out that the `rust-ordered` crate and it's
`ArbitraryOrd` trait are only useful for locktimes and only marginally
useful for them at best.

Remove the `ArbitraryOrd` impls and the `rust-ordered` dependency.

This topic was discussed in various places including:

- #2500
- #4002
- #3881

Close: #4029
2025-02-18 13:36:07 +11:00
Tobin C. Harding d392cdbd7d
Remove PartialOrd from locktimes
Currently it is possible to write

```rust
if this_locktime < that_locktime {
   do_this();
}
```

with the hope that this code means if a locktime is satisfied by the
value in the other locktime. This is a footgun because locktimes are
incommensurate.

We provide the `is_satisfied_by` API to help users do locktime
comparisons.

Remove the `PartialOrd` implementation from both locktime types.
2025-02-18 13:30:42 +11:00
jeremiah e41653d188 add chacha20 benchmarks 2025-02-17 21:00:40 -05:00
merge-script fab1a97a9c
Merge rust-bitcoin/rust-bitcoin#4061: Make Debug representation of Witness to be slice of hex-encoded bytes strings to improve readability
8d8edd2c77 make Debug representation of Witness to be slice of hex-encoded bytes strings (Erick Cestari)

Pull request description:

  This PR updates the Debug implementation for the Witness type to improve its readability by displaying the witness data as a slice of hex-encoded strings rather than a concatenated blob or list of raw u8 values. The changes include:

  - Improved Output:
  The debug output now shows pseudo-fields such as the number of elements and the total length of all elements, making it easier to understand the underlying data without exposing internal indices like indices_start.

  - Hex-Encoding:
  Each witness element is displayed as a hex-encoded string, similar to Bitcoin Core's output style, which enhances clarity during debugging sessions.

  These changes should provide a more developer-friendly view of the witness data and align with similar patterns used elsewhere in the ecosystem.

  Closes #4023.

  Example display:

  ```
  Witness {
      num_elements: 3,
      total_bytes: 5,
      elements: [
          0b,
          1516,
          1f20,
      ],
  }
  ```
  ```
  Witness { num_elements: 3, total_bytes: 5, elements: [0b, 1516, 1f20] }
  ```

ACKs for top commit:
  tcharding:
    ACK 8d8edd2c77
  Kixunil:
    ACK 8d8edd2c77
  apoelstra:
    ACK 8d8edd2c77de9b0423533fc70802171803761fcd; successfully ran local tests

Tree-SHA512: ffcdf67542049f405317eecd74876b51972d27ec552eec8e9c7b6324f18f31f4721fc4d2be1e596232c39af90a8d169c082f9b0636e5aa1a80fe1b063d645456
2025-02-17 23:21:39 +00:00
merge-script 7ea40b244b
Merge rust-bitcoin/rust-bitcoin#4067: Add `inline` to all small functions in the new `result` module
914730d7f1 Add inline to small functions in result module (Jamil Lambert, PhD)

Pull request description:

  Close #4064

ACKs for top commit:
  Kixunil:
    ACK 914730d7f1
  apoelstra:
    ACK 914730d7f1cb5e032cce155440bbe4f064a09533; successfully ran local tests

Tree-SHA512: eb6d743df462462a048686f803d687756b230fdbd6b20c3bccd210f839a37dae1a390ff732efd0686f1b1df36d771b8147c5da87010025af3b1964b5b2c65751
2025-02-17 20:46:39 +00:00
merge-script bee652d7fd
Merge rust-bitcoin/rust-bitcoin#4049: hashes: Test macros in function scope
8c2439550a hashes: Test macros in function scope (Tobin C. Harding)

Pull request description:

  The two main public macros can be used in function scope - prove it.

  While we are at it prove that additional attributes are supported by them both as well as visability keywords.

ACKs for top commit:
  apoelstra:
    ACK 8c2439550acdf3cb52c78d69eb55160f9d03a139; successfully ran local tests
  Kixunil:
    ACK 8c2439550a

Tree-SHA512: 66d6a9fd142966f6e68e9a5cb849345a77357dc6e415a10507418425a4cf6a1440deaf47515db43b9ec5b5d337d53164c617db165cb2ff782cf6a6e4ff195c77
2025-02-17 18:25:14 +00:00
Jamil Lambert, PhD 914730d7f1
Add inline to small functions in result module 2025-02-17 12:13:28 +00:00
Erick Cestari 8d8edd2c77 make Debug representation of Witness to be slice of hex-encoded bytes strings 2025-02-17 00:08:55 -03:00
Tobin C. Harding 50c0af7138
Stop using Hash::from_slice
This function is deprecated, stop using it in favour of
`Hash::from_byte_array`.

Patch only touches test code, I'm guessing that is why lint warnings
were no showing up.
2025-02-17 12:39:11 +11:00
Tobin C. Harding 85652359e8
hashes: Derive Copy and Clone for Hkdf
Currently the `Hkdf` type does not derive any traits.

We would like to derive the common set of traits but there are a bunch
reasons we can't;

- Don't want to leak secrets in `Debug`.
- Don't want to enable timing attacks with Eq/Ord and friends.

For now just derive `Copy` and `Clone`. We will then implement `Debug`
manually.
2025-02-17 12:12:15 +11:00
merge-script 4712e81b70
Merge rust-bitcoin/rust-bitcoin#4060: Automated daily update to rustc (to nightly-2025-02-14)
f433b36ee1 Automated update to Github CI to rustc nightly-2025-02-14 (Update Nightly Rustc Bot)

Pull request description:

  Automated update to Github CI workflow `rust.yml` by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

ACKs for top commit:
  tcharding:
    ACK f433b36ee1

Tree-SHA512: e3e97e4a5aa924e8020c7d0909e541fa3507a10e49045db8bb1b03986e422c10dfd8cfe4e32da3fa3e076bb6b8c19ac306a9ad5cb4ba46a0a7122e58d135666e
2025-02-17 11:40:37 +11:00
Tobin C. Harding 8c2439550a
hashes: Test macros in function scope
The two main public macros can be used in function scope - prove it.

While we are at it prove that additional attributes are supported by
them both as well as visability keywords.
2025-02-17 11:34:40 +11:00
merge-script 0a053513a5
Merge rust-bitcoin/rust-bitcoin#4058: Do not enable `soft-float` when running `miri`
f99847d6ec Do not enable `soft-float` when running `miri` (Martin Habovstiak)

Pull request description:

  To ensure that all target features are tested we simply enable all of them. However some of them are problematic. We already have an exception to not enable `crt-static`. This change also adds `soft-float` to the list because `miri` was warning about it being UB.

ACKs for top commit:
  apoelstra:
    ACK f99847d6eca0977d6f987baa7846c62a0613ba35; successfully ran local tests; thanks for digging into this!
  tcharding:
    ACK f99847d6ec

Tree-SHA512: c016179bca1fafae22f5229b232fe190e22942c9e71b719bfcafc33ab269c52f5ff5a834b194974b8f0e6ab4e0ba93aa226231ce0f2618a6c6221e363cd3c333
2025-02-16 23:53:03 +00:00
merge-script 15a385a5b2
Merge rust-bitcoin/rust-bitcoin#4063: Automated nightly rustfmt (2025-02-16)
0fbfe68c72 2025-02-16 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 0fbfe68c72496c3135108914cdb2c2b45e496e99; successfully ran local tests
  tcharding:
    ACK 0fbfe68c72

Tree-SHA512: 08ac71f7cf0259dcda0d7fd127ad8485e65edb06307a09ae03506f61fb917faf0c8c721b2299f15a370d6fc124cf35488f6410ddf15d522371660e6d97fd848b
2025-02-16 20:54:39 +00:00
merge-script 987a74cd96
Merge rust-bitcoin/rust-bitcoin#4007: Introduce monadic `NumOpResult` type
6244cb75fa Introduce monadic AmountOpResult (Tobin C. Harding)

Pull request description:

  We would like to return an error when doing math ops on amount types. We cannot however use the stdlib `Result` or `Option` because we want to implement ops on the result type.

  Add an `NumOpResult` type. Return this type from all math operations on `Amount` and `SignedAmount`.

  Implement `core::iter::Sum` for the new type to allow summing iterators of amounts.

  Note please this removes `AddAssign` impls for amount types.

ACKs for top commit:
  apoelstra:
    ACK 6244cb75faf62aed4b47d63a59d14cb766e4e7a8; successfully ran local tests; let's do it -- but definitely want the followup issues addressed
  Kixunil:
    ACK 6244cb75fa

Tree-SHA512: 7a105acb1aa492ab3e97d94ae182ac4c30a364edd183f71cc320cf80d85060049e8caf1e5736ef6d1af32f39c3376f21382afe35ac65ea1b8c15130c622d9d64
2025-02-16 17:04:16 +00:00
Fmt Bot 0fbfe68c72 2025-02-16 automated rustfmt nightly 2025-02-16 01:21:38 +00:00
merge-script 3fb5275e16
Merge rust-bitcoin/rust-bitcoin#4055: hashes: Only enable hex/std, and hex/alloc when hex is
7c12d92bc3 Only enable hex/std, alloc when hex is (Jamil Lambert, PhD)
11770cac1c Add hashes to io dev-depencies and require hex (Jamil Lambert, PhD)
e7c6564d38 Add missing hex feature gate (Jamil Lambert, PhD)

Pull request description:

  `hex/std` and `hex/alloc` should only be included if optional dependency `hex` is enabled.  A bunch of tests that need `hex` relied on an `alloc` feature gate to ensure `hex/alloc` was enabled.

  Add feature gates to the tests that require `hex`.

  Add `?` so `hex/alloc` or `hex/std` are only included if the optional feature `hex` is enabled.

  Audit rest of crates `Cargo.toml` files: no other cases found.

  Close #4035

ACKs for top commit:
  Kixunil:
    ACK 7c12d92bc3
  apoelstra:
    ACK 7c12d92bc3011e1305238f0f5d3b155a01875814; successfully ran local tests; Played with cargo a bit; `cargo tree` seems to confirm that you can mix dev and non-dev dependencies like this.

Tree-SHA512: bd752d3c074dd8c93b09aa318d98ccb761b2f9baa2797566dd1d5f486349a92fbcd05787ddeb53d1f05ef0b29fbf559152f6373674fbec01e1251e74ad61e61f
2025-02-15 19:57:38 +00:00
merge-script 0a19d0140c
Merge rust-bitcoin/rust-bitcoin#4043: Implement Default for Script
ab2f709181 Implement Default for Script (jrakibi)

Pull request description:

  This PR implements Default for `Script` to return an empty script.

  *Note: ScriptBuf already has `#[derive(Default)]` in the code so it's already handled*
  Resolves #3735

ACKs for top commit:
  tcharding:
    ACK ab2f709181
  Kixunil:
    ACK ab2f709181
  apoelstra:
    ACK ab2f7091814333b20669d41f1f78e0e52795df08; successfully ran local tests; neat!

Tree-SHA512: c06ba98d9bf8568e323ef9082a7f06756586360d6bef2b93721db7f6e28a777852e494c86319c97b0fd5444a0010d6c679625753534c0e1c8116e452ce8fa9cc
2025-02-15 12:57:15 +00:00
merge-script 007f4d3362
Merge rust-bitcoin/rust-bitcoin#4037: primitives: Add tests to LockTime
6cecc40ae4 Test LockTime PartialOrd (Jamil Lambert, PhD)

Pull request description:

  Add tests to kill the mutants in both relative and absolute PartialOrd.

ACKs for top commit:
  tcharding:
    ACK 6cecc40ae4
  apoelstra:
    ACK 6cecc40ae4d52b711f58998315155bc8c6b19d7b; successfully ran local tests; thanks!

Tree-SHA512: dba7d90e3f6e62f0d3417bacc09d38145dd29bf654f84c2d3bc68af30c0e65b105146466a384bd35ef4326913ca414fd31f92daa3d7ffe3ff409c49bd1c05d96
2025-02-15 03:55:05 +00:00
Update Nightly Rustc Bot f433b36ee1 Automated update to Github CI to rustc nightly-2025-02-14 2025-02-15 01:39:44 +00:00
merge-script e1cb0f1199
Merge rust-bitcoin/rust-bitcoin#4044: units: Remove alloc from fee module
43a7c66f50 units: Remove alloc from fee module (jrakibi)

Pull request description:

  This PR removes the `alloc` feature gating from fee module

  Closes #3815

ACKs for top commit:
  tcharding:
    ACK 43a7c66f50
  apoelstra:
    ACK 43a7c66f50b663aee503c958c5158127fa0b8d5c; successfully ran local tests; nice!

Tree-SHA512: 645d50cd6cde915972a576d7282a5dfc9aa27a8c3a3b44d3f3eb7a7f066cb3a697bed7e757bc86766498d92cc534607960caf20c90a1ac6fabf9246db4b30249
2025-02-15 00:32:56 +00:00
merge-script 0000bdb609
Merge rust-bitcoin/rust-bitcoin#4054: Kill mutants found by github-actions
854a4cf511 Kill mutant in checked_mul_by_fee_rate (Jamil Lambert, PhD)
44df39e72c Skip deprecated functions in mutants.toml (Jamil Lambert, PhD)

Pull request description:

  Recent changes to units created new mutants.

  Skip mutants from deprecated functions.

  Modify existing test to kill `checked_mul_by_fee_rate` mutant.

  Close #4026

ACKs for top commit:
  tcharding:
    ACK 854a4cf511
  apoelstra:
    ACK 854a4cf51189b4be596c4f048420fc9b1212d714; successfully ran local tests

Tree-SHA512: 62343984d16d7a6f2287454a21c4ec5333387c940ce97819c2610da08f709ba3e806e024dc2f352e309b4ed5555c13e7b02fdf0c41aae5961f0e0c3c35d049a3
2025-02-14 21:59:00 +00:00
merge-script 1a610cb36f
Merge rust-bitcoin/rust-bitcoin#4050: Validate compressed WIF keys
00cd247bc4 Validate compressed WIF keys (ndungudedan)

Pull request description:

  For private WIF keys corresponding to a compressed address, the last byte of the key needs to be 0x01, but the API doesn't enforce this when using PrivateKey::from_wif(). So, invalid keys can be accepted.

  Thus we check if the last byte is equivalent to 0x01 if the key's length is 34 (which indicates it's
  compressed).

  resolves #3773

ACKs for top commit:
  Kixunil:
    ACK 00cd247bc4
  tcharding:
    ACK 00cd247bc4
  apoelstra:
    ACK 00cd247bc49451fe8c2cbf537ed042b0bb5c3340; successfully ran local tests

Tree-SHA512: 8d2cfc13f713dd4ae47d4f55d87f783167b5b3755f4f902cd009ebe0c5da19b0d3bf31393570a804e22010685bf97381922d21c53a71a9c144aa53ff7aac2167
2025-02-14 18:00:11 +00:00
Jamil Lambert, PhD 7c12d92bc3
Only enable hex/std, alloc when hex is
`hex/std` and `hex/alloc` should only be included if optional
dependency `hex` is enabled`.

Add `?` so it is only included if the optional feature `hex` is enabled.
2025-02-14 15:22:13 +00:00
Jamil Lambert, PhD 11770cac1c
Add hashes to io dev-depencies and require hex
The tests in `hash` require hex.  Previously this was enabled when
`alloc` was enabled.  Now `alloc` doesn't enable `hex` add `hashes` to
`dev-dependecies` and set it to require `hex`
2025-02-14 15:21:41 +00:00
Martin Habovstiak f99847d6ec Do not enable `soft-float` when running `miri`
To ensure that all target features are tested we simply enable all of
them. However some of them are problematic. We already have an exception
to not enable `crt-static`. This change also adds `soft-float` to the
list because `miri` was warning about it being UB.
2025-02-14 13:56:37 +01:00
Jamil Lambert, PhD e7c6564d38
Add missing hex feature gate
`hex` was previously enabled by `alloc`, now it is optional add the
missing feature gate to tests.
2025-02-14 11:44:55 +00:00
merge-script fce0cf1692
Merge rust-bitcoin/rust-bitcoin#4036: primitives: Add tests to witness
7e66091e1e Add from impl tests (Jamil Lambert, PhD)
2f95064cfd Add from_parts test (Jamil Lambert, PhD)
3ee66c5bb8 Modify push test (Jamil Lambert, PhD)

Pull request description:

  Add tests to kill the mutants in `primitives/src/witness.rs`

ACKs for top commit:
  tcharding:
    ACK 7e66091e1e
  apoelstra:
    ACK 7e66091e1e8b6cdd3e40d001ea1824125f7175e7; successfully ran local tests

Tree-SHA512: 57b2b0e4dbd93023d1a6a9709a02fa843e3ef9b25e7293ad641726b9c335e220a4ed87b717ec5dda999217677a916b86ac7daa9aaaec077afbfee4789836344e
2025-02-14 01:41:08 +00:00