feat(swap): Use art_client to dial over Tor (#196)

- Upgrade `sqlx` to `0.8`
- Use `arti_client@0.24` in combination with [`libp2p-community-tor`](https://crates.io/crates/libp2p-community-tor/0.4.1). https://github.com/umgefahren/libp2p-tor/pull/18 was required for this.
- Display spinner in GUI while Tor circuits are being established
- Remove unused dependencies (`once_cell`, `tauri-plugin-devtools`, `digest`, `hyper`, `itertools`, `erased_serde`)
- Bundle roboto font from npm registry
This commit is contained in:
binarybaron 2024-11-21 01:00:36 +01:00 committed by GitHub
parent 3aef92e848
commit 6cd228fada
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
41 changed files with 2689 additions and 871 deletions

View file

@ -625,7 +625,7 @@ pub async fn buy_xmr(
let mut swarm = swarm::cli(
seed.derive_libp2p_identity(),
context.config.tor_socks5_port,
context.tor_client.clone(),
behaviour,
)
.await?;
@ -813,7 +813,7 @@ pub async fn resume_swap(
),
(seed.clone(), context.config.namespace),
);
let mut swarm = swarm::cli(seed.clone(), context.config.tor_socks5_port, behaviour).await?;
let mut swarm = swarm::cli(seed.clone(), context.tor_client.clone(), behaviour).await?;
let our_peer_id = swarm.local_peer_id();
tracing::debug!(peer_id = %our_peer_id, "Network layer initialized");
@ -1083,7 +1083,7 @@ pub async fn list_sellers(
rendezvous_node_peer_id,
rendezvous_point,
context.config.namespace,
context.config.tor_socks5_port,
context.tor_client.clone(),
identity,
)
.await?;
@ -1224,17 +1224,9 @@ where
}
loop {
println!("max_giveable: {}", max_giveable);
println!("bid_quote.min_quantity: {}", bid_quote.min_quantity);
let min_outstanding = bid_quote.min_quantity - max_giveable;
println!("min_outstanding: {}", min_outstanding);
let min_bitcoin_lock_tx_fee = estimate_fee(min_outstanding).await?;
println!("min_bitcoin_lock_tx_fee: {}", min_bitcoin_lock_tx_fee);
let min_deposit_until_swap_will_start = min_outstanding + min_bitcoin_lock_tx_fee;
println!(
"min_deposit_until_swap_will_start: {}",
min_deposit_until_swap_will_start
);
let max_deposit_until_maximum_amount_is_reached =
maximum_amount - max_giveable + min_bitcoin_lock_tx_fee;