From 3e9267071fba5887f35b64b2a76c0e3e708366da Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 14 Nov 2024 08:57:22 +1100 Subject: [PATCH 1/3] primitives: Update crate level docs re allocator We slightly improved the situation but much of the functionality is still behind the `alloc` feature. --- primitives/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index e8617dea6..b04d624da 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -4,7 +4,8 @@ //! //! Primitive data types that are used throughout the [`rust-bitcoin`] ecosystem. //! -//! This crate can be used in a no-std environment but requires an allocator. +//! This crate can be used in a no-std environment but a lot of the functionality requires an +//! allocator i.e., requires the `alloc` feature to be enabled. //! //! [`rust-bitcoin`]: From 175171d339959cbbd96dcb8e9a2e0da43535c422 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 14 Nov 2024 08:58:32 +1100 Subject: [PATCH 2/3] Make primitives re-exports uniform Remove the whitespace, it should never have been there and put the attributes in the same order. Internal change only. --- primitives/src/lib.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index b04d624da..b01432e39 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -46,14 +46,13 @@ pub mod witness; #[doc(inline)] pub use units::amount::{self, Amount, SignedAmount}; -#[cfg(feature = "alloc")] #[doc(inline)] +#[cfg(feature = "alloc")] pub use units::{ block::{BlockHeight, BlockInterval}, fee_rate::{self, FeeRate}, weight::{self, Weight}, }; - #[doc(inline)] #[cfg(feature = "alloc")] pub use self::{ From 53d3ab18b9d3385c8c72fe422a36235c825f44c3 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 18 Sep 2024 13:50:37 +1000 Subject: [PATCH 3/3] Bump version of bitcoin-primitives to 0.101.0 In preparation for releasing `primitives v0.101.0` bump the version number, add a changelog entry, update the lock files, and depend on the new version in all crates that depend on `primitives`. --- Cargo-minimal.lock | 2 +- Cargo-recent.lock | 2 +- bitcoin/Cargo.toml | 2 +- primitives/CHANGELOG.md | 26 ++++++++++++++++++++++++++ primitives/Cargo.toml | 2 +- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 36c95be9d..5ec37a016 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -109,7 +109,7 @@ dependencies = [ [[package]] name = "bitcoin-primitives" -version = "0.100.0" +version = "0.101.0" dependencies = [ "arbitrary", "bincode", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 94b3ca578..ed3d594ec 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -108,7 +108,7 @@ dependencies = [ [[package]] name = "bitcoin-primitives" -version = "0.100.0" +version = "0.101.0" dependencies = [ "arbitrary", "bincode", diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml index ff078247a..9da7e24bd 100644 --- a/bitcoin/Cargo.toml +++ b/bitcoin/Cargo.toml @@ -31,7 +31,7 @@ hashes = { package = "bitcoin_hashes", version = "0.15.0", default-features = fa hex = { package = "hex-conservative", version = "0.3.0", default-features = false, features = ["alloc"] } internals = { package = "bitcoin-internals", version = "0.4.0", features = ["alloc"] } io = { package = "bitcoin-io", version = "0.2.0", default-features = false, features = ["alloc"] } -primitives = { package = "bitcoin-primitives", version = "0.100.0", default-features = false, features = ["alloc"] } +primitives = { package = "bitcoin-primitives", version = "0.101.0", default-features = false, features = ["alloc"] } secp256k1 = { version = "0.29.0", default-features = false, features = ["hashes", "alloc"] } units = { package = "bitcoin-units", version = "0.2.0", default-features = false, features = ["alloc"] } diff --git a/primitives/CHANGELOG.md b/primitives/CHANGELOG.md index 1ec5495d7..762bd9c15 100644 --- a/primitives/CHANGELOG.md +++ b/primitives/CHANGELOG.md @@ -1,3 +1,29 @@ +# 0.101.0 - 2024-11-15 + +This is the first "real" release of the `primitives` crate, as such it +includes a lot of work. Search GitHub with the following filter to see +all related PRs: `is:pr label:C-primitives merged:<=2024-11-15` + +Move the following modules and types from `rust-bitcoin` to `bitcoin-primitives`: + +- `block`: `Block`, `Header`, `Version`, `BlockHash`, `WitnessCommitment`, `Validation`, `Checked`, `Unchecked` +- `locktime`: `absolute::LockTime`, `relative::LockTime` +- `merkle_tree`: `TxMerkleNode`, `WitnessMerkleNode` +- `opcodes`: `Opcode` +- `pow`: `CompactTarget` +- `sequence`: `Sequence` +- `taproot`: `TapBranchTag`, `TapLeafHash`, `TapLeafTag`, `TapNodeHash`, `TapTweakHash`, `TapTweakTag` +- `transaction`: `Transaction`, `TxIn`, `TxOut`, `OutPoint`, `Txid`, `Wtxid`, `Version` +- `witness`: `Witness`, `Iter` + +And various error types. See re-exports at the crate root and also in `rust-bitcoin` at the crate +root and from the respective module. + +We hope to very soon release `primitives 1.0` - please raise any and all issues you come across no +matter how small so we can fix them for the stable release. + +Enjoy! + # 0.100.0 - 2024-07-01 * Initial release of the `github.com/rust-bitcoin/rust-bitcoin/primitives` crate as diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 1387fc1d9..13ec4dc2d 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -2,7 +2,7 @@ name = "bitcoin-primitives" # Arbitrary high version number so as to not clash with the original # `bitcoin-primitives` crate that we replaced `v0.1.16-alpha`. -version = "0.100.0" +version = "0.101.0" authors = ["Andrew Poelstra "] license = "CC0-1.0" repository = "https://github.com/rust-bitcoin/rust-bitcoin"