Remove rocksdb dependency from result.rs
This commit is contained in:
parent
37d7ad819b
commit
b36ceb5be4
|
@ -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 {
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue