fix tests

This commit is contained in:
Sergio Chouhy
2026-04-21 22:39:14 -03:00
parent 145198a078
commit 9d2abc76a1
7 changed files with 122 additions and 17 deletions
@@ -533,25 +533,49 @@ mod tests {
.key_map
.get_mut(&ChainIndex::from_str("/1").unwrap())
.unwrap();
acc.value.1.push((0, nssa::Account { balance: 2, ..nssa::Account::default() }));
acc.value.1.push((
0,
nssa::Account {
balance: 2,
..nssa::Account::default()
},
));
let acc = tree
.key_map
.get_mut(&ChainIndex::from_str("/2").unwrap())
.unwrap();
acc.value.1.push((0, nssa::Account { balance: 3, ..nssa::Account::default() }));
acc.value.1.push((
0,
nssa::Account {
balance: 3,
..nssa::Account::default()
},
));
let acc = tree
.key_map
.get_mut(&ChainIndex::from_str("/0/1").unwrap())
.unwrap();
acc.value.1.push((0, nssa::Account { balance: 5, ..nssa::Account::default() }));
acc.value.1.push((
0,
nssa::Account {
balance: 5,
..nssa::Account::default()
},
));
let acc = tree
.key_map
.get_mut(&ChainIndex::from_str("/1/0").unwrap())
.unwrap();
acc.value.1.push((0, nssa::Account { balance: 6, ..nssa::Account::default() }));
acc.value.1.push((
0,
nssa::Account {
balance: 6,
..nssa::Account::default()
},
));
// Update account_id_map for nodes that now have entries
for chain_index_str in ["/1", "/2", "/0/1", "/1/0"] {
+7 -1
View File
@@ -174,7 +174,13 @@ mod tests {
// /2
let second_chain_index = key_tree_private.generate_new_node_layered().unwrap();
key_tree_private.key_map.get(&second_chain_index).expect("Node was just inserted").value.0.clone()
key_tree_private
.key_map
.get(&second_chain_index)
.expect("Node was just inserted")
.value
.0
.clone()
}
#[test]