feat: remove unused arg on melt

This commit is contained in:
thesimplekid
2024-07-15 14:34:44 +01:00
parent d324907547
commit 140ec21883
5 changed files with 6 additions and 18 deletions

View File

@@ -36,6 +36,7 @@
- cdk(mint): On `swap` verify correct number of sigs on outputs when `SigAll` ([thesimplekid]).
### Removed
- cdk(wallet): Remove unused argument `SplitTarget` on `melt` ([thesimplekid]).
## [v0.2.0]

View File

@@ -167,16 +167,8 @@ impl JsWallet {
}
#[wasm_bindgen(js_name = melt)]
pub async fn melt(
&mut self,
quote_id: String,
split_target_amount: Option<JsAmount>,
) -> Result<JsMelted> {
let target = split_target_amount
.map(|a| SplitTarget::Value(*a.deref()))
.unwrap_or_default();
let melted = self.inner.melt(&quote_id, target).await.map_err(into_err)?;
pub async fn melt(&mut self, quote_id: String) -> Result<JsMelted> {
let melted = self.inner.melt(&quote_id).await.map_err(into_err)?;
Ok(melted.into())
}

View File

@@ -4,7 +4,6 @@ use std::str::FromStr;
use std::{io, println};
use anyhow::{bail, Result};
use cdk::amount::SplitTarget;
use cdk::wallet::Wallet;
use cdk::{Bolt11Invoice, UncheckedUrl};
@@ -47,7 +46,7 @@ pub async fn pay(wallets: HashMap<UncheckedUrl, Wallet>) -> Result<()> {
println!("{:?}", quote);
let melt = wallet.melt(&quote.id, SplitTarget::default()).await?;
let melt = wallet.melt(&quote.id).await?;
println!("Paid invoice: {}", melt.state);
if let Some(preimage) = melt.preimage {

View File

@@ -1189,11 +1189,7 @@ impl Wallet {
/// Melt
#[instrument(skip(self))]
pub async fn melt(
&self,
quote_id: &str,
amount_split_target: SplitTarget,
) -> Result<Melted, Error> {
pub async fn melt(&self, quote_id: &str) -> Result<Melted, Error> {
let quote_info = self.localstore.get_melt_quote(quote_id).await?;
let quote_info = if let Some(quote) = quote_info {

View File

@@ -267,7 +267,7 @@ impl MultiMintWallet {
}
}
wallet.melt(&quote.id, SplitTarget::default()).await
wallet.melt(&quote.id).await
}
/// Restore