mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-03 22:03:06 +00:00
add test_get_tx
This commit is contained in:
parent
dc058c666b
commit
7b9d1bafaf
@ -131,4 +131,15 @@ mod tests {
|
|||||||
assert_eq!(tree.leaves.len(), 2);
|
assert_eq!(tree.leaves.len(), 2);
|
||||||
assert!(tree.get_root().is_some());
|
assert!(tree.get_root().is_some());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_get_tx() {
|
||||||
|
let tx1 = MockTransaction { hash: get_first_32_bytes("tx1") };
|
||||||
|
let tx2 = MockTransaction { hash: get_first_32_bytes("tx2") };
|
||||||
|
|
||||||
|
let tree = HashStorageMerkleTree::new(vec![tx1.clone(), tx2.clone()]);
|
||||||
|
|
||||||
|
assert_eq!(tree.get_tx(tx1.hash()), Some(&tx1));
|
||||||
|
assert_eq!(tree.get_tx(tx2.hash()), Some(&tx2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user