From bdc59751c75ca0bfa94e707da5565edd8783106f Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Mon, 15 Jan 2024 14:16:13 +0100 Subject: [PATCH] Use all_mana --- .../block_builder/input_selection/remainder.rs | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/sdk/src/client/api/block_builder/input_selection/remainder.rs b/sdk/src/client/api/block_builder/input_selection/remainder.rs index 13a3b2d0aa..e9dc415c5b 100644 --- a/sdk/src/client/api/block_builder/input_selection/remainder.rs +++ b/sdk/src/client/api/block_builder/input_selection/remainder.rs @@ -125,25 +125,11 @@ impl InputSelection { let mut input_mana = 0; for input in &self.selected_inputs { - let potential_mana = { - let min_deposit = input - .output - .minimum_amount(self.protocol_parameters.storage_score_parameters()); - let generation_amount = input.output.amount().saturating_sub(min_deposit); - - self.protocol_parameters.generate_mana_with_decay( - generation_amount, - input.output_id().transaction_id().slot_index(), - self.slot_index, - ) - }?; - let stored_mana = self.protocol_parameters.mana_with_decay( - input.output.mana(), + input_mana += input.output.all_mana( + &self.protocol_parameters, input.output_id().transaction_id().slot_index(), self.slot_index, )?; - - input_mana += potential_mana + stored_mana; // TODO rewards }