Przeglądaj źródła

vanityadr: Remove serde_json dependency.

parazyd 4 lat temu
rodzic
commit
6479851e40
3 zmienionych plików z 9 dodań i 14 usunięć
  1. 3 4
      Cargo.lock
  2. 2 3
      bin/vanityaddr/Cargo.toml
  3. 4 7
      bin/vanityaddr/src/main.rs

+ 3 - 4
Cargo.lock

@@ -2954,9 +2954,9 @@ dependencies = [
 
 [[package]]
 name = "indicatif"
-version = "0.17.0-rc.9"
+version = "0.17.0-rc.10"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e540eeecee89ed4391cbbe2c86a9df6c061fc93f7710e2af69cbfccdc6564eae"
+checksum = "088977cb4de4e09ea0232bd51c844490475ad94344fb0c60784f1fb380059b6d"
 dependencies = [
  "console",
  "number_prefix",
@@ -6576,11 +6576,10 @@ dependencies = [
  "clap 3.1.8",
  "ctrlc",
  "darkfi",
- "indicatif 0.17.0-rc.9",
+ "indicatif 0.17.0-rc.10",
  "num_cpus",
  "rand 0.8.5",
  "rayon",
- "serde_json",
 ]
 
 [[package]]

+ 2 - 3
bin/vanityaddr/Cargo.toml

@@ -10,11 +10,10 @@ edition = "2021"
 
 [dependencies]
 bs58 = "0.4.0"
-clap = {version = "3.1.6", features = ["derive"]}
+clap = {version = "3.1.8", features = ["derive"]}
 ctrlc = "3.2.1"
 darkfi = {path = "../../", features = ["crypto"]}
-indicatif = "0.17.0-rc.9"
+indicatif = "0.17.0-rc.10"
 num_cpus = "1.13.1"
 rand = "0.8.5"
 rayon = "1.5.1"
-serde_json = "1.0.79"

+ 4 - 7
bin/vanityaddr/src/main.rs

@@ -4,7 +4,6 @@ use clap::Parser;
 use indicatif::{ProgressBar, ProgressStyle};
 use rand::rngs::OsRng;
 use rayon::prelude::*;
-use serde_json::json;
 
 use darkfi::{
     cli_desc,
@@ -116,13 +115,11 @@ fn main() {
         let attempts = progress.position();
         progress.finish_and_clear();
 
-        let result = json!({
-            "address": addr.address,
-            "secret": format!("{:?}", addr.secret.0),
-            "attempts": attempts,
-        });
+        println!(
+            "{{\"address\":\"{}\",\"attempts\":{},\"secret\":\"{:?}\"}}",
+            addr.address, attempts, addr.secret.0
+        );
 
-        println!("{}", result);
         exit(0);
     });