From 28af551f2ce0bfe08523b7285750634a1a496b15 Mon Sep 17 00:00:00 2001 From: Thibault Martinez Date: Tue, 20 Feb 2024 09:24:58 +0100 Subject: [PATCH] ISA: fix implicit account transition (#2029) --- .../client/api/block_builder/input_selection/remainder.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 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 0d2651c394..1e9442ac7a 100644 --- a/sdk/src/client/api/block_builder/input_selection/remainder.rs +++ b/sdk/src/client/api/block_builder/input_selection/remainder.rs @@ -168,7 +168,7 @@ impl InputSelection { fn output_for_added_mana_exists(&self, remainder_address: &Address) -> bool { // Find the first value that matches the remainder address - self.added_outputs.iter().any(|o| { + self.non_remainder_outputs().any(|o| { (o.is_basic() || o.is_account() || o.is_anchor() || o.is_nft()) && o.unlock_conditions() .map_or(true, |uc| uc.expiration().is_none() && uc.timelock().is_none()) @@ -189,14 +189,16 @@ impl InputSelection { ]); // Remove those that do not have an ordering and sort let ordered_outputs = self - .added_outputs + .provided_outputs .iter_mut() + .chain(&mut self.added_outputs) .filter(|o| { o.unlock_conditions() .map_or(true, |uc| uc.expiration().is_none() && uc.timelock().is_none()) }) .filter_map(|o| sort_order.get(&o.kind()).map(|order| (*order, o))) .collect::>(); + // Find the first value that matches the remainder address ordered_outputs.into_values().find(|o| { matches!(o.required_address(