From 61418544579e518816e6105991be7d56b1b5b8d7 Mon Sep 17 00:00:00 2001 From: cchudant Date: Sun, 3 Nov 2024 09:07:33 +0000 Subject: [PATCH] remove dd.rs --- src/dd.rs | 41 ----------------------------------------- 1 file changed, 41 deletions(-) delete mode 100644 src/dd.rs diff --git a/src/dd.rs b/src/dd.rs deleted file mode 100644 index aeec73f..0000000 --- a/src/dd.rs +++ /dev/null @@ -1,41 +0,0 @@ -pub trait Database { - type View; - type WriteBatch; -} - -pub trait BonsaiDbStrategy { - type DB: Database; - fn get_node(&self, path: &BitSlice, db_view: &Self::DB::View) -> Result; - fn write_to_batch(&self, modifications: MerkleTree, db_write: &mut Self::DB::WriteBatch) -> Result<()>; -} - -pub struct GlobalTrie { - prefix_len: usize, - strategy: DBStrategy, -} - -impl GlobalTrie { - pub fn get_tree_at(&self, db: &DBStrategy::DB::View, prefix: &BitSlice) -> MerkleTree; -} - -pub trait DBForLayeredState: Database { - type Instance; - pub fn new_instance(&self, at_version: u64) -> Result; - pub fn get_closest(&self, iter: &mut Self::Instance, key: &[u8]) -> Result; - pub fn delete_range(&self, iter: &mut Self::Instance, write_to: &mut Self::WriteBatch, prefix: &[u8]) -> Result<()>; -} - -pub struct LayeredStateStrategy { - -} - -impl BonsaiDbStrategy for DBForLayeredState { - type DB = DB; - fn get_node(&self, path: &BitSlice, db_view: &Self::DB::View) -> Result { - todo!() - } - - fn write_to_batch(&self, modifications: MerkleTree, db_write: &mut Self::DB::WriteBatch) -> Result<()> { - todo!() - } -} \ No newline at end of file