mirror of https://github.com/zcash/orchard.git
Merge pull request #314 from nuttycom/feature/spend_minconf
Update incrementalmerkletree dependency version.
This commit is contained in:
commit
a30caec124
|
@ -84,3 +84,4 @@ debug = true
|
|||
[patch.crates-io]
|
||||
halo2_gadgets = { git = "https://github.com/zcash/halo2.git", rev = "0c33fa4e6e41464884765c8fb4cefebafd300ca2" }
|
||||
halo2_proofs = { git = "https://github.com/zcash/halo2.git", rev = "0c33fa4e6e41464884765c8fb4cefebafd300ca2" }
|
||||
incrementalmerkletree = { git = "https://github.com/zcash/incrementalmerkletree.git", rev = "f23e3d89507849a24543121839eea6f40b141aff" }
|
||||
|
|
|
@ -590,8 +590,7 @@ impl<V> Bundle<InProgress<Proof, PartiallyAuthorized>, V> {
|
|||
#[cfg_attr(docsrs, doc(cfg(feature = "test-dependencies")))]
|
||||
pub mod testing {
|
||||
use core::fmt::Debug;
|
||||
|
||||
use incrementalmerkletree::{bridgetree::BridgeTree, Frontier, Tree};
|
||||
use incrementalmerkletree::{bridgetree::BridgeTree, Tree};
|
||||
use rand::{rngs::StdRng, CryptoRng, SeedableRng};
|
||||
|
||||
use proptest::collection::vec;
|
||||
|
@ -666,6 +665,7 @@ pub mod testing {
|
|||
(
|
||||
n_notes in 1usize..30,
|
||||
n_recipients in 1..30,
|
||||
|
||||
)
|
||||
(
|
||||
// generate note values that we're certain won't exceed MAX_NOTE_VALUE in total
|
||||
|
@ -691,14 +691,15 @@ pub mod testing {
|
|||
tree.append(&leaf);
|
||||
let position = tree.witness().expect("tree is not empty");
|
||||
|
||||
let path = MerklePath::from((position, tree.authentication_path(position).expect("we just witnessed the path")));
|
||||
let root = tree.root(0).unwrap();
|
||||
let path = MerklePath::from((position, tree.authentication_path(position, &root).expect("we just witnessed the path")));
|
||||
notes_and_auth_paths.push((*note, path));
|
||||
}
|
||||
|
||||
ArbitraryBundleInputs {
|
||||
rng: StdRng::from_seed(rng_seed),
|
||||
sk,
|
||||
anchor: tree.root().into(),
|
||||
anchor: tree.root(0).unwrap().into(),
|
||||
notes: notes_and_auth_paths,
|
||||
recipient_amounts
|
||||
}
|
||||
|
|
|
@ -284,14 +284,15 @@ pub mod testing {
|
|||
let position = tree.witness().expect("tree is not empty");
|
||||
assert_eq!(position, i.into());
|
||||
|
||||
assert_eq!(tree.root().0, pallas::Base::from_repr(tv.root).unwrap());
|
||||
let root = tree.root(0).unwrap();
|
||||
assert_eq!(root.0, pallas::Base::from_repr(tv.root).unwrap());
|
||||
|
||||
// Check paths for all leaves up to this point. The test vectors include paths
|
||||
// for not-yet-appended leaves (using UNCOMMITTED_ORCHARD as the leaf value),
|
||||
// but BridgeTree doesn't encode these.
|
||||
for j in 0..=i {
|
||||
assert_eq!(
|
||||
tree.authentication_path(j.try_into().unwrap()),
|
||||
tree.authentication_path(j.try_into().unwrap(), &root),
|
||||
Some(
|
||||
tv.paths[j]
|
||||
.iter()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use incrementalmerkletree::{bridgetree::BridgeTree, Frontier, Hashable, Tree};
|
||||
use incrementalmerkletree::{bridgetree::BridgeTree, Hashable, Tree};
|
||||
use orchard::{
|
||||
builder::Builder,
|
||||
bundle::{Authorized, Flags},
|
||||
|
@ -73,12 +73,13 @@ fn bundle_chain() {
|
|||
let mut tree = BridgeTree::<MerkleHashOrchard, 32>::new(0);
|
||||
tree.append(&leaf);
|
||||
let position = tree.witness().unwrap();
|
||||
let auth_path = tree.authentication_path(position).unwrap();
|
||||
let root = tree.root(0).unwrap();
|
||||
let auth_path = tree.authentication_path(position, &root).unwrap();
|
||||
let merkle_path = MerklePath::from_parts(
|
||||
u64::from(position).try_into().unwrap(),
|
||||
auth_path[..].try_into().unwrap(),
|
||||
);
|
||||
let anchor = tree.root().into();
|
||||
let anchor = root.into();
|
||||
assert_eq!(anchor, merkle_path.root(cmx));
|
||||
|
||||
let mut builder = Builder::new(Flags::from_parts(true, true), anchor);
|
||||
|
|
Loading…
Reference in New Issue