Skip to content

Commit

Permalink
Release zcash_keys version 0.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
nuttycom committed Dec 17, 2024
1 parent 2f33e1e commit f23e478
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 43 deletions.
3 changes: 1 addition & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }

Expand Down
2 changes: 1 addition & 1 deletion zcash_client_backend/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion zcash_client_sqlite/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
8 changes: 5 additions & 3 deletions zcash_keys/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ and this library adheres to Rust's notion of

## [Unreleased]

## [0.6.0] - 2024-12-16

### 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 dependency
on `zcash_primitives`.
- The `UnifiedAddressRequest` argument to the following methods is now optional:
- `zcash_keys::keys::UnifiedSpendingKey::address`
- `zcash_keys::keys::UnifiedSpendingKey::default_address`
Expand Down
12 changes: 8 additions & 4 deletions zcash_keys/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>",
"Kris Nuttycombe <[email protected]>"
Expand Down Expand Up @@ -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"]
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions zcash_keys/src/address.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,15 +476,15 @@ 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};

#[cfg(feature = "sapling")]
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"))]
Expand Down
39 changes: 13 additions & 26 deletions zcash_keys/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -202,10 +202,9 @@ impl<P: consensus::Parameters> AddressCodec<P> 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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -351,9 +346,7 @@ pub fn encode_payment_address_p<P: consensus::Parameters>(
/// 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,
Expand Down Expand Up @@ -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 transparent::address::TransparentAddress;
///
/// assert_eq!(
/// encode_transparent_address(
Expand Down Expand Up @@ -459,10 +448,8 @@ pub fn encode_transparent_address_p<P: consensus::Parameters>(
/// # Examples
///
/// ```
/// use zcash_primitives::{
/// consensus::{TEST_NETWORK, NetworkConstants, Parameters},
/// legacy::TransparentAddress,
/// };
/// use zcash_protocol::consensus::{TEST_NETWORK, NetworkConstants, Parameters};
/// use transparent::address::TransparentAddress;
/// use zcash_keys::{
/// encoding::decode_transparent_address,
/// };
Expand Down Expand Up @@ -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() {
Expand Down
7 changes: 4 additions & 3 deletions zcash_keys/src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
///
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit f23e478

Please sign in to comment.