Browse Source

Reorganize repo to Rust format

Vecna 1 year ago
parent
commit
b945051c47
4 changed files with 4 additions and 13 deletions
  1. 1 1
      Cargo.toml
  2. 0 9
      bridgedb/Cargo.toml
  3. 2 2
      src/bin/bridge_auth.rs
  4. 1 1
      src/bin/bridgedb.rs

+ 1 - 1
bridge_auth/Cargo.toml → Cargo.toml

@@ -1,5 +1,5 @@
 [package]
-name = "bridge_auth"
+name = "lox_test"
 version = "0.1.0"
 edition = "2021"
 

+ 0 - 9
bridgedb/Cargo.toml

@@ -1,9 +0,0 @@
-[package]
-name = "bridgedb"
-version = "0.1.0"
-edition = "2021"
-
-# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
-
-[dependencies]
-lox = { git = "https://git-crysp.uwaterloo.ca/iang/lox.git" }

+ 2 - 2
bridge_auth/src/main.rs → src/bin/bridge_auth.rs

@@ -8,7 +8,7 @@ use std::io::Write;
 fn main() {
     // import bridgedb pubkey
     // note: currently no checks for valid data
-    let infile = std::fs::File::open("../pubkeys/bridgedb_pubkey").unwrap();
+    let infile = std::fs::File::open("bridgedb_pubkey").unwrap();
     let mut reader = BufReader::new(infile);
     let mut buffer = Vec::new();
     reader
@@ -28,7 +28,7 @@ fn main() {
         count += 1;
         let pubkey_bytes = pubkey.compress().to_bytes();
         // Is this the proper way to concatenate an integer and a string?
-        let mut outfile = File::create(format!("{}{}", "../pubkeys/bridge_auth_pubkey_", count))
+        let mut outfile = File::create(format!("bridge_auth_pubkey_{}", count))
             .expect("Failed to create pubkey file");
         outfile
             .write_all(&pubkey_bytes)

+ 1 - 1
bridgedb/src/main.rs → src/bin/bridgedb.rs

@@ -9,7 +9,7 @@ fn main() {
     // output public key to new file
     let pubkey_bytes = bridgedb.pubkey.to_bytes();
     let mut outfile =
-        File::create("../pubkeys/bridgedb_pubkey").expect("Failed to create pubkey file");
+        File::create("bridgedb_pubkey").expect("Failed to create pubkey file");
     outfile.write_all(&pubkey_bytes)
         .expect("Failed to write pubkey");
 }