rootstore.rs 251 B

123456789101112
  1. use crate::Result;
  2. const SLED_ROOTS_TREE: &[u8] = b"_merkleroots";
  3. pub struct RootStore(sled::Tree);
  4. impl RootStore {
  5. pub fn new(db: &sled::Db) -> Result<Self> {
  6. let tree = db.open_tree(SLED_ROOTS_TREE)?;
  7. Ok(Self(tree))
  8. }
  9. }