ghassmo 5 лет назад
Родитель
Сommit
2a367549ee
6 измененных файлов с 13 добавлено и 12 удалено
  1. 6 2
      src/bin/darkfid.rs
  2. 2 2
      src/bin/gatewayd.rs
  3. 1 2
      src/blockchain/mod.rs
  4. 1 1
      src/blockchain/rocks.rs
  5. 1 1
      src/blockchain/slabstore.rs
  6. 2 4
      src/service/gateway.rs

+ 6 - 2
src/bin/darkfid.rs

@@ -51,11 +51,15 @@ impl ProgramState for State {
     }
     }
 
 
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
     fn is_valid_merkle(&self, merkle_root: &MerkleNode) -> bool {
-        self.merkle_roots.key_exist(*merkle_root).expect("couldn't check if the merkle_root valid")
+        self.merkle_roots
+            .key_exist(*merkle_root)
+            .expect("couldn't check if the merkle_root valid")
     }
     }
 
 
     fn nullifier_exists(&self, nullifier: &Nullifier) -> bool {
     fn nullifier_exists(&self, nullifier: &Nullifier) -> bool {
-        self.nullifiers.key_exist(nullifier.repr).expect("couldn't check if nullifier exists")
+        self.nullifiers
+            .key_exist(nullifier.repr)
+            .expect("couldn't check if nullifier exists")
     }
     }
 
 
     fn mint_pvk(&self) -> &groth16::PreparedVerifyingKey<Bls12> {
     fn mint_pvk(&self) -> &groth16::PreparedVerifyingKey<Bls12> {

+ 2 - 2
src/bin/gatewayd.rs

@@ -1,9 +1,9 @@
 use std::net::SocketAddr;
 use std::net::SocketAddr;
 use std::sync::Arc;
 use std::sync::Arc;
 
 
+use drk::blockchain::{rocks::columns, Rocks, RocksColumn};
 use drk::service::{GatewayService, ProgramOptions};
 use drk::service::{GatewayService, ProgramOptions};
 use drk::Result;
 use drk::Result;
-use drk::blockchain::{Rocks, RocksColumn, rocks::columns};
 
 
 extern crate clap;
 extern crate clap;
 use async_executor::Executor;
 use async_executor::Executor;
@@ -22,7 +22,7 @@ async fn start(executor: Arc<Executor<'_>>, options: ProgramOptions) -> Result<(
     let database_path = options.database_path.as_path();
     let database_path = options.database_path.as_path();
 
 
     let rocks = Rocks::new(database_path)?;
     let rocks = Rocks::new(database_path)?;
-    let rocks_slabstore_column = RocksColumn::<columns::Slabs>::new(rocks); 
+    let rocks_slabstore_column = RocksColumn::<columns::Slabs>::new(rocks);
 
 
     let gateway = GatewayService::new(accept_addr, pub_addr, rocks_slabstore_column)?;
     let gateway = GatewayService::new(accept_addr, pub_addr, rocks_slabstore_column)?;
 
 

+ 1 - 2
src/blockchain/mod.rs

@@ -1,8 +1,7 @@
+pub mod rocks;
 pub mod slab;
 pub mod slab;
 pub mod slabstore;
 pub mod slabstore;
-pub mod rocks;
 
 
 pub use rocks::{Rocks, RocksColumn};
 pub use rocks::{Rocks, RocksColumn};
 pub use slab::Slab;
 pub use slab::Slab;
 pub use slabstore::SlabStore;
 pub use slabstore::SlabStore;
-

+ 1 - 1
src/blockchain/rocks.rs

@@ -1,6 +1,6 @@
+use async_std::sync::Arc;
 use std::marker::PhantomData;
 use std::marker::PhantomData;
 use std::path::Path;
 use std::path::Path;
-use async_std::sync::Arc;
 
 
 use crate::serial::{deserialize, serialize, Decodable, Encodable};
 use crate::serial::{deserialize, serialize, Decodable, Encodable};
 use crate::{Error, Result};
 use crate::{Error, Result};

+ 1 - 1
src/blockchain/slabstore.rs

@@ -3,8 +3,8 @@ use std::sync::Arc;
 use crate::serial::{deserialize, serialize};
 use crate::serial::{deserialize, serialize};
 use crate::Result;
 use crate::Result;
 
 
-use super::slab::Slab;
 use super::rocks::{columns, IteratorMode, RocksColumn};
 use super::rocks::{columns, IteratorMode, RocksColumn};
+use super::slab::Slab;
 
 
 pub struct SlabStore {
 pub struct SlabStore {
     rocks: RocksColumn<columns::Slabs>,
     rocks: RocksColumn<columns::Slabs>,

+ 2 - 4
src/service/gateway.rs

@@ -3,10 +3,8 @@ use std::convert::From;
 use std::net::SocketAddr;
 use std::net::SocketAddr;
 
 
 use super::reqrep::{PeerId, Publisher, RepProtocol, Reply, ReqProtocol, Request, Subscriber};
 use super::reqrep::{PeerId, Publisher, RepProtocol, Reply, ReqProtocol, Request, Subscriber};
-use crate::{serial::deserialize, serial::serialize,  Error,
-    Result,
-};
-use crate::blockchain::{Slab, SlabStore, RocksColumn, rocks::columns};
+use crate::blockchain::{rocks::columns, RocksColumn, Slab, SlabStore};
+use crate::{serial::deserialize, serial::serialize, Error, Result};
 use async_executor::Executor;
 use async_executor::Executor;
 use log::*;
 use log::*;