From 0c373f6bf89100e123c6ba8c0348b418e7334272 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Tue, 12 Mar 2024 14:41:26 +0000 Subject: [PATCH] Updates post merge --- .../sumtree-orderbook/src/sumtree/test/test_node.rs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs b/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs index 3f0141d..60804fb 100644 --- a/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs +++ b/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs @@ -216,8 +216,6 @@ fn test_node_insert_valid() { if test.print { println!("Print Tree: {}", test.name); println!("--------------------------"); - // print_tree(deps.as_ref().storage, &tree, true); - // println!(); let nodes = tree.traverse_bfs(deps.as_ref().storage).unwrap(); for (idx, row) in nodes.iter().enumerate() { @@ -355,7 +353,10 @@ fn test_node_deletion_valid() { if test.print { println!("Pre-Deletion Tree: {}", test.name); println!("--------------------------"); - print_tree(deps.as_ref().storage, &tree, 0, true); + let nodes = tree.traverse_bfs(deps.as_ref().storage).unwrap(); + for (idx, row) in nodes.iter().enumerate() { + print_tree_row(row.clone(), idx == 0, (nodes.len() - idx - 1) as u32); + } println!(); } @@ -379,7 +380,10 @@ fn test_node_deletion_valid() { if test.print { println!("Post-Deletion Tree: {}", test.name); println!("--------------------------"); - print_tree(deps.as_ref().storage, &tree, 0, true); + let nodes = tree.traverse_bfs(deps.as_ref().storage).unwrap(); + for (idx, row) in nodes.iter().enumerate() { + print_tree_row(row.clone(), idx == 0, (nodes.len() - idx - 1) as u32); + } println!(); }