Skip to content

Commit

Permalink
Merge pull request zcash#1168 from nuttycom/zcash_keys_sapling_feature
Browse files Browse the repository at this point in the history
zcash_keys: Add `sapling` and `transparent` feature flags.
  • Loading branch information
nuttycom authored Feb 27, 2024
2 parents f50deb4 + 635bc31 commit 5ed788d
Show file tree
Hide file tree
Showing 7 changed files with 415 additions and 230 deletions.
2 changes: 1 addition & 1 deletion zcash_client_backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ rustdoc-args = ["--cfg", "docsrs"]
[dependencies]
zcash_address.workspace = true
zcash_encoding.workspace = true
zcash_keys.workspace = true
zcash_keys = { workspace = true, features = ["sapling"] }
zcash_note_encryption.workspace = true
zcash_primitives.workspace = true
zip32.workspace = true
Expand Down
5 changes: 3 additions & 2 deletions zcash_client_backend/src/data_api/wallet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ where
/// };
/// use zcash_proofs::prover::LocalTxProver;
/// use zcash_client_backend::{
/// keys::UnifiedSpendingKey,
/// keys::{UnifiedSpendingKey, UnifiedAddressRequest},
/// data_api::{wallet::create_spend_to_address, error::Error, testing},
/// wallet::OvkPolicy,
/// };
Expand All @@ -166,8 +166,9 @@ where
/// };
///
/// let account = AccountId::from(0);
/// let req = UnifiedAddressRequest::new(false, true, true);
/// let usk = UnifiedSpendingKey::from_seed(&Network::TestNetwork, &[0; 32][..], account).unwrap();
/// let to = usk.to_unified_full_viewing_key().default_address().0.into();
/// let to = usk.to_unified_full_viewing_key().default_address(req).0.into();
///
/// let mut db_read = testing::MockWalletDb {
/// network: Network::TestNetwork
Expand Down
12 changes: 8 additions & 4 deletions zcash_client_sqlite/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ rustdoc-args = ["--cfg", "docsrs"]
zcash_address.workspace = true
zcash_client_backend = { workspace = true, features = ["unstable-serialization", "unstable-spanning-tree"] }
zcash_encoding.workspace = true
zcash_keys = { workspace = true, features = ["orchard"] }
zcash_keys = { workspace = true, features = ["orchard", "sapling"] }
zcash_primitives.workspace = true

# Dependencies exposed in a public API:
Expand Down Expand Up @@ -90,7 +90,7 @@ multicore = ["maybe-rayon/threads", "zcash_primitives/multicore"]

## Enables support for storing data related to the sending and receiving of
## Orchard funds.
orchard = ["dep:orchard", "zcash_client_backend/orchard"]
orchard = ["dep:orchard", "zcash_client_backend/orchard", "zcash_keys/orchard"]

## Exposes APIs that are useful for testing, such as `proptest` strategies.
test-dependencies = [
Expand All @@ -100,8 +100,12 @@ test-dependencies = [
"incrementalmerkletree/test-dependencies",
]

## Enables receiving transparent funds and shielding them.
transparent-inputs = ["dep:hdwallet", "zcash_client_backend/transparent-inputs"]
## Enables receiving transparent funds and sending to transparent recipients
transparent-inputs = [
"dep:hdwallet",
"zcash_keys/transparent-inputs",
"zcash_client_backend/transparent-inputs"
]

#! ### Experimental features

Expand Down
5 changes: 4 additions & 1 deletion zcash_keys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ subtle.workspace = true
bls12_381.workspace = true
group.workspace = true
orchard = { workspace = true, optional = true }
sapling.workspace = true
sapling = { workspace = true, optional = true }

# - Test dependencies
proptest = { workspace = true, optional = true }
Expand All @@ -75,6 +75,9 @@ transparent-inputs = ["dep:hdwallet", "zcash_primitives/transparent-inputs"]
## Enables use of Orchard key parts and addresses
orchard = ["dep:orchard"]

## Enables use of Sapling key parts and addresses
sapling = ["dep:sapling"]

## Exposes APIs that are useful for testing, such as `proptest` strategies.
test-dependencies = [
"dep:proptest",
Expand Down
Loading

0 comments on commit 5ed788d

Please sign in to comment.