From b36ceb5be495df6200fe82e1f0594d7aa93b8065 Mon Sep 17 00:00:00 2001 From: Michael Vines Date: Thu, 20 Dec 2018 09:57:29 -0800 Subject: [PATCH] Remove rocksdb dependency from result.rs --- src/db_ledger.rs | 9 ++++++++- src/result.rs | 7 ------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/db_ledger.rs b/src/db_ledger.rs index 7a44637a0c..cc4062b8db 100644 --- a/src/db_ledger.rs +++ b/src/db_ledger.rs @@ -20,10 +20,17 @@ pub const DB_LEDGER_DIRECTORY: &str = "rocksdb"; // A good value for this is the number of cores on the machine pub const TOTAL_THREADS: i32 = 8; -#[derive(Debug, PartialEq, Eq)] +#[derive(Debug)] pub enum DbLedgerError { BlobForIndexExists, InvalidBlobData, + RocksDb(rocksdb::Error), +} + +impl std::convert::From for Error { + fn from(e: rocksdb::Error) -> Error { + Error::DbLedgerError(DbLedgerError::RocksDb(e)) + } } pub trait LedgerColumnFamily { diff --git a/src/result.rs b/src/result.rs index d4966892a8..fba4b14bef 100644 --- a/src/result.rs +++ b/src/result.rs @@ -9,7 +9,6 @@ use crate::packet; use crate::poh_recorder; use crate::vote_stage; use bincode; -use rocksdb; use serde_json; use std; use std::any::Any; @@ -31,7 +30,6 @@ pub enum Error { SendError, PohRecorderError(poh_recorder::PohRecorderError), VoteError(vote_stage::VoteError), - RocksDb(rocksdb::Error), DbLedgerError(db_ledger::DbLedgerError), } @@ -111,11 +109,6 @@ impl std::convert::From for Error { Error::VoteError(e) } } -impl std::convert::From for Error { - fn from(e: rocksdb::Error) -> Error { - Error::RocksDb(e) - } -} impl std::convert::From for Error { fn from(e: db_ledger::DbLedgerError) -> Error { Error::DbLedgerError(e)