Skip to content

Commit

Permalink
Introduce empty primitives crate
Browse files Browse the repository at this point in the history
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`.
  • Loading branch information
tcharding committed Jul 2, 2024
1 parent db72ea8 commit 65e9ad2
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 1 deletion.
4 changes: 4 additions & 0 deletions Cargo-minimal.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions Cargo-recent.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
5 changes: 4 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -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]
Expand All @@ -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"
4 changes: 4 additions & 0 deletions primitives/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
27 changes: 27 additions & 0 deletions primitives/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>"]
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"]
13 changes: 13 additions & 0 deletions primitives/README.md
Original file line number Diff line number Diff line change
@@ -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/).
14 changes: 14 additions & 0 deletions primitives/contrib/test_vars.sh
Original file line number Diff line number Diff line change
@@ -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=""
22 changes: 22 additions & 0 deletions primitives/src/lib.rs
Original file line number Diff line number Diff line change
@@ -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`]: <https://github.com/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;

0 comments on commit 65e9ad2

Please sign in to comment.