Remove rocksdb dependency from result.rs

This commit is contained in:
Michael Vines 2018-12-20 09:57:29 -08:00
parent 37d7ad819b
commit b36ceb5be4
2 changed files with 8 additions and 8 deletions

View File

@ -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<rocksdb::Error> for Error {
fn from(e: rocksdb::Error) -> Error {
Error::DbLedgerError(DbLedgerError::RocksDb(e))
}
}
pub trait LedgerColumnFamily {

View File

@ -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<vote_stage::VoteError> for Error {
Error::VoteError(e)
}
}
impl std::convert::From<rocksdb::Error> for Error {
fn from(e: rocksdb::Error) -> Error {
Error::RocksDb(e)
}
}
impl std::convert::From<db_ledger::DbLedgerError> for Error {
fn from(e: db_ledger::DbLedgerError) -> Error {
Error::DbLedgerError(e)