fix(wallet): swap for proofs with conditons in send

This commit is contained in:
thesimplekid
2024-05-13 18:51:57 +01:00
parent 2671c92c00
commit 91e18236d8

View File

@@ -730,14 +730,16 @@ impl Wallet {
) -> Result<String, Error> {
let input_proofs = self.select_proofs(mint_url.clone(), unit, amount).await?;
let send_proofs = match input_proofs
.iter()
.map(|p| p.amount)
.sum::<Amount>()
.eq(&amount)
{
true => Some(input_proofs),
false => {
let send_proofs = match (
input_proofs
.iter()
.map(|p| p.amount)
.sum::<Amount>()
.eq(&amount),
&conditions,
) {
(true, None) => Some(input_proofs),
_ => {
self.swap(mint_url, unit, Some(amount), input_proofs, conditions)
.await?
}