Commit Graph

2904 Commits

Author SHA1 Message Date
Steven Roose ed6421c939
address: Add generic serde::Serialize for Address
Otherwise a generic `Address<impl NetworkValidation>` is not
serializable.
2023-04-09 19:02:53 +01:00
Steven Roose 814b9917da
address: Add Sync, Send, Sized and UnPin marker traits on NetworkValidation 2023-04-09 19:02:43 +01:00
Tobin C. Harding 088fa24be8
hashes: Derive traits on the sha512::Hash type
For all the other hash types we use derive, by way of the `hash_type!`
macro, unless I'm missing something we can do the same for
`sha512::Hash`.
2023-04-09 13:36:38 +10:00
Andrew Poelstra e83a2d3422
Merge rust-bitcoin/rust-bitcoin#1742: Use package in manifest and shorten import
fabcde036f Use package in manifest and shorten import (Tobin C. Harding)

Pull request description:

  We can use `package` to rename `bitcoin_hashes` to `hashes` and `bitcoin_internals` to `internals`. This makes imports more terse with no loss of meaning.

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

Tree-SHA512: bc5bff6f7f6bf3b68ba1e0644a83da014081d8c6c9d578c21cb54fdd56a018f68733dd1135d05b590ba193ed9efd12fa9019182c1fed347e604d8548f6ef9103
2023-04-05 14:20:06 +00:00
Andrew Poelstra 8edfc4597b
Merge rust-bitcoin/rust-bitcoin#1765: unsafe address type conversions
29cb34eed7 Refactor Address struct and its methods (Harshil Jani)

Pull request description:

  Closes #1755

  In this PR the `as_unchecked` is added to the Address struct, which returns a reference to the same address but with the type Address<NetworkUnchecked>.  Similarly, the `assume_checked_ref` is added to Address<NetworkUnchecked>, which returns a reference to the same address but with the type Address.

ACKs for top commit:
  tcharding:
    ACK 29cb34eed7
  apoelstra:
    ACK 29cb34eed7

Tree-SHA512: 75ba40883d9fb31026b0e94e8d3fdcf808ff38a4d10f61f99a1e14ddc48358da86bad44cd78563dc67aa5d39382a5493e73c03891317f361f590e39b6257cb84
2023-04-04 17:40:33 +00:00
Tobin C. Harding e223cbe6df
CI: Only run release job for release PRs
Currently we run the release jobs for all PRs, this leads to red CI runs
any time we have unreleased changes in one crate used by another i.e.,
basically days after a release comes out.

Add a `release.sh` script that has more smarts to try and figure out if
the patch series currently ontop of tip of mater contains changes that
imply its a release PR. To do so we check for changes to the version
field in the manifest of each crate.
2023-04-04 12:49:59 +10:00
Andrew Poelstra 350b413e59
Merge rust-bitcoin/rust-bitcoin#1773: Make `sha256t_hash_newtype!` evocative of the output.
91f45a214f Replace hardcoded values with compile-time hashing (Martin Habovstiak)
095b7958dd Make `sha256t_hash_newtype!` evocative of the output. (Martin Habovstiak)

Pull request description:

  The Rust API guidelines state that macros should be evocative of the
  output, which is a sensible recommendation. We already had this for
  `hash_newtype!` macro but didn't for sha256t version.

  This changes the macro to have this syntax:

  ```rust
  sha256t_hash_newtype! {
      // Order of these structs is fixed.
      /// Optional documentation details here. Summary is auto-generated.
      /*pub*/ struct Tag = raw(MIDSTATE_BYTES, LEN);

      /// Documentation here
      #[hash_newtype(forward)] // optional, default is backward
      /*pub*/ struct HashType(/* attributes allowed here */ _);
  }
  ```

  Closes https://github.com/rust-bitcoin/rust-bitcoin/issues/1427

  Depends on #1769

  How do you like the syntax? Is weird `struct Foo = bar(..);` acceptable?

ACKs for top commit:
  tcharding:
    ACK 91f45a214f
  apoelstra:
    ACK 91f45a214f

Tree-SHA512: f6b555b20311a4c1cb097bc296c92459f6fbe16ba102d8c977eb2383dbcae3cc8ffce32e3cb771e7e22197fda26379971aa4feaadc5e2e70d37fa690ae8b8859
2023-04-03 18:21:58 +00:00
Andrew Poelstra 142b4fc431
Merge rust-bitcoin/rust-bitcoin#1771: Use slice patterns
873501a85f Use slice patterns (Martin Habovstiak)

Pull request description:

  Some code looks better with slice patterns. This changes `bip32` to use them.

ACKs for top commit:
  apoelstra:
    ACK 873501a85f
  tcharding:
    ACK 873501a85f

Tree-SHA512: 2e91b21d0f943c04f592112f241444ba3b1b1dad47ea6bea162f62cfbcaf98e383257cad144072b3807aaa0c122dabab638ac10b1cc1f5179727a5f05aac0659
2023-04-03 15:48:35 +00:00
Andrew Poelstra cd9f706cb1
Merge rust-bitcoin/rust-bitcoin#1769: Implement computing SHA256 in const context
42d3ae05be Implement computing SHA256 in const context (Martin Habovstiak)

Pull request description:

  Computing hashes in const fn is useful for esily creating tags for `sha256t`. This adds `const fn` implementation for `sha256::Hash` and the algorithm for computing midstate of tagged hash in `const` context.

  Part of #1427

  I'd like to make sha256t evocative of the output after this which would also do the thing we want to do with #1427 (awkward language to bypass GH automatically closing it...) I'm thinking of this:

  ```rust
  sha256t_newtype_hash! {
  // optional attrs
  /*pub*/ struct TagName = "tag_str"; // weird syntax but I guess OK-ish?

  // optional attrs
  /*pub*/ struct HashName(_); // allowed to elide the type because it's implied; maybe also allow writing it?
  }
  ```

  What do you think? I was also thinking about this alternative:

  ```rust
  sha256t_newtype_hash! {
  // optional attrs
  /*pub*/ struct TagName;

  const TAG: Tag = from_str("tag_str"); // allows for having from_raw([...]) or even from_hex([...])

  // optional attrs
  /*pub*/ struct HashName(_); // allowed to elide the type because it's implied; maybe also allow writing it?
  }
  ```

  Which looks more natural but maybe too much boilerplate? Which one do you like? Any better ideas? Heads up sanket1729

  Also FYI tcharding this is the kind of post-1.48 change I was thinking about. :)

ACKs for top commit:
  apoelstra:
    ACK 42d3ae05be
  tcharding:
    ACK 42d3ae05be

Tree-SHA512: 437f3160e53104fcdf94c6e09ca6722ea2fe1032429b4701e578dded665cb9cab45cc68ee718b8925075c05dff231c0b898dc03949ef57b831666c68e38950a6
2023-04-03 15:10:19 +00:00
Andrew Poelstra f34f308f4b
Merge rust-bitcoin/rust-bitcoin#1774: Update clippy MSRV configuration
8b4280d5ef Update clippy MSRV configuration (Martin Habovstiak)

Pull request description:

  We've upgraded MSRV but didn't update clippy config, so some things that could be improved aren't caught by clippy. This updates the config and fixes the new issues.

  I also `rg '1\.41\.1'`ed for interesting changes and found one additional improvement.

ACKs for top commit:
  apoelstra:
    ACK 8b4280d5ef
  tcharding:
    ACK 8b4280d5ef

Tree-SHA512: 337ca099ca1a4b8b5d230c802bc455a5e0bbc3436066e41577c5b67f8d7fedede6f7a446b208da067ffc2cc2cebcbc187404846c295e9d89798f11dc66d34e34
2023-04-03 13:41:49 +00:00
Harshil Jani 29cb34eed7 Refactor Address struct and its methods
This commit refactors the Address struct and its methods to improve
its functionality and usability.The AddressInner struct now holds
the payload and network, and the PhantomData<V> type is used to track
the network validation state.

Also as_unchecked and assume_checked_red methods are added to allow
conversion between checked and unchecked network validation state.

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
2023-04-03 15:24:45 +05:30
Martin Habovstiak 91f45a214f Replace hardcoded values with compile-time hashing
Previous changes enabled passing the string used as a tag into
`sha256t_hash_newtype!` macro rather than hard-coding midstate. This
commit takes advantage of it and replaces the hard-coded values with
compile-time executed (`const`) hashing.
2023-04-02 17:01:10 +02:00
Martin Habovstiak 095b7958dd Make `sha256t_hash_newtype!` evocative of the output.
The Rust API guidelines state that macros should be evocative of the
output, which is a sensible recommendation. We already had this for
`hash_newtype!` macro but didn't for sha256t version.

This changes the macro to have this syntax:

```rust
sha256t_hash_newtype! {
    // Order of these structs is fixed.
    /// Optional documentation details here. Summary is auto-generated.
    /*pub*/ struct Tag = raw(MIDSTATE_BYTES, LEN);

    /// Documentation here
    #[hash_newtype(forward)] // optional, default is backward
    /*pub*/ struct HashType(/* attributes allowed here */ _);
}
```

Closes #1427
2023-04-02 17:00:52 +02:00
Martin Habovstiak 8b4280d5ef Update clippy MSRV configuration
We've upgraded MSRV but didn't update clippy config, so some things that
could be improved aren't caught by clippy. This updates the config and
fixes the new issues.

I also `rg '1\.41\.1'`ed for interesting changes and found one
additional improvement.
2023-04-02 16:28:10 +02:00
Martin Habovstiak 42d3ae05be Implement computing SHA256 in const context
Computing hashes in const fn is useful for esily creating tags for
`sha256t`. This adds `const fn` implementation for `sha256::Hash` and
the algorithm for computing midstate of tagged hash in `const` context.

Part of #1427
2023-04-02 01:35:12 +02:00
Martin Habovstiak 873501a85f Use slice patterns
Some code looks better with slice patterns. This changes `bip32` to use
them.
2023-04-02 01:08:03 +02:00
Tobin C. Harding c8e38d6a5a
hashes: Implement JsonSchema for sha256t::Hash<T>
The derived implementation of `JsonSchema` recently stopped working as
described here:

https://github.com/rust-bitcoin/rust-bitcoin/pull/1696#issuecomment-1458670415

Implement the suggestion.
2023-03-31 11:09:07 +11:00
Andrew Poelstra c7f970d8dc
Merge rust-bitcoin/rust-bitcoin#1760: Add per crate release notes link
1187e10299 Add per crate release notes link (Tobin C. Harding)

Pull request description:

  In #1759 we fixed the link to the bitcoin changelog, we can go one step further and add links for each of the crates.

ACKs for top commit:
  apoelstra:
    ACK 1187e10299
  Kixunil:
    ACK 1187e10299
  sanket1729:
    ACK 1187e10299

Tree-SHA512: 10c79c2e633c130855b321d7644b639d7f5fde9dbe94ee54005c34f7ac0821bab714d8a09a6480bfc5363cadc05eeb6dc052409b62e744aae130b7955d9d250d
2023-03-30 19:58:55 +00:00
Andrew Poelstra 895db71156
Merge rust-bitcoin/rust-bitcoin#1763: Use doc_auto_cfg
a189942c64 Use doc_auto_cfg (Tobin C. Harding)

Pull request description:

  If we use `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` instead of `#![cfg_attr(docsrs, feature(doc_cfg))]` we no longer need to manually mark types with `#[cfg_attr(docsrs, doc(cfg(feature = "std")))]`.

  Sweeeeeet.

  Props to pezcore for the lesson :)

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

Tree-SHA512: 1ced1e09f5d1733b362b83ca650d3f52c89eb57e78e8437f74c496d89776548f8c50feab6750352342e2abe680434681de2c126ce36a81dda21397b9695d4d4e
2023-03-30 16:56:49 +00:00
Tobin C. Harding 1187e10299
Add per crate release notes link
We moved to a workspace and did not update the README to point to the
respective changelogs.
2023-03-30 09:33:44 +11:00
Andrew Poelstra 0c48c6b009
Merge rust-bitcoin/rust-bitcoin#1761: Feature (hashes): Add from_bytes_ref and from_bytes_mut to all Hash types
91863c8a78 Feature (hashes): Add from_bytes_ref and from_bytes_mut to all Hash types (junderw)

Pull request description:

  Closes #1756

  I added tests to one of the Hash types, let me know if this seems reasonable as a test and I'll add it for all the other Hash types.

ACKs for top commit:
  apoelstra:
    ACK 91863c8a78
  tcharding:
    ACK 91863c8a78

Tree-SHA512: e1fc278eab4c13b04462636d424b05c599d8f75d76ac8c50cff195085af5ab71aee8a74386d58a457a7ab528226ff4686b3fd0c0019530835709ac1c9577281e
2023-03-29 14:32:42 +00:00
Andrew Poelstra 5984818f87
Merge rust-bitcoin/rust-bitcoin#1757: Add implementation of PartialEq trait for Address with NetworkUnchecked
046bda321b comparing NetworkUncheck addresses (Harshil Jani)

Pull request description:

  Closes #1754

  This PR adds an implementation of the PartialEq trait for the `Address` struct with NetworkUnchecked. The newly implemented function checks if two addresses are equal based on their network and payload. This implementation is useful when comparing an Address with NetworkUnchecked to another Address with NetworkUnchecked

ACKs for top commit:
  Kixunil:
    ACK 046bda321b
  apoelstra:
    ACK 046bda321b

Tree-SHA512: 9db28bd9fe6721c754515812bf8b7ca6a2a1285501e3e998298bb430cc129971dc03b9b9ed4a764aa1ebd9d3cb0b06cc5e7fdb9196682410e795c57211672b87
2023-03-29 14:08:33 +00:00
Harshil Jani 046bda321b comparing NetworkUncheck addresses
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>

implementation of PartialEq<Address> for Address<NetworkUnchecked>

Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
2023-03-29 11:33:20 +05:30
Tobin C. Harding a189942c64
Use doc_auto_cfg
If we use `#![cfg_attr(docsrs, feature(doc_auto_cfg))]` instead of
`#![cfg_attr(docsrs, feature(doc_cfg))]` we no longer need to manually
mark types with `#[cfg_attr(docsrs, doc(cfg(feature = "std")))]`.

Sweeeeeet.
2023-03-29 14:50:33 +11:00
Andrew Poelstra 2716e72365
Merge rust-bitcoin/rust-bitcoin#1759: [Docs] Update internal project link to changelog
bbda9599fa [Docs] Update internal project link to changelog (David A. Harding)

Pull request description:

  The changelog was moved in[1], but the link to it in README.md wasn't updated.  I don't see any other outdated links to it in this project via a quick git grep.

  ---Not your usual Harding

  [1] bae64e156e

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

Tree-SHA512: d2b94f4b1afe161357f6dd1fd85fa641be9aa927d48c1ef6d0c49b982633dbcb1e47caa75ebd7f81ef0706617024d0810bcde6d2b7e9149ea978a3c05a71ab1b
2023-03-29 02:33:53 +00:00
junderw 91863c8a78
Feature (hashes): Add from_bytes_ref and from_bytes_mut to all Hash types 2023-03-28 18:27:41 -07:00
David A. Harding bbda9599fa [Docs] Update internal project link to changelog 2023-03-28 14:02:39 -10:00
Andrew Poelstra dc72dfb9f2
Merge rust-bitcoin/rust-bitcoin#1753: Add `ChainHash::from_genesis_block_hash`
ed80df5ebc Add `ChainHash::from_genesis_block_hash` (Martin Habovstiak)

Pull request description:

  This improves readability of converting `BlockHash` into `ChainHash`. It's useful in e.g. Electrum protocol which sends `BlockHash` (serialized backward).

  Closes #1751

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

Tree-SHA512: b03eb9ca0a1eb38196cc8e43751c2def0d00b463b774003c5319bf56599db598ddd4bb0e2ad0bd3803f21a925135992d421848e7b1ba5e7bab3a405f60fc973c
2023-03-28 01:25:18 +00:00
Tobin C. Harding fabcde036f
Use package in manifest and shorten import
We can use `package` to rename `bitcoin_hashes` to `hashes` and
`bitcoin_internals` to `internals`. This makes imports more terse with
no loss of meaning.
2023-03-28 12:20:04 +11:00
Andrew Poelstra 2e2d5e9e34
Merge rust-bitcoin/rust-bitcoin#1740: create a set of recognized denomination forms
82b6332b91 create a set of recognized denomination forms (yancy)

Pull request description:

  I took a stab at restricting the acceptable forms here.  There was some consensus that "BtC" was confusing that was discussed in a previous pr https://github.com/rust-bitcoin/rust-bitcoin/pull/1715.

  Also, personally I felt that the `PossiblyConfusingDenomination` enum variant was itself confusing.  I think it's probably cleaner to just maintain a list of acceptable forms and treat everything else as unknown.  For now I just created a const of possibly confusing forms.

ACKs for top commit:
  Kixunil:
    ACK 82b6332b91
  apoelstra:
    ACK 82b6332b91

Tree-SHA512: f3c212046e4d8a34ce2d50f34065b1778ae190ca80dd9ad73ef41eb5925705c88c0a764ec149d731eb1735d670c5542415953633a7f3f672d0c1e46b6e004d0b
2023-03-27 19:43:00 +00:00
yancy 82b6332b91 create a set of recognized denomination forms 2023-03-27 11:19:55 +02:00
Martin Habovstiak ed80df5ebc Add `ChainHash::from_genesis_block_hash`
This improves readability of converting `BlockHash` into `ChainHash`.
It's useful in e.g. Electrum protocol which sends `BlockHash`
(serialized backward).

Closes #1751
2023-03-26 10:42:22 +02:00
Andrew Poelstra d8c7cd1e6c
Merge rust-bitcoin/rust-bitcoin#1737: add SECURITY.md
9ade4f3620 add SECURITY.md (Andrew Poelstra)

Pull request description:

  Draft of a SECURITY.md. Right now it only lists me -- if you are willing to be an alternate, don't be afraid to ask. Pretty-much any of the major regular contributors would be fine.

  Fixes #1718

ACKs for top commit:
  sanket1729:
    ACK 9ade4f3620
  tcharding:
    ACK 9ade4f3620

Tree-SHA512: 8c6ca4e511a23efc132f2ceee7538f38116d815c20bd81b3650cddfa32e695cb812167964f2f0a0c94d6499c037b72a7c8464e5427fd77a8035540ef9e6b6b65
2023-03-23 22:05:46 +00:00
Andrew Poelstra 531dbc888c
Merge rust-bitcoin/rust-bitcoin#1730: Use shorter imports
122188f7dd Use shorter import statements (Tobin C. Harding)

Pull request description:

  Just patch 2, patch 1 is #1728

  From the commit log of patch 2

      Use shorter import statements

      As per discussion [0] use the shorter form for importing crates that we
      re-export (`hashes` and `secp256k1`).

      [0] https://github.com/rust-bitcoin/rust-bitcoin/discussions/1661

ACKs for top commit:
  apoelstra:
    ACK 122188f7dd
  sanket1729:
    utACK 122188f7dd

Tree-SHA512: 3f540464d38c72ba9d68f8ceda8600540bd0c3eef0ba67531c87fa1e0e4f757af7035cf80a1a5f17aa05604a17fdd9ef59bb6bece6b4145d540dac1e5362fc01
2023-03-23 17:39:03 +00:00
Andrew Poelstra 3e31a785e1
Merge rust-bitcoin/rust-bitcoin#1725: ci: do dry-run releases in CI
99cb83c3e9 ci: do dry-run releases in CI (Andrew Poelstra)

Pull request description:

  Will set this to "allow failure" since I think it'll fail during large parts of development, but this will be useful to avoid last-minute problems with releases.

ACKs for top commit:
  tcharding:
    ACK 99cb83c3e9
  Kixunil:
    ACK 99cb83c3e9

Tree-SHA512: 32a3e541deba26c0ef3b70a5cf9b4cf8efcebcb962258dd50ff77bd78b38cd9e749246e37133e9ddb806c558faa9cbbc9d8039061cbe888e8abb247c673325a6
2023-03-23 16:46:09 +00:00
Andrew Poelstra 9ade4f3620
add SECURITY.md 2023-03-23 16:11:11 +00:00
Andrew Poelstra 3417585a53
Merge rust-bitcoin/rust-bitcoin#1729: Bump MSRV to 1.48.0
1dc04fe10f Remove rust_v_1_46 (Tobin C. Harding)
71fa9e81e7 Bump MSRV to 1.48.1 (Tobin C. Harding)

Pull request description:

  Just patch 2, patch 1 is #1728

  From the commit log of patch 2

      Bump MSRV to 1.48.1

      As per discussion [0] bump our MSRV for all crates in `rust-bitcoin`
      repo to 1.48.1 [1].

      [0] https://github.com/rust-bitcoin/rust-bitcoin/discussions/1329
      [1] https://blog.rust-lang.org/2020/11/19/Rust-1.48.html

ACKs for top commit:
  apoelstra:
    ACK 1dc04fe10f
  sanket1729:
    ACK 1dc04fe10f

Tree-SHA512: 533470c55f7aeede88382db8245033dac9317d75b38ced2ad8256d38319632a524335f893044e96300a1e60048f9aaca2d1634735eb324eb8ed9ad3c9ab2f872
2023-03-23 00:50:33 +00:00
Andrew Poelstra 3ca9de82a6
Merge rust-bitcoin/rust-bitcoin#1735: Add kilo weight unit conversion
dbd2ea07b5 Add kilo weight unit conversion (yancy)

Pull request description:

  The FeeRate module defaults to sats per `kwu` so when doing fee calculations, it would be convenient to easily convert weight to the same units.

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

Tree-SHA512: fe26b631cf474f1dca627a4d21e9052c80f8ada9a0eb635c46b7f8f42095671b9b161fb5012b723699008372faf7668507d5e92bde7d1808d389f85dba33529b
2023-03-23 00:11:12 +00:00
Andrew Poelstra 99cb83c3e9
ci: do dry-run releases in CI 2023-03-22 23:40:09 +00:00
Andrew Poelstra 136d5772b6
Merge rust-bitcoin/rust-bitcoin#1734: remove Lines of Code badge
450df18166 remove Lines of Code badge (Harshil Jani)

Pull request description:

  closes #1727

ACKs for top commit:
  tcharding:
    ACK 450df18166
  Kixunil:
    ACK 450df18166
  apoelstra:
    ACK 450df18166

Tree-SHA512: f8f5b91d4e0dacf18778f3e864fa36014260b5c786f8299bd59c584cd073fe5bdcc1ff87e39e7ec60e04cd4a7defb014d1f9207d1704cbaee570d6a80e46d4d7
2023-03-22 22:07:17 +00:00
Tobin C. Harding 1dc04fe10f
Remove rust_v_1_46
We just bumped the MSRV to 1.48.0 so we know that we have all features
from 1.46, no need for `rust_v_1_46` check anymore.
2023-03-23 08:27:10 +11:00
Tobin C. Harding 71fa9e81e7
Bump MSRV to 1.48.1
As per discussion [0] bump our MSRV for all crates in `rust-bitcoin`
repo to 1.48.1 [1].

[0] https://github.com/rust-bitcoin/rust-bitcoin/discussions/1329
[1] https://blog.rust-lang.org/2020/11/19/Rust-1.48.html
2023-03-23 08:03:06 +11:00
yancy dbd2ea07b5 Add kilo weight unit conversion 2023-03-22 20:05:07 +01:00
Andrew Poelstra dda3cb6fe2
Merge rust-bitcoin/rust-bitcoin#1733: CI: Prevent duplicate CI runs
a629bef85e CI: Prevent duplicate CI runs (Jonathan Underwood)

Pull request description:

  Closes #1726

  This will prevent duplicate CI runs when merging an internal branch into master.

  You can opt-in to a non-master branch CI by using the prefix given.

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

Tree-SHA512: b3a43d55ce9ae7d3c3898dfae42058f4c2990ed176a612e688166e4cb01dd0d9ddd5eec3580d275f5cb19101e43b822e4a17a34d75db68f4fe2c5ad23cdea97d
2023-03-22 17:16:41 +00:00
Harshil Jani 450df18166 remove Lines of Code badge
Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
2023-03-22 21:22:37 +05:30
Andrew Poelstra 0f98c56962
Merge rust-bitcoin/rust-bitcoin#1728: Run cargo +nightly rustfmt
5781896814 Run cargo +nightly rustfmt (Tobin C. Harding)

Pull request description:

  We just merged a patch to enable formatting in CI but commit: `05fdead2 Feature: Add difficulty_float method for block::Header.` must have slipped in.

  Run the formatter.

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

Tree-SHA512: 7e97b5d56610ec9771ede30533e491e410ce79441070c8ff22f2e3d7fefc23fe327eb5ce3325ee3e356fc940c8e47806816a628daaa44b463071124beee2fbeb
2023-03-22 15:20:32 +00:00
Jonathan Underwood a629bef85e
CI: Prevent duplicate CI runs 2023-03-22 08:19:30 -07:00
Tobin C. Harding 122188f7dd
Use shorter import statements
As per discussion [0] use the shorter form for importing crates that we
re-export (`hashes` and `secp256k1`).

[0] https://github.com/rust-bitcoin/rust-bitcoin/discussions/1661
2023-03-22 14:09:58 +11:00
Tobin C. Harding 5781896814
Run cargo +nightly rustfmt
We just merged a patch to enable formatting in CI but commit: `05fdead2
Feature: Add difficulty_float method for block::Header.` must have
slipped in.

Run the formatter.
2023-03-22 13:49:17 +11:00
Andrew Poelstra 24af58c5ad
Merge rust-bitcoin/rust-bitcoin#1434: Format the `rust-bitcoin` crate
913575ac91 hashes: Run the formatter (Tobin C. Harding)
52c4579057 Enable formatting for hashes (Tobin C. Harding)
3f16b6bf9f util: Run the formatter (Tobin C. Harding)
d210d2ac83 Enable formatting for util (Tobin C. Harding)
5973dce9db blockdata: Run the formatter (Tobin C. Harding)
0dcbed3c7b Enable formatting for blockdata (Tobin C. Harding)
a52746d01c psbt: Run the formatter (Tobin C. Harding)
ef306db5e2 Enable formatting for psbt (Tobin C. Harding)
296f2ed82c Make test panic instead of using code comment (Tobin C. Harding)
3ec8a12428 crypto: Run the formatter (Tobin C. Harding)
c8a3c58786 Enable formatting for crypto (Tobin C. Harding)
314e6786b4 crypto: Add rustfmt::skip attributes (Tobin C. Harding)
450a84f6e8 consensus: Run the formatter (Tobin C. Harding)
89143205f9 Enable formatting for consensus (Tobin C. Harding)
ce773af20f tests: Remove useless use of super imports (Tobin C. Harding)
ef01f4d0f6 consensus: Introduce local variables (Tobin C. Harding)

Pull request description:

  One final push crew, 16 patches, only a few are big.

  All non-trivial formatting is done in separate patches so the changes can be verified mechanically.

  With this applied the whole `rust-bitcoin` crate will be formatted.

  Big thanks to everyone for putting up with the ongoing formatting PRs, no-one likes doing these but hopefully this an improvement to the project - especially in helping us get more contributors to the project.

ACKs for top commit:
  tcharding:
    > ACK [913575a](913575ac91). Went through the workflow locally.
  sanket1729:
    ACK 913575ac91. Went through the workflow locally.
  apoelstra:
    ACK 913575ac91

Tree-SHA512: b30eaa2893563155de05f8fa97be4a24a7dd8bf43bb426314c5104598477ca2173af279da796da8b18cc53a0ed525908b3d4edd0504836a443465efa0773632d
2023-03-22 01:40:01 +00:00