From 2a367549ee634656db91bd45f0278e73e3100713 Mon Sep 17 00:00:00 2001 From: ghassmo Date: Sun, 6 Jun 2021 19:39:21 +0300 Subject: [PATCH] cargo fmt --- src/bin/darkfid.rs | 8 ++++++-- src/bin/gatewayd.rs | 4 ++-- src/blockchain/mod.rs | 3 +-- src/blockchain/rocks.rs | 2 +- src/blockchain/slabstore.rs | 2 +- src/service/gateway.rs | 6 ++---- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/src/bin/darkfid.rs b/src/bin/darkfid.rs index 3bba5395f..0d9503a5c 100644 --- a/src/bin/darkfid.rs +++ b/src/bin/darkfid.rs @@ -51,11 +51,15 @@ impl ProgramState for State { } 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 { - 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 { diff --git a/src/bin/gatewayd.rs b/src/bin/gatewayd.rs index f7df5a768..40a09f9cf 100644 --- a/src/bin/gatewayd.rs +++ b/src/bin/gatewayd.rs @@ -1,9 +1,9 @@ use std::net::SocketAddr; use std::sync::Arc; +use drk::blockchain::{rocks::columns, Rocks, RocksColumn}; use drk::service::{GatewayService, ProgramOptions}; use drk::Result; -use drk::blockchain::{Rocks, RocksColumn, rocks::columns}; extern crate clap; use async_executor::Executor; @@ -22,7 +22,7 @@ async fn start(executor: Arc>, options: ProgramOptions) -> Result<( let database_path = options.database_path.as_path(); let rocks = Rocks::new(database_path)?; - let rocks_slabstore_column = RocksColumn::::new(rocks); + let rocks_slabstore_column = RocksColumn::::new(rocks); let gateway = GatewayService::new(accept_addr, pub_addr, rocks_slabstore_column)?; diff --git a/src/blockchain/mod.rs b/src/blockchain/mod.rs index d86dc76ea..afb35e3e2 100644 --- a/src/blockchain/mod.rs +++ b/src/blockchain/mod.rs @@ -1,8 +1,7 @@ +pub mod rocks; pub mod slab; pub mod slabstore; -pub mod rocks; pub use rocks::{Rocks, RocksColumn}; pub use slab::Slab; pub use slabstore::SlabStore; - diff --git a/src/blockchain/rocks.rs b/src/blockchain/rocks.rs index 4c295e8b5..8c4605c68 100644 --- a/src/blockchain/rocks.rs +++ b/src/blockchain/rocks.rs @@ -1,6 +1,6 @@ +use async_std::sync::Arc; use std::marker::PhantomData; use std::path::Path; -use async_std::sync::Arc; use crate::serial::{deserialize, serialize, Decodable, Encodable}; use crate::{Error, Result}; diff --git a/src/blockchain/slabstore.rs b/src/blockchain/slabstore.rs index 6aa6943d0..34fd8c7ec 100644 --- a/src/blockchain/slabstore.rs +++ b/src/blockchain/slabstore.rs @@ -3,8 +3,8 @@ use std::sync::Arc; use crate::serial::{deserialize, serialize}; use crate::Result; -use super::slab::Slab; use super::rocks::{columns, IteratorMode, RocksColumn}; +use super::slab::Slab; pub struct SlabStore { rocks: RocksColumn, diff --git a/src/service/gateway.rs b/src/service/gateway.rs index 81817b674..f849c9f9a 100644 --- a/src/service/gateway.rs +++ b/src/service/gateway.rs @@ -3,10 +3,8 @@ use std::convert::From; use std::net::SocketAddr; 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 log::*;