Apply suggestions from code review

Co-authored-by: str4d <thestr4d@gmail.com>
This commit is contained in:
Kris Nuttycombe 2022-02-24 09:16:39 -07:00 committed by GitHub
parent 1cf828fe7b
commit 273662c00b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -9,4 +9,4 @@ and this project adheres to Rust's notion of
Initial release!
## [Removed]
- The `std::hash::Hash` instance for `MerkleHashOrchard` has been removed.
- `impl std::hash::Hash for MerkleHashOrchard` (use `BTreeMap` instead of `HashMap`).

View File

@ -672,9 +672,9 @@ pub mod testing {
for note in notes.iter() {
let leaf = MerkleHashOrchard::from_cmx(&note.commitment().into());
tree.append(&leaf);
let (position, leaf) = tree.witness().unwrap();
let (position, leaf) = tree.witness().expect("tree is not empty");
let path = MerklePath::from((position, tree.authentication_path(position, &leaf).unwrap()));
let path = MerklePath::from((position, tree.authentication_path(position, &leaf).expect("we just witnessed the path")));
notes_and_auth_paths.push((*note, path));
}

View File

@ -285,7 +285,7 @@ pub mod testing {
{
let cmx = MerkleHashOrchard::from_bytes(&tv.leaves[i]).unwrap();
tree.append(&cmx);
tree.witness().unwrap();
tree.witness().expect("tree is not empty");
assert_eq!(tree.root().0, pallas::Base::from_bytes(&tv.root).unwrap());