From a2b019f82321fd395c7a6ab5cdfd138b7cd10145 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 4 Apr 2024 08:18:51 +1100 Subject: [PATCH 1/2] Enable internals "alloc" feature We have 2 crates that require an allocator, `bitcoin` and `base58ck` - these crates should enable the "alloc" feature when depending on `internals`. For `units` we use the `internals::error::InputString` but do not enable the "alloc" feature - this is a bug, it means that the parsed string is being lost from the error types that use `InputString`. Enable "alloc" for `bitcoin`, `base58ck`, and `units`. - `bitcoin` and `base56ck` is just for good measure so we don't get bitten later on. - `units` is a bug fix and requires a point release. --- base58/Cargo.toml | 2 +- bitcoin/Cargo.toml | 2 +- units/Cargo.toml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/base58/Cargo.toml b/base58/Cargo.toml index c83a11b5..61fe35a0 100644 --- a/base58/Cargo.toml +++ b/base58/Cargo.toml @@ -22,7 +22,7 @@ rustdoc-args = ["--cfg", "docsrs"] [dependencies] hashes = { package = "bitcoin_hashes", version = "0.14.0", default-features = false, features = ["alloc"] } -internals = { package = "bitcoin-internals", version = "0.3.0" } +internals = { package = "bitcoin-internals", version = "0.3.0", features = ["alloc"] } [dev-dependencies] hex = { package = "hex-conservative", version = "0.2.0", default-features = false, features = ["alloc"] } diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml index cb343929..5aaf6a56 100644 --- a/bitcoin/Cargo.toml +++ b/bitcoin/Cargo.toml @@ -33,7 +33,7 @@ bech32 = { version = "0.11.0", default-features = false, features = ["alloc"] } hashes = { package = "bitcoin_hashes", version = "0.14.0", default-features = false, features = ["alloc", "io"] } hex = { package = "hex-conservative", version = "0.2.0", default-features = false, features = ["alloc"] } hex_lit = "0.1.1" -internals = { package = "bitcoin-internals", version = "0.3.0" } +internals = { package = "bitcoin-internals", version = "0.3.0", features = ["alloc"] } io = { package = "bitcoin-io", version = "0.1.1", default-features = false, features = ["alloc"] } secp256k1 = { version = "0.29.0", default-features = false, features = ["hashes", "alloc"] } units = { package = "bitcoin-units", version = "0.1.0", default-features = false, features = ["alloc"] } diff --git a/units/Cargo.toml b/units/Cargo.toml index 51b968d1..157f3082 100644 --- a/units/Cargo.toml +++ b/units/Cargo.toml @@ -22,7 +22,7 @@ all-features = true rustdoc-args = ["--cfg", "docsrs"] [dependencies] -internals = { package = "bitcoin-internals", version = "0.3.0" } +internals = { package = "bitcoin-internals", version = "0.3.0", features = ["alloc"] } serde = { version = "1.0.103", default-features = false, features = ["derive"], optional = true } From e06ebd69e754572f3e90f8431a3aaf1e961860ce Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Thu, 4 Apr 2024 08:24:28 +1100 Subject: [PATCH 2/2] units: Bump version number to 0.1.1 We just did a minor bug fix to error code in the `amounts` module. This change did not effect the public API but improved the display of two error types from that module. In preparation for doing a point release bump the version number and add a changelog entry. --- Cargo-minimal.lock | 2 +- Cargo-recent.lock | 2 +- units/CHANGELOG.md | 5 +++++ units/Cargo.toml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 435e9958..64da99b4 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -92,7 +92,7 @@ version = "0.1.2" [[package]] name = "bitcoin-units" -version = "0.1.0" +version = "0.1.1" dependencies = [ "bitcoin-internals", "serde", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 51b496d2..6150ac03 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -91,7 +91,7 @@ version = "0.1.2" [[package]] name = "bitcoin-units" -version = "0.1.0" +version = "0.1.1" dependencies = [ "bitcoin-internals", "serde", diff --git a/units/CHANGELOG.md b/units/CHANGELOG.md index e2c14218..47b644f4 100644 --- a/units/CHANGELOG.md +++ b/units/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.1.1 - 2024-04-04 + +* Enable "alloc" feature for `internals` dependency - enables caching + of parsed input strings in a couple of `amount` error types. + # 0.1.0 - Initial Release - 2024-04-03 Initial release of the `bitcoin-units` crate. These unit types are diff --git a/units/Cargo.toml b/units/Cargo.toml index 157f3082..04fffb94 100644 --- a/units/Cargo.toml +++ b/units/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "bitcoin-units" -version = "0.1.0" +version = "0.1.1" authors = ["Andrew Poelstra "] license = "CC0-1.0" repository = "https://github.com/rust-bitcoin/rust-bitcoin/"