Commit Graph

4451 Commits

Author SHA1 Message Date
merge-script e7af76f1cd
Merge rust-bitcoin/rust-bitcoin#2936: Bump honggfuzz version
43360bdd74 Bump honggfuzz version (yancy)

Pull request description:

  Bump hongfuzz version

ACKs for top commit:
  apoelstra:
    ACK 43360bdd74
  tcharding:
    ACK 43360bdd74

Tree-SHA512: fe0e9e5a54fa2d4205a3d9974c19b86e57bfd5e525cd7f379c3c1b7ed15d37b03e6808a7cbf5c15b35bf69df820bd302fb81b5a8525fd3a09102aef13f3abf0d
2024-07-22 21:57:14 +00:00
Tobin C. Harding c82c052407
Merge rust-bitcoin/rust-bitcoin#3089: Automated daily update to rustc (to nightly-2024-07-21)
dbb5917128 Automated update to Github CI to rustc nightly-2024-07-21 (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 dbb5917128

Tree-SHA512: 6f9a7939ff2eea6d07338cb75e393e319b2d38009dbad35e408bd23534e6240ef8c95a268b2316f7b81045eba7031e4269918a3841fe3353da966605ea752407
2024-07-22 14:26:55 -05:00
merge-script 5d20f2ec4c
Merge rust-bitcoin/rust-bitcoin#3085: Automated nightly rustfmt (2024-07-21)
61d46fffa8 2024-07-21 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 61d46fffa8
  apoelstra:
    ACK 61d46fffa8

Tree-SHA512: 405120e45a94687504796c0cfcfa613eb4b29037a5a10d263dccc22f501a6e8f91ddb832964fc8eac804c3007b73bddbbd41c14356647d14c15a81b5da0c0829
2024-07-22 19:20:03 +00:00
Update Nightly Rustc Bot dbb5917128 Automated update to Github CI to rustc nightly-2024-07-21 2024-07-22 01:36:12 +00:00
Fmt Bot 61d46fffa8 2024-07-21 automated rustfmt nightly 2024-07-21 01:11:38 +00:00
merge-script 84ed27b194
Merge rust-bitcoin/rust-bitcoin#3056: CONTRIBUTING: error/expect messages
0beefda7ea CONTRIBUTING: error/expect messages (Jose Storopoli)

Pull request description:

  - adds an item that all error messages
    should be lower case, except for proper nouns and variable names.
  - adds a section on expect messages,
    following discussion in #3019 and #3053.

  Closes #3053.

ACKs for top commit:
  tcharding:
    ACK 0beefda7ea
  Kixunil:
    ACK 0beefda7ea
  apoelstra:
    ACK 0beefda7ea

Tree-SHA512: b924245e5d18d4f627d4998073422003def789c87502bca121d5db443f5bbe387bfe951664458c9495a6ea0995b6ccf6e28d1784e19dfb876d7eddf3c6209727
2024-07-19 17:07:01 +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 1c3f39e99e
Merge rust-bitcoin/rust-bitcoin#3080: Automated daily update to rustc (to nightly-2024-07-17)
04bcb7950d Automated update to Github CI to rustc nightly-2024-07-17 (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 04bcb7950d

Tree-SHA512: 2b2a02fd5eb5dfcc1e8b1551ef66180d76019655262a5eebeb6e849885db5e37c495cd9d1108ce550b9401c446a5abf2ca30508eb3d1139a807188b668d232ef
2024-07-19 08:06:42 +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
merge-script a28f11c9fb
Merge rust-bitcoin/rust-bitcoin#3062: Add more unit test coverage for relative LockTime
a76c13f675 Add more unit test coverage for relative LockTime (Shing Him Ng)

Pull request description:

  Adding some test cases for `from_seconds_floor` and one more for `from_seconds_ceil`

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

Tree-SHA512: 5d773a30fa56842af21109d232ec3eae7fde7ce38aca93dadccc7bfbf14d5207ea329ef737f847e45ba755fd22e1862c3e78e7e64a8a0babebcb0e27a2bb7a90
2024-07-18 14:21:46 +00:00
Update Nightly Rustc Bot 04bcb7950d Automated update to Github CI to rustc nightly-2024-07-17 2024-07-18 01:25:40 +00:00
Jose Storopoli 0beefda7ea
CONTRIBUTING: error/expect messages
- adds an item that all error messages
  should be lower case, except for proper nouns and variable names.
- adds a section on expect messages,
  following discussion in #3019 and #3053.
2024-07-17 16:07:05 -03: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
merge-script 59c806996c
Merge rust-bitcoin/rust-bitcoin#3028: ci: fix semver-checks master
6ab8f99731 ci: fix semver-checks master (Jose Storopoli)

Pull request description:

  Ok now I think I've nailed this! 🚀
  Closes #3018.

  ## Summary

  This PR fix the permissions by adding a secondary job, `semver-checks-pr-label`, that runs only if the `semver-checks` completes and does not fail, i.e. we have either Semver API breaks.
  This is a secure job according to internal discussions and https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#workflow_run

  ## Implementation notes

  We split the semver checks into the actual check and labeling. This is due to the fact that we were having several permission issues and the original implementation was insecure. Also it is currently failing on several PRs.
  1. `semver-checks.yml`: checks for API semver breaks. Upon finding API semver-checks, it creates a file named `semver-break` that has the PR number inside. If this file is present we upload an artifact representing that the API semver was broken with the PR number.
  2. `semver-checks-pr-label.yml`: runs after the `semver-checks.yml` is completed. It uses `actions/github-script` (in JavaScript) to list the previous workflow artifacts and, if finds that an API semver break is present, adds a corresponding label and a comment to the PR that is inside the file `semver-break`. We sanitize the hell out of the thing to be a number only, both in BASH but also in JavaScript.

  ## How I tested this?

  1. I merged this PR to my `master` branch in my `storopoli/rust-bitcoin` repo.
  2. I've set the following settings in the repo settings to mimic what we have for `rust-bitcoin`:

     ![image](https://github.com/user-attachments/assets/7bea176f-c67c-4c0c-94ba-d7775af9fdb5)

  3. I've made a PR (cherry-picked from Toby) that breaks semver, see https://github.com/storopoli/rust-bitcoin/pull/10. It correctly labelled as `API break` and added a comment to the PR

    ![image](https://github.com/user-attachments/assets/b64fba4f-e78a-4989-b9b6-a5f67b914174)

ACKs for top commit:
  Kixunil:
    ACK 6ab8f99731
  apoelstra:
    ACK 6ab8f99731 thanks for sticking with this\!\!

Tree-SHA512: 27385d6d4a40b5ffc3b95f00ad34010fabe5f1f9442d258b4cb433807bc663fc70b98c7c632048f05929cad073fd81ac6217f72016740b72db7575dac9d3939b
2024-07-16 20:19:06 +00: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
Shing Him Ng a76c13f675 Add more unit test coverage for relative LockTime 2024-07-16 12:19:13 -05:00
merge-script 2cfa570639
Merge rust-bitcoin/rust-bitcoin#3047: Remove unused variable from LockTime example
86f82b487d Remove unused variable from LockTime example (Shing Him Ng)

Pull request description:

  Following up on [a comment](https://github.com/rust-bitcoin/rust-bitcoin/pull/3026#discussion_r1676744486) from #3026 and removing an unused variable from the LockTime example

ACKs for top commit:
  tcharding:
    ACK 86f82b487d
  Kixunil:
    ACK 86f82b487d

Tree-SHA512: 526d42e68297e9670953f7aadfbf624b7bc20f1bf95b3e5ff66a58871967e38eca917d9ee9c385cf40ed7d9a867cb081ef17f2aa3683138f6fc55a74414a83f6
2024-07-16 16:17:50 +00: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 f765deb160
Merge rust-bitcoin/rust-bitcoin#3052: Throw error instead of panic when from_second_ceil input is too large
7874db8fc3 Throw error instead of panic when from_second_ceil input is too large (Shing Him Ng)

Pull request description:

  Update `from_second_ceil` per [comment](https://github.com/rust-bitcoin/rust-bitcoin/issues/3029#issuecomment-2227459248) and add unit tests

  Resolves #3029

ACKs for top commit:
  Kixunil:
    ACK 7874db8fc3
  tcharding:
    ACK 7874db8fc3

Tree-SHA512: 0d60397f867d4536ff00b81441c27ea3dc4bf9e5ecc2fb5afbe50cb3153101df54c2bb5056da1916d83c3e84367f987f5bac07a381b7433a5701a0ea8a587f95
2024-07-16 13:36:23 +00:00
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