consensus_encoding: fix `consensus-encoding` package name
What changed, and why it matters
This commit simply renames an internal Rust package from `consensus-encoding` to `bitcoin-consensus-encoding` so the crate name matches the one published on crates.io. It updates lock files, package manifests, and internal `use` statements accordingly. There is no change to program logic, no bug fix, and no security relevance.
No security action needed. Treat as routine maintenance/rename.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff is a pure rename/refactor: consensus_encoding/Cargo.toml changes name and bumps version from 0.0.0 to 0.1.0; dependent crates primitives and units update their package = "..." aliases; lock files regenerate the package entry; examples and tests switch use consensus_encoding to use bitcoin_consensus_encoding. No code behavior is altered.
Changed components
consensus_encoding/Cargo.tomlprimitives/Cargo.tomlunits/Cargo.tomlCargo-minimal.lockCargo-recent.lockconsensus_encoding/examples/encoder.rsconsensus_encoding/tests/composition.rsconsensus_encoding/tests/decode.rsconsensus_encoding/tests/encode.rsconsensus_encoding/tests/wrappers.rsInspect captured patch +36 / −36
diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock
index 750738c6..d9281019 100644
--- a/Cargo-minimal.lock
+++ b/Cargo-minimal.lock
@@ -72,6 +72,14 @@ dependencies = [
name = "bitcoin-addresses"
version = "0.0.0"
+[[package]]
+name = "bitcoin-consensus-encoding"
+version = "0.1.0"
+dependencies = [
+ "bitcoin-internals",
+ "bitcoin_hashes 0.16.0",
+]
+
[[package]]
name = "bitcoin-fuzz"
version = "0.0.1"
@@ -129,10 +137,10 @@ dependencies = [
"arbitrary",
"arrayvec",
"bincode",
+ "bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-units",
"bitcoin_hashes 0.16.0",
- "consensus-encoding",
"hex-conservative 0.3.0",
"serde",
"serde_json",
@@ -144,8 +152,8 @@ version = "1.0.0-rc.0"
dependencies = [
"arbitrary",
"bincode",
+ "bitcoin-consensus-encoding",
"bitcoin-internals",
- "consensus-encoding",
"serde",
"serde_json",
"serde_test",
@@ -205,14 +213,6 @@ dependencies = [
"hex-conservative 0.3.0",
]
-[[package]]
-name = "consensus-encoding"
-version = "0.0.0"
-dependencies = [
- "bitcoin-internals",
- "bitcoin_hashes 0.16.0",
-]
-
[[package]]
name = "getrandom"
version = "0.2.0"
diff --git a/Cargo-recent.lock b/Cargo-recent.lock
index 42f41654..65e9dc1b 100644
--- a/Cargo-recent.lock
+++ b/Cargo-recent.lock
@@ -71,6 +71,14 @@ dependencies = [
name = "bitcoin-addresses"
version = "0.0.0"
+[[package]]
+name = "bitcoin-consensus-encoding"
+version = "0.1.0"
+dependencies = [
+ "bitcoin-internals",
+ "bitcoin_hashes 0.16.0",
+]
+
[[package]]
name = "bitcoin-fuzz"
version = "0.0.1"
@@ -128,10 +136,10 @@ dependencies = [
"arbitrary",
"arrayvec",
"bincode",
+ "bitcoin-consensus-encoding",
"bitcoin-internals",
"bitcoin-units",
"bitcoin_hashes 0.16.0",
- "consensus-encoding",
"hex-conservative 0.3.0",
"serde",
"serde_json",
@@ -143,8 +151,8 @@ version = "1.0.0-rc.0"
dependencies = [
"arbitrary",
"bincode",
+ "bitcoin-consensus-encoding",
"bitcoin-internals",
- "consensus-encoding",
"serde",
"serde_json",
"serde_test",
@@ -207,14 +215,6 @@ dependencies = [
"hex-conservative 0.3.0",
]
-[[package]]
-name = "consensus-encoding"
-version = "0.0.0"
-dependencies = [
- "bitcoin-internals",
- "bitcoin_hashes 0.16.0",
-]
-
[[package]]
name = "getrandom"
version = "0.2.15"
diff --git a/consensus_encoding/Cargo.toml b/consensus_encoding/Cargo.toml
index 8be95e4e..48800fb6 100644
--- a/consensus_encoding/Cargo.toml
+++ b/consensus_encoding/Cargo.toml
@@ -1,6 +1,6 @@
[package]
-name = "consensus-encoding"
-version = "0.0.0"
+name = "bitcoin-consensus-encoding"
+version = "0.1.0"
authors = ["Andrew Poelstra <apoelstra@wpsoftware.net>", "Tobin C. Harding <me@tobin.cc>"]
license = "CC0-1.0"
repository = "https://github.com/rust-bitcoin/rust-bitcoin/"
diff --git a/consensus_encoding/examples/encoder.rs b/consensus_encoding/examples/encoder.rs
index 19ada677..9bd8127f 100644
--- a/consensus_encoding/examples/encoder.rs
+++ b/consensus_encoding/examples/encoder.rs
@@ -2,7 +2,7 @@
//! Example of creating an encoder that encodes a slice of encodable objects.
-use consensus_encoding as encoding;
+use bitcoin_consensus_encoding as encoding;
use encoding::{ArrayEncoder, BytesEncoder, CompactSizeEncoder, Encodable, Encoder2, SliceEncoder};
fn main() {
diff --git a/consensus_encoding/tests/composition.rs b/consensus_encoding/tests/composition.rs
index eca6b500..ba59f5dd 100644
--- a/consensus_encoding/tests/composition.rs
+++ b/consensus_encoding/tests/composition.rs
@@ -2,7 +2,7 @@
//! Test composition of encoders and decoders.
-use consensus_encoding::{
+use bitcoin_consensus_encoding::{
ArrayDecoder, ArrayEncoder, Decodable, Decoder, Decoder2, Decoder6, Encodable, Encoder,
Encoder2, Encoder6, UnexpectedEofError,
};
diff --git a/consensus_encoding/tests/decode.rs b/consensus_encoding/tests/decode.rs
index 2b34c1a8..1f0c5cff 100644
--- a/consensus_encoding/tests/decode.rs
+++ b/consensus_encoding/tests/decode.rs
@@ -2,7 +2,7 @@
//! Integration tests for decode module.
-use consensus_encoding::{ArrayDecoder, Decoder, UnexpectedEofError};
+use bitcoin_consensus_encoding::{ArrayDecoder, Decoder, UnexpectedEofError};
const EMPTY: &[u8] = &[];
diff --git a/consensus_encoding/tests/encode.rs b/consensus_encoding/tests/encode.rs
index a5c48477..1c450d53 100644
--- a/consensus_encoding/tests/encode.rs
+++ b/consensus_encoding/tests/encode.rs
@@ -5,7 +5,7 @@
#[cfg(feature = "std")]
use std::io::{Cursor, Write};
-use consensus_encoding::{ArrayEncoder, BytesEncoder, Encodable, Encoder};
+use bitcoin_consensus_encoding::{ArrayEncoder, BytesEncoder, Encodable, Encoder};
// Simple test type that implements Encodable.
#[cfg(feature = "alloc")]
@@ -43,7 +43,7 @@ fn encode_std_writer() {
let data = TestData(0x1234_5678);
let mut cursor = Cursor::new(Vec::new());
- consensus_encoding::encode_to_writer(&data, &mut cursor).unwrap();
+ bitcoin_consensus_encoding::encode_to_writer(&data, &mut cursor).unwrap();
let result = cursor.into_inner();
assert_eq!(result, vec![0x78, 0x56, 0x34, 0x12]);
@@ -53,7 +53,7 @@ fn encode_std_writer() {
#[cfg(feature = "alloc")]
fn encode_vec() {
let data = TestData(0xDEAD_BEEF);
- let vec = consensus_encoding::encode_to_vec(&data);
+ let vec = bitcoin_consensus_encoding::encode_to_vec(&data);
assert_eq!(vec, vec![0xEF, 0xBE, 0xAD, 0xDE]);
}
@@ -61,7 +61,7 @@ fn encode_vec() {
#[cfg(feature = "alloc")]
fn encode_vec_empty_data() {
let data = EmptyData;
- let result = consensus_encoding::encode_to_vec(&data);
+ let result = bitcoin_consensus_encoding::encode_to_vec(&data);
assert!(result.is_empty());
}
@@ -70,7 +70,7 @@ fn encode_vec_empty_data() {
fn encode_std_writer_empty_data() {
let data = EmptyData;
let mut cursor = Cursor::new(Vec::new());
- consensus_encoding::encode_to_writer(&data, &mut cursor).unwrap();
+ bitcoin_consensus_encoding::encode_to_writer(&data, &mut cursor).unwrap();
let result = cursor.into_inner();
assert!(result.is_empty());
@@ -93,7 +93,7 @@ fn encode_std_writer_io_error() {
let data = TestData(0x1234_5678);
let mut writer = FailingWriter;
- let result = consensus_encoding::encode_to_writer(&data, &mut writer);
+ let result = bitcoin_consensus_encoding::encode_to_writer(&data, &mut writer);
assert!(result.is_err());
assert_eq!(result.unwrap_err().kind(), std::io::ErrorKind::Other);
@@ -103,10 +103,10 @@ fn encode_std_writer_io_error() {
fn encode_newtype_lifetime_flexibility() {
// Test that the encoder_newtype macro allows different lifetime names.
- consensus_encoding::encoder_newtype! {
+ bitcoin_consensus_encoding::encoder_newtype! {
pub struct CustomEncoder<'data>(BytesEncoder<'data>);
}
- consensus_encoding::encoder_newtype! {
+ bitcoin_consensus_encoding::encoder_newtype! {
pub struct NoLifetimeEncoder(ArrayEncoder<4>);
}
diff --git a/consensus_encoding/tests/wrappers.rs b/consensus_encoding/tests/wrappers.rs
index 70439ee3..674c022b 100644
--- a/consensus_encoding/tests/wrappers.rs
+++ b/consensus_encoding/tests/wrappers.rs
@@ -2,7 +2,7 @@
#![cfg(feature = "std")]
-use consensus_encoding as encoding;
+use bitcoin_consensus_encoding as encoding;
use encoding::{ArrayEncoder, BytesEncoder, CompactSizeEncoder, Encodable, Encoder2, SliceEncoder};
encoding::encoder_newtype! {
diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml
index 4d831b4c..61200233 100644
--- a/primitives/Cargo.toml
+++ b/primitives/Cargo.toml
@@ -23,7 +23,7 @@ arbitrary = ["dep:arbitrary", "units/arbitrary"]
hex = ["dep:hex", "hashes/hex", "internals/hex"]
[dependencies]
-encoding = { package = "consensus-encoding", path = "../consensus_encoding", default-features = false }
+encoding = { package = "bitcoin-consensus-encoding", path = "../consensus_encoding", default-features = false }
hashes = { package = "bitcoin_hashes", path = "../hashes", default-features = false }
internals = { package = "bitcoin-internals", path = "../internals" }
units = { package = "bitcoin-units", path = "../units", default-features = false, features = [ "encoding" ] }
diff --git a/units/Cargo.toml b/units/Cargo.toml
index 829dab13..8a4e4e5c 100644
--- a/units/Cargo.toml
+++ b/units/Cargo.toml
@@ -18,7 +18,7 @@ std = ["alloc", "internals/std", "encoding?/std"]
alloc = ["internals/alloc", "serde?/alloc", "encoding?/alloc"]
[dependencies]
-encoding = { package = "consensus-encoding", path = "../consensus_encoding", default-features = false, optional = true }
+encoding = { package = "bitcoin-consensus-encoding", path = "../consensus_encoding", default-features = false, optional = true }
internals = { package = "bitcoin-internals", path = "../internals", version = "0.4.0" }
serde = { version = "1.0.195", default-features = false, features = ["derive"], optional = true }
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.