From 91e18236d841a28730e068775a68c4480e04c078 Mon Sep 17 00:00:00 2001 From: thesimplekid Date: Mon, 13 May 2024 18:51:57 +0100 Subject: [PATCH] fix(wallet): swap for proofs with conditons in send --- crates/cdk/src/wallet.rs | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/crates/cdk/src/wallet.rs b/crates/cdk/src/wallet.rs index ab7c6e98..4d8dce40 100644 --- a/crates/cdk/src/wallet.rs +++ b/crates/cdk/src/wallet.rs @@ -730,14 +730,16 @@ impl Wallet { ) -> Result { let input_proofs = self.select_proofs(mint_url.clone(), unit, amount).await?; - let send_proofs = match input_proofs - .iter() - .map(|p| p.amount) - .sum::() - .eq(&amount) - { - true => Some(input_proofs), - false => { + let send_proofs = match ( + input_proofs + .iter() + .map(|p| p.amount) + .sum::() + .eq(&amount), + &conditions, + ) { + (true, None) => Some(input_proofs), + _ => { self.swap(mint_url, unit, Some(amount), input_proofs, conditions) .await? }