Commit Graph

4626 Commits

Author SHA1 Message Date
merge-script 3980d6e6e4
Merge rust-bitcoin/rust-bitcoin#3051: Automated daily update to rustc (to nightly-2024-07-14)
580c2cf246 Automated update to Github CI to rustc nightly-2024-07-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 580c2cf246

Tree-SHA512: 0b01575733d6b4d70be9b00d55d53670db33324498cef991e5beca052a3b59bcbb128351a677ab83773855b3b57cacd4c7f08e93079387d67229d1014666cfae
2024-07-16 09:49:50 +10:00
merge-script 12f47c72c5
Merge rust-bitcoin/rust-bitcoin#3030: Rename variable assignment
84dd04cf60 Rename variable assignment (yancy)

Pull request description:

  The type created after assignment is a Weight type.  Using a var name vb which is short for virtual byte is incorrect.

  Pulled this out of stale PR 2215

ACKs for top commit:
  shinghim:
    ACK 84dd04cf60
  apoelstra:
    ACK 84dd04cf60
  Kixunil:
    ACK 84dd04cf60

Tree-SHA512: 1bfc875f53037b2c1e8da25fe44e9ca3303981bdce4e48661a8fb2061833e3cd90318d854f7119c805e861cd8a591697378f829f32eb74ac99a71dc4c947abde
2024-07-15 22:40:37 +00:00
Shing Him Ng 86f82b487d Remove unused variable from LockTime example 2024-07-15 17:03:12 -05:00
merge-script 36d5c471cf
Merge rust-bitcoin/rust-bitcoin#3032: Move impl above tests
301fe9fad9 Move impl above tests (yancy)

Pull request description:

  It's common in other modules for the tests to be at the end of the file. Moving the tests to the bottom helps the code base uniformity.

  Pulled from stale PR 2215

ACKs for top commit:
  shinghim:
    ACK 301fe9fad9
  tcharding:
    ACK 301fe9fad9
  Kixunil:
    ACK 301fe9fad9

Tree-SHA512: c749c4c2c5fba2c8a57fe034d4ef5d34ff26baddb1b2148b9778dc554c955ad31c7bc83b89a3647228bf5f175adddb03105a1e494b28f5a7955369abaa11cfd1
2024-07-15 21:57:36 +00:00
merge-script 6d483585df
Merge rust-bitcoin/rust-bitcoin#2991: Move locktimes and `Sequence` to `primitives`
64c31cfb97 Move locktimes and Sequence to primitives (Tobin C. Harding)

Pull request description:

  The `absolute` and `relative` locktimes as well as the `Sequence` are all primitive bitcoin types.

  Move the `Sequence`, and `locktime` stuff over to `primitives`.

  There is nothing surprising here, the consensus encoding stuff stays in `bitcoin` and we re-export everything from `blockdata`.

  Note please `Sequence` is no longer publicly available at `bitcoin::transaction::Sequence` but it is available at `bitcoin::Sequence`.

ACKs for top commit:
  Kixunil:
    ACK 64c31cfb97
  apoelstra:
    ACK 64c31cfb97

Tree-SHA512: 968aa595bfb53e8fcfa860dae797ec5381ed49c67326a8ef9494086ec65d737502dffe4b24143e159042d07c59c5109d50103029082f87e1c3c26671e975f1b3
2024-07-15 21:13:41 +00:00
merge-script e137a2cfb6
Merge rust-bitcoin/rust-bitcoin#3048: Rename key field in Key to key_data
02e7933fe4 Rename key field in Key to key_data (Shing Him Ng)

Pull request description:

  Follow-up change from [a comment](https://github.com/rust-bitcoin/rust-bitcoin/pull/3022#issuecomment-2226166039) in #3022 that updates the `key` field in the PSBT `Key` to `key_data`, which more closely follows the doc

ACKs for top commit:
  tcharding:
    ACK 02e7933fe4
  Kixunil:
    ACK 02e7933fe4

Tree-SHA512: 67cc621e9f5b326f96c3f08e340acecf60b1d03d25bbd012998bab34f49e96c4dca9f5dc24047f743f1a1b6fcaa5d3c166f2e4cf2ea96d4375c9b1b041d3196f
2024-07-15 17:50:41 +00:00
yancy 84dd04cf60 Rename variable assignment
The type created after assighnment is a Weight type.  Using a var name
vb which is short for virtual byte is incorrect.
2024-07-15 10:05:47 -05:00
merge-script c50796c238
Merge rust-bitcoin/rust-bitcoin#2981: Remove to/from/as_raw_hash functions
2b56f763d0 hashes: Remove to/from/as_raw_hash (Tobin C. Harding)

Pull request description:

  In an effort to shrink the API of `hashes` remove the `from_raw_hash`, `to_raw_hash`, and `as_raw_hash` inherent functions from types created with the `hash_newtype` macro.

  There are a few reasons why this is favourable:

  - It allows stable crates to use the macro and not expose unstable `hashes` types in their API.
  - It makes types created with the macro less "general" in the sense that its more obscure to just hash any data into them. This allows us to write cleaner APIs in `rust-bitcoin`.

ACKs for top commit:
  Kixunil:
    ACK 2b56f763d0
  apoelstra:
    ACK 2b56f763d0

Tree-SHA512: 3d73aa8250dd775994623c9201dd819256acf2ec82526b3537da74c9e19c2ac5e8bba358a2171f7b02342804cb6b4d5ac4dca88d912b3d46d14e3bc35dd5cb91
2024-07-15 13:53:37 +00:00
Shing Him Ng 7874db8fc3 Throw error instead of panic when from_second_ceil input is too large 2024-07-15 07:55:41 -05:00
Jose Storopoli 6ab8f99731
ci: fix semver-checks master 2024-07-15 12:21:04 +00:00
Jamil Lambert, PhD 2169b75bba Use lower case error messages
Error messages should start with a lower case character unless it is a
proper noun.

This has been changed everywhere.
2024-07-15 09:25:08 +01:00
Update Nightly Rustc Bot 580c2cf246 Automated update to Github CI to rustc nightly-2024-07-14 2024-07-15 01:35:29 +00:00
Shing Him Ng 02e7933fe4 Rename key field in Key to key_data 2024-07-14 18:12:24 -05:00
Tobin C. Harding 64c31cfb97
Move locktimes and Sequence to primitives
The `absolute` and `relative` locktimes as well as the `Sequence` are
all primitive bitcoin types.

Move the `Sequence`, and `locktime` stuff over to `primitives`.

There is nothing surprising here, the consensus encoding stuff stays in
`bitcoin` and we re-export everything from `blockdata`.
2024-07-15 08:53:51 +10:00
merge-script 9477ddc57b
Merge rust-bitcoin/rust-bitcoin#3022: Update Key documentation
164b72e07b Update Key documentation (Shing Him Ng)

Pull request description:

  The documentation for `Key` was a bit confusing since `<key> := <keylen> <keytype> <keydata>` was right above the `key` field, when in reality the `key` field represents the key data. Moving the documentation that describes a `Key` as a whole to the struct itself and specifying that `key` represents key data will hopefully clear things up a bit

ACKs for top commit:
  Kixunil:
    ACK 164b72e07b
  tcharding:
    ACK 164b72e07b

Tree-SHA512: 33c2b24d3006a0ed85a5d96351e0a01c1365c8ea01472233b024de54941319cdbefa0126f8b9538385e8f33ba7e2e3895f0dc5b6a36a1c501c8b97ebbede6502
2024-07-14 22:43:17 +00:00
merge-script 25fc7e5f2f
Merge rust-bitcoin/rust-bitcoin#3009: Remove midstate from the `GeneralHash` and `HashEngine` traits
8dcecfc144 Remove midstate from the GeneralHash and HashEngine traits (Tobin C. Harding)

Pull request description:

  Midstates are not generic objects; they don't have universal cryptographic properties and if you are using them you should be using a specific midstate type. Therefore it shouldn't be part of `GeneralHash` or `HashEngine`. Furthermore, in practice it seems like `sha2` midstates are the only ones that anybody uses, at least in bitcoin.

  Remove the midstate stuff from the `GeneralHash` and `HashEngine` traits. Keep the `midstate` functionality as inherent functions if it is used internally. Keep the functionality on `sha256` as inherent public functions.

  Done as a first step towards #2918.

ACKs for top commit:
  apoelstra:
    ACK 8dcecfc144
  Kixunil:
    ACK 8dcecfc144

Tree-SHA512: 495fe6a4d852ecf51c21acc1ae7215f1914f6d12377eb7e6da678b8ffb2c3c8b06976aa5290010a88d5a9cbc56752fcbdf740cb27b22ada8079a69dcf2e32dc0
2024-07-14 22:00:06 +00:00
merge-script 11f28e2728
Merge rust-bitcoin/rust-bitcoin#2955: Add scriptPubkey extension traits to script types
bcf6d2839e Introduce scriptPubkey extension traits (Tobin C. Harding)
ee333defa4 Remove path from ScriptBuf (Tobin C. Harding)

Pull request description:

  Done in preparation for moving the script types to `primitives`.

  Add three public traits, one each for the three `script` types: `Builder`, `ScriptBuf`, and `Script`.

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

Tree-SHA512: 0ad11e474ddf1183d0119e36454cb4fd18d49a68655d274df800c6ef20afa7f8d0fdecd415c02595ea67a011e3a842b7ccc23c2d58f92ed9acbdc7f277fbd217
2024-07-14 19:53:26 +00:00
merge-script 752f54797a
Merge rust-bitcoin/rust-bitcoin#3040: Automated nightly rustfmt (2024-07-14)
d57ca72ed0 2024-07-14 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 d57ca72ed0

Tree-SHA512: 3f9d1718c485cdcaa0c03fab3e86e5a0f5534ec3164f3d25c7b4d9b1db7374edf534bb2436da615c1f6432dbbc692b37ca400b309b732170c8cf01ee4482d18f
2024-07-14 16:32:36 +00:00
merge-script ac490bf347
Merge rust-bitcoin/rust-bitcoin#2980: just: install/remove git hooks
1b0653314b just: install/remove git hooks (Ryan Breen)

Pull request description:

  Added `just install-git-hooks` and `just remove-git-hooks` (with contrib script). Fix: #2599

ACKs for top commit:
  Kixunil:
    ACK 1b0653314b
  tcharding:
    ACK 1b0653314b

Tree-SHA512: fa11eb3429a91928de43be94223862fd1805b7328a61e098cf3fad89fd6df4f6818eaa4b2eeea432e1f0b16c6df12c5fcca66389236af915113d49f1ac2741f8
2024-07-14 15:03:11 +00:00
merge-script 9844c68ba6
Merge rust-bitcoin/rust-bitcoin#3026: Specify required_height in variable name when comparing to other height
e2b0fd33be Specify required_height in variable name when comparing to other height (Shing Him Ng)

Pull request description:

  Update the variable names for `h`/`height` to `required_height` in instances where it was being used to create another height or used comparatively i.e. `required_height + 1` or `required_height < height`

  Resolves #2553

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

Tree-SHA512: 05fa8df721148d9bbc6eaa2b14c2583d3415c3ab0d53b8fdf39d7b9e9a28463265e43abfc430dfc7f6d0b53cd17767f5cad83c2de73b8a153aeb6befeeac84bc
2024-07-14 14:17:15 +00:00
Fmt Bot d57ca72ed0 2024-07-14 automated rustfmt nightly 2024-07-14 01:11:56 +00:00
yancy 301fe9fad9 Move impl above tests
It's common in other modules for the tests to be at the end of the file.
Moving the tests to the bottom helps the code base uniformity.
2024-07-13 14:57:31 -05:00
Tobin C. Harding 2b56f763d0
hashes: Remove to/from/as_raw_hash
In an effort to shrink the API of `hashes` remove the `from_raw_hash`,
`to_raw_hash`, and `as_raw_hash` inherent functions from types created
with the `hash_newtype` macro.

There are a few reasons why this is favourable:

- It allows stable crates to use the macro and not expose unstable
`hashes` types in their API.
- It makes types created with the macro less "general" in the sense that
its more obscure to just hash any data into them. This allows us to
write cleaner APIs in `rust-bitcoin`.
2024-07-14 05:03:36 +10:00
Ryan Breen 1b0653314b just: install/remove git hooks 2024-07-13 14:05:32 -04:00
Shing Him Ng e2b0fd33be Specify required_height in variable name when comparing to other height 2024-07-12 22:26:56 -05:00
Tobin C. Harding bcf6d2839e
Introduce scriptPubkey extension traits
Done in preparation for moving the script types to `primitives`.

The script types have a bunch of functionality to support scriptPubkeys,
and scriptPubkeys are an address thing.

Create a module under `address` and in it create a bunch of extension
traits to hold all scriptPubkey functionality.

Includes adding an ugly-as-hell macro to create the traits.
2024-07-13 08:43:06 +10:00
Tobin C. Harding ee333defa4
Remove path from ScriptBuf
The `ScriptBuf` type is perfectly descriptive without the use of the
additional `script::` path.

Refactor only, no logic changes.
2024-07-13 08:35:54 +10:00
Tobin C. Harding 8dcecfc144
Remove midstate from the GeneralHash and HashEngine traits
Midstates are not generic objects; they don't have universal
cryptographic properties and if you are using them you should be using a
specific midstate type. Therefore it shouldn't be part of `GeneralHash` or
`HashEngine`. Furthermore, in practice it seems like `sha2` midstates are
the only ones that anybody uses, at least in bitcoin.

Remove the midstate stuff from the `GeneralHash` and `HashEngine`
traits. Keep the `midstate` functionality as inherent functions if it is
used internally. Keep the functionality on `sha256` as inherent public
functions.
2024-07-13 07:59:33 +10:00
Shing Him Ng 164b72e07b Update Key documentation 2024-07-12 15:59:01 -05:00
merge-script 2fcd65ad97
Merge rust-bitcoin/rust-bitcoin#3017: hashes: Use `$crate` in macro
360d1fb1bb hashes: Use $crate in macro (Tobin C. Harding)

Pull request description:

  Depending on types being in scope when calling macros is bad practice but we have mistakenly done so in `internal_macros` when using the `FromSliceError`.

  Use `$crate::FromSliceError` in the macro and remove import statements.

ACKs for top commit:
  Kixunil:
    ACK 360d1fb1bb
  apoelstra:
    ACK 360d1fb1bb

Tree-SHA512: e93264ed7313e6f128cc9a441f68100fe423263aa9677c194d768cf1b04058bfc840027540e1c9d82ff5e925ddc165f34b2c6926987f610caa1686ea27a955eb
2024-07-12 20:25:43 +00:00
merge-script b14625f0d5
Merge rust-bitcoin/rust-bitcoin#2646: Some additional inspectors on Script and Witness
ac4db6369d witness: Add Witness::witness_script inspector (Steven Roose)
6cc6c8621a witness: Add Witness::taproot_annex (Steven Roose)
b0848022eb witness: Add Witness::taproot_control_block (Steven Roose)
ef336e1387 witness: Improve Witness::tapscript (Steven Roose)
e48a2e4225 script: Add Script::redeem_script inspector (Steven Roose)

Pull request description:

  Bundled these because they are very similar. Got a bunch of larger changes coming up based on these. I've been using these for a while for TXHASH work.

ACKs for top commit:
  apoelstra:
    ACK ac4db6369d but will need to wait for next release. I think we should merge these as-is although they will be much clearer after we do script tagging.
  tcharding:
    ACK ac4db6369d

Tree-SHA512: e1590d1bdc8b91aeba137453f0cdaa7e1ae6df3c8e9e1e0f087ed9be1a6beaf2286818379247d26c5dd27d07c12c10433db1c9b9a71667ab4d8d37c7deff1373
2024-07-12 18:09:10 +00:00
merge-script beab1dd724
Merge rust-bitcoin/rust-bitcoin#3006: rustfmt: Use `show_parse_errors`
e2c3694184 rustfmt: Use show_parse_errors (Tobin C. Harding)

Pull request description:

  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`.

ACKs for top commit:
  Kixunil:
    ACK e2c3694184
  storopoli:
    ACK e2c3694184
  apoelstra:
    ACK e2c3694184

Tree-SHA512: f75f3abf194d65e0ef2a1bef2544bc94ed1c4911b94cbc6bc5700ecb8e6ec87c5564b9711a7dde8ca1a83400e1bf3154d25574a485e9893049be0a46f2c95e33
2024-07-12 14:57:19 +00:00
Tobin C. Harding 360d1fb1bb
hashes: Use $crate in macro
Depending on types being in scope when calling macros is bad practice
but we have mistakenly done so in `internal_macros` when using the
`FromSliceError`.

Use `$crate::FromSliceError` in the macro and remove import statements.
2024-07-12 12:55:22 +10:00
merge-script 6c8f759676
Merge rust-bitcoin/rust-bitcoin#2996: Add alloc feature to `base58`, `addresses`, and `primitives`
dc96475f58 Add/fix alloc features (Tobin C. Harding)

Pull request description:

  Eventually we would like all our crates other than `bitcoin` to be able to be used without an allocator. Currently, and during crate smashing, this is not that useful because so much of the code comes from `bitcoin` and relies on the availability of an allocator.

  As an initial step, add the `alloc` feature to `addresses` , `base58`, and `primitives`.

  In order to to keep `--no-default-features` builds working make the crates empty if the `alloc` feature is not enabled. This is a suboptimal solution because the error messages users will get when they forget to enable `alloc` will be confusing (eg something like primitives does not contain Transaction). However our CI script (`run_task.sh`) expects `--no-default-features` to build cleanly (as do I).

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

Tree-SHA512: 28006ad638e72d3c712becaf94f6aaddc559fb2f7e7ad0d0810348fe979fb61e32f53e5b20894e472c5ac9e2b7f80cba6a3f0e12b766b817f412a927957ae3a2
2024-07-11 22:31:42 +00:00
merge-script ce7ce6ca9b
Merge rust-bitcoin/rust-bitcoin#3007: Run the formatter
40bee24de7 Run the formatter (Tobin C. Harding)

Pull request description:

  I don't want to wait for the bot, just run the formatter now.

  No manual changes.

ACKs for top commit:
  apoelstra:
    ACK 40bee24de7 fine by me, but will give Kix 2 days to express displeasure, at which point the bot will pretty-much be ready to run
  Kixunil:
    ACK 40bee24de7

Tree-SHA512: a9e54305062900dc18f73c61deef0af74702c17f7040614f5f8697a47dd084d07a9c321878c5e29910e2a8d129bac23b95ee1023176beddf2e915544b13e7b0c
2024-07-11 20:37:48 +00:00
merge-script 80cc0b9723
Merge rust-bitcoin/rust-bitcoin#3000: ci: add `all-features` semver-checks and run on rust `stable`
9933fa0dd5 contributing: fix instructions for the semver CI (Jose Storopoli)
213566f34b ci: semver-checks should run on rust stable (Jose Storopoli)
0fa2b0b16a ci: add all-features semver-checks (Jose Storopoli)

Pull request description:

  Crates missing:
  - `bitcoin_hashes`
  - `bitcoin-units`
  - `bitcoin-io`

  Also adds:

  1. corrects a small error in the CONTRIBUTING.md; and
  2. runs on `stable` since `cargo-semver-checks` do not support `nightly` (rustdocs JSON format breaks almost daily)

  Closes #2999.

ACKs for top commit:
  Kixunil:
    ACK 9933fa0dd5
  tcharding:
    ACK 9933fa0dd5

Tree-SHA512: c5251cec7c7189e7ef16a657ef35723b2c3e8fa7262c452fc83828dc16215107259d445f911916ec0716ea6e20ce59d0910b9a4fa004f150322fd4fcd00d15c5
2024-07-11 17:02:43 +00:00
merge-script fec8ec3661
Merge rust-bitcoin/rust-bitcoin#3002: Optimize base58 on small inputs
d05723c401 Optimize base58 on small inputs (Martin Habovstiak)

Pull request description:

  Most base58 strings in Bitcoin are somewhat short. There was previously an "optimization" putting part of the input on stack which was removed in #2759 because it actually made the code slower. This appears to be mostly because of branches caused by using `iter::Chain`.

  Manually splitting the iterations into two helped bring the performance close to what #2759 achieved but that still wasn't worth it. But given that we know the input length in many cases (it's just a slice) we can determine whether it'll fit a buffer upfront and then just call different functions which don't have the branches in loops. To avoid having two functions this uses generics instead. Further, we increase the buffer length to 128 and use `ArrayVec` from `internals` which internally avoids initializing the buffer thanks to `MaybeUninit`

  In total this increases performance by around 4% on my machine.

ACKs for top commit:
  tcharding:
    ACK d05723c401
  apoelstra:
    ACK d05723c401

Tree-SHA512: a12fa15ef2b58282a69545685dbbe027d4e73a285651a9fe05de5a039a11c5da2fc1000eb369801e77584cd403bb0e972f5f01bcab0d1e62624f054992b8b83d
2024-07-11 16:22:43 +00:00
Martin Habovstiak d05723c401 Optimize base58 on small inputs
Most base58 strings in Bitcoin are somewhat short. There was previously
an "optimization" putting part of the input on stack which was removed
in #2759 because it actually made the code slower. This appears to be
mostly because of branches caused by using `iter::Chain`.

Manually splitting the iterations into two helped bring the performance
close to what #2759 achieved but that still wasn't worth it. But given
that we know the input length in many cases (it's just a slice) we can
determine whether it'll fit a buffer upfront and then just call
different functions which don't have the branches in loops. To avoid
having two functions this uses generics instead. Further, we increase
the buffer length to 128 and use `ArrayVec` from `internals` which
internally avoids initializing the buffer thanks to `MaybeUninit`

In total this increases performance by around 4% on my machine.
2024-07-11 06:40:47 +02:00
merge-script 93f950ba5f
Merge rust-bitcoin/rust-bitcoin#3008: Automated daily update to rustc (to nightly-2024-07-10)
1324ae88ee Automated update to Github CI to rustc nightly-2024-07-10 (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 1324ae88ee

Tree-SHA512: 8689a061a578f6f435d4e3f885d6b952b8d7d0c618928ba5b7f7a92ad2311f2799251f72ab3b2170f97ae390605f2b6b29b1249c70b7e53933006be23b3ae6cf
2024-07-11 11:55:12 +10:00
Update Nightly Rustc Bot 1324ae88ee Automated update to Github CI to rustc nightly-2024-07-10 2024-07-11 01:33:04 +00:00
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
Tobin C. Harding 40bee24de7
Run the formatter
I don't want to wait for the bot, just run the formatter now.

No manual changes.
2024-07-11 11:21:53 +10:00
Tobin C. Harding dc96475f58
Add/fix alloc features
Eventually we would like all our crates other than `bitcoin` to be able
to be used without an allocator. Currently, and during crate smashing,
this is not that useful because so much of the code comes from `bitcoin`
and relies on the availability of an allocator.

As an initial step, add the `alloc` feature to `addresses` , `base58`,
and `primitives`.

In order to to keep `--no-default-features` builds working make the
crates empty if the `alloc` feature is not enabled. This is a suboptimal
solution because the error messages users will get when they forget to
enable `alloc` will be confusing (eg something like primitives does not
contain Transaction). However our CI script (`run_task.sh`) expects
`--no-default-features` to build cleanly (as do I).
2024-07-11 10:14:50 +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
Jose Storopoli 9933fa0dd5
contributing: fix instructions for the semver CI 2024-07-10 13:02:38 -03:00
Jose Storopoli 213566f34b
ci: semver-checks should run on rust stable 2024-07-10 16:02:24 +00:00