mirror of
https://github.com/logos-blockchain/lssa.git
synced 2026-01-08 16:23:12 +00:00
errors in utxo_tree
This commit is contained in:
parent
43bd2a8314
commit
ffad7c48d2
@ -88,7 +88,7 @@ mod tests {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn sample_utxo() -> UTXO {
|
fn sample_utxo() -> anyhow::Result<UTXO> {
|
||||||
UTXO::create_utxo_from_payload(sample_utxo_payload())
|
UTXO::create_utxo_from_payload(sample_utxo_payload())
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_insert_item() {
|
fn test_insert_item() {
|
||||||
let mut smt = UTXOSparseMerkleTree::new();
|
let mut smt = UTXOSparseMerkleTree::new();
|
||||||
let utxo = sample_utxo();
|
let utxo = sample_utxo().unwrap();
|
||||||
|
|
||||||
let result = smt.insert_item(utxo.clone());
|
let result = smt.insert_item(utxo.clone());
|
||||||
|
|
||||||
@ -119,8 +119,8 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_insert_items() {
|
fn test_insert_items() {
|
||||||
let mut smt = UTXOSparseMerkleTree::new();
|
let mut smt = UTXOSparseMerkleTree::new();
|
||||||
let utxo1 = sample_utxo();
|
let utxo1 = sample_utxo().unwrap();
|
||||||
let utxo2 = sample_utxo();
|
let utxo2 = sample_utxo().unwrap();
|
||||||
|
|
||||||
let result = smt.insert_items(vec![utxo1.clone(), utxo2.clone()]);
|
let result = smt.insert_items(vec![utxo1.clone(), utxo2.clone()]);
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_get_item_exists() {
|
fn test_get_item_exists() {
|
||||||
let mut smt = UTXOSparseMerkleTree::new();
|
let mut smt = UTXOSparseMerkleTree::new();
|
||||||
let utxo = sample_utxo();
|
let utxo = sample_utxo().unwrap();
|
||||||
|
|
||||||
smt.insert_item(utxo.clone()).unwrap();
|
smt.insert_item(utxo.clone()).unwrap();
|
||||||
|
|
||||||
@ -151,7 +151,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_get_item_not_exists() {
|
fn test_get_item_not_exists() {
|
||||||
let mut smt = UTXOSparseMerkleTree::new();
|
let mut smt = UTXOSparseMerkleTree::new();
|
||||||
let utxo = sample_utxo();
|
let utxo = sample_utxo().unwrap();
|
||||||
|
|
||||||
// Insert one UTXO and try to fetch a different hash
|
// Insert one UTXO and try to fetch a different hash
|
||||||
smt.insert_item(utxo).unwrap();
|
smt.insert_item(utxo).unwrap();
|
||||||
@ -166,7 +166,7 @@ mod tests {
|
|||||||
#[test]
|
#[test]
|
||||||
fn test_get_membership_proof() {
|
fn test_get_membership_proof() {
|
||||||
let mut smt = UTXOSparseMerkleTree::new();
|
let mut smt = UTXOSparseMerkleTree::new();
|
||||||
let utxo = sample_utxo();
|
let utxo = sample_utxo().unwrap();
|
||||||
|
|
||||||
smt.insert_item(utxo.clone()).unwrap();
|
smt.insert_item(utxo.clone()).unwrap();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user