Commit Graph

6323 Commits

Author SHA1 Message Date
yancy f6105ea417 Use InputWeightPrediction to calculate effective_value
InputWeightPrediction can be used to determine the weight needed
to calculate the effective_value.  This simplifies the process for api
consumers by allowing an easier interface with which to use to predict
the weight.  Prior to this change, it was required to manually calculate
the predicted weight for whichever input type was to be used.
2025-04-10 07:25:12 -05:00
tushar994 52f9c13358 Implement Copy for Address and AddressInner
Enables by-value Address semantics for easier use; large sizes can use Box.
2025-04-09 12:25:43 +05:30
Nick Johnson d878e5b367
chore(hashes): update serde dependency to workspace
Update serde from 1.0 to 1.0.103 to align with versions used in other
workspace crates. This makes the dependency constraint match reality
since it was almost always implicitly raised by the other crates.
2025-04-08 14:45:47 -07:00
Tobin C. Harding da69e636a9
units: Use 100 column width in rustdoc comments
We typically use 100 column width for comments, do so but only if it
does not make the layout worse.
2025-04-08 14:25:04 +10:00
Tobin C. Harding 53c6ae4d40
units: Remove expect from rustdoc example
We can just assert against an explicit `Some` value instead of using
`expect`.
2025-04-08 14:25:04 +10:00
merge-script 265f9ebee0
Merge rust-bitcoin/rust-bitcoin#4306: chore: remove unused cortex-m dependency
dab577471d chore: remove unused cortex-m dependency from embedded Cargo.toml files in bitcoin and hashes modules. (lfgtwo)

Pull request description:

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

Tree-SHA512: 77e852313f067d10241b47db3516716344383a670011e56f7b7ffadbcdb82787aac3800971d13e3160b4d1f533b71398c2bfaa0f6e47dc24d4c8a1d7d82e2405
2025-04-08 02:47:16 +00:00
Tobin C. Harding d6881ff5f8
units: Enable differentiating div-by-zero
Division by zero is a different error class that overflow. Add a
`MathOp` enum that enables one to check the error class.
2025-04-08 09:04:30 +10:00
merge-script 8599ceefe3
Merge rust-bitcoin/rust-bitcoin#4309: Automated nightly rustfmt (2025-04-06)
4c35e06c01 2025-04-06 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:
  tcharding:
    ACK 4c35e06c01
  apoelstra:
    ACK 4c35e06c0164f4cc18550e4a8e8eec9b79daf4f2; successfully ran local tests; nicee

Tree-SHA512: a989a58511e3e1ecfc14885aa0a3b1c1d8c54bdf49221d39f88a4cc230c8808701ddad4ef2d62b30e6819f75f86e77796848304a170720ba5c3c38d0125f3d1f
2025-04-07 20:56:12 +00:00
merge-script 808771d87e
Merge rust-bitcoin/rust-bitcoin#4311: fix correction in comment mod.rs
0a1efdaa66 fix correction in comment mod.rs (Bilog WEB3)

Pull request description:

  assoctiated - associated

ACKs for top commit:
  tcharding:
    ACK 0a1efdaa66
  apoelstra:
    ACK 0a1efdaa669c37892371ae0df0b94848e554154a; successfully ran local tests

Tree-SHA512: bdeb08b17e7f39b7fbe6644fdc76c1c264f078039c51801de66fd1ebf02cd89a5951cb2ebd5d8e052331a82cdc0b0e2796c37c7a2e43403ea22d8420e76f03cf
2025-04-07 16:48:04 +00:00
merge-script 372f376997
Merge rust-bitcoin/rust-bitcoin#4307: Rename 'indecies' to 'indices' in bip_174.rs for correct terminology
c55da5c342 Update bip_174.rs (fuder.eth)

Pull request description:

  This pull request renames the variable 'indecies' to 'indices' throughout the bip_174.rs file to use the correct plural form of 'index'. The change affects both variable names and comments, ensuring consistent and proper terminology throughout the codebase.

  Changes include:
  - Renamed 'indecies' to 'indices' in comments
  - Renamed the variable declaration and all references
  - Updated the for loop iteration

  This is a simple terminology correction with no functional changes to the code.

ACKs for top commit:
  tcharding:
    ACK c55da5c342
  apoelstra:
    ACK c55da5c3427ff2d850feb2e5891ce5d52cc304ba; successfully ran local tests; lol

Tree-SHA512: 04249c13599824dc56ea8b86ca1b989bc727cad16f771100e1af00017e3c11559a8dd9fc906569bebed94e36119ff4086cc806dda3b7606c011c5bc95f1398b6
2025-04-07 13:26:23 +00:00
merge-script 7307c115e8
Merge rust-bitcoin/rust-bitcoin#4294: Automated daily update to rustc (to nightly-2025-04-04)
b01152ef5d Automated update to Github CI to rustc nightly-2025-04-04 (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 b01152ef5d

Tree-SHA512: 720894224ed8f4b49457f13e0fd93eb21fda5ebcdfee59ede998ff1f92ec04554bf923f322aa92e43c9d6d7d79827abd1954d741f467dbd13127038c985394e6
2025-04-07 15:27:14 +10:00
Tobin C. Harding 5fb64953c5
units: Return NumOpResult when implementing Div
Currently we use a std numeric type for the output of various `Div`
implementations while other ops use `NumOpResult`. This makes it
difficult to chain operations.

Throughout the crate use `Output = NumOpResult<Foo>` when implementing
`Div`.

Later we want to enable users differentiating between an overflow and a
div-by-zero. Explicitly do not implement that yet, done separately to
assist review.
2025-04-07 15:08:01 +10:00
Tobin C. Harding dba61c9efe
units: Fix internal docs
The `impl_op_for_references` macro implements an `ops` trait, nothing to
do with opcodes.
2025-04-07 12:14:12 +10:00
Tobin C. Harding 512326b8b9
units: Macroize implementing OptionExt
We are going to add implementations of `OptionExt` for various other
types and all impls are almost identical. To make doing so easier
macroize the implementation for `Amount` and `SignedAmount`.

Internal change only, no logic changes.
2025-04-07 12:14:12 +10:00
Tobin C. Harding f5b54e5fe0
units: Move general result stuff to a separate module
We currently use the `NumOpResult` for operations involving more than
just amount types (e.g. `FeeRate`) however when the `result` module was
written we only used amount types.

To make the intention of the custom result types more clear introduce a
top level `result` module and move the general code there. Leave the
amount implementations in the `amount` module. Note that both `result`
modules are private.

Move the `OptionExt` impls because later we will add a bunch more of them.

Internal change only, no logic changes.
2025-04-07 12:14:09 +10:00
Tobin C. Harding f49efdf3f7
units: Remove mention of amount in result module
We currently use the `NumOpResult` for operations involving more than
just amount types (e.g. `FeeRate`) however when the `result` module was
written we only used amount types.

To make the docs and code clearer use 'numeric type' instead of
'amount' in docs. And for local variables use `x` instead of `amount`.

This is docs and internal changes only.
2025-04-07 12:13:45 +10:00
Bilog WEB3 0a1efdaa66
fix correction in comment mod.rs 2025-04-06 13:38:37 +02:00
Fmt Bot 4c35e06c01 2025-04-06 automated rustfmt nightly 2025-04-06 01:26:49 +00:00
fuder.eth c55da5c342
Update bip_174.rs 2025-04-05 20:34:17 +02:00
lfgtwo dab577471d chore: remove unused cortex-m dependency from embedded Cargo.toml files in bitcoin and hashes modules. 2025-04-05 18:25:41 +08:00
Update Nightly Rustc Bot b01152ef5d Automated update to Github CI to rustc nightly-2025-04-04 2025-04-05 01:47:30 +00:00
merge-script 263db9057b
Merge rust-bitcoin/rust-bitcoin#4305: Automated weekly update to rustc stable (to 1.86.0)
f3cc445c87 Automated update to Github CI to rustc stable-1.86.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 f3cc445c87

Tree-SHA512: 1111f912ed137de0b5a328ba5909bcbeb0b8d66e82bf8729e3e3a825c1ba73147fd19200e0c7018a97604535d199ee82b54f515feb83ccee2224cdd4a0a56756
2025-04-05 09:44:41 +11:00
merge-script 1994c4ab33
Merge rust-bitcoin/rust-bitcoin#4165: Update contributing guide re merging and CI
b387b923c8 Update contributing guide re merging and CI (Tobin C. Harding)

Pull request description:

  Lately we have had a bunch of new devs bumping PRs trying to get things merged. Everyone gets excited, no need to be too harsh on them. At least we can try to explain why we might be taking so long.

  We (*cough* Andrew) runs a custom CI box that leads to slightly unusual merge behaviour in this repo if one is unaware of it.

  Document our CI better and ask folk not to bump too much.

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

Tree-SHA512: 96505714a444b3a3aa86a7e41de6fda954f40a444917a8066fc0c395ac4207a7f4ea310d8e2d7f76c2bfacc1db18047a26536d738c1f1b8bd17a9d09f87d3998
2025-04-04 13:25:49 +00:00
Update Stable Rustc Bot f3cc445c87 Automated update to Github CI to rustc stable-1.86.0 2025-04-04 00:59:28 +00:00
merge-script 9f7f659591
Merge rust-bitcoin/rust-bitcoin#4302: Add push_relative_lock_time() and deprecate push_sequence()
ebaf162a96 Add push_relative_lock_time() and deprecate push_sequence() (Erick Cestari)

Pull request description:

  This pr improves the script builder API to better align with Bitcoin semantics when working with relative timelocks:

  - Add `push_relative_lock_time()` method that takes a `relative::LockTime` parameter, which correctly represents the semantic meaning when working with CHECKSEQUENCEVERIFY

  - Deprecate `push_sequence()` in favor of `push_relative_lock_time()` to avoid confusion between sequence numbers and relative timelocks

  This addresses a potential confusion point in the API where developers might incorrectly push raw sequence numbers in scripts when what they actually need is to push a relative locktime value that will be checked against the transaction's sequence numbers by CHECKSEQUENCEVERIFY.

  Closes #4301

ACKs for top commit:
  apoelstra:
    ACK ebaf162a962494329c6cb5f6d375a6a4a97fe83b; successfully ran local tests
  tcharding:
    ACK ebaf162a96

Tree-SHA512: 52c37b6e8bbcaa3f9346c5fd5db26eba69169bce13f915906df95fdc65204067fd75f803f8b5adad76978c9baad553c99281628736db4d1d317b149ab257d81f
2025-04-03 19:23:52 +00:00
Tobin C. Harding b387b923c8
Update contributing guide re merging and CI
Lately we have had a bunch of new devs bumping PRs trying to get things
merged. Everyone gets excited, no need to be too harsh on them. At least
we can try to explain why we might be taking so long.

We (*cough* Andrew) runs a custom CI box that leads to slightly unusual
merge behaviour in this repo if one is unaware of it.

Document our CI better and ask folk not to bump too much.

While we are at it remove the `API changes` section because we removed
the API files already.
2025-04-03 13:30:04 +11:00
Tobin C. Harding ca6c607953
Adhere to sanity rules for amount types
From my reading of the new sanity rules (#4090) we should only have a
single constructor that accesses the inner field of the amount types.

Furthermore we have one const constructor inside the privacy boundry and
a couple outside.

Move the const constructors outside of the privacy boundry.

Internal change only.

Please note

The function being inside privacy boundary allows it to not have the
"runtime" check (most likely optimized-away after inlining). But if we
wanted to get rid of that check we should have _unchecked method
instead. But we don't want that (yet), since the check here will have
zero performance impact in optimized builds and it's not worth the
cost of dealing with unchecked constructors to optimize debug builds.
2025-04-03 13:09:40 +11:00
Tobin C. Harding 6c614d9320
units: Fix panic message
Recently I wrote a panic message that included the maximum value of an
integer however I used the max of a 16 bit value for both signed and
unsigned - this is incorrect.

Use the correct values for `u16::MAX` and `i16::MAX`.
2025-04-03 12:58:30 +11:00
merge-script f7006e3d15
Merge rust-bitcoin/rust-bitcoin#4304: minor docstring fixups
157fe48dfd minor docstring fixups (planetBoy)

Pull request description:

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

Tree-SHA512: 29fe6168ff729f0f65f32a2c6ad28d45e36e0761cac4455b57b891f9c0bd2622db51a21b4961d33fa5a8934302eefca4a77c20732bf047e2721a5bc5d655c340
2025-04-02 16:51:06 +00:00
merge-script f63ae57d7d
Merge rust-bitcoin/rust-bitcoin#4303: fix correction typos
ab63ec9768 fix correction typos (Bilog WEB3)

Pull request description:

  tesnet - testnet `fixed`
  How may blocks - How many blocks `fixed`

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

Tree-SHA512: 6e84cdc45973c7a9831a7cad4f408cb90dc5a9b01c3f929b4df7449b5719e7f9148ce308797d29e72caa3e1fd73e7ca645e27ae4598f18e133b49dc8f979b480
2025-04-02 16:04:44 +00:00
planetBoy 157fe48dfd
minor docstring fixups 2025-04-02 12:26:53 +02:00
Bilog WEB3 ab63ec9768
fix correction typos 2025-04-01 17:38:24 +02:00
Erick Cestari ebaf162a96 Add push_relative_lock_time() and deprecate push_sequence()
This commit improves the script builder API to better align with Bitcoin
semantics when working with relative timelocks:

- Add push_relative_lock_time() method that takes a relative::LockTime
  parameter, which correctly represents the semantic meaning when working
  with CHECKSEQUENCEVERIFY

- Deprecate push_sequence() in favor of push_relative_lock_time() to avoid
  confusion between sequence numbers and relative timelocks

This addresses a potential confusion point in the API where developers
might incorrectly push raw sequence numbers in scripts when what they
actually need is to push a relative locktime value that will be checked
against the transaction's sequence numbers by CHECKSEQUENCEVERIFY.
2025-03-31 14:01:14 -03:00
merge-script 436de8ef12
Merge rust-bitcoin/rust-bitcoin#4297: chore: remove unused serde_json dep
6ba0e46b53 chore: remove unused serde_json dep (lfg2)

Pull request description:

  checked by [shear](https://github.com/boshen/cargo-shear)
  ```
  bitcoin_hashes -- hashes/Cargo.toml:
    serde_json

  Fixed 1 dependencies!
  ```

  cargo +nightly build  in local env is ok, local cargo.lock  is ok(not include serde_json) so no need update cargo.lock
  ```
  [[package]]
  name = "bitcoin_hashes"
  version = "0.16.0"
  dependencies = [
   "bitcoin-internals",
   "hex-conservative 0.3.0",
   "serde",
   "serde_test",
  ]
  ```

  but check CI seems need update
  `error: the lock file /home/runner/work/rust-bitcoin/rust-bitcoin/Cargo.lock needs to be updated but --locked was passed to prevent this
  If you want to try to generate the lock file without accessing the network, remove the --locked flag and use --offline instead.`

ACKs for top commit:
  Kixunil:
    ACK 6ba0e46b53
  apoelstra:
    ACK 6ba0e46b53fbc9d6ea0c3e23a553920581930e75; successfully ran local tests

Tree-SHA512: 68a444e05876733af9606d4489ca30a18c9d3439dedf932e40db67dcfdb5ae40ab0f8cf937146f6b1ef92edc626dcb27a441b63c283e6945aa8071500bcc43a4
2025-03-30 21:23:45 +00:00
merge-script 59524adafd
Merge rust-bitcoin/rust-bitcoin#4295: Automated nightly rustfmt (2025-03-30)
b8910e201e 2025-03-30 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 b8910e201ea4374bb0508aa50c6779d080ef6484; successfully ran local tests

Tree-SHA512: 9bd89439304322d30e04aae8f9803f9e07830b616cb49339ac4b1e0ee1bfe440865d9ebc7f41eea1bcd35cb751060215eec20d258d88e9f20dd3f905b9ab690f
2025-03-30 19:37:31 +00:00
lfg2 6ba0e46b53 chore: remove unused serde_json dep 2025-03-30 23:35:18 +08:00
merge-script f2869ad348
Merge rust-bitcoin/rust-bitcoin#4292: chore: fix grammatical errors
6ebdf61e76 Fix grammatical typos (VolodymyrBg)

Pull request description:

  base58/src/error.rs:

  - Corrected grammar in error comment: "Found a invalid ASCII byte" → "Found an invalid ASCII byte".

  bitcoin/CHANGELOG.md:

  - Fixed typo in function name: p2wpkh_signiture_hash → p2wpkh_signature_hash.

  units/src/amount/error.rs:

  - Fixed grammar: "was large than" → "was larger than".

  units/src/fee_rate/mod.rs:

  - Corrected typo: "assoctiated" → "associated".

  units/tests/api.rs:

  - Grammar fix: "THE POINT of tests are" → "THE POINT of tests is".

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

Tree-SHA512: bb5800b6248bedad46d511a0123c50b1d8d2deacfa752cd675d21e40cb78a6a5d917da28a9a87c3f779cd13819d5b16a7668d1e388d1d58d200ea688d8c114ac
2025-03-30 15:19:49 +00:00
merge-script 18512513e0
Merge rust-bitcoin/rust-bitcoin#4280: updated and corrected links CHANGELOG.md
51d3a83891 updated and corrected links CHANGELOG.md (Bilog WEB3)

Pull request description:

  Hey , I read through the whole `CHANGELOG.md` and fixed all the links + adjusted some

ACKs for top commit:
  apoelstra:
    ACK 51d3a83891395195fb89ae8590addded7efb4871; successfully ran local tests
  Kixunil:
    ACK 51d3a83891

Tree-SHA512: d36f38dd4b4fb83e615a3cdfe5efdbec5418283b53b09a0e7f288d88711626123c3e1dd5d3dac151186a4592dfbbaa26c90e4d409ed9f1cbf2116292979c3e20
2025-03-30 14:35:41 +00:00
Fmt Bot b8910e201e 2025-03-30 automated rustfmt nightly 2025-03-30 01:27:51 +00:00
Bilog WEB3 51d3a83891 updated and corrected links CHANGELOG.md 2025-03-29 12:03:28 +02:00
merge-script afcfc13333
Merge rust-bitcoin/rust-bitcoin#4293: chore: remove needless question mark
89d61304af chore: remove needless question mark (lfgtwo)

Pull request description:

  There’s no reason to use ? to short-circuit when execution of the body will end there anyway.

ACKs for top commit:
  apoelstra:
    ACK 89d61304af8e05757e5ce3d57497ddbef716674e; successfully ran local tests; sure
  Kixunil:
    ACK 89d61304af

Tree-SHA512: ac266c9e1d5104c1cb05488a6f3d8d5710e53a17a678ceff7a8a53f839683c3c55e5d229c2df132b0338580f53340686c0c8c554852787c0ead1225b0ef790fa
2025-03-29 00:18:53 +00:00
merge-script 3748bfcd66
Merge rust-bitcoin/rust-bitcoin#4289: [hashes] Disable fixed-time equality cmp when building for fuzzers, use fixed-time equality for `Hmac`
2d9e240fb6 [hashes] Use `fixed_time_eq` for `Hmac::eq` (Matt Corallo)
7ac7273013 [hashes] Disable fixed-time equality cmp when building for fuzzers (Matt Corallo)

Pull request description:

  Fuzzers want to break memcmp calls into separate comparisons for coverage monitoring, allowing them to not-quite-brute-force find inputs that fully match. Thus, we disable our fancy fixed-time comparison when built with the `hashes_fuzz` cfg.

ACKs for top commit:
  Kixunil:
    ACK 2d9e240fb6
  apoelstra:
    ACK 2d9e240fb6ae13e6139713f9bb8ccb51e5dc0bff; successfully ran local tests

Tree-SHA512: 372e344ae5497a10ca03a50baadb9d2e8a6dac914bbc4ca91fd5c9b839fb036f42c8b47c252ca3466c15286e889a6f5b51390cc0d938ba24dc50b13e8b863463
2025-03-28 23:31:40 +00:00
merge-script cb5f84c21f
Merge rust-bitcoin/rust-bitcoin#4290: fix err `P2WPKH` to `P2WSH` witness_version.rs
7b193b5125 fix err P2WPKH to P2WSH (planetBoy)

Pull request description:

  The correction is important because “P2WPK” is not a valid name. In the BIP141 specifications, the correct terms are “P2WPKH” and “P2WSH”.

ACKs for top commit:
  Kixunil:
    ACK 7b193b5125
  apoelstra:
    ACK 7b193b5125336263f672f2e2c69447cc3ae58926; successfully ran local tests

Tree-SHA512: 951bcde2c28e2086a69043c1ed27bde0935df0918f418c5f6f89ed476ba9e182e99eec545a438f79ca4e1704ce496d443b5bc9e368a53dd583a884f1da405865
2025-03-28 18:32:34 +00:00
lfgtwo 89d61304af chore: remove needless question mark 2025-03-29 01:00:06 +08:00
merge-script a2408e9b0c
Merge rust-bitcoin/rust-bitcoin#4281: Return `ControlBlock` from `Witness::taproot_control_block`
492073f288 Strengthen the type of `taproot_control_block()` (Martin Habovstiak)
e8a42d5851 Unify/reduce usage of `unsafe` (Martin Habovstiak)
d42364bd9d Swap around the fields in `Address` (Martin Habovstiak)
7a115e3cf1 Make `Address` obey sanity rules (Martin Habovstiak)
bc6da1fe07 Swap around the fields in `sha256t::Hash` (Martin Habovstiak)
8ee088df74 Make `sha256t` obey sanity rules (Martin Habovstiak)

Pull request description:

  Well, I thought this PR will be just the last commit... 😅

  Anyway, this implements a bunch of changes to allow returning `ControlBlock` from `Witness` method(s). One cool side effect is that this PR also reduces the number of `unsafe` blocks.

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

Tree-SHA512: 11979517cc310abf25644fc93a75deccacae66af8ba2d9b4011fdc3f414b15fac7e748399c7eef492ca850c11b7aacc3f24ec46fccf95e6d57a400212979637e
2025-03-28 15:06:43 +00:00
Matt Corallo 2d9e240fb6 [hashes] Use `fixed_time_eq` for `Hmac::eq`
When someone is checking if an `Hmac` is equal to some other
`Hmac`, its fairly common for them to be doing a
constant-time-ness-sensitive operation. Thus, here we default to
our existing `fixed_time_eq` method for `PartialEq` on `Hamc`,
rather than the naive Rust slice comparison.

While we should consider doing the same for all hash types, we do
not yet do so here.
2025-03-28 13:49:00 +00:00
merge-script b0abb92fa0
Merge rust-bitcoin/rust-bitcoin#4288: chore: fix some typos in comment
2867a7074f chore: fix some typos in comment (todaymoon)

Pull request description:

  I fix some typos in the comments to improve readability.

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

Tree-SHA512: 64a418b36443b0c1fd653cfc66fb35c13fafd0f3dff388df365ded35a83b759c5a6a3565add626f7d9813f3985019df92635fb18acd1893e453e02687717de18
2025-03-28 13:23:18 +00:00
merge-script 171c779c01
Merge rust-bitcoin/rust-bitcoin#4287: units: Kill mutants found in weekly mutation testing
f15e461baf Add an exclusion for a mutant in a deprecated fn (Jamil Lambert, PhD)
9a2b56f381 Modify test in Amount to kill mutants (Jamil Lambert, PhD)
1d1cf00b1e Add test to BlockTime to kill mutants (Jamil Lambert, PhD)

Pull request description:

  Weekly mutation testing found mutants in `Amount` and `BlockTime`.

  Add a test to `BlockTime`.
  Add two asserts to `Amount` tests.
  Exclude deprecated function from mutation testing.

  Closes #4225, #4243, #4278

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

Tree-SHA512: 18a405362db1b2eabac7c7ac01a56d306a1bf5f705626b5c217ec329e6420daa2f2e62b37c72537f29b7ee76b9fd795adde2da71b226fec3a74d0f25dca6cd96
2025-03-28 12:29:14 +00:00
Matt Corallo 7ac7273013 [hashes] Disable fixed-time equality cmp when building for fuzzers
Fuzzers want to break memcmp calls into separate comparisons for
coverage monitoring, allowing them to not-quite-brute-force find
inputs that fully match. Thus, we disable our fancy fixed-time
comparison when built with the `hashes_fuzz` cfg.
2025-03-28 12:05:23 +00:00
planetBoy 7b193b5125 fix err P2WPKH to P2WSH 2025-03-27 22:20:32 +02:00