Commit Graph

1473 Commits

Author SHA1 Message Date
merge-script 2dac88b416
Merge rust-bitcoin/rust-bitcoin#3126: Remove catch all pattern
6836de9ee6 Remove catch all pattern (Tobin C. Harding)

Pull request description:

  The `PushBytes` type enforces len is less than 0x100000000 so we do not need to panic in a catch all pattern after explicitly matching against less than 0x100000000.

  Refactor only because of the invariant on `PushBytes` - no logic changes.

ACKs for top commit:
  apoelstra:
    ACK 6836de9ee6 successfully ran local tests
  Kixunil:
    ACK 6836de9ee6

Tree-SHA512: a7cdb31683a8c00eecbdd0879886bec48133f9029f899b5279f1f5294ef40320592db196bfcafdeef4507636fc785a7ab87879b25b6d1b4905ae573b545f1ff4
2024-08-06 13:06:20 +00:00
Tobin C. Harding 6836de9ee6
Remove catch all pattern
The `PushBytes` type enforces len is less than 0x100000000 so we do
not need to panic in a catch all pattern after explicitly matching
against less than 0x100000000.

Refactor only because of the invariant on `PushBytes` - no logic
changes.
2024-08-06 10:23:47 +10:00
merge-script 5cca2f271d
Merge rust-bitcoin/rust-bitcoin#3122: Introduce helper function name policy
84df3438ca Fix markdown list items (Tobin C. Harding)
0a45c68cf8 Introduce helper function name policy (Tobin C. Harding)

Pull request description:

  As much as it hurts the C hacker inside me we have settled on using `_internal` to mark private function names that clash with a public function of the same name.

  Introduce a policy section and rename one instance, I did not grep the codebase looking for other violations.

  This came up because I had to look at what `_inner` implied when reading the function name somewhere else.

ACKs for top commit:
  storopoli:
    ACK 84df3438ca
  apoelstra:
    ACK 84df3438ca successfully ran local tests; sgtm. should probably update rust-miniscript which uses a `real_` prefix

Tree-SHA512: aece73fac54c4f34bdba72c08721586eb6d76dc9191442bbca43301f2af3d3b3e3217383f1ad20752fa7654e7f5d09927d1a4b72602aa064e76d550b5d6e81bd
2024-08-05 23:11:05 +00:00
Tobin C. Harding 0a45c68cf8
Introduce helper function name policy
As much as it hurts the C hacker inside me we have settled on using
`_internal` to mark private function names that clash with a public
function of the same name.

Introduce a policy section and rename one instance, I did not grep the
codebase looking for other violations.

This came up because I had to look at what `_inner` implied when reading
the function name somewhere else.
2024-08-06 04:17:28 +10:00
Tobin C. Harding ea9f6e8f97
Cast after calling min
In an effort to reduce the cognitive load of reading code we are
removing casts unless they are useful or obvious.

Move the cast onto the call to `min` and comment it for good measure.
This allows us to call infallible `from` for conversion when needed.

Refactor only, no logic changes.
2024-08-05 07:59:35 +10:00
Tobin C. Harding 342fe18ad0
Use From in map_to_range
In an effort to remove unnecessary casts use `u128::from` to convert
from `u64`s. Leave the cast to `u64` in there because it is right after
a shift right and is brain-dead obvious.
2024-08-05 07:59:35 +10:00
Tobin C. Harding d9331794f1
bip158: Fix typo 2024-08-05 07:59:35 +10:00
Tobin C. Harding 298b96c579
Add an extension trait for script validation
Add an extension trait for the validation logic in preparation for
moving the `Script` type to `primitives`.
2024-07-29 07:48:07 -05:00
Tobin C. Harding c1aa33ed89
Use impl syntax instead of generic
A single trait bound can be expressed using the `impl` style. This is a
breaking change because callers can no longer use turbofish. In this
case that probably does not matter because users are likely just passing
an integer in and letting the compiler infer the type.

Done in preparation for moving logic into an extension trait so that the
functions can be parsed by the `define_extension_trait` macro.

ref: https://doc.rust-lang.org/reference/types/impl-trait.html
2024-07-29 07:43:50 -05:00
merge-script 15b87606bf
Merge rust-bitcoin/rust-bitcoin#3100: Bump MSRV to 1.63
c72069e921 Bump MSRV to 1.63 (Martin Habovstiak)

Pull request description:

  The version 1.63 satisfies our requirements for MSRV and provides significant benefits so this commit bumps it. This commit also starts using some advantages of the new MSRV, namely namespaced features, weak dependencies and the ability to use trait bounds in `const` context.

  This however does not yet migrade the `rand-std` feature because that requires a release of `secp256k1` with the same kind of change - bumping MSRV to 1.63 and removing `rand-std` in favor of weak dependency. (Accompanying PR to secp256k1: https://github.com/rust-bitcoin/rust-secp256k1/pull/709 )

  Suggested plan:

  * merge both PRs
  * at some point release `hashes` and `secp256k`
  * remove `rand-std` from `bitcoin`
  * release the rest of the crates

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

Tree-SHA512: 0b301ef8145f01967318d3ed1c738d33e6cf9e44f835f3762122b460a536f926916dbd6ea39d6f80b4f95402cd845e924401e75427dbb0731ca5b12b4fa6915e
2024-07-28 21:11:28 +00:00
Fmt Bot 08fc780033 2024-07-28 automated rustfmt nightly 2024-07-28 01:12:04 +00:00
merge-script 5f79ff0966
Merge rust-bitcoin/rust-bitcoin#3098: Make `ScriptBuf::p2wpkh_script_code` stand alone
feef34fdea Make ScriptBuf::p2wpkh_script_code stand alone (Tobin C. Harding)

Pull request description:

  We would like to move the `Script` type to `primitives` without moving any key stuff, including pubkey hashes. We may later, before releasing `primitives`, move the `WPubkeyHash` at which time this patch can be reverted or re-implemented on `ScriptBuf`.

  The `ScriptBuf::p2wpkh_script_code` function does not take `self` as a parameter but it does return `Self` - this can trivially be made into a standalone function.

  Make `ScriptBuf::p2wpkh_script_code` a standalone function.

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

Tree-SHA512: 9de43bb274480b85d328ddd4cb6d79b501a525837307ca399dea1c3d39e9a7c0d8719dbb0e5d852629351d2b1fe09ce0244df82c53ff9ef2342be85a71887329
2024-07-27 21:08:34 +00:00
Martin Habovstiak c72069e921 Bump MSRV to 1.63
The version 1.63 satisfies our requirements for MSRV and provides
significant benefits so this commit bumps it. This commit also starts
using some advantages of the new MSRV, namely namespaced features, weak
dependencies and the ability to use trait bounds in `const` context.

This however does not yet migrade the `rand-std` feature because that
requires a release of `secp256k1` with the same kind of change - bumping
MSRV to 1.63 and removing `rand-std` in favor of weak dependency.
2024-07-27 07:24:32 +02:00
merge-script d5149c1f54
Merge rust-bitcoin/rust-bitcoin#3065: Move `validation` module to `consensus_validation`
29b213daca Move validation module to consensus_validation (Tobin C. Harding)

Pull request description:

  The `consensus` module is currently doing two things, validation and encoding. These two things are orthogonal.

  Move the `consensus::validation` module to `consensus_validation`. Remove the function re-exports from `consensus`.

  This was originally discussed here: https://github.com/rust-bitcoin/rust-bitcoin/issues/2779

ACKs for top commit:
  Kixunil:
    ACK 29b213daca
  apoelstra:
    ACK 29b213daca

Tree-SHA512: 3bd0e43c220b0d89a47e9df0e0c92b776ccc65f5f60d57f413db834acc8e86269379bc9fdd688f8c4f0138db22f8eb8983770afa2d7d53d51acf063f2302121c
2024-07-26 11:26:36 +00:00
Tobin C. Harding feef34fdea
Make ScriptBuf::p2wpkh_script_code stand alone
We would like to move the `Script` type to `primitives` without moving
any key stuff, including pubkey hashes. We may later, before releasing
`primitives`, move the `WPubkeyHash` at which time this patch can be
reverted or re-implemented on `ScriptBuf`.

The `ScriptBuf::p2wpkh_script_code` function does not take `self` as a
parameter but it does return `Self` - this can trivially be made into a
standalone function.

Make `ScriptBuf::p2wpkh_script_code` a standalone function.
2024-07-23 11:24:31 -05:00
merge-script 1b83763cdc
Merge rust-bitcoin/rust-bitcoin#3083: Fix rustdocs in `blockdata`
3b15ef6d27 Fix rustdocs in `blockdata` (Jamil Lambert, PhD)

Pull request description:

  Following up on the [comment](https://github.com/rust-bitcoin/rust-bitcoin/pull/2646#discussion_r1548848611) in #2646 the rustdocs formatting was fixed in `blockdata`.

ACKs for top commit:
  Kixunil:
    ACK 3b15ef6d27
  tcharding:
    ACK 3b15ef6d27

Tree-SHA512: 509aa2b8ae559f5a7f8230c016c0866f468cc147773238e226b9a975784d7a424c41a5d966ddcf9b3f8f8d4fe197a4f272b5777c61f3cc53051803abb520b95e
2024-07-23 13:29:27 +00:00
Fmt Bot 61d46fffa8 2024-07-21 automated rustfmt nightly 2024-07-21 01:11:38 +00:00
merge-script e1478b1802
Merge rust-bitcoin/rust-bitcoin#3069: Remove re-export of `ParseIntError`
ab581a90f8 Remove re-export of ParseIntError (Tobin C. Harding)

Pull request description:

  In d242125 I claimed that `ParseIntError` was somehow special, I no longer thing this is the case. As we pin down the re-export policy (for errors and other types) it is hard if we have one non-typical re-export.

  We have https://github.com/rust-bitcoin/rust-bitcoin/issues/3068 to discuss the policy, for now just remove the unusual re-export.

ACKs for top commit:
  Kixunil:
    ACK ab581a90f8
  shinghim:
    ACK ab581a90f8
  apoelstra:
    ACK ab581a90f8

Tree-SHA512: 5ac4123aeb27c8cee78e5760f21e70be8035d526ba7e14e72759cba27f98b51cc2cba9b2bf0eeb99e0f6b7210ec4a750986bb6c5dc0725ed892730fdec8a7e06
2024-07-19 15:36:21 +00:00
merge-script ff5d437d42
Merge rust-bitcoin/rust-bitcoin#3067: Move `params` to the `network` module
54c30556a2 Move params to network module (Tobin C. Harding)
045a661ebe Create network directory (Tobin C. Harding)

Pull request description:

  Discussed in #2779. Patch one moves `network.rs` to `network/mod.rs`, and patch 2 moves the `params` module over there.

ACKs for top commit:
  apoelstra:
    ACK 54c30556a2 Yeah, this seems like a good place for it
  Kixunil:
    ACK 54c30556a2

Tree-SHA512: 134813419db21323d303d465b12fcbf37fd61dc1baf3305e156d324eafd822379e63dede02877ee99dce41540193a29e6e13acd13f9121f3e2fe11096524aa5e
2024-07-19 14:10:26 +00:00
Tobin C. Harding 29b213daca
Move validation module to consensus_validation
The `consensus` module is currently doing two things, validation and
encoding. These two things are orthogonal.

Move the `consensus::validation` module to `consensus_validation`.

Remove the function re-exports from `consensus`.
2024-07-19 14:28:31 +10:00
merge-script 128684e0da
Merge rust-bitcoin/rust-bitcoin#3058: Improve `define_extension_trait`
386ad93253 Manually format function parameters (Tobin C. Harding)
871f4398b9 Add optional comma to function parameter list (Tobin C. Harding)

Pull request description:

  During #2955 I was lazy and did not think through why the macro didn't handle function parameters on individual lines, I just manually re-formatted all function calls onto a single LOC. This was a bit slack of me.

  - Patch 1: Fix the macro.
  - Patch 2: Revert the manual formatting.

ACKs for top commit:
  jamillambert:
    ACK 386ad93253
  Kixunil:
    ACK 386ad93253
  apoelstra:
    ACK 386ad93253

Tree-SHA512: 577154668a4cd0bad225a5b306193a5cd3d38d275dd5df22b4a29737e0d2c910c695da33c0ed77265f6c5d876c162316e444f8eca80f9c30788d110d989493e3
2024-07-18 21:48:19 +00:00
merge-script 8804fa63b4
Merge rust-bitcoin/rust-bitcoin#3064: Remove public error re-export
beea3c1e5d Remove public error re-export (Tobin C. Harding)

Pull request description:

  We do not have a policy to re-export things from other modules just because they are in the public API - I don't see any other reason to re-export this error, users should go to the `validation` module directly to get the error type.

  Raising this trivial change as a separate PR so that we can really pin down our re-export policy. Please review the policy implications as well as the code change.

  Note please that this change was introduced in 7d695f6b4 by me, and buried in a PR that did not mention the change. This was wrong, as in the code change was wrong and also the patching method was wrong.

ACKs for top commit:
  Kixunil:
    ACK beea3c1e5d

Tree-SHA512: 5fc072f3fb8a727f30751211c6bc85dc268d413ee62937c714bdf9f47405dfdbc93cfff3df76c201493c39f49d5d315907fc9e7e4fa0d927652c01038815fdc5
2024-07-18 15:48:47 +00:00
Jamil Lambert, PhD 3b15ef6d27 Fix rustdocs in `blockdata`
Following up on the comment in #2646 the rustdocs formatting was fixed.
2024-07-18 11:04:35 +01:00
Tobin C. Harding ab581a90f8
Remove re-export of ParseIntError
In d242125 I claimed that `ParseIntError` was somehow special, I no
longer thing this is the case. As we pin down the re-export policy (for
errors and other types) it is hard if we have one non-typical re-export.

We have https://github.com/rust-bitcoin/rust-bitcoin/issues/3068 to
discuss the policy, for now just remove the unusual re-export.
2024-07-17 08:01:32 +10:00
Tobin C. Harding 54c30556a2
Move params to network module
The `Params` struct is currently defined in the `consensus` module which
has become a collection of orthogonal consensus-ish things. We would
like to put things in more descriptive places.

The `Params` struct defines constants that are network specific so it
makes sense to put it in the `network` module. As soft proof of this
argument note in this patch how often the `Params` type is imported
along with the `Network` type.

API break:

The type is no longer available at `bitcoin::consensus::Params` but
rather is re-exported at `bitcoin::network::Params`.
2024-07-17 07:39:34 +10:00
Tobin C. Harding 045a661ebe
Create network directory
In preparation for moving the `Params` struct to the `network` module
add a directory and move `network.rs` to `network/mod.rs`.
2024-07-17 07:19:27 +10:00
Tobin C. Harding beea3c1e5d
Remove public error re-export
We do not have a policy to re-export things from other modules just
because they are in the public API - I don't see any other reason to
re-export this error, users should go to the `validation` module
directly to get the error type.
2024-07-17 06:52:15 +10:00
Tobin C. Harding 386ad93253
Manually format function parameters
Now that the `define_extension_trait` can handle function parameters on
individual lines revert the manual formatting that was introduced in
PR #2955.

Refactor only, no logic changes.
2024-07-17 06:15:37 +10:00
Tobin C. Harding 871f4398b9
Add optional comma to function parameter list
The `define_extension_trait` macro currently does not allow for a
trailing comma in the function paramater list, this occurs when the
function paramaters are put on individual lines (eg by `rustfmt`).

Extend the macro to support function paramaters being on individual
lines. This should have been done originally instead of my manual
override of formatting - bad Tobin no biscuit.
2024-07-17 06:15:32 +10:00
merge-script 8eb5d8fad0
Merge rust-bitcoin/rust-bitcoin#3019: Fix error messages
2169b75bba Use lower case error messages (Jamil Lambert, PhD)

Pull request description:

  Error messages should be lower case, except for proper nouns and variable names.  These have all been changed.

  ~~They should also state what went wrong.  Some expect error messages were positive, giving the correct behaviour or correct input.  These have been changed so that they are now negative, i.e. saying what went wrong.~~

  EDIT: After further discussion it was decided not to change the expect messages.

ACKs for top commit:
  Kixunil:
    ACK 2169b75bba
  tcharding:
    ACK 2169b75bba

Tree-SHA512: 92442c869e0141532425f6fca5195fd319b65026f68c4230a65ad70253565d98931b2b44ee202975c307280525c505147e272297dc81207312e40c43d007021c
2024-07-16 15:30:26 +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
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
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 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
Fmt Bot d57ca72ed0 2024-07-14 automated rustfmt nightly 2024-07-14 01:11:56 +00: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
Shing Him Ng 164b72e07b Update Key documentation 2024-07-12 15:59:01 -05: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 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
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 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