casper_storage/block_store/
mod.rs1mod block_provider;
2mod error;
3pub mod lmdb;
5pub mod types;
7
8pub use block_provider::{BlockStoreProvider, BlockStoreTransaction, DataReader, DataWriter};
9pub use error::BlockStoreError;
10
11#[derive(Debug)]
14pub struct DbRawBytesSpec {
15 is_legacy: bool,
16 raw_bytes: Vec<u8>,
17}
18
19impl DbRawBytesSpec {
20 pub fn new_legacy(raw_bytes: &[u8]) -> Self {
22 Self {
23 is_legacy: true,
24 raw_bytes: raw_bytes.to_vec(),
25 }
26 }
27
28 pub fn new_current(raw_bytes: &[u8]) -> Self {
30 Self {
31 is_legacy: false,
32 raw_bytes: raw_bytes.to_vec(),
33 }
34 }
35
36 pub fn is_legacy(&self) -> bool {
38 self.is_legacy
39 }
40
41 pub fn into_raw_bytes(self) -> Vec<u8> {
43 self.raw_bytes
44 }
45}