mirror of
https://github.com/logos-blockchain/logos-execution-zone.git
synced 2026-03-23 18:53:13 +00:00
add test_add_tx
This commit is contained in:
parent
994e8ff802
commit
8d2da05c3c
@ -153,4 +153,16 @@ mod tests {
|
|||||||
let proof = tree.get_proof(tx1.hash());
|
let proof = tree.get_proof(tx1.hash());
|
||||||
assert!(proof.is_some());
|
assert!(proof.is_some());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn test_add_tx() {
|
||||||
|
let tx1 = MockTransaction { hash: get_first_32_bytes("tx1") };
|
||||||
|
let tx2 = MockTransaction { hash: get_first_32_bytes("tx2") };
|
||||||
|
|
||||||
|
let mut tree = HashStorageMerkleTree::new(vec![tx1.clone()]);
|
||||||
|
|
||||||
|
tree.add_tx(tx2.clone());
|
||||||
|
assert_eq!(tree.leaves.len(), 2);
|
||||||
|
assert_eq!(tree.get_tx(tx2.hash()), Some(&tx2));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user