diff --git a/CHANGELOG.md b/CHANGELOG.md index f2c04ae0..9415e6c4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,7 +14,7 @@ and this project adheres to Rust's notion of - `FullViewingKey::scope_for_address` ### Changed -- Migrated to `halo2_proofs 0.1.0-beta.4`. +- Migrated to `halo2_proofs 0.1.0-beta.4`, `incrementalmerkletree 0.3.0-beta.2`. - `orchard::builder`: - `Builder::add_spend` now requires that the `FullViewingKey` matches the given `Note`, and handles any scoping itself (instead of requiring the diff --git a/Cargo.toml b/Cargo.toml index 6d6bd981..2ac8329c 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -41,7 +41,7 @@ nonempty = "0.7" serde = { version = "1.0", features = ["derive"] } subtle = "2.3" zcash_note_encryption = "0.1" -incrementalmerkletree = "=0.3.0-beta.1" +incrementalmerkletree = "=0.3.0-beta.2" # Developer tooling dependencies plotters = { version = "0.3.0", optional = true } diff --git a/src/builder.rs b/src/builder.rs index 5808c67a..ae2df0ac 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -690,9 +690,9 @@ pub mod testing { for note in notes.iter() { let leaf = MerkleHashOrchard::from_cmx(¬e.commitment().into()); tree.append(&leaf); - let (position, leaf) = tree.witness().expect("tree is not empty"); + let position = tree.witness().expect("tree is not empty"); - let path = MerklePath::from((position, tree.authentication_path(position, &leaf).expect("we just witnessed the path"))); + let path = MerklePath::from((position, tree.authentication_path(position).expect("we just witnessed the path"))); notes_and_auth_paths.push((*note, path)); } diff --git a/src/tree.rs b/src/tree.rs index 874d08e0..dd01af7e 100644 --- a/src/tree.rs +++ b/src/tree.rs @@ -283,7 +283,8 @@ pub mod testing { { let cmx = MerkleHashOrchard::from_bytes(&tv.leaves[i]).unwrap(); tree.append(&cmx); - tree.witness().expect("tree is not empty"); + 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()); @@ -291,9 +292,8 @@ pub mod testing { // for not-yet-appended leaves (using UNCOMMITTED_ORCHARD as the leaf value), // but BridgeTree doesn't encode these. for j in 0..=i { - let leaf = MerkleHashOrchard::from_bytes(&tv.leaves[j]).unwrap(); assert_eq!( - tree.authentication_path(j.try_into().unwrap(), &leaf), + tree.authentication_path(j.try_into().unwrap()), Some( tv.paths[j] .iter() diff --git a/tests/builder.rs b/tests/builder.rs index c7496f9f..9f89ec7d 100644 --- a/tests/builder.rs +++ b/tests/builder.rs @@ -74,8 +74,8 @@ fn bundle_chain() { let leaf = MerkleHashOrchard::from_cmx(&cmx); let mut tree = BridgeTree::::new(0); tree.append(&leaf); - let (position, leaf) = tree.witness().unwrap(); - let auth_path = tree.authentication_path(position, &leaf).unwrap(); + let position = tree.witness().unwrap(); + let auth_path = tree.authentication_path(position).unwrap(); let merkle_path = MerklePath::from_parts( u64::from(position).try_into().unwrap(), auth_path[..].try_into().unwrap(),