mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-05 23:03:06 +00:00
add test_insert_items
This commit is contained in:
parent
887a8d9600
commit
c14b5a59be
@ -114,5 +114,23 @@ mod tests {
|
||||
assert!(smt.curr_root.is_some());
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_insert_items() {
|
||||
let mut smt = UTXOSparseMerkleTree::new();
|
||||
let utxo1 = sample_utxo();
|
||||
let utxo2 = sample_utxo();
|
||||
|
||||
let result = smt.insert_items(vec![utxo1.clone(), utxo2.clone()]);
|
||||
|
||||
// Test insertion of multiple items is successful
|
||||
assert!(result.is_ok());
|
||||
|
||||
// Test UTXOs are now stored in the tree
|
||||
assert!(smt.store.get(&utxo1.hash).is_some());
|
||||
assert!(smt.store.get(&utxo2.hash).is_some());
|
||||
|
||||
// Test curr_root is updated
|
||||
assert!(smt.curr_root.is_some());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user