From 7070eed31b7c3a9be311d01bd80ca94bd49ecff9 Mon Sep 17 00:00:00 2001 From: Quantum Explorer Date: Thu, 11 Jul 2024 14:45:03 +0700 Subject: [PATCH] fixed debugger --- grovedb/src/debugger.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/grovedb/src/debugger.rs b/grovedb/src/debugger.rs index a090984e..de76c6df 100644 --- a/grovedb/src/debugger.rs +++ b/grovedb/src/debugger.rs @@ -5,6 +5,7 @@ use std::{fs, net::Ipv4Addr, sync::Weak}; use axum::{extract::State, http::StatusCode, response::IntoResponse, routing::post, Json, Router}; use grovedb_merk::debugger::NodeDbg; use grovedb_path::SubtreePath; +use grovedb_version::version::GroveVersion; use grovedbg_types::{NodeFetchRequest, NodeUpdate, Path}; use tokio::{ net::ToSocketAddrs, @@ -85,8 +86,9 @@ async fn fetch_node( return Err(AppError::Closed); }; + // todo: GroveVersion::latest() to actual version let merk = db - .open_non_transactional_merk_at_path(path.as_slice().into(), None, grove_version) + .open_non_transactional_merk_at_path(path.as_slice().into(), None, GroveVersion::latest()) .unwrap()?; let node = merk.get_node_dbg(&key)?; @@ -106,8 +108,9 @@ async fn fetch_root_node( return Err(AppError::Closed); }; + // todo: GroveVersion::latest() to actual version let merk = db - .open_non_transactional_merk_at_path(SubtreePath::empty(), None, grove_version) + .open_non_transactional_merk_at_path(SubtreePath::empty(), None, GroveVersion::latest()) .unwrap()?; let node = merk.get_root_node_dbg()?; @@ -129,7 +132,8 @@ fn node_to_update( right_child, }: NodeDbg, ) -> Result { - let grovedb_element = crate::Element::deserialize(&value, grove_version)?; + // todo: GroveVersion::latest() to actual version + let grovedb_element = crate::Element::deserialize(&value, GroveVersion::latest())?; let element = match grovedb_element { crate::Element::Item(value, ..) => grovedbg_types::Element::Item { value },