Commit Graph

5476 Commits

Author SHA1 Message Date
Tobin C. Harding ed387e5f1d
hashes: Hide both macros
We have two macro definitions feature gated on `serde`. At some stage we
added the `doc(hidden)` attribute to one of them but forgot to add it to
the other. This technically makes our features non-additive. This macro
is "internal" so its unlikely that this is being used in the wild.

Add `doc(hidden)` to the `serde_impl` macro that is missing it.

Found by `cargo semver-checks` after recent upgrade to 0.38
2024-12-29 08:23:39 +11:00
merge-script 39dedf42d4
Merge rust-bitcoin/rust-bitcoin#3818: Automated daily update to rustc (to nightly-2024-12-26)
de0f940b90 Automated update to Github CI to rustc nightly-2024-12-26 (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 de0f940b90

Tree-SHA512: 83ba49d2df44853ac2179edf432fb05e77b2e2d98d515eb86743f96bbf637b4ea1b75e5975991049635e5372847cafdb96a2503beb5a8915c4d5af3335f86dce
2024-12-29 07:41:05 +11:00
Update Nightly Rustc Bot de0f940b90 Automated update to Github CI to rustc nightly-2024-12-26 2024-12-28 01:38:59 +00:00
merge-script dacf75594e
Merge rust-bitcoin/rust-bitcoin#3799: Automated nightly rustfmt (2024-12-22)
19acae7163 2024-12-22 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 19acae7163
  apoelstra:
    ACK 19acae716334ce2b215e4baf1cf405d05b326a9a; successfully ran local tests

Tree-SHA512: 93b1959faab558d8ebf825f70014cbef6ae21b28db7fff18bab4a3f1ae7c6ff331091a94548caf6d63dd5f0bb40e4d0833cb089388fbac4467e6ea80a9230dfc
2024-12-24 21:58:27 +00:00
merge-script 2de44ab2a6
Merge rust-bitcoin/rust-bitcoin#3798: refactor: use amount type
774f066879 refactor: Change from u64 to Amount (yancy)

Pull request description:

  Separate out refactor commit from https://github.com/rust-bitcoin/rust-bitcoin/pull/3794.  Can be merged independently.

ACKs for top commit:
  tcharding:
    ACK 774f066879
  apoelstra:
    ACK 774f066879c8ad1af81c7e46b404fa63682a0b4c; successfully ran local tests

Tree-SHA512: 9ec5121d823ee3ec506eee5b5187bd496221bd3576afcaa6daf647099720d87b58b69521f29ae9537f123e2958771bc867b123da3f2ba941cba403a6c98e46de
2024-12-24 14:53:03 +00:00
merge-script 3a42bc41ee
Merge rust-bitcoin/rust-bitcoin#3803: Fix typos
589dd025df units: fix typo (calciumbe)
a6a746b8c0 hashes: fix typo (calciumbe)
9a5970dbfe chacha20_poly1305: fix typo (calciumbe)
bcf8580913 bitcoin: fix typo (calciumbe)
bfac237287 base58: fix typo (calciumbe)

Pull request description:

  base58: fix typo
  bitcoin: fix typo
  chacha20_poly1305: fix typo
  hashes: fix typo
  units: fix typo

ACKs for top commit:
  storopoli:
    ACK 589dd025df
  tcharding:
    ACK 589dd025df
  apoelstra:
    ACK 589dd025df938da3efac277511836cda5c53aa06; successfully ran local tests; thanks!

Tree-SHA512: 8f7cb0b4daaaa1f71a5ef0a7e45ed6d62fb08a5a5a3ddceeab1844469dc017c40a74054bb4d4c98c130c4c733e6779f8e447a8395ed1f58c5763eb0d524180a1
2024-12-24 13:35:21 +00:00
merge-script 604cefc781
Merge rust-bitcoin/rust-bitcoin#3802: Rename parameter `rhs` to `weight`
29811ba82c api: Run just check-api (Tobin C. Harding)
0a16382fa3 Rename rhs to weight (Tobin C. Harding)

Pull request description:

  In ops functions we typically use `rhs` but for the more unconventional `checked_*_by_*` functions lets use a more descriptive parameter name.

  Interestingly `cargo public-api` thinks this is an API breaking change. This is obviously an internal change but the api files are updated because the parameter names appear in the api text files.

ACKs for top commit:
  apoelstra:
    ACK 29811ba82cc598d08dc877825ecf8890c48d23b7; successfully ran local tests; sure
  sanket1729:
    ACK 29811ba82c

Tree-SHA512: b44c958ab3ef024c867d81f12819775afa62f1762b96afb93831bb4857ddb9bc95ae5b5f42f32b1a1d23832c69c3cae55f12a80d109fadda7d6763bc764d06aa
2024-12-24 12:54:54 +00:00
yancy 774f066879 refactor: Change from u64 to Amount
The Amount type provides better type safety and is more appropriate in
this context than u64.  Currently the checked arithmetic operations for
Amount and u64 are identical in behavior.  Therefore, this refactor does
not result in any behavior change and is purely cosmetic.
2024-12-23 13:03:53 -06:00
merge-script d75a26aa69
Merge rust-bitcoin/rust-bitcoin#3801: units: Make `amount::error` module private
6e78c05e03 api: Run just check-api (Tobin C. Harding)
760f0715dd units: Make amount::error module private (Tobin C. Harding)

Pull request description:

  The `untis::error` module is just a code organisation thing it should never have been public. We already re-export all the error types and this is verified by the `units/tests/api.rs` test file.

  Make the module private and remove it from the paths in the `api` test.

ACKs for top commit:
  apoelstra:
    ACK 6e78c05e0394773c18c1cbd6d140b9f57a6575b1; successfully ran local tests; man, these API tests are awesome

Tree-SHA512: eb1fd6d0a9c49b49c275782e6525e904ff72536260a1fba965140fab5a62f53db13d06a294e5efbc54d500a03d9fc7322b16b8154e587a5f0ff4e7d5e2c0288e
2024-12-23 18:12:26 +00:00
calciumbe 589dd025df
units: fix typo 2024-12-23 20:44:18 +08:00
calciumbe a6a746b8c0
hashes: fix typo 2024-12-23 20:44:18 +08:00
calciumbe 9a5970dbfe
chacha20_poly1305: fix typo 2024-12-23 20:44:18 +08:00
calciumbe bcf8580913
bitcoin: fix typo 2024-12-23 20:44:18 +08:00
calciumbe bfac237287
base58: fix typo 2024-12-23 20:40:31 +08:00
Tobin C. Harding 6e78c05e03
api: Run just check-api 2024-12-23 15:50:44 +11:00
Tobin C. Harding 760f0715dd
units: Make amount::error module private
The `untis::error` module is just a code organisation thing it should
never have been public. We already re-export all the error types and
this is verified by the `units/tests/api.rs` test file.

Make the module private and remove it from the paths in the `api` test.
2024-12-23 15:50:44 +11:00
Tobin C. Harding 29811ba82c
api: Run just check-api
Note that the changes here are not actually API breaking changes, they
are only changes to the parameter name.
2024-12-23 15:50:25 +11:00
Tobin C. Harding 0a16382fa3
Rename rhs to weight
In ops functions we typically use `rhs` but for the more unconventional
`checked_*_by_*` functions lets use a more descriptive parameter name.

This is an internal change but the api files are updated because the
paramater names appear in the api text files.
2024-12-23 15:50:25 +11:00
merge-script 35f1e8641f
Merge rust-bitcoin/rust-bitcoin#3797: Automated daily update to rustc (to nightly-2024-12-20)
73140b5fb7 Automated update to Github CI to rustc nightly-2024-12-20 (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 73140b5fb7

Tree-SHA512: 107f7d799481a64719daa478c0c4b6f20855837ad0ca0fd3f255be275b45747cb64b8141d1486cf6dacbc6e721604ca56b24b5bc99ecec1c0829c70db21424fc
2024-12-23 15:42:13 +11:00
Fmt Bot 19acae7163 2024-12-22 automated rustfmt nightly 2024-12-22 01:21:54 +00:00
merge-script 1c405524e8
Merge rust-bitcoin/rust-bitcoin#3777: Implement Arbitrary for units types
04dfe8dd45 Add api test to check Arbitrary impls (Shing Him Ng)
678fc71b88 Implement Arbitrary for units types (Shing Him Ng)

Pull request description:

  Implement Arbitrary for the rest of the types in `units`. Also moved the implementation in `FeeRate` right before the `tests` module

  Closes #3705

ACKs for top commit:
  apoelstra:
    ACK 04dfe8dd45fae9b55dacfe9eb0d73ea306db14ba; successfully ran local tests
  tcharding:
    ACK 04dfe8dd45

Tree-SHA512: 156bd26d4de85d484711d476df1d2758805387125209f0307aa786dd1585ff9953dbe41b0864b00ae101419176647e3bde7994ed9257c18307d161463b1c8d2e
2024-12-21 17:30:19 +00:00
Update Nightly Rustc Bot 73140b5fb7 Automated update to Github CI to rustc nightly-2024-12-20 2024-12-21 01:39:59 +00:00
merge-script 989db7c14b
Merge rust-bitcoin/rust-bitcoin#3793: Update regex lookahead to match when there are no characters
23f75a098c Update regex lookahead to match when there are no characters (Shing Him Ng)

Pull request description:

  Was working on #3777 and noticed that `amount::Denomination` didn't show up when running `contrib/api.sh units types`. There are some structs/enums in `api/<crate>/all-features.txt` that dont have a `\(`, `;`, or ` ` after the struct/enum name, and the line just ends, so matching the end of line `$` should also be added.

  This allows the script to find the additional type from `units`:
  `#[non_exhaustive] pub enum bitcoin_units::amount::Denomination`

  Also tested this in `primitives`, and it returned:
  ```
  script::Script
  BlockChecked
  BlockUnchecked
  absolute::LockTime
  block::Checked
  block::Unchecked
  locktime::absolute::LockTime
  locktime::relative::LockTime
  opcodes::Class
  opcodes::ClassifyContext
  relative::LockTime
  BlockHash
  BlockHeader
  CompactTarget
  Sequence
  TapBranchTag
  TapLeafHash
  TapLeafTag
  TapNodeHash
  TapTweakHash
  TapTweakTag
  Transaction
  TxIn
  TxMerkleNode
  TxOut
  Txid
  Witness
  WitnessCommitment
  WitnessMerkleNode
  Wtxid
  block::BlockHash
  block::Header
  block::Version
  block::WitnessCommitment
  merkle_tree::TxMerkleNode
  merkle_tree::WitnessMerkleNode
  opcodes::Opcode
  pow::CompactTarget
  script::ScriptBuf
  script::ScriptHash
  script::WScriptHash
  sequence::Sequence
  taproot::TapBranchTag
  taproot::TapLeafHash
  taproot::TapLeafTag
  taproot::TapNodeHash
  taproot::TapTweakHash
  taproot::TapTweakTag
  transaction::OutPoint
  transaction::Transaction
  transaction::TxIn
  transaction::TxOut
  transaction::Txid
  transaction::Version
  transaction::Wtxid
  witness::Witness
  ```

  vs without this update (on `master`):
  ```
  script::Script
  BlockHash
  CompactTarget
  Sequence
  TapLeafHash
  TapNodeHash
  TapTweakHash
  TxMerkleNode
  Txid
  WitnessCommitment
  WitnessMerkleNode
  Wtxid
  block::BlockHash
  block::Version
  block::WitnessCommitment
  merkle_tree::TxMerkleNode
  merkle_tree::WitnessMerkleNode
  pow::CompactTarget
  script::ScriptBuf
  script::ScriptHash
  script::WScriptHash
  sequence::Sequence
  taproot::TapLeafHash
  taproot::TapNodeHash
  taproot::TapTweakHash
  transaction::Txid
  transaction::Version
  transaction::Wtxid
  ```

ACKs for top commit:
  tcharding:
    ACK 23f75a098c
  storopoli:
    ACK 23f75a098c
  apoelstra:
    ACK 23f75a098ca38aeb1b79473bfe231ae27e20c6df; successfully ran local tests

Tree-SHA512: ce6a43d017bb4bc6317853a4646ce4a8dcf5ce957bb2b9cc50bbd333c6854efd7527c25571c1b30736ae496305fedcf876022ad26c50bee232150d308cb62d08
2024-12-20 15:20:32 +00:00
merge-script 229aa0141a
Merge rust-bitcoin/rust-bitcoin#3786: units::SignedAmount make rustdocs conform to the API guidelines
937a3da8dd Add rustdoc errors (Jamil Lambert, PhD)
78f1628bf6 Add Examples to rustdocs (Jamil Lambert, PhD)
09e184015e Fix rustdocs in SignedAmount (Jamil Lambert, PhD)

Pull request description:

  Update rustdocs in `units::SignedAmount` to conform to the API guidelines.  Add examples to `Amount` to match the ones added to `SignedAmount`.

ACKs for top commit:
  tcharding:
    ACK 937a3da8dd
  apoelstra:
    ACK 937a3da8dde74128f79486cf2668f9abaf133bea; successfully ran local tests

Tree-SHA512: a7ad926a33d0943d7334cf3990392d9ca5911603c5ddda69601dd2f744ff0784bd123317179c88d9841c3e9f25f9d75e745100c5b4db7a5b801a7d6a5e15f948
2024-12-20 03:52:05 +00:00
Shing Him Ng 04dfe8dd45 Add api test to check Arbitrary impls 2024-12-19 21:13:35 -06:00
Shing Him Ng 678fc71b88 Implement Arbitrary for units types 2024-12-19 17:00:35 -06:00
Shing Him Ng 23f75a098c Update regex lookahead to match when there are no characters 2024-12-19 16:28:25 -06:00
Jamil Lambert, PhD 937a3da8dd
Add rustdoc errors 2024-12-19 14:05:12 +00:00
Jamil Lambert, PhD 78f1628bf6
Add Examples to rustdocs 2024-12-19 14:05:10 +00:00
Jamil Lambert, PhD 09e184015e
Fix rustdocs in SignedAmount 2024-12-19 14:04:33 +00:00
merge-script 9cb302e477
Merge rust-bitcoin/rust-bitcoin#3782: A couple of kani fixes
f4617e71f5 kani: Verify no out of bounds for ArrayVec (Tobin C. Harding)
e378cdd8fa kani: Don't bother checking signed to unsigned conversion (Tobin C. Harding)
50224eecc2 kani: Don't overflow the tests (Tobin C. Harding)

Pull request description:

  PR does two things because a recent upgrade of `kani` broke our setup. I'm not sure why it just showed up.

  We fix the verification for `amount` types which recently broke because of `MAX_MONEY` changes and then we add a verification function to `internals` because build fails and one fix is to just add something.

  - Patch 1: units: Assumes correct values
  - Patch 2: units: Removes a stale check now that MAX_MONEY is being used for MAX
  - Patch 3: Add verification to `internals::ArrayVec`.

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

Tree-SHA512: dfef05a7bbb5372415efa8acab7f79801aa7326ac298c007b173786f00bcccd0b1b81d327113723c359fb2797895414a586cc3fb86e495476a03fcac02a96899
2024-12-19 02:18:07 +00:00
Tobin C. Harding f4617e71f5
kani: Verify no out of bounds for ArrayVec
I'm not super confident that I know exactly what kani does but I believe
this test verifies that the `ArrayVec` can add and access elements less
than capacity and upto capacity.
2024-12-19 09:05:43 +11:00
merge-script ebe43b6f87
Merge rust-bitcoin/rust-bitcoin#3757: Test types MIN/MAX instead of i64::MIN/i64::MAX
f08d8741d3 Test types MIN/MAX instead of i64::MIN/i64::MAX (yancy)

Pull request description:

  The MIN/MAX for SignedAmount recently changed from i64::MIN and i64::MAX to MAX_MONEY/MIN_MONEY.  Update the tests to reflect this new MIN/MAX since it is no longer valid to create a value above or bellow MAX_MONEY/MIN_MONEY.

ACKs for top commit:
  apoelstra:
    ACK f08d8741d39685b636830680bb891bd414826e88; successfully ran local tests
  tcharding:
    ACK f08d8741d3

Tree-SHA512: 563408240dffaf95f88a9d570e56f9b9b161b422cb59a89828c18b9c784e7acb717f57fe55c80411f104443ac2a3f908f2a98ab1a4b34edab69b6946a723b30c
2024-12-18 14:35:37 +00:00
merge-script c111416401
Merge rust-bitcoin/rust-bitcoin#3704: units: Enable pedantic clippy lints
2513e05501 api: Run just check-api (Tobin C. Harding)
9619f68956 units: Move excluded lints to manifest (Tobin C. Harding)
5290a93a38 units: Add all pedantic lints (Tobin C. Harding)

Pull request description:

  Add all pedantic clippy lints but leave a few marked as TODO.

  The coment on the list claims to it is an exhaustive list of pedantic lints, that claim is going to go stale. I would be nice if we had tooling to catch new lints as they were added.

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

Tree-SHA512: 33b2a7448d49d6a5571c9e4e9922b6042ab03aaaa9f7acad243a926f8a03a0ffed75d4f5f37be4705f23862c32f96879582214cd17c7e5ab81e47517a84745e0
2024-12-18 02:38:02 +00:00
merge-script 221bc38543
Merge rust-bitcoin/rust-bitcoin#3781: Remove deprecated tests
01af266335 Remove deprecated tests (yancy)

Pull request description:

  Unchecked methods have been removed in a previous commit, therefore the tests are no longer applicable.

ACKs for top commit:
  tcharding:
    ACK 01af266335
  apoelstra:
    ACK 01af2663356f9cf1f00e7aa0359aca7b9515e96a; successfully ran local tests

Tree-SHA512: f45049750b3b3d2b6528cb9c892cf6ba9a95bd3fd30e375bb6c22722b0e46bcaddf315b80e6255b8f2451d250adf5536d7b3d91eb5ae4e496782cc75940674ea
2024-12-18 00:30:53 +00:00
Tobin C. Harding e378cdd8fa
kani: Don't bother checking signed to unsigned conversion
Now that we use MAX_MONEY a signed amount always fits in an unsigned
amount.
2024-12-18 09:36:54 +11:00
Tobin C. Harding 50224eecc2
kani: Don't overflow the tests
Amount add and sub now enforce the MAX_MONEY invariant when doing
addition and subtraction. We need to tell kani to assume we don't
overflow before doing actual tests.

Note also that `ops::Add` calls through to `checked_add` and
`ops::Sub` calls through to `checked_sub` so separate kani tests for
these are unnecessary.
2024-12-18 09:36:33 +11:00
Tobin C. Harding 2513e05501
api: Run just check-api 2024-12-18 08:25:19 +11:00
Tobin C. Harding 9619f68956
units: Move excluded lints to manifest
Might as well put these with the pedantic ones.
2024-12-18 08:25:12 +11:00
Tobin C. Harding 5290a93a38
units: Add all pedantic lints
Add all the pedantic lints to the repository by way of the repository
manifest. Then enable these lints in the `units` manifest.

Some things worth mentioning:

- Fix `needless_pass_by_value` by adding derives to `FormatOptions`.
- Fix lint `cast_lossless` using `cargo clippy --fix``
- While fixing `lint enum_glob_use` introduce a new style to the
codebase; import enums using a single character. Doing so prevents
namespace clashes, improves clarity, and maintains terseness.

Audit:

Use the following lints locally and audit all the warnings, they produce
many false positives so we can't enable them permentently.

- `cast_possible_truncation`
- `cast_possible_lint`
- `cast_sign_loss`
2024-12-18 08:25:12 +11:00
yancy 01af266335 Remove deprecated tests
Unchecked methods have been removed in a previous commit, therefore the
tests are no longer applicable.
2024-12-17 13:12:17 -06:00
yancy f08d8741d3 Test types MIN/MAX instead of i64::MIN/i64::MAX
The MIN/MAX for SignedAmount recently changed from i64::MIN and
i64::MAX to MAX_MONEY/MIN_MONEY.  Update the tests to reflect this new
MIN/MAX since it is no longer valid to create a value above or bellow
MAX_MONEY/MIN_MONEY.
2024-12-17 12:19:17 -06:00
merge-script f4069fcd61
Merge rust-bitcoin/rust-bitcoin#3780: Use uniform capitalisation of SegWit in rustdocs
e56f461916 Make capitalization of SegWit uniform in strings (Jamil Lambert, PhD)
3520e832ac Make capitalization of SegWit uniform in rustdocs (Jamil Lambert, PhD)

Pull request description:

  Fixes #3770

  - Searched and replaced all occurrences of `//` * `segwit` (case insensitive) with `//` * `SegWit`
  - Searched and replaced all occurrences of `"` * `segwit` (case insensitive) with `"` * `SegWit`

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

Tree-SHA512: c56704102d8e86f26378bb302d5fdc7ea21d41fd49f55606e589ec32ff896f1adfb1960d8fb29abccfbf298b90fc357ed609d80fd0163dcb4ff01573646b02c3
2024-12-17 18:10:44 +00:00
merge-script 1d3f42e589
Merge rust-bitcoin/rust-bitcoin#3762: Remove double spacing in rustdocs
bb29490308 Remove double spacing in rustdocs (Jamil Lambert, PhD)

Pull request description:

  Fixes #3761

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

Tree-SHA512: efc41bdfd7b46bae4ed1159c852b3a2df0a95e36e1964679640de37ae3e0cc994426e7e9d643beb5ba0f5210bb6c2a19028fc8d28a6150580bad4471d4502bb3
2024-12-17 16:38:01 +00:00
merge-script b5cf121c55
Merge rust-bitcoin/rust-bitcoin#3754: Release tracking PR: `hashes 0.16.0`
b5f553d866 hashes: Bump version to 0.16.0 (Tobin C. Harding)

Pull request description:

  We need to do a quick release because our current `bitcoin` manifest does not work with hashes `v0.15.0` and we'd like to release an alpha version with the current state of `master`. https://github.com/rust-bitcoin/rust-bitcoin/pull/3718

  ```
  the package `bitcoin` depends on `bitcoin_hashes`, with features: `hex`
  but `bitcoin_hashes` does not have these features. It has a required
  dependency with that name, but only optional dependencies can be used as
  features.
  ```

  Add a changelog, bump the version, depend on the new version repo wide, and update the lock files - like its our job.

ACKs for top commit:
  sanket1729:
    utACK b5f553d866
  apoelstra:
    ACK b5f553d8662836e2bf4cd8fc134e5538782b37f6; successfully ran local tests

Tree-SHA512: dfd85a658a7274e934bd9508a7529a4076a34a922c12ac97d952302a3e7e2d60ac3fca676a2c950482cec36f6c4818a9fd0cec8935be2783fa193cb90701f371
2024-12-17 14:57:21 +00:00
Jamil Lambert, PhD e56f461916
Make capitalization of SegWit uniform in strings 2024-12-17 14:49:01 +00:00
Jamil Lambert, PhD 3520e832ac
Make capitalization of SegWit uniform in rustdocs 2024-12-17 14:28:28 +00:00
Jamil Lambert, PhD bb29490308
Remove double spacing in rustdocs 2024-12-17 14:21:12 +00:00
merge-script 8d508e0deb
Merge rust-bitcoin/rust-bitcoin#3728: units: Unify and flesh out ops impls
68f3c3e5d7 api: Run just check-api (Tobin C. Harding)
b956940a6d Add ops unit tests for amount types (Tobin C. Harding)
d88306fb68 units: Implement ops for amount types (Tobin C. Harding)
4a3aa4a08b Add ops unit tests for Weight (Tobin C. Harding)
43ef9a618c units: Implement ops for Weight (Tobin C. Harding)
c5fbc7e117 units: Add assign macros (Tobin C. Harding)
20a79da344 units: Use one level of path for ops traits (Tobin C. Harding)
6ce5385914 units: Add macros for Add and Sub (Tobin C. Harding)
b31ca72b33 units: Use rhs instead of other (Tobin C. Harding)
cd0fa2d1dc Make FeeRate ops impls more terse (Tobin C. Harding)

Pull request description:

  Sort out `Add`, `AddAssign`, `Sub`, and `SubAssign` for the following types:

  - `Amount`
  - `SignedAmount`
  - `FeeRate`
  - `Weight`

  And clean up as we go.

  Note that `BlockInterval` isn't touched in this PR - it looks correct already.

  The unit tests in the two patches "Add ops tests ..." can be moved if you want to verify that they don't build without the patch they follow.

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

Tree-SHA512: a82d3bf288f61b169b8cff498e81bd2cd123c8dcbf534413233ff03f06102a42508e09b2f7e5b268b21f82d4bf2b3612cd88dea1231b4d3e6455c7e99f82e729
2024-12-17 03:52:24 +00:00
merge-script d2c9fab460
Merge rust-bitcoin/rust-bitcoin#3765: contrib: check if the user has cargo-public-api
f01f071751 api: document the need of cargo nightly (Jose Storopoli)
ff67eadc7f contributing: clarify API changes (Jose Storopoli)
04852958b9 contrib: check if the user has cargo-public-api (Jose Storopoli)

Pull request description:

  Closes #3764.

  yancyribbens can you test it locally? It works in my end both with and without `cargo-public-api`. Of course without gives the error message that I was supposed to see.

  EDIT: You can run it with `just check-api`.

ACKs for top commit:
  apoelstra:
    ACK f01f071751332bb6aa8b9affa4677f913035de7f; successfully ran local tests
  tcharding:
    ACK f01f071751

Tree-SHA512: 7acf8332731191de47afc02e24c151bc53c1f38685217eccbea1b64c216674f31729ba703e132765cba67183dff95757aa949d653c5cbe538240371c2db52c14
2024-12-16 23:53:49 +00:00