From 8662b0230c0b2225efa0350fa42741015cff2145 Mon Sep 17 00:00:00 2001 From: Tal Derei Date: Mon, 1 Apr 2024 22:37:03 -0700 Subject: [PATCH] properly handle memos --- crates/view/src/planner.rs | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/crates/view/src/planner.rs b/crates/view/src/planner.rs index 289a4b3745..be638b46f8 100644 --- a/crates/view/src/planner.rs +++ b/crates/view/src/planner.rs @@ -92,19 +92,12 @@ impl Planner { fn calculate_balance(&self) -> Balance { let mut balance = Balance::zero(); - println!("self.actions inside calculate_balance: {:?}", self.actions); for action in &self.actions { balance += action.balance(); } - println!("balance inside calculate balance: {:?}", balance); - println!( - "self.actions inside calculate_balance: {:?}", - self.change_outputs.values() - ); for action in self.change_outputs.values() { balance += action.balance(); } - println!("balance inside calculate balance: {:?}", balance); balance } @@ -576,8 +569,6 @@ impl Planner { let fmd_params = view.fmd_parameters().await?; // Caller has already processed all the user-supplied intents into complete action plans. - println!("self.plan.actions.clone(): {:?}", self.plan.actions.clone()); - self.actions = self.plan.actions.clone(); let change_address = view.address_by_index(source).await?; @@ -730,11 +721,9 @@ impl Planner { fee: self.fee_estimate(&self.gas_prices, &self.fee_tier), }, detection_data: None, - memo: None, + memo: self.plan.memo.clone(), }; - println!("action plans: {:?}", self.plan.actions); - // If there are outputs, we check that a memo has been added. If not, we add a blank memo. if self.plan.num_outputs() > 0 && self.plan.memo.is_none() { self.memo(MemoPlaintext::blank_memo(change_address.clone())) @@ -747,14 +736,6 @@ impl Planner { self.plan .populate_detection_data(&mut OsRng, fmd_params.precision_bits.into()); - println!("!!!!!!!!!!!!!!!!!!!!!!!!"); - println!( - "calculate_balance: {:?}", - self.calculate_balance().is_zero() - ); - println!("balance inner: {:?}", self.balance); - println!("!!!!!!!!!!!!!!!!!!!!!!!!"); - // All actions have now been added, so check to make sure that you don't build and submit an // empty transaction. if self.actions.is_empty() {