Skip to content

Commit

Permalink
Implement Test for root_of_single_item_tree()
Browse files Browse the repository at this point in the history
  • Loading branch information
rurumimic authored and junha1 committed Oct 21, 2023
1 parent 9fd5157 commit f54b3a9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion core/src/merkle_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,12 @@ mod test {
#[test]
/// Check the root of the tree with a single item, with the manual calculation.
fn root_of_single_item_tree() {
// TODO
let key: Hash256 = Hash256::hash("hello world");
let merkle_tree: OneshotMerkleTree = OneshotMerkleTree::create(Vec::from([key]));
let root_hash: Hash256 = OneshotMerkleTree::root(&merkle_tree);

assert!(root_hash == key);
assert!(merkle_tree.hash_list.len() == 1);
}

#[test]
Expand Down

0 comments on commit f54b3a9

Please sign in to comment.