diff --git a/src/bin/tx.rs b/src/bin/tx.rs index e3802dffa..8d0f0a7e0 100644 --- a/src/bin/tx.rs +++ b/src/bin/tx.rs @@ -5,13 +5,12 @@ use rand::rngs::OsRng; use std::path::Path; use sapvi::crypto::{ - node::{hash_coin, Node}, - create_mint_proof, create_spend_proof, load_params, + load_params, merkle::{CommitmentTree, IncrementalWitness}, + node::{hash_coin, Node}, note::{EncryptedNote, Note}, nullifier::Nullifier, - save_params, setup_mint_prover, setup_spend_prover, verify_mint_proof, verify_spend_proof, - MintRevealedValues, SpendRevealedValues, + save_params, setup_mint_prover, setup_spend_prover, }; use sapvi::serial::{Decodable, Encodable}; use sapvi::state::{state_transition, ProgramState, StateUpdates}; diff --git a/src/crypto/mod.rs b/src/crypto/mod.rs index 1e311ed3f..321e903d4 100644 --- a/src/crypto/mod.rs +++ b/src/crypto/mod.rs @@ -1,8 +1,8 @@ -pub mod node; pub mod diffie_hellman; pub mod fr_serial; pub mod merkle; pub mod mint_proof; +pub mod node; pub mod note; pub mod nullifier; pub mod schnorr; diff --git a/src/state.rs b/src/state.rs index 91612054c..d351a61a4 100644 --- a/src/state.rs +++ b/src/state.rs @@ -3,12 +3,7 @@ use bls12_381::Bls12; use std::fmt; use crate::{ - crypto::{ - node::Node, - note::{EncryptedNote, Note}, - nullifier::Nullifier, - }, - error::{Error, Result}, + crypto::{node::Node, note::EncryptedNote, nullifier::Nullifier}, tx, }; diff --git a/src/tx/builder.rs b/src/tx/builder.rs index 31c47a6b5..f656d3711 100644 --- a/src/tx/builder.rs +++ b/src/tx/builder.rs @@ -7,16 +7,8 @@ use super::{ partial::{PartialTransaction, PartialTransactionClearInput, PartialTransactionInput}, Transaction, TransactionClearInput, TransactionInput, TransactionOutput, }; -use crate::crypto::{ - node::Node, - create_mint_proof, create_spend_proof, load_params, - merkle::CommitmentTree, - note::{EncryptedNote, Note}, - save_params, schnorr, setup_mint_prover, setup_spend_prover, verify_mint_proof, - verify_spend_proof, MintRevealedValues, SpendRevealedValues, -}; -use crate::error::{Error, Result}; -use crate::serial::{Decodable, Encodable, VarInt}; +use crate::crypto::{create_mint_proof, create_spend_proof, note::Note, schnorr}; +use crate::serial::Encodable; pub struct TransactionBuilder { pub clear_inputs: Vec, diff --git a/src/tx/partial.rs b/src/tx/partial.rs index 01d30fdf1..94f3fdaa3 100644 --- a/src/tx/partial.rs +++ b/src/tx/partial.rs @@ -2,16 +2,9 @@ use bellman::groth16; use bls12_381::Bls12; use std::io; -use super::{Transaction, TransactionClearInput, TransactionInput, TransactionOutput}; -use crate::crypto::{ - node::Node, - create_mint_proof, create_spend_proof, load_params, - merkle::CommitmentTree, - note::{EncryptedNote, Note}, - save_params, schnorr, setup_mint_prover, setup_spend_prover, verify_mint_proof, - verify_spend_proof, MintRevealedValues, SpendRevealedValues, -}; -use crate::error::{Error, Result}; +use super::TransactionOutput; +use crate::crypto::SpendRevealedValues; +use crate::error::Result; use crate::impl_vec; use crate::serial::{Decodable, Encodable, VarInt};