Commit Graph

4375 Commits

Author SHA1 Message Date
Tobin C. Harding e2c3694184
rustfmt: Use show_parse_errors
There are no behaviour changes with this patch applied.

In https://github.com/rust-lang/rustfmt/pull/5961 the
`hide_parse_errors` was changed to `show_parse_errors` with default
`true`.

Since we run the formatter with nightly we are getting the following
warning

 Warning: the `hide_parse_errors` option is deprecated. Use
 `show_parse_errors` instead

Rename the variable and keep the default value `true`.
2024-07-11 11:27:54 +10:00
merge-script 0511f44d99
Merge rust-bitcoin/rust-bitcoin#2994: Remove private prelude module from `units` crate
1cce1b5aa6 Remove private prelude module from units crate (Jamil Lambert, PhD)

Pull request description:

  The private prelude module has been removed from the units crate and instead imports are stated in full when needed.  As discussed in #2926.

ACKs for top commit:
  Kixunil:
    ACK 1cce1b5aa6
  apoelstra:
    ACK 1cce1b5aa6

Tree-SHA512: 58b93ff66f74399938bc1a7f59fe8d2a21d0437c7e90e0c190d3d6a8de30f9c9268c8e4288d1db287b4d190624968937b1ad6c6e54d29025370e47e71be925c1
2024-07-10 21:56:03 +00:00
merge-script bf027fc1f2
Merge rust-bitcoin/rust-bitcoin#2985: internals: Remove derive from test-serde
c2bdc68f5e internals: Remove derive from test-serde (Tobin C. Harding)

Pull request description:

  During review of #2889 it was noted that we don't need to enable the `derive` feature of `serde` in the `test-serde` feature.

  Do not enable `derive` in the `test-serde` feature.

ACKs for top commit:
  apoelstra:
    ACK c2bdc68f5e nice
  Kixunil:
    ACK c2bdc68f5e

Tree-SHA512: 64def07c2ae93fd98fae10a51b978c9777b43b4e153a4f42c6d7dfa6ba7d65b98a313f08337bb3ace3078a319cc450e23717c481ba631aca5ed84b098dcf36e4
2024-07-10 19:15:47 +00:00
merge-script 5ad78ccc6b
Merge rust-bitcoin/rust-bitcoin#2987: Add `TxIdentifier` trait
a738754f67 Add TxIdentifier trait (Tobin C. Harding)

Pull request description:

  Add a new trait `TxIdentifier` that abstracts over the `Txid` and `Wtxid` types. We make `AsRef` a super trait so that the new trait needs no methods.

  Seal the trait so consumers of the library cannot implement it.

  Use the new trait in:

  - the `bip152` module to tighten up the `with_siphash_keys` function
  - as a trait bound on the `Leaf` associated type in the `MerkleNode` trait

ACKs for top commit:
  apoelstra:
    ACK a738754f67
  Kixunil:
    ACK a738754f67

Tree-SHA512: a7bda26a4a5107f96b24ea3c163286a7ab21a817bdec3434b3ab27d78e99c0548a7362a2271d362b89038c80d9251767c0d62e1df702ef57d9edaf141ab55cd6
2024-07-10 18:28:31 +00:00
merge-script 66b0b52870
Merge rust-bitcoin/rust-bitcoin#2988: Add additional `HashEngine` types
51010777bf hashes: Strongly type the hash160::HashEngine (Tobin C. Harding)
d5dd54a489 hashes: Strongly type the sha256d::HashEngine (Tobin C. Harding)
a7422a779c hashes: Add const hash engine constructors (Tobin C. Harding)

Pull request description:

  Currently we are using a type alias for a few of the hash engines.

  Type alias' allow for potential mixing of types, a struct can better serve our users with not much additional complexity or maintenance burden.

  - As preparation add const constructors where possible to hash engines (excl. `HmacEngine`).
  - Add a `sha256d::HashEngine` struct
  - Add a `hash160::HashEngine` struct

  If this goes in we can improve the `sha256t::HashEngine` in a similar manner.

ACKs for top commit:
  Kixunil:
    ACK 51010777bf
  apoelstra:
    ACK 51010777bf but will hold off on merging until tcharding indicates whether he wants to address the midstate thing

Tree-SHA512: 810db3a8cd66e4d135b04a65d5b4c926cf2e5e8ac531619bbd884db69df17b29b64daeb6fb31b8b1fb32bffbf81cf84e55cd46945c743451c73f1b7f63489f63
2024-07-10 17:46:33 +00:00
merge-script bcfc9dcb20
Merge rust-bitcoin/rust-bitcoin#2989: Move opcodes to `primitives`
9a586987d1 Move opcodes to primitives (Tobin C. Harding)

Pull request description:

  Move the `opcodes` module to the new `primitives` crate. This is pretty straight forward, some things to note:

  - Are we ok with the public wildcard re-export from `blockdata`? I think so because the whole `blockdata` module should, IMO, be deleted after everything in it is moved to `primitives`.

  - `decode_pushnum` becomes public.

ACKs for top commit:
  Kixunil:
    ACK 9a586987d1
  apoelstra:
    ACK 9a586987d1

Tree-SHA512: ee9fa0ae4265f54ff7784dc873abc12572852c32ff24456e34cd6a8a004f9e1f932e01c80d3448107fca76507db4bdaa3dfff6b5a80de0707d59a033e582fb9e
2024-07-10 16:32:52 +00:00
merge-script 00ca5da78b
Merge rust-bitcoin/rust-bitcoin#2990: Use super for imports in script module
afd19ebd61 Use super for imports in script module (Tobin C. Harding)

Pull request description:

  In the `script` module we currently import `script` types using the fully qualified path, as recently discussed code is easier to maintain if we use `super` when `super != crate`.

  Internal change only, no external changes.

ACKs for top commit:
  Kixunil:
    ACK afd19ebd61
  apoelstra:
    ACK afd19ebd61

Tree-SHA512: 5d8546de3d8d9014054fb53020ec0d742eb9698d6d70cd0b2e722b5e43792f4d1ad480d1c61d67b10ddda6a5ef42839118f0de0332251bd64cf31f0a566fd40b
2024-07-10 13:40:29 +00:00
Jamil Lambert, PhD 1cce1b5aa6 Remove private prelude module from units crate
The private prelude module has been removed from the units crate and
instead imports are stated in full when needed.
2024-07-10 09:14:33 +01:00
merge-script 2320877253
Merge rust-bitcoin/rust-bitcoin#2969: ci: move semver-checks to its own job
f8c91b067b ci: move semver-checks to its own job (Jose Storopoli)

Pull request description:

  This is necessary because it needs to run only on pull_request, and not on push events.

  Closes #2968.

ACKs for top commit:
  apoelstra:
    ACK f8c91b067b
  tcharding:
    ACK f8c91b067b
  Kixunil:
    ACK f8c91b067b

Tree-SHA512: 31b8817c2cc6aaf4902666140fba51ae1b2f54cc8843eacbe2782dbfca526023c536064351e08b58e5e1d999eb08937a39f619a36e3d9107fd688dea313638d2
2024-07-09 17:32:17 +00:00
merge-script 13e27acb16
Merge rust-bitcoin/rust-bitcoin#2957: Fix rustdocs in `units` crate
6dd5af9678 Add missing links (Jamil Lambert, PhD)
47e367f011 Standardize error headings (Jamil Lambert, PhD)
75f317a689 Fix rustdoc grammar (Jamil Lambert, PhD)
573f8ce724 Add backticks to rustdoc links (Jamil Lambert, PhD)

Pull request description:

  The rustdocs in the `units` crate has been reviewed and improved.

  Some of the links were missing backticks, these have been added.

  Some grammatical changes have been made to improve the documentation.

  The use of links was inconsistent and has been changed to have links everywhere that seemed appropriate.

  A couple of error headings were added and a description as to why a capital M is not accepted in the denomination for MegaSatoshi or MegaBitcoin.

ACKs for top commit:
  apoelstra:
    ACK 6dd5af9678
  tcharding:
    ACK 6dd5af9678

Tree-SHA512: f5481a7c3aa99d7882cda9ccda9df9e27f092ff91ef584f07dc887f38bfe12e5ea801cfa7f42bb4022301860489ee6be55557752a8cbe70932f258ea753495dc
2024-07-09 14:13:32 +00:00
merge-script c40fda2f78
Merge rust-bitcoin/rust-bitcoin#2978: Fixed typo in encode.rs
74ca0195e7 Fixed typo in encode.rs (douglaz)

Pull request description:

ACKs for top commit:
  tcharding:
    ACK 74ca0195e7
  Kixunil:
    ACK 74ca0195e7
  apoelstra:
    ACK 74ca0195e7

Tree-SHA512: 20b52a14c5d7c084de545b0e72c23396378c2be3a3e4c225550433901970521801e225804e56ebb3e7736de7dc31dce2d06ea09e7863a617c3daff46eefb297c
2024-07-09 13:28:18 +00:00
Tobin C. Harding 9a586987d1
Move opcodes to primitives
Move the `opcodes` module to the new `primitives` crate. This is pretty
straight forward, some things to note:

- Are we ok with the public wildcard re-export from `blockdata`? I think
so because the whole `blockdata` module should, IMO, be deleted after
everything in it is moved to `primitives`.

- `decode_pushnum` becomes public.

Includes addition of a `patch` section for `primitives` in the
`bitcoin/embedded` crate.
2024-07-09 15:26:33 +10:00
Tobin C. Harding afd19ebd61
Use super for imports in script module
In the `script` module we currently import `script` types using the
fully qualified path, as recently discussed code is easier to maintain
if we use `super` when `super != crate`.

Internal change only, no external changes.
2024-07-09 15:13:08 +10:00
merge-script b9f1dba3f7
Merge rust-bitcoin/rust-bitcoin#2979: Automated daily update to rustc (to nightly-2024-07-07)
f5dcbc1723 Automated update to Github CI to rustc nightly-2024-07-07 (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 f5dcbc1723

Tree-SHA512: 094407c926fa79fe22d26253296076c80b58240e62de5921f5ed4aee67177d3fb3711f0d40c2bd422b834a88df62ab4e9442165c2826ad1f787ad2d3fb23b2a4
2024-07-09 14:16:03 +10:00
Tobin C. Harding 51010777bf
hashes: Strongly type the hash160::HashEngine
Currently we are using a type alias for the `hash160::HashEngine`.

Type alias' allow for potential mixing of types, a `hash160::HashEngine`
struct can better serve our users with not much additional complexity or
maintenance burden.

As we did for the `sha256d::HashEngine`, add a new wrapper type
`hash160::HashEngine` that replaces the current type alias.
2024-07-09 13:30:20 +10:00
Tobin C. Harding d5dd54a489
hashes: Strongly type the sha256d::HashEngine
Currently we are using a type alias for the `sha256d::HashEngine`.

Type alias' allow for potential mixing of types, a `sha256d::HashEngine`
struct can better serve our users with not much additional complexity or
maintenance burden.
2024-07-09 13:21:11 +10:00
Tobin C. Harding a7422a779c
hashes: Add const hash engine constructors
Add `const` constructors to all hash engines. Call through to
`Self::new` in `default` impls on `HashEngine`.
2024-07-09 13:17:16 +10:00
Tobin C. Harding a738754f67
Add TxIdentifier trait
Add a new trait `TxIdentifier` that abstracts over the `Txid` and
`Wtxid` types. We make `AsRef` a super trait so that the new trait needs
no methods.

Seal the trait so consumers of the library cannot implement it.

Use the new trait in:

- the `bip152` module to tighten up the `with_siphash_keys` function
- as a trait bound on the `Leaf` associated type in the `MerkleNode` trait
2024-07-09 12:28:03 +10:00
merge-script c53d6b7d44
Merge rust-bitcoin/rust-bitcoin#2970: bip152: check if indexes do not overflow
837f466f72 bip152: check if indexes do not overflow (Bruno Garcia)

Pull request description:

  When deserializing a `HeaderAndShortIds` we could check if the number of txs does not overflow 16 bits. If so, throw an error.

ACKs for top commit:
  apoelstra:
    ACK 837f466f72
  Kixunil:
    ACK 837f466f72

Tree-SHA512: 21797689758ae22666289cde123e3e9ae1bdb1ab2f85a1cd0f07ee8fa2a441e7b1b928f30b8fb1f65aef0c526c899eb96b83ed4fff074e70b31e0afad2c35930
2024-07-08 21:57:43 +00:00
Tobin C. Harding c2bdc68f5e
internals: Remove derive from test-serde
During review of #2889 it was noted that we don't need to enable the
`derive` feature of `serde` in the `test-serde` feature.

Do not enable `derive` in the `test-serde` feature.
2024-07-09 07:50:55 +10:00
merge-script b392510ec1
Merge rust-bitcoin/rust-bitcoin#2889: Move `serde_round_trip` macro to internals
7fa53440dc Move serde_round_trip macro to internals (Tobin C. Harding)

Pull request description:

  We currently duplicate the serde_round_trip macro in `units` and `bitcoin`, this is unnecessary since it is a private test macro we can just throw it in `internals`.

  While we are at it lets improve the macro by testing a binary encoding also, elect to use the `bincode` crate because we already have it in our dependency graph.

  Add `test-serde` feature to `internals` to feature gate the macro and its usage (preventing the transient dependency on `bincode` and `serde_json`).

ACKs for top commit:
  Kixunil:
    ACK 7fa53440dc
  apoelstra:
    ACK 7fa53440dc

Tree-SHA512: f40c78bf2539940b7836ed413d5fe96ce4e9ce59bad7b3f86d831971320d1c2effcd23d0da5c785d6c372a2c6962bf720080ec4351248fbbdc0f2cfb4ffd602c
2024-07-08 20:50:23 +00:00
merge-script 786494b72d
Merge rust-bitcoin/rust-bitcoin#2982: Add missing `ref` keyword in `p2p`
58a43b309e Add missing ref keyword (Jamil Lambert, PhD)

Pull request description:

  One item in the match statement was missing the `ref` keyword.  This has been added.

ACKs for top commit:
  apoelstra:
    ACK 58a43b309e I think the noise is fine; this is an easy one-ack merge and should not cause rebasing pain for anybody

Tree-SHA512: 6ef383fba4a1836e0f904889086d8494a82bd01c407d738360d15cd31742ff6979e1aa406f20b27f47060f8d8e96015c20cce1834948d9ef786731ad7e7f8ce6
2024-07-08 18:06:49 +00:00
Jamil Lambert, PhD 58a43b309e Add missing ref keyword
This change ensures that the value is borrowed rather than moved.
2024-07-08 11:15:12 +01:00
Jamil Lambert, PhD 6dd5af9678 Add missing links
The use of links in the rustdocs was inconsistent.

Links have been added when missing.

[`locktime::absolute::Height`] and [`locktime::relative::Height`] did
not work and `(crate::locktime)` was appended to fix it.
2024-07-08 08:53:13 +01:00
Jamil Lambert, PhD 47e367f011 Standardize error headings
Created headings for a couple of function error descriptions to be
consistent with the rest of the crate.

Added a description explaining why Mega is not allowed in a
denomination.
2024-07-08 08:52:15 +01:00
Jamil Lambert, PhD 75f317a689 Fix rustdoc grammar
In the rustdocs, made all function descriptions third person. Corrected
some grammar and improved some wording.
2024-07-08 08:52:15 +01:00
Jamil Lambert, PhD 573f8ce724 Add backticks to rustdoc links
Links in rustdocs should be formatted with a backtick.  This has been
changed throughout Units.
2024-07-08 08:52:15 +01:00
merge-script 4507cd1fe7
Merge rust-bitcoin/rust-bitcoin#2976: Automated nightly rustfmt (2024-07-07)
91382977fb 2024-07-07 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 91382977fb
  tcharding:
    ACK 91382977fb

Tree-SHA512: 8729e3ca874d1269cd4396a21b79da95d3775e91985429f08c2ca4f77fac2c44c5b16183c1ccefcf40a6e12c3836a0ab7b035f4dfcb3b715ff4f954f6d7443e1
2024-07-08 14:05:29 +10:00
Update Nightly Rustc Bot f5dcbc1723 Automated update to Github CI to rustc nightly-2024-07-07 2024-07-08 01:33:57 +00:00
douglaz 74ca0195e7
Fixed typo in encode.rs 2024-07-07 23:27:54 +00:00
Fmt Bot 91382977fb 2024-07-07 automated rustfmt nightly 2024-07-07 01:10:59 +00:00
merge-script 59a3b2b683
Merge rust-bitcoin/rust-bitcoin#2855: bitcoin: Update crate level docs
4bb9240992 bitcoin: Add comment to manifest (Tobin C. Harding)
c6c70a721e bitcoin: Update feature docs (Tobin C. Harding)
7712e5d891 bitcoin: Use 100 colum width in crate level docs (Tobin C. Harding)

Pull request description:

  Update stale crate level docs in `bitcoin`. Done as two separate patches so the last one is trivial to review, whitespace only.

ACKs for top commit:
  Kixunil:
    ACK 4bb9240992
  apoelstra:
    ACK 4bb9240992

Tree-SHA512: b9d5474f7e7a0576f535df428ea20084acbcb74d0576e7f2934c547dd2c54f4a939d73ec547b3b254105a45c2372113c65ce136be1eabd63701259a3a6de3737
2024-07-06 13:02:56 +00:00
Tobin C. Harding 7fa53440dc
Move serde_round_trip macro to internals
We currently duplicate the serde_round_trip macro in `units` and
`bitcoin`, this is unnecessary since it is a private test macro we can
just throw it in `internals`.

While we are at it lets improve the macro by testing a binary encoding
also, elect to use the `bincode` crate because we already have it in
our dependency graph.

Add `test-serde` feature to `internals` to feature gate the macro and
its usage (preventing the transient dependency on `bincode` and
`serde_json`).
2024-07-06 14:51:30 +10:00
Tobin C. Harding 1c96da080d
Merge rust-bitcoin/rust-bitcoin#2962: Automated daily update to rustc (to nightly-2024-07-03)
830ebfe95e Automated update to Github CI to rustc nightly-2024-07-03 (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 830ebfe95e

Tree-SHA512: b0458197d37697208ee856d774ba9f41da948545b334f64974383df832cc247f96287fdeef1e54f0f2091b8ef72b4e98f800900a10a5e254381c26e29c30d6cd
2024-07-06 12:08:21 +10:00
Bruno Garcia 837f466f72 bip152: check if indexes do not overflow 2024-07-05 17:44:54 -03:00
Jose Storopoli f8c91b067b
ci: move semver-checks to its own job
This is necessary because it needs to run only on pull_request,
and not on push events.
2024-07-05 17:27:08 -03:00
merge-script 68f71d54ca
Merge rust-bitcoin/rust-bitcoin#2967: just: add just docsrs
d07550d86d just: add just docsrs (Jose Storopoli)

Pull request description:

  Adds `just docsrs` which takes [variadic arguments](https://just.systems/man/en/chapter_41.html?highlight=zero%20or#recipe-parameters) (zero or more after the command).

  Kixunil this allows for `just docsrs` and `just docsrs --open`.

  Closes #2965.

  Using the command from `rust-bitcoin-maintainer-tools`: 3494ceec52/ci/run_task.sh (L277)

ACKs for top commit:
  jamillambert:
    ACK d07550d86d
  Kixunil:
    ACK d07550d86d
  apoelstra:
    ACK d07550d86d

Tree-SHA512: dfc8a91bf9d572cb0cb460102f051aabe026fde2852ef2c82e962f0c60d8532628aa15bb99590a6140871d5539cdd9e5c6f80d0684fc128031f1c930e66e99ff
2024-07-05 18:45:28 +00:00
merge-script 5ca4d0e376
Merge rust-bitcoin/rust-bitcoin#2964: Remove nonsense method
dfce405007 Remove nonsense method (yancy)

Pull request description:

  Weight type implicitly includes witness scale factor

  closes https://github.com/rust-bitcoin/rust-bitcoin/issues/2963

ACKs for top commit:
  Kixunil:
    ACK dfce405007
  apoelstra:
    ACK dfce405007 agreed about CI, we are very close to removing it

Tree-SHA512: 1c30c61863dd9c2ce5b6524931a21f99825edfd7401b833581194792c622030a4aa6b9c0f9680f97a8ae901604314805efa77e6fe1e8c15b356ddfea99ffe90c
2024-07-05 14:59:03 +00:00
merge-script 57f608fced
Merge rust-bitcoin/rust-bitcoin#2946: ci: `cargo-semver-checks`
eeae225cfc ci: add cargo-semver-checks (Jose Storopoli)
d9567b097f ci: remove check-api (Jose Storopoli)

Pull request description:

  - Removes `check-api` (`cargo-public-api`)
  - Adds `cargo-semver-checks`

  ## Note to Reviewers

  There is a new script `contrib/check-semver.sh` that checks for semver breaks against `master`.
  If it detects a breaking change it will create the `.semver-break` file.
  If this file exists then we will add an `API break` label and a big comment to the PR saying:

  > 🚨 API BREAKING CHANGE DETECTED

  It reproduces the current behavior of `cargo-public-api`:

  - `bitcoin`:
    - `all-features`
    - `no-default-features`
  - `base58ck`:
    - `all-features`
    - `no-default-features`
  - `bitcoin_hashes`:
    - `no-default-features`
    - `features alloc`
  - `bitcoin-units`:
    - `no-default-features`
    - `features alloc`
  - `bitcoin-io`:
    - `no-default-features`
    - `features alloc`

  Closes #1875.
  Supersedes #2912.

  ## Context

  Our current test to check API breaks using `cargo public-api` is not "automated" per se.
  It needs contributors to keep tabs on text files with function signatures and other things and forces reviewers to be the _de facto_ API break detector tool.

  The idea is to use the well-acclaimed and maintained `cargo semver-checks` that will do this automatically in CI.

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

Tree-SHA512: a77d64b4ca6500b80e6f98f9735d17193f8eaa9998e38602f46418f4b9f3b391ffe9b06bfe8e0285fc4350e8214ebd203034693bac858bac31b7d722903933ae
2024-07-05 14:18:02 +00:00
Jose Storopoli d07550d86d
just: add just docsrs 2024-07-05 08:15:37 -03:00
Tobin C. Harding 4bb9240992
bitcoin: Add comment to manifest
Add a comment to the manifest features section to try to help the docs
not go stale again.
2024-07-05 07:19:41 +10:00
Tobin C. Harding c6c70a721e
bitcoin: Update feature docs
The `bitcoin` crate documents its features in the crate level rustdocs,
currently they are stale.

Update and improve the feature docs section of crate level docs.
2024-07-05 07:19:40 +10:00
merge-script ec18895bd4
Merge rust-bitcoin/rust-bitcoin#2961: bip158: Hash data instead of copying first
6d3137ed87 bip158: Hash data instead of copying first (Tobin C. Harding)

Pull request description:

  Currently we copy data into a new buffer before passing it into the hasher, we can just hash the data directly.

  Internal change only, no external change.

  Fix: #2917

ACKs for top commit:
  Kixunil:
    ACK 6d3137ed87
  apoelstra:
    ACK 6d3137ed87

Tree-SHA512: ff5bd18feffe1e77494b0cd14713bc55f1111f026d05bfa58a679f609fdba70160ab9df7677f0790b5b269878226c2f16164be2c918e1ad8b77e2c23d72889dd
2024-07-04 20:33:20 +00:00
yancy dfce405007 Remove nonsense method
Weight type implicitly includes witness scale factor
2024-07-04 12:11:46 -05:00
merge-script 60b3ac5ad5
Merge rust-bitcoin/rust-bitcoin#2950: Introduce empty primitives crate
65e9ad2fea Introduce empty primitives crate (Tobin C. Harding)

Pull request description:

  Introduce an empty `bitcoin-primitives` crate.

  We were give the name on crates.io and previously a version `v0.1.16-alpha` was released so we use `v0.100.0`.

  Does not include adding api files since that whole thing is in flux. This is an even smaller step than #2908 that does not include dependencies.

ACKs for top commit:
  Kixunil:
    ACK 65e9ad2fea
  apoelstra:
    ACK 65e9ad2fea

Tree-SHA512: e8664a5b697281b188345623783f3d92f625e7b42f497bd0c64e9117ac2eb42286071757b04ff92415fbb37ef53dbb7a395717785a941b69bee0f0e2a611c9c3
2024-07-04 16:56:51 +00:00
merge-script 014c4931be
Merge rust-bitcoin/rust-bitcoin#2951: Fix `Amount` decimals handling
3196c271ac Deprecate `Amount::fmt_value_in` (Martin Habovstiak)
467546fc0c Round `Amount` when requested precision is too low (Martin Habovstiak)
7c95a777c1 Fix `Amount` decimals handling (Martin Habovstiak)

Pull request description:

  Displaying with minimal number of zeros is the default in Rust and we want to follow it. This was originally implemented in #716 but #2604 reversed it claiming this is common, however it broke people who rely on minimal display (e.g. BIP21) without fixing the root cause of #2136.

  This reverts commit d887423efc adds a test to prevent this change and also fixes the problem with `{:0.8}` not working.

  Closes #2136
  Closes #2948

  Can we backport this one too?

ACKs for top commit:
  tcharding:
    ACK 3196c271ac
  apoelstra:
    ACK 3196c271ac I also really like how this reduces the complexity of the module, basically passing everything through to `display_in`

Tree-SHA512: 3221f83086ac55af3d4caad03fe2b619be303533bba12096040419d119600c8597938809e171662f11b515d469156b083b2072b901d445e4fdfc7b1062cf7b6a
2024-07-04 13:19:32 +00:00
Jose Storopoli eeae225cfc
ci: add cargo-semver-checks 2024-07-04 10:08:06 +00:00
Jose Storopoli d9567b097f
ci: remove check-api
Removes check-api workflow, helper scripts, documentation, and files.
2024-07-04 10:08:06 +00:00
Update Nightly Rustc Bot 830ebfe95e Automated update to Github CI to rustc nightly-2024-07-03 2024-07-04 01:25:03 +00:00
Tobin C. Harding 6d3137ed87
bip158: Hash data instead of copying first
Currently we copy data into a new buffer before passing it into the
hasher, we can just hash the data directly.

Internal change only, no external change.

Fix: #2917
2024-07-04 09:30:36 +10:00