From 5c1fbafb9c5c613512d5404cb2020fe1f6725d16 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Fri, 22 Mar 2024 18:17:35 +0000 Subject: [PATCH] Removed unnecessary print lines --- .../sumtree-orderbook/src/sumtree/node.rs | 18 ------------------ .../src/sumtree/test/test_node.rs | 4 ---- 2 files changed, 22 deletions(-) diff --git a/contracts/sumtree-orderbook/src/sumtree/node.rs b/contracts/sumtree-orderbook/src/sumtree/node.rs index 227d90f..4142e36 100644 --- a/contracts/sumtree-orderbook/src/sumtree/node.rs +++ b/contracts/sumtree-orderbook/src/sumtree/node.rs @@ -371,8 +371,6 @@ impl TreeNode { new_node.parent = Some(self.key); new_node.save(storage)?; self.save(storage)?; - #[cfg(test)] - println!("Inserted {} left on {}", new_node, self); self.rebalance(storage)?; return Ok(()); } @@ -387,8 +385,6 @@ impl TreeNode { new_node.parent = Some(self.key); new_node.save(storage)?; self.save(storage)?; - #[cfg(test)] - println!("Inserted {} right on {}", new_node, self); self.rebalance(storage)?; return Ok(()); } @@ -399,8 +395,6 @@ impl TreeNode { new_node.parent = Some(self.key); new_node.save(storage)?; self.save(storage)?; - #[cfg(test)] - println!("Inserted {} right on {}", new_node, self); self.rebalance(storage)?; return Ok(()); } @@ -419,11 +413,6 @@ impl TreeNode { let new_left = left.split(storage, new_node)?; self.left = Some(new_left); self.save(storage)?; - #[cfg(test)] - println!( - "Split {} left on {} generating {}", - new_node, self, new_left - ); self.rebalance(storage)?; return Ok(()); } @@ -436,8 +425,6 @@ impl TreeNode { new_node.parent = Some(self.key); new_node.save(storage)?; self.save(storage)?; - #[cfg(test)] - println!("Inserted {} right on {} after reordering", new_node, self); self.rebalance(storage)?; return Ok(()); } @@ -448,11 +435,6 @@ impl TreeNode { let new_right = right.split(storage, new_node)?; self.right = Some(new_right); self.save(storage)?; - #[cfg(test)] - println!( - "Split {} right on {} generating {}", - new_node, self, new_right - ); self.rebalance(storage)?; return Ok(()); } diff --git a/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs b/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs index ee91e38..b0ef91c 100644 --- a/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs +++ b/contracts/sumtree-orderbook/src/sumtree/test/test_node.rs @@ -494,10 +494,7 @@ fn test_tree_rebalancing() { NodeType::leaf(6u32, 1u32), NodeType::leaf(3u32, 1u32), NodeType::leaf(5u32, 1u32), - NodeType::leaf(20u32, 1u32), - NodeType::leaf(13u32, 1u32), NodeType::leaf(4u32, 1u32), - NodeType::leaf(7u32, 1u32), ], print: true, }, @@ -511,7 +508,6 @@ fn test_tree_rebalancing() { NodeType::leaf(3u32, 1u32), NodeType::leaf(2u32, 1u32), NodeType::leaf(4u32, 1u32), - NodeType::leaf(12u32, 1u32), ], print: true, },