mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-12-23 22:49:41 -05:00
Merge #604
604: Bump torut from 0.1.9 to 0.1.10 r=thomaseizinger a=dependabot[bot] Bumps [torut](https://github.com/teawithsand/torut) from 0.1.9 to 0.1.10. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/teawithsand/torut/releases">torut's releases</a>.</em></p> <blockquote> <h2>Release 0.1.10</h2> <p>Deprecated onion services V2 and all stuff associated with it. Updated tokio version. Implemented std::error::Error for error types in this crate, support for these errors is very basic and all that was done was implementing Error trait for existing error types. No error structure refactoring was done.</p> </blockquote> </details> <details> <summary>Commits</summary> <ul> <li><a href="8a26ddde79
"><code>8a26ddd</code></a> Implemented std::error::Error for error types</li> <li><a href="c5cee8a369
"><code>c5cee8a</code></a> Implemented std::error::Error for error types</li> <li><a href="caed51d697
"><code>caed51d</code></a> Deprecated v2 onion service stuff</li> <li><a href="87bcde20bb
"><code>87bcde2</code></a> Updated tokio version</li> <li>See full diff in <a href="https://github.com/teawithsand/torut/compare/v0.1.9...v0.1.10">compare view</a></li> </ul> </details> <br /> [![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=torut&package-manager=cargo&previous-version=0.1.9&new-version=0.1.10)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) You can trigger a rebase of this PR by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) </details> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Thomas Eizinger <thomas@eizinger.io>
This commit is contained in:
commit
4cd27e372c
4
Cargo.lock
generated
4
Cargo.lock
generated
@ -4294,9 +4294,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "torut"
|
||||
version = "0.1.9"
|
||||
version = "0.1.10"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "05253df8056cc5830af67e5e86d6bb88bef83221238e698783f2560048584757"
|
||||
checksum = "5b2cdfcb8b9dccc90fd618101a6f0a5a1f9e23e36956da9a2fe0abee901b04cc"
|
||||
dependencies = [
|
||||
"base32",
|
||||
"base64 0.10.1",
|
||||
|
@ -1,4 +1,4 @@
|
||||
use anyhow::{anyhow, bail, Context, Result};
|
||||
use anyhow::{bail, Context, Result};
|
||||
use std::future::Future;
|
||||
use std::net::{Ipv4Addr, SocketAddr, SocketAddrV4};
|
||||
use tokio::net::TcpStream;
|
||||
@ -50,7 +50,7 @@ impl Client {
|
||||
pub async fn assert_tor_running(&self) -> Result<()> {
|
||||
// Make sure you are running tor and this is your socks port
|
||||
let proxy = reqwest::Proxy::all(format!("socks5h://{}", self.socks5_address).as_str())
|
||||
.map_err(|_| anyhow!("tor proxy should be there"))?;
|
||||
.context("Failed to construct Tor proxy URL")?;
|
||||
let client = reqwest::Client::builder().proxy(proxy).build()?;
|
||||
|
||||
let res = client.get("https://check.torproject.org").send().await?;
|
||||
@ -77,21 +77,21 @@ impl Client {
|
||||
let mut uc = self
|
||||
.init_unauthenticated_connection()
|
||||
.await
|
||||
.map_err(|_| anyhow!("Could not connect to Tor. Tor might not be running or the control port is incorrect."))?;
|
||||
.context("Failed to connect to Tor")?;
|
||||
|
||||
let tor_info = uc
|
||||
.load_protocol_info()
|
||||
.await
|
||||
.map_err(|_| anyhow!("Failed to load protocol info from Tor."))?;
|
||||
.context("Failed to load protocol info from Tor")?;
|
||||
|
||||
let tor_auth_data = tor_info
|
||||
.make_auth_data()?
|
||||
.context("Failed to make Tor auth data.")?;
|
||||
.context("Failed to make Tor auth data")?;
|
||||
|
||||
// Get an authenticated connection to the Tor via the Tor Controller protocol.
|
||||
uc.authenticate(&tor_auth_data)
|
||||
.await
|
||||
.map_err(|_| anyhow!("Failed to authenticate with Tor"))?;
|
||||
.context("Failed to authenticate with Tor")?;
|
||||
|
||||
Ok(AuthenticatedClient {
|
||||
inner: uc.into_authenticated().await,
|
||||
@ -123,6 +123,6 @@ impl AuthenticatedClient {
|
||||
self.inner
|
||||
.add_onion_v3(tor_key, false, false, false, None, &mut listeners)
|
||||
.await
|
||||
.map_err(|e| anyhow!("Could not add onion service.: {:#?}", e))
|
||||
.context("Failed to add onion service")
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user