Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cooperative Refund + Lowball Broadcast #40

Merged
merged 9 commits into from
May 1, 2024
13 changes: 11 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ pub mod swaps;
/// utilities (key, preimage, error)
pub mod util;

pub use bitcoin::{PublicKey,secp256k1::{Keypair, Secp256k1}, Address,blockdata::locktime::absolute::LockTime,hashes::hash160::Hash, Amount};
pub use elements::{secp256k1_zkp::{Keypair as ZKKeyPair, Secp256k1 as ZKSecp256k1}, address::Address as ElementsAddress, locktime::LockTime as ElementsLockTime};
pub use bitcoin::{
blockdata::locktime::absolute::LockTime,
hashes::hash160::Hash,
secp256k1::{Keypair, Secp256k1},
Address, Amount, PublicKey,
};
pub use elements::{
address::Address as ElementsAddress,
locktime::LockTime as ElementsLockTime,
secp256k1_zkp::{Keypair as ZKKeyPair, Secp256k1 as ZKSecp256k1},
};
pub use lightning_invoice::Bolt11Invoice;

pub use swaps::boltz::{SwapTxKind, SwapType};
Expand Down
9 changes: 6 additions & 3 deletions src/network/electrum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,13 @@ pub struct ElectrumConfig {
}

impl ElectrumConfig {

pub fn default(chain: Chain, regtest_url: Option<String>) -> Result<Self, Error> {
if (chain == Chain::LiquidRegtest || chain == Chain::BitcoinRegtest ) && regtest_url.is_none() {
return Err(Error::Electrum(electrum_client::Error::Message("Regtest requires using a custom url".to_string())))
if (chain == Chain::LiquidRegtest || chain == Chain::BitcoinRegtest)
&& regtest_url.is_none()
{
return Err(Error::Electrum(electrum_client::Error::Message(
"Regtest requires using a custom url".to_string(),
)));
}
match chain {
Chain::Bitcoin => Ok(ElectrumConfig::new(
Expand Down
Loading
Loading