From 27257909e35f1fead088c0298879fa292a14bc62 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Mon, 16 Dec 2024 21:04:44 -0700 Subject: [PATCH] Release `zcash_keys` version `0.6.0` --- Cargo.lock | 3 +-- Cargo.toml | 2 +- zcash_client_backend/CHANGELOG.md | 2 +- zcash_client_sqlite/CHANGELOG.md | 2 +- zcash_keys/CHANGELOG.md | 8 ++++--- zcash_keys/Cargo.toml | 12 ++++++---- zcash_keys/src/address.rs | 4 ++-- zcash_keys/src/encoding.rs | 39 +++++++++++-------------------- zcash_keys/src/keys.rs | 7 +++--- 9 files changed, 36 insertions(+), 43 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d4aaa96f4..6f31b1f2e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6338,7 +6338,7 @@ dependencies = [ [[package]] name = "zcash_keys" -version = "0.5.0" +version = "0.6.0" dependencies = [ "bech32", "bip32", @@ -6362,7 +6362,6 @@ dependencies = [ "tracing", "zcash_address", "zcash_encoding", - "zcash_primitives", "zcash_protocol", "zcash_transparent", "zip32", diff --git a/Cargo.toml b/Cargo.toml index 8906fd30d..fc49c01f0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -37,7 +37,7 @@ equihash = { version = "0.2", path = "components/equihash" } zcash_address = { version = "0.6", path = "components/zcash_address", default-features = false } zcash_client_backend = { version = "0.15", path = "zcash_client_backend" } zcash_encoding = { version = "0.2.1", path = "components/zcash_encoding", default-features = false } -zcash_keys = { version = "0.5", path = "zcash_keys" } +zcash_keys = { version = "0.6", path = "zcash_keys" } zcash_protocol = { version = "0.4.1", path = "components/zcash_protocol", default-features = false } zip321 = { version = "0.2", path = "components/zip321" } diff --git a/zcash_client_backend/CHANGELOG.md b/zcash_client_backend/CHANGELOG.md index d4081b9c7..646c9c14e 100644 --- a/zcash_client_backend/CHANGELOG.md +++ b/zcash_client_backend/CHANGELOG.md @@ -16,7 +16,7 @@ and this library adheres to Rust's notion of - `wallet::extract_and_store_transaction_from_pczt` ### Changed -- Migrated to `sapling-crypto` version `0.4`. +- Migrated to `sapling-crypto` version `0.4`, `zcash_keys` version `0.6`. - `zcash_client_backend::data_api::AccountBalance`: Refactored to use `Balance` for transparent funds (issue #1411). It now has an `unshielded_balance()` method that returns `Balance`, allowing the unshielded spendable, unshielded diff --git a/zcash_client_sqlite/CHANGELOG.md b/zcash_client_sqlite/CHANGELOG.md index a89e04cd9..e199e2a23 100644 --- a/zcash_client_sqlite/CHANGELOG.md +++ b/zcash_client_sqlite/CHANGELOG.md @@ -11,7 +11,7 @@ and this library adheres to Rust's notion of - `zcash_client_sqlite::AccountUuid` ### Changed -- Migrated to `sapling-crypto` version `0.4`. +- Migrated to `sapling-crypto` version `0.4`, `zcash_keys` version `0.6`. - The `v_transactions` view has been modified: - The `account_id` column has been replaced with `account_uuid`. - The `v_tx_outputs` view has been modified: diff --git a/zcash_keys/CHANGELOG.md b/zcash_keys/CHANGELOG.md index db6b02da5..025ea3b63 100644 --- a/zcash_keys/CHANGELOG.md +++ b/zcash_keys/CHANGELOG.md @@ -6,10 +6,12 @@ and this library adheres to Rust's notion of ## [Unreleased] +## [0.6.0] - 2024-11-14 + ### Changed -- Migrated to `bech32 0.11`. -- Migrated to `sapling-crypto` version `0.4`. -- Removed dependency on `zcash_primitives`. +- Migrated to `bech32 0.11`, `sapling-crypto 0.4`. +- Added dependency on `zcash_transparent 0.1` to replace dependnecy + on `zcash_primitives`. - The `UnifiedAddressRequest` argument to the following methods is now optional: - `zcash_keys::keys::UnifiedSpendingKey::address` - `zcash_keys::keys::UnifiedSpendingKey::default_address` diff --git a/zcash_keys/Cargo.toml b/zcash_keys/Cargo.toml index 0ab84ba67..f950bcbf7 100644 --- a/zcash_keys/Cargo.toml +++ b/zcash_keys/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "zcash_keys" description = "Zcash key and address management" -version = "0.5.0" +version = "0.6.0" authors = [ "Jack Grigg ", "Kris Nuttycombe " @@ -72,12 +72,15 @@ hex.workspace = true jubjub.workspace = true proptest.workspace = true rand_core.workspace = true +orchard = { workspace = true, features = ["circuit"] } zcash_address = { workspace = true, features = ["test-dependencies"] } -zcash_primitives = { workspace = true, features = ["test-dependencies"] } [features] ## Enables use of transparent key parts and addresses -transparent-inputs = ["dep:bip32", "zcash_primitives/transparent-inputs"] +transparent-inputs = [ + "dep:bip32", + "transparent/transparent-inputs", +] ## Enables use of Orchard key parts and addresses orchard = ["dep:orchard"] @@ -89,7 +92,8 @@ sapling = ["dep:sapling"] test-dependencies = [ "dep:proptest", "orchard?/test-dependencies", - "zcash_primitives/test-dependencies", + "sapling?/test-dependencies", + "transparent/test-dependencies", ] #! ### Experimental features diff --git a/zcash_keys/src/address.rs b/zcash_keys/src/address.rs index 01093c4d5..15b7fb8fd 100644 --- a/zcash_keys/src/address.rs +++ b/zcash_keys/src/address.rs @@ -476,7 +476,7 @@ pub mod testing { #[cfg(test)] mod tests { use zcash_address::test_vectors; - use zcash_primitives::consensus::MAIN_NETWORK; + use zcash_protocol::consensus::MAIN_NETWORK; use super::{Address, UnifiedAddress}; @@ -484,7 +484,7 @@ mod tests { use crate::keys::sapling; #[cfg(any(feature = "orchard", feature = "sapling"))] - use zcash_primitives::zip32::AccountId; + use zip32::AccountId; #[test] #[cfg(any(feature = "orchard", feature = "sapling"))] diff --git a/zcash_keys/src/encoding.rs b/zcash_keys/src/encoding.rs index f4e97d006..efb3dca79 100644 --- a/zcash_keys/src/encoding.rs +++ b/zcash_keys/src/encoding.rs @@ -202,10 +202,9 @@ impl AddressCodec

for UnifiedAddress { /// # Examples /// /// ``` -/// use zcash_primitives::{ -/// constants::testnet::{COIN_TYPE, HRP_SAPLING_EXTENDED_SPENDING_KEY}, -/// zip32::AccountId, -/// }; +/// use zcash_protocol::constants::testnet::{COIN_TYPE, HRP_SAPLING_EXTENDED_SPENDING_KEY}; +/// use zip32::AccountId; +/// /// use zcash_keys::{ /// encoding::encode_extended_spending_key, /// keys::sapling, @@ -237,10 +236,8 @@ pub fn decode_extended_spending_key( /// /// ``` /// use ::sapling::zip32::ExtendedFullViewingKey; -/// use zcash_primitives::{ -/// constants::testnet::{COIN_TYPE, HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY}, -/// zip32::AccountId, -/// }; +/// use zcash_protocol::constants::testnet::{COIN_TYPE, HRP_SAPLING_EXTENDED_FULL_VIEWING_KEY}; +/// use zip32::AccountId; /// use zcash_keys::{ /// encoding::encode_extended_full_viewing_key, /// keys::sapling, @@ -305,9 +302,7 @@ pub fn decode_extfvk_with_network( /// use zcash_keys::{ /// encoding::encode_payment_address, /// }; -/// use zcash_primitives::{ -/// constants::testnet::HRP_SAPLING_PAYMENT_ADDRESS, -/// }; +/// use zcash_protocol::constants::testnet::HRP_SAPLING_PAYMENT_ADDRESS; /// /// let pa = PaymentAddress::from_bytes(&[ /// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x8e, 0x11, @@ -351,9 +346,7 @@ pub fn encode_payment_address_p( /// use zcash_keys::{ /// encoding::decode_payment_address, /// }; -/// use zcash_primitives::{ -/// consensus::{TEST_NETWORK, NetworkConstants, Parameters}, -/// }; +/// use zcash_protocol::consensus::{TEST_NETWORK, NetworkConstants, Parameters}; /// /// let pa = PaymentAddress::from_bytes(&[ /// 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x8e, 0x11, @@ -393,13 +386,9 @@ pub fn decode_payment_address( /// # Examples /// /// ``` -/// use zcash_keys::{ -/// encoding::encode_transparent_address, -/// }; -/// use zcash_primitives::{ -/// consensus::{TEST_NETWORK, NetworkConstants, Parameters}, -/// legacy::TransparentAddress, -/// }; +/// use zcash_keys::encoding::encode_transparent_address; +/// use zcash_protocol::consensus::{TEST_NETWORK, NetworkConstants, Parameters}; +/// use zcash_transparent::address::TransparentAddress; /// /// assert_eq!( /// encode_transparent_address( @@ -459,10 +448,8 @@ pub fn encode_transparent_address_p( /// # Examples /// /// ``` -/// use zcash_primitives::{ -/// consensus::{TEST_NETWORK, NetworkConstants, Parameters}, -/// legacy::TransparentAddress, -/// }; +/// use zcash_protocol::consensus::{TEST_NETWORK, NetworkConstants, Parameters}; +/// use zcash_transparent::address::TransparentAddress; /// use zcash_keys::{ /// encoding::decode_transparent_address, /// }; @@ -515,7 +502,7 @@ mod tests_sapling { Bech32DecodeError, }; use sapling::{zip32::ExtendedSpendingKey, PaymentAddress}; - use zcash_primitives::constants; + use zcash_protocol::constants; #[test] fn extended_spending_key() { diff --git a/zcash_keys/src/keys.rs b/zcash_keys/src/keys.rs index c83ef32b3..140e2cc58 100644 --- a/zcash_keys/src/keys.rs +++ b/zcash_keys/src/keys.rs @@ -56,7 +56,7 @@ pub mod sapling { /// # Examples /// /// ``` - /// use zcash_primitives::constants::testnet::COIN_TYPE; + /// use zcash_protocol::constants::testnet::COIN_TYPE; /// use zcash_keys::keys::sapling; /// use zip32::AccountId; /// @@ -1311,7 +1311,8 @@ mod tests { use proptest::prelude::proptest; - use {zcash_primitives::consensus::MAIN_NETWORK, zip32::AccountId}; + use zcash_protocol::consensus::MAIN_NETWORK; + use zip32::AccountId; #[cfg(any(feature = "sapling", feature = "orchard"))] use { @@ -1553,7 +1554,7 @@ mod tests { #[test] #[cfg(any(feature = "orchard", feature = "sapling"))] fn uivk_round_trip() { - use zcash_primitives::consensus::NetworkType; + use zcash_protocol::consensus::NetworkType; #[cfg(feature = "orchard")] let orchard = {