mirror of
https://github.com/aljazceru/cdk.git
synced 2026-02-03 12:16:12 +01:00
feat: remove unused arg on melt
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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("e_id, target).await.map_err(into_err)?;
|
||||
pub async fn melt(&mut self, quote_id: String) -> Result<JsMelted> {
|
||||
let melted = self.inner.melt("e_id).await.map_err(into_err)?;
|
||||
|
||||
Ok(melted.into())
|
||||
}
|
||||
|
||||
@@ -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("e.id, SplitTarget::default()).await?;
|
||||
let melt = wallet.melt("e.id).await?;
|
||||
|
||||
println!("Paid invoice: {}", melt.state);
|
||||
if let Some(preimage) = melt.preimage {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -267,7 +267,7 @@ impl MultiMintWallet {
|
||||
}
|
||||
}
|
||||
|
||||
wallet.melt("e.id, SplitTarget::default()).await
|
||||
wallet.melt("e.id).await
|
||||
}
|
||||
|
||||
/// Restore
|
||||
|
||||
Reference in New Issue
Block a user