Start treestate module
This commit is contained in:
parent
28a7420079
commit
0d618a3abf
|
@ -1,8 +1,11 @@
|
|||
use super::{difficulty::CompactDifficulty, BlockHeaderHash, Error};
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
|
||||
use crate::equihash_solution::EquihashSolution;
|
||||
use crate::merkle_tree::MerkleTreeRootHash;
|
||||
use crate::serialization::ZcashSerialize;
|
||||
use chrono::{DateTime, Duration, Utc};
|
||||
use crate::treestate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
|
||||
use super::{difficulty::CompactDifficulty, BlockHeaderHash, Error};
|
||||
|
||||
/// Block header.
|
||||
///
|
||||
|
|
|
@ -7,6 +7,7 @@ use crate::equihash_solution::EquihashSolution;
|
|||
use crate::merkle_tree::MerkleTreeRootHash;
|
||||
use crate::serialization::ZcashDeserializeInto;
|
||||
use crate::serialization::{ReadZcashExt, SerializationError, ZcashDeserialize, ZcashSerialize};
|
||||
use crate::treestate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
|
||||
use super::Block;
|
||||
use super::BlockHeader;
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::merkle_tree::MerkleTreeRootHash;
|
|||
use crate::serialization::{
|
||||
SerializationError, ZcashDeserialize, ZcashDeserializeInto, ZcashSerialize,
|
||||
};
|
||||
use crate::types::BlockHeight;
|
||||
use crate::treestate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
use crate::types::LockTime;
|
||||
use crate::Network;
|
||||
use crate::{sha256d_writer::Sha256dWriter, test::generate};
|
||||
|
|
|
@ -19,12 +19,12 @@ pub mod addresses;
|
|||
pub mod block;
|
||||
pub mod equihash_solution;
|
||||
pub mod keys;
|
||||
pub mod note_commitment_tree;
|
||||
pub mod notes;
|
||||
pub mod parameters;
|
||||
pub mod proofs;
|
||||
pub mod serialization;
|
||||
pub mod transaction;
|
||||
pub mod treestate;
|
||||
pub mod types;
|
||||
pub mod utils;
|
||||
|
||||
|
|
|
@ -95,7 +95,6 @@ pub struct NotePlaintext {
|
|||
value: Amount<NonNegative>,
|
||||
// TODO: refine type
|
||||
rho: [u8; 32],
|
||||
// TODO: refine as jub-jub appropriate in the base field.
|
||||
note_commitment_randomness: NoteCommitmentRandomness,
|
||||
memo: Memo,
|
||||
}
|
||||
|
|
|
@ -331,7 +331,7 @@ impl ZcashSerialize for Spend {
|
|||
|
||||
impl ZcashDeserialize for Spend {
|
||||
fn zcash_deserialize<R: io::Read>(mut reader: R) -> Result<Self, SerializationError> {
|
||||
use crate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
use crate::treestate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
Ok(Spend {
|
||||
cv: reader.read_32_bytes()?,
|
||||
anchor: SaplingNoteTreeRootHash(reader.read_32_bytes()?),
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
// XXX this name seems too long?
|
||||
use crate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
use crate::notes::sapling;
|
||||
use crate::proofs::Groth16Proof;
|
||||
use crate::redjubjub::{self, Binding, SpendAuth};
|
||||
use crate::serde_helpers;
|
||||
use crate::treestate::note_commitment_tree::SaplingNoteTreeRootHash;
|
||||
use futures::future::Either;
|
||||
|
||||
/// A _Spend Description_, as described in [protocol specification §7.3][ps].
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
use crate::{
|
||||
note_commitment_tree::SaplingNoteTreeRootHash,
|
||||
notes::{sapling, sprout},
|
||||
proofs::{Groth16Proof, ZkSnarkProof},
|
||||
transaction::{
|
||||
CoinbaseData, JoinSplit, JoinSplitData, OutPoint, Output, ShieldedData, Spend, Transaction,
|
||||
TransparentInput,
|
||||
},
|
||||
treestate::note_commitment_tree::SaplingNoteTreeRootHash,
|
||||
types::{
|
||||
amount::{Amount, NonNegative},
|
||||
BlockHeight, Script,
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
pub mod note_commitment_tree;
|
||||
// mod nullifier_set;
|
Loading…
Reference in New Issue