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