mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-07-31 12:31:22 +00:00
Move merkle_tree::Node into sapling module
This makes the merkle_tree module properly generic over the tree hash. It still hard-codes a depth 32 tree, because Rust doesn't yet support generic sizes, and we are unlikely to need to alter the tree depth in future circuit changes.
This commit is contained in:
@@ -13,7 +13,7 @@ use sapling_crypto::{
|
||||
primitives::{Diversifier, Note, PaymentAddress, ProofGenerationKey, ValueCommitment},
|
||||
redjubjub::{PrivateKey, PublicKey, Signature},
|
||||
};
|
||||
use zcash_primitives::merkle_tree::CommitmentTreeWitness;
|
||||
use zcash_primitives::{merkle_tree::CommitmentTreeWitness, sapling::Node};
|
||||
|
||||
use super::compute_value_balance;
|
||||
|
||||
@@ -43,7 +43,7 @@ impl SaplingProvingContext {
|
||||
ar: Fs,
|
||||
value: u64,
|
||||
anchor: Fr,
|
||||
witness: CommitmentTreeWitness,
|
||||
witness: CommitmentTreeWitness<Node>,
|
||||
proving_key: &Parameters<Bls12>,
|
||||
verifying_key: &PreparedVerifyingKey<Bls12>,
|
||||
params: &JubjubBls12,
|
||||
@@ -112,7 +112,11 @@ impl SaplingProvingContext {
|
||||
payment_address: Some(payment_address),
|
||||
commitment_randomness: Some(rcm),
|
||||
ar: Some(ar),
|
||||
auth_path: witness.auth_path,
|
||||
auth_path: witness
|
||||
.auth_path
|
||||
.iter()
|
||||
.map(|n| n.map(|(node, b)| (node.into(), b)))
|
||||
.collect(),
|
||||
anchor: Some(anchor),
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user