From ac0bb7e6276e698215401998f94abe0cc188b3bb Mon Sep 17 00:00:00 2001 From: Armin Sabouri Date: Tue, 25 Oct 2022 20:03:44 -0400 Subject: [PATCH] Rename all instances of loin to nolooking Co-authored-by: DanGould --- Cargo.lock | 52 ++++++++++++++++++++++---------------------- Cargo.toml | 2 +- config_spec.toml | 4 ++-- src/http.rs | 2 +- tests/integration.rs | 18 ++++++++------- 5 files changed, 40 insertions(+), 38 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 8c2e303..ce7f24b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -559,32 +559,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "loin" -version = "0.1.0" -dependencies = [ - "base64", - "bip78", - "bitcoin", - "bitcoincore-rpc", - "configure_me", - "configure_me_codegen", - "hyper", - "hyper-tls", - "ln-types", - "rand", - "rcgen", - "serde", - "serde_derive", - "serde_json", - "tempfile", - "tokio", - "tokio-native-tls", - "tonic", - "tonic_lnd", - "url", -] - [[package]] name = "man" version = "0.1.1" @@ -636,6 +610,32 @@ dependencies = [ "tempfile", ] +[[package]] +name = "nolooking" +version = "0.1.0" +dependencies = [ + "base64", + "bip78", + "bitcoin", + "bitcoincore-rpc", + "configure_me", + "configure_me_codegen", + "hyper", + "hyper-tls", + "ln-types", + "rand", + "rcgen", + "serde", + "serde_derive", + "serde_json", + "tempfile", + "tokio", + "tokio-native-tls", + "tonic", + "tonic_lnd", + "url", +] + [[package]] name = "num_cpus" version = "1.13.1" diff --git a/Cargo.toml b/Cargo.toml index 1422cc9..d4c8816 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "loin" +name = "nolooking" version = "0.1.0" authors = ["Dan Gould ", "Martin Habovstiak "] exclude = ["./tests/compose"] diff --git a/config_spec.toml b/config_spec.toml index bae9a32..8269b3f 100644 --- a/config_spec.toml +++ b/config_spec.toml @@ -1,5 +1,5 @@ [general] -env_prefix = "LOIN" +env_prefix = "NOLOOKING" conf_file_param = "conf" conf_dir_param = "conf_dir" doc = """ @@ -11,7 +11,7 @@ This server optimizes your channel opening from a remote wallet which supports P [[param]] name = "bind_port" type = "u16" -doc = "Loin HTTP port to listen on" +doc = "nolooking HTTP port to listen on" optional = false [[param]] diff --git a/src/http.rs b/src/http.rs index 96941e6..2c5dc3c 100644 --- a/src/http.rs +++ b/src/http.rs @@ -6,7 +6,7 @@ use crate::scheduler::{ScheduledPayJoin, Scheduler, self}; use std::net::SocketAddr; #[cfg(not(feature = "test_paths"))] -const STATIC_DIR: &str = "/usr/share/loin/static"; +const STATIC_DIR: &str = "/usr/share/nolooking/static"; #[cfg(feature = "test_paths")] const STATIC_DIR: &str = "static"; diff --git a/tests/integration.rs b/tests/integration.rs index eaeece7..a086c2c 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -12,8 +12,8 @@ mod integration { use bitcoincore_rpc::{Auth, Client, RpcApi}; use hyper::client::HttpConnector; use ln_types::P2PAddress; - use loin::scheduler; - use loin::{scheduler::{ScheduledChannel, ScheduledPayJoin, Scheduler}, lnd::LndClient, http}; + use nolooking::scheduler; + use nolooking::{scheduler::{ScheduledChannel, ScheduledPayJoin, Scheduler}, lnd::LndClient, http}; use std::collections::HashMap; use std::convert::TryFrom; use tempfile::tempdir; @@ -51,7 +51,7 @@ mod integration { }; - // merchant lnd loin configuration + // merchant lnd nolooking configuration let address_str = "https://localhost:53281"; let cert_file = format!("{}/merchant-tls.cert", &tmp_path).to_string(); let macaroon_file = format!("{}/merchant-admin.macaroon", &tmp_path).to_string(); @@ -98,8 +98,8 @@ mod integration { "bind_port=3000\nendpoint=\"{}\"\nlnd_address=\"{}\"\nlnd_cert_path=\"{}\"\nlnd_macaroon_path=\"{}\"", &endpoint.clone().to_string(), &address_str, &cert_file, &macaroon_file ); - let loin_conf = format!("{}/loin.conf", &tmp_path); - std::fs::write(&loin_conf, conf_string).expect("Unable to write loin.conf"); + let nolooking_conf = format!("{}/nolooking.conf", &tmp_path); + std::fs::write(&nolooking_conf, conf_string).expect("Unable to write nolooking.conf"); Command::new("docker") .arg("cp") @@ -177,10 +177,10 @@ mod integration { }); let bind_addr = ([127, 0, 0, 1], 3000).into(); - let loin_server = http::serve(scheduler, bind_addr, endpoint.clone()); + let nolooking_server = http::serve(scheduler, bind_addr, endpoint.clone()); // trigger payjoin-client let payjoin_channel_open = tokio::spawn(async move { - // if we don't wait for loin server to run we'll make requests to a closed port + // if we don't wait for nolooking server to run we'll make requests to a closed port std::thread::sleep(Duration::from_secs(2)); // TODO loop on ping 3000 until it the server is live @@ -254,9 +254,11 @@ mod integration { bitcoin_rpc.generate_to_address(8, &source_address).unwrap(); }); + let nolooking_server = http::serve(scheduler, bind_addr, endpoint.clone()); + tokio::select! { _ = payjoin_channel_open => println!("payjoin-client completed first"), - _ = loin_server => println!("loin server stopped first. This shouldn't happen"), + _ = nolooking_server => println!("nolooking server stopped first. This shouldn't happen"), _ = tokio::time::sleep(Duration::from_secs(20)) => println!("payjoin timed out after 20 seconds"), };