mirror of
https://github.com/aljazceru/cdk.git
synced 2026-01-20 21:35:57 +01:00
fix(wallet): swap for proofs with conditons in send
This commit is contained in:
@@ -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?
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user