From 65e9ad2fea6064681275551a92816f448e1cde02 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Tue, 2 Jul 2024 13:42:07 +1000 Subject: [PATCH] Introduce empty primitives crate Introduce an empty `bitcoin-primitives` crate. We were give the name on crates.io and previously a version `v0.1.16-alpha` was released so we use `v0.100.0`. --- Cargo-minimal.lock | 4 ++++ Cargo-recent.lock | 4 ++++ Cargo.toml | 5 ++++- primitives/CHANGELOG.md | 4 ++++ primitives/Cargo.toml | 27 +++++++++++++++++++++++++++ primitives/README.md | 13 +++++++++++++ primitives/contrib/test_vars.sh | 14 ++++++++++++++ primitives/src/lib.rs | 22 ++++++++++++++++++++++ 8 files changed, 92 insertions(+), 1 deletion(-) create mode 100644 primitives/CHANGELOG.md create mode 100644 primitives/Cargo.toml create mode 100644 primitives/README.md create mode 100644 primitives/contrib/test_vars.sh create mode 100644 primitives/src/lib.rs diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 49b2d61a5..a19047609 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -93,6 +93,10 @@ dependencies = [ name = "bitcoin-io" version = "0.1.2" +[[package]] +name = "bitcoin-primitives" +version = "0.100.0" + [[package]] name = "bitcoin-units" version = "0.1.1" diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 91c38c420..cb03d2a9a 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -92,6 +92,10 @@ dependencies = [ name = "bitcoin-io" version = "0.1.2" +[[package]] +name = "bitcoin-primitives" +version = "0.100.0" + [[package]] name = "bitcoin-units" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 35cd100a1..492954549 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = ["addresses", "base58", "bitcoin", "fuzz", "hashes", "internals", "io", "units"] +members = ["addresses", "base58", "bitcoin", "fuzz", "hashes", "internals", "io", "primitives", "units"] resolver = "2" [patch.crates-io.bitcoin-addresses] @@ -20,5 +20,8 @@ path = "internals" [patch.crates-io.bitcoin-io] path = "io" +[patch.crates-io.bitcoin-primitives] +path = "primitives" + [patch.crates-io.bitcoin-units] path = "units" diff --git a/primitives/CHANGELOG.md b/primitives/CHANGELOG.md new file mode 100644 index 000000000..1ec5495d7 --- /dev/null +++ b/primitives/CHANGELOG.md @@ -0,0 +1,4 @@ +# 0.100.0 - 2024-07-01 + +* Initial release of the `github.com/rust-bitcoin/rust-bitcoin/primitives` crate as + `bitcoin-primitives`. The name on crates.io was generously transferred to us. diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml new file mode 100644 index 000000000..752129d50 --- /dev/null +++ b/primitives/Cargo.toml @@ -0,0 +1,27 @@ +[package] +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" +authors = ["Andrew Poelstra "] +license = "CC0-1.0" +repository = "https://github.com/rust-bitcoin/rust-bitcoin" +description = "Primitive types used by the rust-bitcoin eccosystem" +categories = ["cryptography::cryptocurrencies"] +keywords = ["bitcoin", "types"] +readme = "README.md" +edition = "2021" +rust-version = "1.56.1" +exclude = ["tests", "contrib"] + +[features] +default = ["std"] +std = [] + +[dependencies] + +[dev-dependencies] + +[package.metadata.docs.rs] +all-features = true +rustdoc-args = ["--cfg", "docsrs"] diff --git a/primitives/README.md b/primitives/README.md new file mode 100644 index 000000000..cd18cd943 --- /dev/null +++ b/primitives/README.md @@ -0,0 +1,13 @@ +# Rust Bitcoin - primitive types. + +This crate provides primitive data types that are used throughout the +[`rust-bitcoin`](https://github.com/rust-bitcoin) ecosystem. + +## Minimum Supported Rust Version (MSRV) + +This library should always compile with any combination of features on **Rust 1.56.1**. + +## Licensing + +The code in this project is licensed under the [Creative Commons CC0 1.0 Universal license](LICENSE). +We use the [SPDX license list](https://spdx.org/licenses/) and [SPDX IDs](https://spdx.dev/ids/). diff --git a/primitives/contrib/test_vars.sh b/primitives/contrib/test_vars.sh new file mode 100644 index 000000000..03d9a45b3 --- /dev/null +++ b/primitives/contrib/test_vars.sh @@ -0,0 +1,14 @@ +# No shebang, this file should not be executed. +# shellcheck disable=SC2148 +# +# disable verify unused vars, despite the fact that they are used when sourced +# shellcheck disable=SC2034 + +# Test these features with "std" enabled. +FEATURES_WITH_STD="" + +# Test these features without "std" enabled. +FEATURES_WITHOUT_STD="" + +# Run these examples. +EXAMPLES="" diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs new file mode 100644 index 000000000..2de96608f --- /dev/null +++ b/primitives/src/lib.rs @@ -0,0 +1,22 @@ +// SPDX-License-Identifier: CC0-1.0 + +//! # Rust Bitcoin - primitive types. +//! +//! Primitive data types that are used throughout the [`rust-bitcoin`] ecosystem. +//! +//! [`rust-bitcoin`]: + +#![cfg_attr(all(not(test), not(feature = "std")), no_std)] +// Experimental features we need. +#![cfg_attr(docsrs, feature(doc_auto_cfg))] +// Coding conventions. +#![warn(missing_docs)] +// Exclude lints we don't think are valuable. +#![allow(clippy::needless_question_mark)] // https://github.com/rust-bitcoin/rust-bitcoin/pull/2134 +#![allow(clippy::manual_range_contains)] // More readable than clippy's format. +#![allow(clippy::needless_borrows_for_generic_args)] // https://github.com/rust-lang/rust-clippy/issues/12454 + +extern crate alloc; + +#[cfg(feature = "std")] +extern crate std;