Skip to content

Commit

Permalink
fixed debugger
Browse files Browse the repository at this point in the history
  • Loading branch information
QuantumExplorer committed Jul 11, 2024
1 parent c68eeec commit 7070eed
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions grovedb/src/debugger.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)?;

Expand All @@ -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()?;
Expand All @@ -129,7 +132,8 @@ fn node_to_update(
right_child,
}: NodeDbg,
) -> Result<NodeUpdate, crate::Error> {
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 },
Expand Down

0 comments on commit 7070eed

Please sign in to comment.