Commit Graph

59 Commits

Author SHA1 Message Date
Tobin C. Harding 3ed4acdd43
api: Run just check-api 2024-12-16 09:29:54 +11:00
Tobin C. Harding f412f2b149
api: Run just check-api 2024-12-15 09:17:05 +11:00
Tobin C. Harding 6e01383f16
api: Run just check-api 2024-12-12 16:28:49 +11:00
Tobin C. Harding 601a47fb40
Add new api text file changes
In a recent PR (#3682) we introduced api text files. Then in another
PR (#3711) we removed `alloc` feature gating. Possibly due to the
timing of running through CI and merging these two PRs managed to get
merged without an update to the API text files.

As would be expected; removing the `alloc` feature gate adds a bunch of
new lines to the `no-features` api text file.
2024-12-11 08:56:59 +11:00
Tobin C. Harding 219ecd5498
Add api text files
We are about to introduce a script that generates text files for the
public API surface of various crates.

Run the soon-to-be-introduced script and commit the changes. Covers:

- `hashes`
- `io`
- `primitives`
- `units`

The script and CI setup will be done in the next patch, this is just to
make review easier.
2024-12-06 15:20:52 +11: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
Ryan Breen 15f6bacec9 api: Run just check-api 2024-07-02 09:06:36 -04:00
merge-script 35202ba51b
Merge rust-bitcoin/rust-bitcoin#2932: Remove `bech32` dependency from `blockdata`
010141ecc9 api: Run just check-api (Tobin C. Harding)
cf800a1b07 Remove bech32 dependency from blockdata (Tobin C. Harding)

Pull request description:

  We have a single usage of the `bech32` crate inside the `blockdata` module, to convert a `WitnessVersion` to a `Fe32`. We then have a single call site where we use the conversion in the `address` module.

  This code was written without thinking to hard about the introduced dependency on `bech32`, in hindsite it shouldn't have been added.

  In preparation for splitting a bunch of code in `blockdata` out into the `primitives` crate remove the `bech32` stuff from the `witness_version` module.

ACKs for top commit:
  Kixunil:
    ACK 010141ecc9
  apoelstra:
    ACK 010141ecc9

Tree-SHA512: 2d368ebf64ab7197b421e0dec48623f3fb03243081a988ff9ed2070135c8741efe24520c2aab496d54c52595808f10ee39816eaab8e3e4a7e64955cd25285670
2024-06-29 12:51:45 +00:00
merge-script ae90d1930b
Merge rust-bitcoin/rust-bitcoin#2909: bip32: add From<&'a [u32]> for DerivationPath
a7731b2f33 api: Run just check-api (Marko Bencun)
47cba7a655 bip32: add from_32_slice method to DerivationPath (Marko Bencun)

Pull request description:

  ChildNumber already has a `From<u32>` impl, but converting `&[u32]` to a `DerivationPath` was still difficult.

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

Tree-SHA512: 2db94ee035e686102b8201f637422bb96bd79858aeffdb007594d722902d31a20f27e61b88fae8c854c80f785d9e7837b0158a046639ff8cc2d20d8883391842
2024-06-29 00:23:45 +00:00
merge-script 7ca7128b19
Merge rust-bitcoin/rust-bitcoin#2899: Pass sigs and associated types by value
dc10a49876 api: Run just check-api (Tobin C. Harding)
5e8f204581 Pass sigs and associated types by value (Tobin C. Harding)

Pull request description:

  We should pass `Copy` types by value not by reference.

  Currently this is not done in secp, but lets do it here in bitcoin.

  Pass by value:

  - `SerializedSignature`
  - bitcoin sigs
  - secp sigs
  - secp `Message`

  This is a continuation of the work to split up #2404 into manageable PRs.

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

Tree-SHA512: 8736eba067c74edb951c92357f5b3d0fc99c4fa6dc3beea579c10b3150873b74e8ec46c2c01f18818b37fca6e77c6b6edddeb6340edde6a9d8c28a4e69164c8c
2024-06-28 23:48:03 +00:00
merge-script 6e1fe5e1c1
Merge rust-bitcoin/rust-bitcoin#2886: taproot: Split errors up
6a7f780018 api: Run just check-api (Tobin C. Harding)
0c9223ac05 Manually format write_err statement (Tobin C. Harding)
43d7c750cc taproot: Add error types (Tobin C. Harding)
afe41c8a39 taproot: Split errors up (Tobin C. Harding)

Pull request description:

  Currently there are a couple of errors in the `taproot` module that are too general, resulting in functions that return a general error type when a specific one would do.

  Split two errors out and use them for for enum variants and function returns as possible.

  Done as part of #2883

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

Tree-SHA512: bf5ed50dd8f913280d007f03124c7918c4b6cd642e67726bc3ffff23d9897f764a4391e167115668c3a1e951197485eba280fdbb8a0ce1bb7efb051388d13997
2024-06-28 19:50:37 +00:00
Tobin C. Harding 010141ecc9
api: Run just check-api 2024-06-28 08:31:08 +10:00
merge-script 326a6dce55
Merge rust-bitcoin/rust-bitcoin#2895: Re-export UnprefixedHexError in the bitcoin crate root
10440b36a2 api: Run just check-api (Shing Him Ng)
452a7cc091 Re-export public functions, enums, and structs from units::parse in the bitcoin crate root (Shing Him Ng)

Pull request description:

  Re-export UnprefixedHexError in the bitcoin crate root

  Fixes #2874

ACKs for top commit:
  tcharding:
    ACK 10440b36a2

Tree-SHA512: 78a0676aa6d6fe63d810eeeebd3bf053d679d966d0aebf752760bfb440b2d4e831b0ff6b54b0306b390126b3f96a70c0846b4a1ec20aca96994d4a7b75e438e3
2024-06-27 20:00:10 +00:00
Marko Bencun a7731b2f33
api: Run just check-api 2024-06-27 15:27:58 +02:00
Tobin C. Harding 6a7f780018
api: Run just check-api 2024-06-27 08:31:45 +10:00
Shing Him Ng 10440b36a2 api: Run just check-api 2024-06-26 12:47:27 -05:00
merge-script 636e4ed8d4
Merge rust-bitcoin/rust-bitcoin#2904: hashes: Add type alias'
872ba938cc api: Run just check-api (Tobin C. Harding)
264d080054 hashes: Add hash type alias' (Tobin C. Harding)
d2632d3d8a hashes: Re-export Hkdf (Tobin C. Harding)

Pull request description:

  In an effort to make the `hashes` crate more ergonomic to use add a bunch of type alias' to the crate root.

  We intentionally do not rename the `foo::Hash` types so that uses have a choice of either using the module path to differentiate or to use the alias.

  Update the crate level docs to use the alias' because they are more terse with no loss of clarity.

ACKs for top commit:
  Kixunil:
    ACK 872ba938cc

Tree-SHA512: 3635a72e0b9a1d05e49e83ba24bed80c87b8f5fa0b3260e8dd5a5fc130b6cc22e041e2b1798cd04d78c759f3c6e839c754c63afd9b7c3d5de5319a8abc8f5b12
2024-06-26 16:40:50 +00:00
merge-script 9a94166aee
Merge rust-bitcoin/rust-bitcoin#2870: Remove `Denomination::MilliSatoshi`
362c3b8772 api: Run just check-api (Jamil Lambert, PhD)
9ea8c58ad6 Fix case sensitivity of denomination (Jamil Lambert, PhD)
67569ca632 Remove denominations < 1 satoshi (Jamil Lambert, PhD)

Pull request description:

  The denomination `MilliSatoshi` has been removed from `Amount`.

  `NanoBitcoin` and `PicoBitcoin` have also been removed since they are also less than 1 satoshi and the same reason for removing milliSatoshi in Issue #2820 should apply to them.

  The second patch fixes the way the denominations with various combinations of upper and lower case are handled when converted from a string.

  Close: #2820

ACKs for top commit:
  Kixunil:
    ACK 362c3b8772
  tcharding:
    ACK 362c3b8772

Tree-SHA512: d2dc23366023dae66705352822fbd25b90567971cbe0139ab6937b4dc419a1fd4681af1380232f39cd7844422e069d7861274eb2fd9bfe6730798271f1b50349
2024-06-26 13:51:17 +00:00
Tobin C. Harding 872ba938cc
api: Run just check-api 2024-06-26 15:06:48 +10:00
Andrew Poelstra 40d1335f08
Merge rust-bitcoin/rust-bitcoin#2897: psbt: implement `const` for `PsbtSighashType::ALL`
2bde5d002e api: Run just check-api (Jose Storopoli)
d1f84329e4 psbt: implement const for PsbtSighashType::ALL (Jose Storopoli)

Pull request description:

  Closes #2751.

  I only did the `ALL` which is by far the most common case.

ACKs for top commit:
  tcharding:
    ACK 2bde5d002e
  apoelstra:
    ACK 2bde5d002e

Tree-SHA512: 693575de758657a3e172d86ba5114ec0bf3b12b82df598e38c6a7916c99c20cfb5c4e74442108b51ae4e7bb1f1e940fd4a7269145e3f9838f727675c7711c890
2024-06-25 17:33:06 +00:00
Jamil Lambert, PhD 362c3b8772 api: Run just check-api 2024-06-25 09:39:39 +01:00
Andrew Poelstra 8bd5c64433
api changes for "drop GeneralHash from wrapped hash types"
There are a few green lines for the Tap*Hash types, which are tagged
hashes, and whose engine/from_engine impls are replaced. The rest is
red, for the other hashtypes where these methods are just dropped.

A later PR will also drop the methods for the Tap*Hash types but that
seemed different enough from the rest to warrant its own PR.
2024-06-24 14:00:57 +00:00
Andrew Poelstra 46dad847f2
api changes for split between Hash/GeneralHash 2024-06-24 13:51:09 +00:00
Jose Storopoli 2bde5d002e
api: Run just check-api 2024-06-24 08:55:05 +00:00
Andrew Poelstra b904de375a
Merge rust-bitcoin/rust-bitcoin#2877: hashes: remove `all_zeros` and constify constructors
4652ce20ed API changes for "delete `all_zeros`" (Andrew Poelstra)
8869f35a69 hashes: drop the `all_zeros` method on arbitrary hashes (Andrew Poelstra)
9f8797f486 API changes for constification of hash constructors (Andrew Poelstra)
154e91af8c hashes: constify a bunch of constructors (Andrew Poelstra)
c155cbf8b2 hashes: use workaround to get constfns on tagged hashes with MSRV (Andrew Poelstra)

Pull request description:

  I think these changes are both uncontroversial but they have fairly large diffs so I am PRing them together before making more invasive changes.

ACKs for top commit:
  tcharding:
    ACK 4652ce20ed

Tree-SHA512: 4560fa397deab50448598894b9364f9d8f8b48169901a84db6a44168cdba795ab69b48ad2cac61caebcee5e227a03271335b405cf5514265290a4d1f2fdf52a2
2024-06-24 04:15:47 +00:00
Tobin C. Harding dc10a49876
api: Run just check-api 2024-06-24 11:00:02 +10:00
Andrew Poelstra 09740853a9
Merge rust-bitcoin/rust-bitcoin#2887: Remove `InvalidInternalKey` variant from `TaprootBuilderError`
72655607b6 api: Run just check-api (Tobin C. Harding)
e8250cd96a Remove InvalidInternalKey variant from TaprootBuilderError (Tobin C. Harding)

Pull request description:

  This variant is unused, remove it.

  Done as part of #2883.

ACKs for top commit:
  Kixunil:
    ACK 72655607b6
  apoelstra:
    ACK 72655607b6

Tree-SHA512: 5cd27cacebcf078afdf1ceba4e3d51e78f20ee4883000b766efb7a246fd7a166240038a2e7d27249a22049c3258673a393ff2fd62cb4b27a2cade04b28ef2ac9
2024-06-23 00:18:01 +00:00
Andrew Poelstra ed514b422d
Merge rust-bitcoin/rust-bitcoin#2880: Pass hash types by value
433fd6bf7e api: Run just check-api (Tobin C. Harding)
8fd583b069 Pass hash types by value (Tobin C. Harding)

Pull request description:

  We should pass `Copy` types by value not by reference. Pass the hash types by value.

  Second step in the pass-copy-types-by-value work, pulled out of #2404.

ACKs for top commit:
  apoelstra:
    ACK 433fd6bf7e
  Kixunil:
    ACK 433fd6bf7e

Tree-SHA512: 999d12f60550cacc4ae19b4cbf505b25c1eed803820f22b1a706e9f95da1b7e7b422f393f4115d579927c0c476cd504036a39b3cdc06a1d6befbcff5513f7433
2024-06-22 19:42:24 +00:00
Andrew Poelstra 4652ce20ed
API changes for "delete `all_zeros`"
This is the kind of diff that is nicer to read than the source code.
2024-06-22 15:09:52 +00:00
Andrew Poelstra 9f8797f486
API changes for constification of hash constructors
This is a noisy diff and probably can just be ignored vs reading the
source diff in the previous commit.
2024-06-22 15:08:15 +00:00
Andrew Poelstra c155cbf8b2
hashes: use workaround to get constfns on tagged hashes with MSRV
As you can see from the - lines in the API diff, there is no reduction
in API surface (we just remove the T:Tag bound from the sha256t::Tag
type, which is not strictly necessary but maybe we would prefer to keep).
2024-06-22 15:08:15 +00:00
Divyansh Gupta 39df0a9fbe update api 2024-06-20 10:19:22 +05:30
Tobin C. Harding 72655607b6
api: Run just check-api 2024-06-20 13:05:24 +10:00
Tobin C. Harding 433fd6bf7e
api: Run just check-api 2024-06-20 09:23:45 +10:00
Andrew Poelstra 48ad5e4789
api changes for "rewrite merkle root calculation" 2024-06-18 16:11:37 +00:00
Andrew Poelstra 2bc97b22e2
api changes for new calculate_root method
These changes are nontrivial. They

* Drop the `From` impls from (w)txids to (w)TxMerkleRoots
* Introduce a new trait and bound calculate_root on it...
* ...in such a way that its return value cannot be inferred without
  further hints (though in practice this doesn't matter because usually
  the return value is immediately assigned to something with a known
  type such as a BlockHeader field)
2024-06-17 19:10:26 +00:00
Andrew Poelstra 04353901ba
api changes after moving the hashes
These are pretty noisy but it's just a move.
2024-06-17 19:10:26 +00:00
Tobin C. Harding 6014788a74
api: Run just check-api 2024-06-17 10:32:06 +10:00
Andrew Poelstra 4defdb08fa
Merge rust-bitcoin/rust-bitcoin#2868: Pass keys by value
9f01871c11 api: Run just check-api (Tobin C. Harding)
7929b51640 Pass keys by value (Tobin C. Harding)

Pull request description:

  We should pass `Copy` types by value not by reference. Pass the key types by value.

  This is patch 1 from #2404

ACKs for top commit:
  apoelstra:
    ACK 9f01871c11 this will annoy some people but I think we should do it

Tree-SHA512: 18afab537edf4ade4dc1c1e5992e50060b8935531f1e3cbe1d3b94b2fcb87aafa39947f342e0e762835bda3b4091dd35b3b74ea79f4dbb3b21660ffd21d1f82e
2024-06-14 23:56:46 +00:00
Andrew Poelstra 72ce271b6b
Merge rust-bitcoin/rust-bitcoin#2852: Add inherent functions to hashes
18b2788a5a api: Run just check-api (Tobin C. Harding)
6b7d02e5ae Add inherent functions to hashes (Tobin C. Harding)

Pull request description:

  Currently we have a trait `Hash` that is required for `Hmac`, `Hkdf`, and other use cases. However, it is unegonomic for users who just want to do a simple hash to have to import the trait.

  Add inherent functions to all hash types including those created with the new wrapper type macros.

  This patch introduces some duplicate code but we are trying to make progress in the hashes API re-write. We can come back and de-dublicate later.

  Includes making `to_byte_array`,`from_byte_array`, `as_byte_array`, and `all_zeros` const where easily possible.

ACKs for top commit:
  apoelstra:
    ACK 18b2788a5a

Tree-SHA512: 6b7a8d8a8501e981416d767040e5bd9fa8d1134be2ca133b5c53aa55f65c8456dccb63b642e30d0d571ca838c6f9eaeff6527d92a9b4212819a49ce619c4e093
2024-06-14 16:30:52 +00:00
Tobin C. Harding 9f01871c11
api: Run just check-api 2024-06-14 14:19:07 +10:00
Tobin C. Harding 18b2788a5a
api: Run just check-api 2024-06-14 10:51:01 +10:00
Divyansh Gupta fcf27a62a2 update api 2024-06-12 09:23:53 +05:30
Liu-Cheng Xu ce585dc529 api: Run just check-api 2024-06-07 08:59:38 +08:00
Andrew Poelstra ee68e80315
Merge rust-bitcoin/rust-bitcoin#2535: Move `read_scriptint` to `PushBytes` & create `read_int` function
d6ef16af30 update api (Divyansh Gupta)
a336ec0dda refactor(script): move `read_scriptint` to `PushBytes` & create `read_int` function (Divyansh Gupta)

Pull request description:

  * Moved `read_scriptint` method to `Push_Bytes` struct
  * Created `Instruction::read_int` method which acts as a wrappper around this  function.

  Done as part of #1547

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

Tree-SHA512: e33df8adcb1c23351da303f6bad1ea4a8eae30e65943d230ae886183a01f970aecd0c8c8fd3a6c337cfe6dde1b7590778d88c308415e393f137065ef7da4b29c
2024-06-01 22:38:44 +00:00
Nick Johnson c9d1ff7037 Update hashes API changes 2024-05-30 15:50:51 -07:00
Andrew Poelstra aabaf6f2a3
Merge rust-bitcoin/rust-bitcoin#2815: Add `const` modifier to `Magic::from_bytes`
d2be969a51 Add `const fn Magic::from_bytes` patch for API files (Velnbur)
b7458256af Add `const` modifier to `Magic::from_bytes` (Velnbur)

Pull request description:

  Resolves: rust-bitcoin/rust-bitcoin#2814

ACKs for top commit:
  apoelstra:
    ACK d2be969a51

Tree-SHA512: 4e8f24b665a2919bcf135333be097114d72f473684b14a8fdd4e8d82bf57e89b4166352f75f744105f76eddc9ffabcb07971a669a7c93dfff6928a3fe519a38f
2024-05-30 16:34:53 +00:00
Velnbur d2be969a51
Add `const fn Magic::from_bytes` patch for API files
To reflect changes from b7458256af
2024-05-30 13:23:37 +03:00
Tobin C. Harding eb723740f1
api: Run just check-api 2024-05-30 16:50:02 +10:00
Tobin C. Harding 18d298ab4f
api: Run just check-api
During a bunch of merges the api/ files have gotten out of sync.

Run just check-api, no other changes.
2024-05-30 07:34:29 +10:00