diff --git a/node/storage/src/log_store/flow_store.rs b/node/storage/src/log_store/flow_store.rs index 0a49bd9..3d862fa 100644 --- a/node/storage/src/log_store/flow_store.rs +++ b/node/storage/src/log_store/flow_store.rs @@ -652,64 +652,3 @@ impl NodeTransaction for NodeDBTransaction { self } } - -// // Adapter implementation for OptionalHash that delegates to the H256 implementation -// impl NodeDatabase for FlowDBStore { -// fn get_node(&self, layer: usize, pos: usize) -> Result> { -// Ok(self.get_node(layer, pos)?.map(OptionalHash::some)) -// } - -// fn get_layer_size(&self, layer: usize) -> Result> { -// // Layer size is the same regardless of hash type -// >::get_layer_size(self, layer) -// } - -// fn start_transaction(&self) -> Box> { -// Box::new(OptionalHashNodeDBTransaction(self.start_transaction())) -// } - -// fn commit(&self, tx: Box>) -> Result<()> { -// let h256_tx = tx -// .into_any() -// .downcast::() -// .map_err(|_| anyhow::anyhow!("Failed to downcast OptionalHashNodeDBTransaction"))?; -// self.commit(h256_tx.0) -// } -// } - -// // Wrapper for NodeTransaction that delegates to NodeTransaction -// pub struct OptionalHashNodeDBTransaction(Box>); - -// impl NodeTransaction for OptionalHashNodeDBTransaction { -// fn save_node(&mut self, layer: usize, pos: usize, node: &OptionalHash) { -// self.0.save_node(layer, pos, &node.unwrap()); -// } - -// fn save_node_list(&mut self, nodes: &[(usize, usize, &OptionalHash)]) { -// let h256_nodes: Vec<(usize, usize, DataRoot)> = nodes -// .iter() -// .map(|(layer, pos, oh)| (*layer, *pos, oh.unwrap())) -// .collect(); -// let h256_node_refs: Vec<(usize, usize, &DataRoot)> = h256_nodes -// .iter() -// .map(|(layer, pos, h)| (*layer, *pos, h)) -// .collect(); -// self.0.save_node_list(&h256_node_refs); -// } - -// fn remove_node_list(&mut self, nodes: &[(usize, usize)]) { -// self.0.remove_node_list(nodes); -// } - -// fn save_layer_size(&mut self, layer: usize, size: usize) { -// self.0.save_layer_size(layer, size); -// } - -// fn remove_layer_size(&mut self, layer: usize) { -// self.0.remove_layer_size(layer); -// } - -// fn into_any(self: Box) -> Box { -// Box::new(self) -// } -// }