mod block_provider;
mod error;
pub mod lmdb;
pub mod types;
pub use block_provider::{BlockStoreProvider, BlockStoreTransaction, DataReader, DataWriter};
pub use error::BlockStoreError;
#[derive(Debug)]
pub struct DbRawBytesSpec {
is_legacy: bool,
raw_bytes: Vec<u8>,
}
impl DbRawBytesSpec {
pub fn new_legacy(raw_bytes: &[u8]) -> Self {
Self {
is_legacy: true,
raw_bytes: raw_bytes.to_vec(),
}
}
pub fn new_current(raw_bytes: &[u8]) -> Self {
Self {
is_legacy: false,
raw_bytes: raw_bytes.to_vec(),
}
}
pub fn is_legacy(&self) -> bool {
self.is_legacy
}
pub fn into_raw_bytes(self) -> Vec<u8> {
self.raw_bytes
}
}