mirror of https://github.com/zcash/orchard.git
Merge pull request #311 from zcash/update-incrementalmerkletree
incrementalmerkletree 0.3.0-beta.2
This commit is contained in:
commit
ae773fde70
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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));
|
||||
}
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -74,8 +74,8 @@ fn bundle_chain() {
|
|||
let leaf = MerkleHashOrchard::from_cmx(&cmx);
|
||||
let mut tree = BridgeTree::<MerkleHashOrchard, 32>::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(),
|
||||
|
|
Loading…
Reference in New Issue