rust-bitcoin-unsafe-fast/units
merge-script 681de7aa17
Merge rust-bitcoin/rust-bitcoin#3840: Address mutants in units
286bf900b1 Address mutants in units (Shing Him Ng)

Pull request description:

  Preemptively addressing these mutants before introducing the `cargo-mutants` workflow. There are several types of changes:
  - Changes that address mutants that were actually missing
  - Changes that address test values that cause `cargo-mutants` to think mutants were missed. For example, `cargo-mutants` will replace the return values for unsigned integer types with 0 and 1. While this case might be tested, the test might be testing this with a call that results in 0 or 1. When `cargo-mutants` substitutes the function call with `Ok(1)`, the test will still pass, and it will consider this a mutant. `cargo-mutants` also replaces operations (+, -, /, %), bitwise operations (&, |, ^, etc), so an operation such as `3 - 2` results in a mutant because changing it to `3 / 2` yields the same result
  - TODOs to ignore functions/impls in the future

  I uased the following `mutants.toml` config file when running `cargo mutants` and skipped the `Debug`, `Arbitrary`, `Display`, and `Error` impls and the `kani` test:
  ```
  additional_cargo_args = ["--all-features"]
  examine_globs = ["units/src/**/*.rs"]
  exclude_globs = ["units/src/amount/verification.rs"]
  exclude_re = ["impl Debug", "impl Arbitrary", "impl Display", ".*Error", "<impl Visitor for VisitOptAmt<X>>"]
  ```

  I wasn't sure the code for Displaying things needed to be tested with `cargo mutants`, but I'm less sure about the errors so i can kill those mutants too if needed

ACKs for top commit:
  tcharding:
    ACK 286bf900b1
  apoelstra:
    ACK 286bf900b1c100d2f5d0a0d45f31a5bf5a0a26ce; successfully ran local tests

Tree-SHA512: 3db9598a5ad92f2013d43876221ce9363cc019cbf720a206768b517a812c8355b7f00594212eb0526c0feb2dc578f88e1df12548f72a2b2360c4d4227de749f7
2025-01-05 19:18:50 +00:00
..
contrib Add Arbitrary dependency 2024-08-23 15:39:20 -05:00
src Merge rust-bitcoin/rust-bitcoin#3840: Address mutants in units 2025-01-05 19:18:50 +00:00
tests Merge rust-bitcoin/rust-bitcoin#3846: Remove `test_` prefix from unit tests 2025-01-04 00:23:46 +00:00
CHANGELOG.md bitcoin: Bump version to v0.33.0-alpha.0 2024-12-04 15:58:36 +11:00
Cargo.toml units: Add serde regression test 2024-12-28 08:15:13 +11:00
README.md Bump MSRV to 1.63 2024-07-27 07:24:32 +02:00

README.md

Bitcoin Units

This crate provides basic Bitcoin numeric units such as Amount.

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.63.0.

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.