mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2024-10-01 01:45:40 -04:00
Use full path imports for dependencies to reduce cfg hell
This commit is contained in:
parent
a1351e5461
commit
b8fd9a734f
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -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…
Reference in New Issue
Block a user