mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-05-02 14:56:10 -04:00
Update dependencies and rust-toolchain to 1.59
This commit updates the rust-toolchain to the current stable version 1.59, and fixes a number of new clippy warnings from that change. Other changes: - updates backoff to 0.4 - updates swap to 2021 edition - updates comfy-table to 5.0 - updates monero-wallet to 2021 edition - updates moneor-harness to 2021 edition - updates bdk and rust_decimal - updates tokio-util to 0.7 - updates workflow to use actions/setup-python@3 - updates pem and serde_with - adds stable rust toolchain notice to readme
This commit is contained in:
parent
c76abd48c7
commit
5a3675a06f
27 changed files with 265 additions and 186 deletions
|
@ -2,7 +2,7 @@
|
|||
name = "swap"
|
||||
version = "0.10.2"
|
||||
authors = [ "The COMIT guys <hello@comit.network>" ]
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
description = "XMR/BTC trustless atomic swaps."
|
||||
|
||||
[lib]
|
||||
|
@ -13,13 +13,13 @@ anyhow = "1"
|
|||
async-compression = { version = "0.3", features = [ "bzip2", "tokio" ] }
|
||||
async-trait = "0.1"
|
||||
atty = "0.2"
|
||||
backoff = { version = "0.3", features = [ "tokio" ] }
|
||||
backoff = { version = "0.4", features = [ "tokio" ] }
|
||||
base64 = "0.13"
|
||||
bdk = "0.12"
|
||||
bdk = "0.16"
|
||||
big-bytes = "1"
|
||||
bitcoin = { version = "0.27", features = [ "rand", "use-serde" ] }
|
||||
bmrng = "0.5"
|
||||
comfy-table = "4.1.1"
|
||||
comfy-table = "5.0"
|
||||
config = { version = "0.11", default-features = false, features = [ "toml" ] }
|
||||
conquer-once = "0.3"
|
||||
curve25519-dalek = { package = "curve25519-dalek-ng", version = "4" }
|
||||
|
@ -56,7 +56,7 @@ time = "0.3"
|
|||
tokio = { version = "1", features = [ "rt-multi-thread", "time", "macros", "sync", "process", "fs", "net" ] }
|
||||
tokio-socks = "0.5"
|
||||
tokio-tungstenite = { version = "0.15", features = [ "rustls-tls" ] }
|
||||
tokio-util = { version = "0.6", features = [ "io" ] }
|
||||
tokio-util = { version = "0.7", features = [ "io", "codec" ] }
|
||||
toml = "0.5"
|
||||
torut = { version = "0.2", default-features = false, features = [ "v3", "control" ] }
|
||||
tracing = { version = "0.1", features = [ "attributes" ] }
|
||||
|
|
|
@ -47,7 +47,7 @@ async fn main() -> Result<()> {
|
|||
json,
|
||||
cmd,
|
||||
} = match parse_args_and_apply_defaults(env::args_os())? {
|
||||
ParseResult::Arguments(args) => args,
|
||||
ParseResult::Arguments(args) => *args,
|
||||
ParseResult::PrintAndExitZero { message } => {
|
||||
println!("{}", message);
|
||||
std::process::exit(0);
|
||||
|
@ -95,7 +95,7 @@ async fn main() -> Result<()> {
|
|||
tracing::debug!(peer_id = %swarm.local_peer_id(), "Network layer initialized");
|
||||
|
||||
let (event_loop, mut event_loop_handle) =
|
||||
EventLoop::new(swap_id, swarm, seller_peer_id, env_config)?;
|
||||
EventLoop::new(swap_id, swarm, seller_peer_id)?;
|
||||
let event_loop = tokio::spawn(event_loop.run());
|
||||
|
||||
let max_givable = || bitcoin_wallet.max_giveable(TxLock::script_size());
|
||||
|
@ -276,8 +276,7 @@ async fn main() -> Result<()> {
|
|||
.add_address(seller_peer_id, seller_address);
|
||||
}
|
||||
|
||||
let (event_loop, event_loop_handle) =
|
||||
EventLoop::new(swap_id, swarm, seller_peer_id, env_config)?;
|
||||
let (event_loop, event_loop_handle) = EventLoop::new(swap_id, swarm, seller_peer_id)?;
|
||||
let handle = tokio::spawn(event_loop.run());
|
||||
|
||||
let monero_receive_address = db.get_monero_address(swap_id).await?;
|
||||
|
|
|
@ -171,7 +171,7 @@ pub fn verify_sig(
|
|||
) -> Result<()> {
|
||||
let ecdsa = ECDSA::verify_only();
|
||||
|
||||
if ecdsa.verify(&verification_key.0, &transaction_sighash.into_inner(), &sig) {
|
||||
if ecdsa.verify(&verification_key.0, &transaction_sighash.into_inner(), sig) {
|
||||
Ok(())
|
||||
} else {
|
||||
bail!(InvalidSignature)
|
||||
|
@ -194,7 +194,7 @@ pub fn verify_encsig(
|
|||
&verification_key.0,
|
||||
&encryption_key.0,
|
||||
&digest.into_inner(),
|
||||
&encsig,
|
||||
encsig,
|
||||
) {
|
||||
Ok(())
|
||||
} else {
|
||||
|
@ -213,7 +213,7 @@ pub fn build_shared_output_descriptor(A: Point, B: Point) -> Descriptor<bitcoin:
|
|||
let A = ToHex::to_hex(&secp256k1::PublicKey::from(A));
|
||||
let B = ToHex::to_hex(&secp256k1::PublicKey::from(B));
|
||||
|
||||
let miniscript = MINISCRIPT_TEMPLATE.replace("A", &A).replace("B", &B);
|
||||
let miniscript = MINISCRIPT_TEMPLATE.replace('A', &A).replace('B', &B);
|
||||
|
||||
let miniscript =
|
||||
bdk::miniscript::Miniscript::<bitcoin::PublicKey, Segwitv0>::from_str(&miniscript)
|
||||
|
|
|
@ -200,9 +200,10 @@ mod tests {
|
|||
#[tokio::test]
|
||||
async fn bob_can_fund_without_a_change_output() {
|
||||
let (A, B) = alice_and_bob();
|
||||
let fees = 610;
|
||||
let fees = 300;
|
||||
let agreed_amount = Amount::from_sat(10000);
|
||||
let wallet = WalletBuilder::new(agreed_amount.as_sat() + fees).build();
|
||||
let amount = agreed_amount.as_sat() + fees;
|
||||
let wallet = WalletBuilder::new(amount).build();
|
||||
|
||||
let psbt = bob_make_psbt(A, B, &wallet, agreed_amount).await;
|
||||
assert_eq!(
|
||||
|
@ -262,7 +263,7 @@ mod tests {
|
|||
amount: Amount,
|
||||
) -> PartiallySignedTransaction {
|
||||
let change = wallet.new_address().await.unwrap();
|
||||
TxLock::new(&wallet, amount, A, B, change)
|
||||
TxLock::new(wallet, amount, A, B, change)
|
||||
.await
|
||||
.unwrap()
|
||||
.into()
|
||||
|
|
|
@ -128,7 +128,7 @@ impl TxRedeem {
|
|||
|
||||
let sig = sigs
|
||||
.into_iter()
|
||||
.find(|sig| verify_sig(&B, &self.digest(), &sig).is_ok())
|
||||
.find(|sig| verify_sig(&B, &self.digest(), sig).is_ok())
|
||||
.context("Neither signature on witness stack verifies against B")?;
|
||||
|
||||
Ok(sig)
|
||||
|
|
|
@ -132,7 +132,7 @@ impl TxRefund {
|
|||
|
||||
let sig = sigs
|
||||
.into_iter()
|
||||
.find(|sig| verify_sig(&B, &self.digest(), &sig).is_ok())
|
||||
.find(|sig| verify_sig(&B, &self.digest(), sig).is_ok())
|
||||
.context("Neither signature on witness stack verifies against B")?;
|
||||
|
||||
Ok(sig)
|
||||
|
|
|
@ -102,7 +102,7 @@ impl Wallet {
|
|||
self.wallet
|
||||
.lock()
|
||||
.await
|
||||
.broadcast(transaction)
|
||||
.broadcast(&transaction)
|
||||
.with_context(|| {
|
||||
format!("Failed to broadcast Bitcoin {} transaction {}", kind, txid)
|
||||
})?;
|
||||
|
@ -152,13 +152,13 @@ impl Wallet {
|
|||
ScriptStatus::Retrying
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
if new_status != ScriptStatus::Retrying
|
||||
{
|
||||
last_status = Some(print_status_change(txid, last_status, new_status));
|
||||
|
||||
let all_receivers_gone = sender.send(new_status).is_err();
|
||||
|
||||
|
||||
if all_receivers_gone {
|
||||
tracing::debug!(%txid, "All receivers gone, removing subscription");
|
||||
client.lock().await.subscriptions.remove(&(txid, script));
|
||||
|
|
|
@ -41,7 +41,7 @@ pub struct Arguments {
|
|||
#[derive(Debug, PartialEq)]
|
||||
pub enum ParseResult {
|
||||
/// The arguments we were invoked in.
|
||||
Arguments(Arguments),
|
||||
Arguments(Box<Arguments>),
|
||||
/// A flag or command was given that does not need further processing other
|
||||
/// than printing the provided message.
|
||||
///
|
||||
|
@ -260,7 +260,7 @@ where
|
|||
},
|
||||
};
|
||||
|
||||
Ok(ParseResult::Arguments(arguments))
|
||||
Ok(ParseResult::Arguments(Box::new(arguments)))
|
||||
}
|
||||
|
||||
#[derive(Debug, PartialEq)]
|
||||
|
@ -693,7 +693,8 @@ mod tests {
|
|||
MULTI_ADDRESS,
|
||||
];
|
||||
|
||||
let expected_args = ParseResult::Arguments(Arguments::buy_xmr_mainnet_defaults());
|
||||
let expected_args =
|
||||
ParseResult::Arguments(Arguments::buy_xmr_mainnet_defaults().into_boxed());
|
||||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
|
||||
assert_eq!(expected_args, args);
|
||||
|
@ -717,7 +718,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::buy_xmr_testnet_defaults())
|
||||
ParseResult::Arguments(Arguments::buy_xmr_testnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -778,7 +779,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_mainnet_defaults())
|
||||
ParseResult::Arguments(Arguments::resume_mainnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -790,7 +791,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_testnet_defaults())
|
||||
ParseResult::Arguments(Arguments::resume_testnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -802,7 +803,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::cancel_mainnet_defaults())
|
||||
ParseResult::Arguments(Arguments::cancel_mainnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -814,7 +815,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::cancel_testnet_defaults())
|
||||
ParseResult::Arguments(Arguments::cancel_testnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -826,7 +827,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::refund_mainnet_defaults())
|
||||
ParseResult::Arguments(Arguments::refund_mainnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -838,7 +839,7 @@ mod tests {
|
|||
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::refund_testnet_defaults())
|
||||
ParseResult::Arguments(Arguments::refund_testnet_defaults().into_boxed())
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -866,6 +867,7 @@ mod tests {
|
|||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_mainnet_defaults()
|
||||
.with_data_dir(PathBuf::from_str(data_dir).unwrap().join("mainnet"))
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -890,6 +892,7 @@ mod tests {
|
|||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_testnet_defaults()
|
||||
.with_data_dir(PathBuf::from_str(data_dir).unwrap().join("testnet"))
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -909,6 +912,7 @@ mod tests {
|
|||
ParseResult::Arguments(
|
||||
Arguments::resume_mainnet_defaults()
|
||||
.with_data_dir(PathBuf::from_str(data_dir).unwrap().join("mainnet"))
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -929,6 +933,7 @@ mod tests {
|
|||
ParseResult::Arguments(
|
||||
Arguments::resume_testnet_defaults()
|
||||
.with_data_dir(PathBuf::from_str(data_dir).unwrap().join("testnet"))
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -950,7 +955,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::buy_xmr_mainnet_defaults().with_debug())
|
||||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_mainnet_defaults()
|
||||
.with_debug()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![
|
||||
|
@ -969,7 +978,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::buy_xmr_testnet_defaults().with_debug())
|
||||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_testnet_defaults()
|
||||
.with_debug()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![BINARY_NAME, "--debug", "resume", "--swap-id", SWAP_ID];
|
||||
|
@ -977,7 +990,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_mainnet_defaults().with_debug())
|
||||
ParseResult::Arguments(
|
||||
Arguments::resume_mainnet_defaults()
|
||||
.with_debug()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![
|
||||
|
@ -992,7 +1009,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_testnet_defaults().with_debug())
|
||||
ParseResult::Arguments(
|
||||
Arguments::resume_testnet_defaults()
|
||||
.with_debug()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1013,7 +1034,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::buy_xmr_mainnet_defaults().with_json())
|
||||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_mainnet_defaults()
|
||||
.with_json()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![
|
||||
|
@ -1032,7 +1057,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::buy_xmr_testnet_defaults().with_json())
|
||||
ParseResult::Arguments(
|
||||
Arguments::buy_xmr_testnet_defaults()
|
||||
.with_json()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![BINARY_NAME, "--json", "resume", "--swap-id", SWAP_ID];
|
||||
|
@ -1040,7 +1069,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_mainnet_defaults().with_json())
|
||||
ParseResult::Arguments(
|
||||
Arguments::resume_mainnet_defaults()
|
||||
.with_json()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
|
||||
let raw_ars = vec![
|
||||
|
@ -1055,7 +1088,11 @@ mod tests {
|
|||
let args = parse_args_and_apply_defaults(raw_ars).unwrap();
|
||||
assert_eq!(
|
||||
args,
|
||||
ParseResult::Arguments(Arguments::resume_testnet_defaults().with_json())
|
||||
ParseResult::Arguments(
|
||||
Arguments::resume_testnet_defaults()
|
||||
.with_json()
|
||||
.into_boxed()
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -1303,6 +1340,10 @@ mod tests {
|
|||
self.json = true;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn into_boxed(self) -> Box<Self> {
|
||||
Box::new(self)
|
||||
}
|
||||
}
|
||||
|
||||
fn data_dir_path_cli() -> PathBuf {
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
use crate::bitcoin::EncryptedSignature;
|
||||
use crate::cli::behaviour::{Behaviour, OutEvent};
|
||||
use crate::monero;
|
||||
use crate::network::encrypted_signature;
|
||||
use crate::network::quote::BidQuote;
|
||||
use crate::network::swap_setup::bob::NewSwap;
|
||||
use crate::protocol::bob::State2;
|
||||
use crate::{env, monero};
|
||||
use anyhow::{Context, Result};
|
||||
use futures::future::{BoxFuture, OptionFuture};
|
||||
use futures::{FutureExt, StreamExt};
|
||||
|
@ -50,7 +50,6 @@ impl EventLoop {
|
|||
swap_id: Uuid,
|
||||
swarm: Swarm<Behaviour>,
|
||||
alice_peer_id: PeerId,
|
||||
env_config: env::Config,
|
||||
) -> Result<(Self, EventLoopHandle)> {
|
||||
let execution_setup = bmrng::channel_with_timeout(1, Duration::from_secs(60));
|
||||
let transfer_proof = bmrng::channel_with_timeout(1, Duration::from_secs(60));
|
||||
|
@ -76,7 +75,6 @@ impl EventLoop {
|
|||
transfer_proof: transfer_proof.1,
|
||||
encrypted_signature: encrypted_signature.0,
|
||||
quote: quote.0,
|
||||
env_config,
|
||||
};
|
||||
|
||||
Ok((event_loop, handle))
|
||||
|
@ -220,7 +218,6 @@ pub struct EventLoopHandle {
|
|||
transfer_proof: bmrng::RequestReceiver<monero::TransferProof, ()>,
|
||||
encrypted_signature: bmrng::RequestSender<EncryptedSignature, ()>,
|
||||
quote: bmrng::RequestSender<(), BidQuote>,
|
||||
env_config: env::Config,
|
||||
}
|
||||
|
||||
impl EventLoopHandle {
|
||||
|
|
|
@ -271,7 +271,7 @@ impl EventLoop {
|
|||
QuoteStatus::Received(Status::Online(quote)) => {
|
||||
let address = self
|
||||
.reachable_asb_address
|
||||
.get(&peer_id)
|
||||
.get(peer_id)
|
||||
.expect("if we got a quote we must have stored an address");
|
||||
|
||||
Ok(Seller {
|
||||
|
@ -282,7 +282,7 @@ impl EventLoop {
|
|||
QuoteStatus::Received(Status::Unreachable) => {
|
||||
let address = self
|
||||
.unreachable_asb_address
|
||||
.get(&peer_id)
|
||||
.get(peer_id)
|
||||
.expect("if we got a quote we must have stored an address");
|
||||
|
||||
Ok(Seller {
|
||||
|
|
|
@ -138,7 +138,7 @@ mod monero_network {
|
|||
Network::Stagenet => "stagenet",
|
||||
Network::Testnet => "testnet",
|
||||
};
|
||||
s.serialize_str(&str)
|
||||
s.serialize_str(str)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn connect(price_ticker_ws_url: Url) -> Result<PriceUpdates> {
|
|||
}
|
||||
}
|
||||
|
||||
Err(backoff::Error::Transient(anyhow!("stream ended")))
|
||||
Err(backoff::Error::transient(anyhow!("stream ended")))
|
||||
}
|
||||
},
|
||||
|error, next: Duration| {
|
||||
|
@ -108,8 +108,8 @@ fn to_backoff(e: connection::Error) -> backoff::Error<anyhow::Error> {
|
|||
|
||||
match e {
|
||||
// Connection closures and websocket errors will be retried
|
||||
connection::Error::ConnectionClosed => Transient(anyhow::Error::from(e)),
|
||||
connection::Error::WebSocket(_) => Transient(anyhow::Error::from(e)),
|
||||
connection::Error::ConnectionClosed => backoff::Error::transient(anyhow::Error::from(e)),
|
||||
connection::Error::WebSocket(_) => backoff::Error::transient(anyhow::Error::from(e)),
|
||||
|
||||
// Failures while parsing a message are permanent because they most likely present a
|
||||
// programmer error
|
||||
|
@ -275,8 +275,6 @@ mod wire {
|
|||
pub struct TickerData {
|
||||
#[serde(rename = "a")]
|
||||
ask: Vec<RateElement>,
|
||||
#[serde(rename = "b")]
|
||||
bid: Vec<RateElement>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize)]
|
||||
|
|
|
@ -6,7 +6,7 @@ pub mod ecdsa_fun {
|
|||
use ::ecdsa_fun::fun::{Point, Scalar, G};
|
||||
|
||||
pub fn point() -> impl Strategy<Value = Point> {
|
||||
scalar().prop_map(|mut scalar| Point::from_scalar_mul(&G, &mut scalar).mark::<Normal>())
|
||||
scalar().prop_map(|mut scalar| Point::from_scalar_mul(G, &mut scalar).mark::<Normal>())
|
||||
}
|
||||
|
||||
pub fn scalar() -> impl Strategy<Value = Scalar> {
|
||||
|
|
|
@ -29,7 +29,7 @@ impl Image for Bitcoind {
|
|||
container
|
||||
.logs()
|
||||
.stdout
|
||||
.wait_for_message(&"init message: Done loading")
|
||||
.wait_for_message("init message: Done loading")
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
|
|
|
@ -14,7 +14,6 @@ pub struct Electrs {
|
|||
entrypoint: Option<String>,
|
||||
wait_for_message: String,
|
||||
volume: String,
|
||||
bitcoind_container_name: String,
|
||||
}
|
||||
|
||||
impl Image for Electrs {
|
||||
|
@ -73,7 +72,6 @@ impl Default for Electrs {
|
|||
entrypoint: Some("/build/electrs".into()),
|
||||
wait_for_message: "Running accept thread".to_string(),
|
||||
volume: uuid::Uuid::new_v4().to_string(),
|
||||
bitcoind_container_name: uuid::Uuid::new_v4().to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -146,14 +146,14 @@ async fn init_containers(cli: &Cli) -> (Monero, Containers<'_>) {
|
|||
let prefix = random_prefix();
|
||||
let bitcoind_name = format!("{}_{}", prefix, "bitcoind");
|
||||
let (bitcoind, bitcoind_url) =
|
||||
init_bitcoind_container(&cli, prefix.clone(), bitcoind_name.clone(), prefix.clone())
|
||||
init_bitcoind_container(cli, prefix.clone(), bitcoind_name.clone(), prefix.clone())
|
||||
.await
|
||||
.expect("could not init bitcoind");
|
||||
let electrs = init_electrs_container(&cli, prefix.clone(), bitcoind_name, prefix)
|
||||
let electrs = init_electrs_container(cli, prefix.clone(), bitcoind_name, prefix)
|
||||
.await
|
||||
.expect("could not init electrs");
|
||||
let (monero, monerod_container, monero_wallet_rpc_containers) =
|
||||
Monero::new(&cli, vec![MONERO_WALLET_NAME_ALICE, MONERO_WALLET_NAME_BOB])
|
||||
Monero::new(cli, vec![MONERO_WALLET_NAME_ALICE, MONERO_WALLET_NAME_BOB])
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
|
@ -237,7 +237,7 @@ async fn start_alice(
|
|||
let resume_only = false;
|
||||
|
||||
let mut swarm = swarm::asb(
|
||||
&seed,
|
||||
seed,
|
||||
min_buy,
|
||||
max_buy,
|
||||
latest_rate,
|
||||
|
@ -485,7 +485,7 @@ impl BobParams {
|
|||
.behaviour_mut()
|
||||
.add_address(self.alice_peer_id, self.alice_address.clone());
|
||||
|
||||
cli::EventLoop::new(swap_id, swarm, self.alice_peer_id, self.env_config)
|
||||
cli::EventLoop::new(swap_id, swarm, self.alice_peer_id)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue