Merge pull request #19 from comit-network/move-tor

Moving tor into swap
This commit is contained in:
Philipp Hoenisch 2020-10-23 13:32:53 +11:00 committed by GitHub
commit 11a4a7563b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 17 additions and 16 deletions

View File

@ -20,13 +20,14 @@ libp2p-tokio-socks5 = "0.4"
log = { version = "0.4", features = ["serde"] } log = { version = "0.4", features = ["serde"] }
monero = "0.9" monero = "0.9"
rand = "0.7" rand = "0.7"
reqwest = { version = "0.10", default-features = false } reqwest = { version = "0.10", default-features = false, features = ["socks"] }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_derive = "1.0" serde_derive = "1.0"
serde_json = "1" serde_json = "1"
structopt = "0.3" structopt = "0.3"
time = "0.2" time = "0.2"
tokio = { version = "0.2", features = ["rt-threaded", "time", "macros", "sync"] } tokio = { version = "0.2", features = ["rt-threaded", "time", "macros", "sync"] }
torut = { version = "0.1", optional = true }
tracing = { version = "0.1", features = ["attributes"] } tracing = { version = "0.1", features = ["attributes"] }
tracing-core = "0.1" tracing-core = "0.1"
tracing-futures = { version = "0.2", features = ["std-future", "futures-03"] } tracing-futures = { version = "0.2", features = ["std-future", "futures-03"] }
@ -35,3 +36,13 @@ tracing-subscriber = { version = "0.2", default-features = false, features = ["f
url = "2.1" url = "2.1"
void = "1" void = "1"
xmr-btc = { path = "../xmr-btc" } xmr-btc = { path = "../xmr-btc" }
[dev-dependencies]
hyper = "0.13"
port_check = "0.1"
spectral = "0.6"
tempfile = "3"
[features]
default = []
tor = ["torut"]

View File

@ -5,6 +5,8 @@ pub mod alice;
pub mod bitcoin; pub mod bitcoin;
pub mod bob; pub mod bob;
pub mod network; pub mod network;
#[cfg(feature = "tor")]
pub mod tor;
pub const ONE_BTC: u64 = 100_000_000; pub const ONE_BTC: u64 = 100_000_000;

View File

@ -6,6 +6,7 @@ mod tor_test {
use reqwest::StatusCode; use reqwest::StatusCode;
use spectral::prelude::*; use spectral::prelude::*;
use std::{convert::Infallible, fs}; use std::{convert::Infallible, fs};
use swap::tor::UnauthenticatedConnection;
use tempfile::{Builder, NamedTempFile}; use tempfile::{Builder, NamedTempFile};
use tokio::sync::oneshot::Receiver; use tokio::sync::oneshot::Receiver;
use torut::{ use torut::{
@ -13,7 +14,6 @@ mod tor_test {
utils::{run_tor, AutoKillChild}, utils::{run_tor, AutoKillChild},
}; };
use tracing_subscriber::util::SubscriberInitExt; use tracing_subscriber::util::SubscriberInitExt;
use xmr_btc::tor::UnauthenticatedConnection;
async fn hello_world( async fn hello_world(
_req: hyper::Request<hyper::Body>, _req: hyper::Request<hyper::Body>,

View File

@ -19,13 +19,10 @@ genawaiter = "0.99.1"
miniscript = { version = "1", features = ["serde"] } miniscript = { version = "1", features = ["serde"] }
monero = { version = "0.9", features = ["serde_support"] } monero = { version = "0.9", features = ["serde_support"] }
rand = "0.7" rand = "0.7"
reqwest = { version = "0.10", default-features = false, features = ["socks"] }
serde = { version = "1", features = ["derive"] } serde = { version = "1", features = ["derive"] }
serde_json = "1"
sha2 = "0.9" sha2 = "0.9"
thiserror = "1" thiserror = "1"
tokio = { version = "0.2", default-features = false, features = ["blocking", "macros", "rt-core", "time", "rt-threaded"] } tokio = { version = "0.2", default-features = false, features = ["time"] }
torut = { version = "0.1", optional = true }
tracing = "0.1" tracing = "0.1"
[dev-dependencies] [dev-dependencies]
@ -33,18 +30,11 @@ backoff = { version = "0.2", features = ["tokio"] }
base64 = "0.12" base64 = "0.12"
bitcoin-harness = { git = "https://github.com/coblox/bitcoin-harness-rs", rev = "7ff30a559ab57cc3aa71189e71433ef6b2a6c3a2" } bitcoin-harness = { git = "https://github.com/coblox/bitcoin-harness-rs", rev = "7ff30a559ab57cc3aa71189e71433ef6b2a6c3a2" }
futures = "0.3" futures = "0.3"
hyper = "0.13"
monero-harness = { path = "../monero-harness" } monero-harness = { path = "../monero-harness" }
port_check = "0.1"
reqwest = { version = "0.10", default-features = false } reqwest = { version = "0.10", default-features = false }
serde_cbor = "0.11" serde_cbor = "0.11"
sled = "0.34" sled = "0.34"
spectral = "0.6"
tempfile = "3" tempfile = "3"
testcontainers = "0.10" testcontainers = "0.10"
tracing = "0.1" tracing = "0.1"
tracing-subscriber = "0.2" tracing-subscriber = "0.2"
[features]
default = []
tor = ["torut"]

View File

@ -50,8 +50,6 @@ pub mod bitcoin;
pub mod bob; pub mod bob;
pub mod monero; pub mod monero;
pub mod serde; pub mod serde;
#[cfg(feature = "tor")]
pub mod tor;
pub mod transport; pub mod transport;
use async_trait::async_trait; use async_trait::async_trait;