diff --git a/cli/Cargo.lock b/cli/Cargo.lock index e8bdff8..34bbfe8 100644 --- a/cli/Cargo.lock +++ b/cli/Cargo.lock @@ -707,7 +707,7 @@ dependencies = [ [[package]] name = "boltz-client" version = "0.2.0" -source = "git+https://github.com/danielgranhao/boltz-rust?rev=e3e87186604c818c667b1293149423af5757dfbe#e3e87186604c818c667b1293149423af5757dfbe" +source = "git+https://github.com/hydra-yse/boltz-rust?rev=5c2a7aebd1669d599d76e782952b876a901bfb05#5c2a7aebd1669d599d76e782952b876a901bfb05" dependencies = [ "bip39", "bitcoin 0.32.5", diff --git a/lib/Cargo.lock b/lib/Cargo.lock index 6077b54..b21f847 100644 --- a/lib/Cargo.lock +++ b/lib/Cargo.lock @@ -802,7 +802,7 @@ dependencies = [ [[package]] name = "boltz-client" version = "0.2.0" -source = "git+https://github.com/danielgranhao/boltz-rust?rev=e3e87186604c818c667b1293149423af5757dfbe#e3e87186604c818c667b1293149423af5757dfbe" +source = "git+https://github.com/hydra-yse/boltz-rust?rev=5c2a7aebd1669d599d76e782952b876a901bfb05#5c2a7aebd1669d599d76e782952b876a901bfb05" dependencies = [ "bip39", "bitcoin 0.32.4", diff --git a/lib/core/Cargo.toml b/lib/core/Cargo.toml index bb37b13..47b6a70 100644 --- a/lib/core/Cargo.toml +++ b/lib/core/Cargo.toml @@ -17,7 +17,7 @@ workspace = true [dependencies] anyhow = { workspace = true } bip39 = "2.0.0" -boltz-client = { git = "https://github.com/danielgranhao/boltz-rust", rev = "e3e87186604c818c667b1293149423af5757dfbe" } +boltz-client = { git = "https://github.com/hydra-yse/boltz-rust", rev = "5c2a7aebd1669d599d76e782952b876a901bfb05" } chrono = "0.4" derivative = "2.2.0" env_logger = "0.11" diff --git a/lib/core/src/send_swap.rs b/lib/core/src/send_swap.rs index 9b44ebf..59ba1b4 100644 --- a/lib/core/src/send_swap.rs +++ b/lib/core/src/send_swap.rs @@ -393,7 +393,7 @@ impl SendSwapHandler { ensure_sdk!( history.len() <= 2, PaymentError::Generic { - err: "Lockup address history for Send Swap {id} has more than 2 txs".to_string() + err: format!("Lockup address history for Send Swap {id} has more than 2 txs") } ); @@ -557,7 +557,7 @@ impl SendSwapHandler { match (from_state, to_state) { (TimedOut, Created) => Ok(()), (_, Created) => Err(PaymentError::Generic { - err: "Cannot transition from {from_state:?} to Created state".to_string(), + err: format!("Cannot transition from {from_state:?} to Created state"), }), (Created | Pending, Pending) => Ok(()), diff --git a/lib/core/src/swapper/boltz/bitcoin.rs b/lib/core/src/swapper/boltz/bitcoin.rs index 0c7769c..782f018 100644 --- a/lib/core/src/swapper/boltz/bitcoin.rs +++ b/lib/core/src/swapper/boltz/bitcoin.rs @@ -3,6 +3,7 @@ use std::str::FromStr; use boltz_client::{ bitcoin::{address::Address, Transaction}, boltz::SwapTxKind, + fees::Fee, util::secrets::Preimage, BtcSwapTx, }; @@ -94,7 +95,11 @@ impl BoltzSwapper { false => None, }; - let signed_tx = refund_tx.sign_refund(&refund_keypair, broadcast_fees_sat, cooperative)?; + let signed_tx = refund_tx.sign_refund( + &refund_keypair, + Fee::Absolute(broadcast_fees_sat), + cooperative, + )?; Ok(signed_tx) } @@ -118,7 +123,7 @@ impl BoltzSwapper { let signed_tx = claim_tx_wrapper.sign_claim( &claim_keypair, &Preimage::from_str(&swap.preimage)?, - swap.claim_fees_sat, + Fee::Absolute(swap.claim_fees_sat), self.get_cooperative_details(swap.id.clone(), Some(pub_nonce), Some(partial_sig)), )?; diff --git a/lib/core/src/swapper/boltz/liquid.rs b/lib/core/src/swapper/boltz/liquid.rs index 49867e1..ed816ed 100644 --- a/lib/core/src/swapper/boltz/liquid.rs +++ b/lib/core/src/swapper/boltz/liquid.rs @@ -3,8 +3,9 @@ use std::str::FromStr; use boltz_client::{ boltz::SwapTxKind, elements::Transaction, + fees::Fee, util::{liquid_genesis_hash, secrets::Preimage}, - Amount, ElementsAddress as Address, LBtcSwapTx, + ElementsAddress as Address, LBtcSwapTx, }; use log::info; @@ -47,8 +48,9 @@ impl BoltzSwapper { let signed_tx = claim_tx_wrapper.sign_claim( &swap.get_claim_keypair()?, &Preimage::from_str(&swap.preimage)?, - Amount::from_sat(swap.claim_fees_sat), + Fee::Absolute(swap.claim_fees_sat), self.get_cooperative_details(swap.id.clone(), None, None), + true, )?; Ok(signed_tx) @@ -74,8 +76,9 @@ impl BoltzSwapper { let signed_tx = claim_tx_wrapper.sign_claim( &claim_keypair, &Preimage::from_str(&swap.preimage)?, - Amount::from_sat(swap.claim_fees_sat), + Fee::Absolute(swap.claim_fees_sat), self.get_cooperative_details(swap.id.clone(), Some(pub_nonce), Some(partial_sig)), + true, )?; Ok(signed_tx) @@ -192,8 +195,9 @@ impl BoltzSwapper { let signed_tx = refund_tx.sign_refund( &refund_keypair, - Amount::from_sat(broadcast_fees_sat), + Fee::Absolute(broadcast_fees_sat), cooperative, + true, )?; Ok(signed_tx) }