From 16948d9d78904b93dba9ad07cd0031e6395eaca6 Mon Sep 17 00:00:00 2001 From: Kris Nuttycombe Date: Thu, 4 Mar 2021 10:48:04 -0700 Subject: [PATCH] Move zcash_primitives::prover to sapling module --- zcash_client_backend/src/data_api/wallet.rs | 2 +- zcash_client_sqlite/src/wallet/transact.rs | 2 +- zcash_primitives/src/lib.rs | 1 - zcash_primitives/src/sapling.rs | 1 + zcash_primitives/src/{ => sapling}/prover.rs | 0 zcash_primitives/src/transaction/builder.rs | 8 +++----- zcash_proofs/src/prover.rs | 2 +- 7 files changed, 7 insertions(+), 9 deletions(-) rename zcash_primitives/src/{ => sapling}/prover.rs (100%) diff --git a/zcash_client_backend/src/data_api/wallet.rs b/zcash_client_backend/src/data_api/wallet.rs index 76f3df3e9..d61c1d537 100644 --- a/zcash_client_backend/src/data_api/wallet.rs +++ b/zcash_client_backend/src/data_api/wallet.rs @@ -4,7 +4,7 @@ use std::fmt::Debug; use zcash_primitives::{ consensus::{self, BranchId, NetworkUpgrade}, memo::MemoBytes, - prover::TxProver, + sapling::prover::TxProver, transaction::{ builder::Builder, components::{amount::DEFAULT_FEE, Amount}, diff --git a/zcash_client_sqlite/src/wallet/transact.rs b/zcash_client_sqlite/src/wallet/transact.rs index 02cd556df..fe1b548cc 100644 --- a/zcash_client_sqlite/src/wallet/transact.rs +++ b/zcash_client_sqlite/src/wallet/transact.rs @@ -156,7 +156,7 @@ mod tests { consensus::BlockHeight, legacy::TransparentAddress, note_encryption::try_sapling_output_recovery, - prover::TxProver, + sapling::prover::TxProver, transaction::{components::Amount, Transaction}, zip32::{ExtendedFullViewingKey, ExtendedSpendingKey}, }; diff --git a/zcash_primitives/src/lib.rs b/zcash_primitives/src/lib.rs index 7d6224af4..11a04a401 100644 --- a/zcash_primitives/src/lib.rs +++ b/zcash_primitives/src/lib.rs @@ -17,7 +17,6 @@ pub mod merkle_tree; pub mod note_encryption; pub mod pedersen_hash; pub mod primitives; -pub mod prover; pub mod sapling; pub mod serialize; pub mod transaction; diff --git a/zcash_primitives/src/sapling.rs b/zcash_primitives/src/sapling.rs index c4e73c6f5..b9fa54662 100644 --- a/zcash_primitives/src/sapling.rs +++ b/zcash_primitives/src/sapling.rs @@ -1,6 +1,7 @@ //! Structs and constants specific to the Sapling shielded pool. pub mod group_hash; +pub mod prover; pub mod redjubjub; use crate::{ diff --git a/zcash_primitives/src/prover.rs b/zcash_primitives/src/sapling/prover.rs similarity index 100% rename from zcash_primitives/src/prover.rs rename to zcash_primitives/src/sapling/prover.rs diff --git a/zcash_primitives/src/transaction/builder.rs b/zcash_primitives/src/transaction/builder.rs index 52411f631..c6d2dd4cf 100644 --- a/zcash_primitives/src/transaction/builder.rs +++ b/zcash_primitives/src/transaction/builder.rs @@ -18,8 +18,7 @@ use crate::{ merkle_tree::MerklePath, note_encryption::SaplingNoteEncryption, primitives::{Diversifier, Note, PaymentAddress}, - prover::TxProver, - sapling::{redjubjub::PrivateKey, spend_sig_internal, Node}, + sapling::{prover::TxProver, redjubjub::PrivateKey, spend_sig_internal, Node}, transaction::{ components::{ amount::Amount, amount::DEFAULT_FEE, OutputDescription, SpendDescription, TxOut, @@ -43,7 +42,7 @@ use crate::{ }; #[cfg(any(test, feature = "test-dependencies"))] -use crate::prover::mock::MockTxProver; +use crate::sapling::prover::mock::MockTxProver; const DEFAULT_TX_EXPIRY_DELTA: u32 = 20; @@ -966,8 +965,7 @@ mod tests { legacy::TransparentAddress, merkle_tree::{CommitmentTree, IncrementalWitness}, primitives::Rseed, - prover::mock::MockTxProver, - sapling::Node, + sapling::{prover::mock::MockTxProver, Node}, transaction::components::{amount::Amount, amount::DEFAULT_FEE}, zip32::{ExtendedFullViewingKey, ExtendedSpendingKey}, }; diff --git a/zcash_proofs/src/prover.rs b/zcash_proofs/src/prover.rs index e95d5ccf8..22d4efc0e 100644 --- a/zcash_proofs/src/prover.rs +++ b/zcash_proofs/src/prover.rs @@ -6,8 +6,8 @@ use std::path::Path; use zcash_primitives::{ merkle_tree::MerklePath, primitives::{Diversifier, PaymentAddress, ProofGenerationKey, Rseed}, - prover::TxProver, sapling::{ + prover::TxProver, redjubjub::{PublicKey, Signature}, Node, },