Use full path imports for dependencies to reduce cfg hell

pull/27/head
Philipp Hoenisch 4 years ago
parent a1351e5461
commit b8fd9a734f
No known key found for this signature in database
GPG Key ID: E5F8E74C672BC666

@ -40,10 +40,10 @@ jobs:
- name: Check code formatting
run: cargo fmt --all -- --check
- name: Run clippy
- name: Run clippy with default features
run: cargo clippy --workspace --all-targets -- -D warnings
- name: Run clippy all features
- name: Run clippy with all features enabled (e.g. tor)
run: cargo clippy --workspace --all-targets --all-features -- -D warnings
build_test:

@ -36,10 +36,6 @@ pub const PORT: u16 = 9876; // Arbitrarily chosen.
pub const ADDR: &str = "127.0.0.1";
pub const BITCOIND_JSON_RPC_URL: &str = "http://127.0.0.1:8332";
#[cfg(feature = "tor")]
use swap::tor::{AuthenticatedConnection, UnauthenticatedConnection};
#[cfg(feature = "tor")]
use torut::onion::TorSecretKeyV3;
#[cfg(feature = "tor")]
pub const TOR_PORT: u16 = PORT + 1;
@ -51,7 +47,7 @@ async fn main() -> Result<()> {
#[cfg(feature = "tor")]
let (addr, _ac) = {
let tor_secret_key = TorSecretKeyV3::generate();
let tor_secret_key = torut::onion::TorSecretKeyV3::generate();
let onion_address = tor_secret_key
.public()
.get_onion_address()
@ -121,9 +117,11 @@ async fn main() -> Result<()> {
}
#[cfg(feature = "tor")]
async fn create_tor_service(tor_secret_key: TorSecretKeyV3) -> Result<AuthenticatedConnection> {
// todo use configurable ports for tor connection
let mut authenticated_connection = UnauthenticatedConnection::default()
async fn create_tor_service(
tor_secret_key: torut::onion::TorSecretKeyV3,
) -> Result<swap::tor::AuthenticatedConnection> {
// TODO use configurable ports for tor connection
let mut authenticated_connection = swap::tor::UnauthenticatedConnection::default()
.init_authenticated_connection()
.await?;
tracing::info!("Tor authenticated.");

Loading…
Cancel
Save