2018-09-20 07:36:49 +00:00
|
|
|
use super::{
|
|
|
|
ClientDB,
|
|
|
|
DBError,
|
|
|
|
};
|
|
|
|
|
|
|
|
mod block_store;
|
2018-09-21 01:13:07 +00:00
|
|
|
mod pow_chain_store;
|
2018-09-21 08:52:03 +00:00
|
|
|
mod validator_store;
|
2018-09-20 07:36:49 +00:00
|
|
|
|
|
|
|
pub use self::block_store::BlockStore;
|
2018-09-21 01:13:07 +00:00
|
|
|
pub use self::pow_chain_store::PoWChainStore;
|
2018-09-22 01:13:55 +00:00
|
|
|
pub use self::validator_store::ValidatorStore;
|
2018-09-20 07:36:49 +00:00
|
|
|
|
2018-09-24 03:16:39 +00:00
|
|
|
use super::bls;
|
|
|
|
|
2018-09-20 07:36:49 +00:00
|
|
|
const BLOCKS_DB_COLUMN: &str = "blocks";
|
2018-09-21 01:13:07 +00:00
|
|
|
const POW_CHAIN_DB_COLUMN: &str = "powchain";
|
2018-09-21 08:52:03 +00:00
|
|
|
const VALIDATOR_DB_COLUMN: &str = "validator";
|
2018-09-24 03:16:39 +00:00
|
|
|
|
|
|
|
#[derive(Debug, PartialEq)]
|
|
|
|
pub enum StoreError {
|
|
|
|
DBError(String),
|
|
|
|
DecodeError,
|
|
|
|
EncodeError,
|
|
|
|
}
|
|
|
|
|
|
|
|
impl From<DBError> for StoreError {
|
|
|
|
fn from(error: DBError) -> Self {
|
|
|
|
StoreError::DBError(error.message)
|
|
|
|
}
|
|
|
|
}
|