From 7238aa4e1d478282bdbeeb3039843023a3d648a4 Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 13 Dec 2024 22:47:06 +0000 Subject: [PATCH 1/2] Disable default features of dependencies to fix no-std support --- CHANGELOG.md | 3 +++ Cargo.lock | 4 ++-- Cargo.toml | 8 ++++---- src/arbitrary.rs | 2 +- src/fingerprint.rs | 4 ++-- src/lib.rs | 3 +++ 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ef028f1..e01db86 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this library adheres to Rust's notion of ## [Unreleased] +### Fixed +- Disabled default features of dependencies to fix no-std support. + ## [0.1.2] - 2024-10-22 ### Added diff --git a/Cargo.lock b/Cargo.lock index 7745bf7..0c97c2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -39,9 +39,9 @@ checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" [[package]] name = "memuse" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2145869435ace5ea6ea3d35f59be559317ec9a0d04e1812d5f185a87b6d36f1a" +checksum = "3d97bbf43eb4f088f8ca469930cde17fa036207c9a5e02ccc5107c4e8b17c964" [[package]] name = "subtle" diff --git a/Cargo.toml b/Cargo.toml index 57722e2..c0213fb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,9 +14,9 @@ edition = "2021" rust-version = "1.60" [dependencies] -blake2b_simd = "1" -memuse = "0.2.1" -subtle = "2.2.3" +blake2b_simd = { version = "1", default-features = false } +memuse = { version = "0.2.2", default-features = false } +subtle = { version = "2.2.3", default-features = false } zcash_spec = "0.1.2" [dev-dependencies] @@ -24,4 +24,4 @@ assert_matches = "1.5" [features] default = ["std"] -std = [] +std = ["memuse/std"] diff --git a/src/arbitrary.rs b/src/arbitrary.rs index ea90fe2..fb58fc3 100644 --- a/src/arbitrary.rs +++ b/src/arbitrary.rs @@ -257,7 +257,7 @@ mod tests { .path .into_iter() .map(|i| ChildIndex::from_index(*i).expect("hardened")) - .collect::>(); + .collect::>(); assert_eq!(&full_path[..i], &path); // The derived master key should be identical to the key at the empty path. diff --git a/src/fingerprint.rs b/src/fingerprint.rs index 82b66af..51288f6 100644 --- a/src/fingerprint.rs +++ b/src/fingerprint.rs @@ -88,8 +88,8 @@ fn test_seed_fingerprint() { let fp = SeedFingerprint::from_seed(&tv.root_seed).expect("root_seed has valid length"); assert_eq!(&fp.to_bytes(), &tv.fingerprint[..]); assert_eq!( - std::format!("{:?}", fp), - std::format!("SeedFingerprint({})", tv.fingerprint_str) + alloc::format!("{:?}", fp), + alloc::format!("SeedFingerprint({})", tv.fingerprint_str) ); } } diff --git a/src/lib.rs b/src/lib.rs index 81f45a9..584e2bb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,9 @@ #![deny(unsafe_code)] #![deny(rustdoc::broken_intra_doc_links)] +#[cfg(test)] +extern crate alloc; + #[cfg(feature = "std")] extern crate std; From a355905c5ed4db608e6fe516d98aea193dd4bb4e Mon Sep 17 00:00:00 2001 From: Jack Grigg Date: Fri, 13 Dec 2024 22:59:19 +0000 Subject: [PATCH 2/2] v0.1.3 --- CHANGELOG.md | 2 ++ Cargo.lock | 2 +- Cargo.toml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e01db86..2b87218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,8 @@ and this library adheres to Rust's notion of ## [Unreleased] +## [0.1.3] - 2024-12-13 + ### Fixed - Disabled default features of dependencies to fix no-std support. diff --git a/Cargo.lock b/Cargo.lock index 0c97c2e..abedeb7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -60,7 +60,7 @@ dependencies = [ [[package]] name = "zip32" -version = "0.1.2" +version = "0.1.3" dependencies = [ "assert_matches", "blake2b_simd", diff --git a/Cargo.toml b/Cargo.toml index c0213fb..d7a6c2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "zip32" -version = "0.1.2" +version = "0.1.3" authors = [ "Jack Grigg ", "Kris Nuttycombe ",