Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: various helper functions and fixes for platform contested resources PR #307

Merged
merged 45 commits into from
Jun 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
c4201ed
feat: added new method to query item value or sum
QuantumExplorer May 18, 2024
a81de5e
feat: added new method to query item value or sum
QuantumExplorer May 18, 2024
8b09e18
feat: added new method to query item value or sum
QuantumExplorer May 18, 2024
a8f02d2
feat: added new method to query item value or sum
QuantumExplorer May 18, 2024
a62699d
feat: extra helpers
QuantumExplorer May 18, 2024
2c0712b
feat: allow to refer to sum trees
QuantumExplorer May 19, 2024
9cd00f3
changed lifetimes
QuantumExplorer May 22, 2024
6af586b
changed lifetimes
QuantumExplorer May 22, 2024
9fd8410
more fixes
QuantumExplorer May 22, 2024
1c7d13d
fix
ogabrielides May 22, 2024
761d45a
more fixes
QuantumExplorer May 22, 2024
1601625
sync session manages its transaction
fominok May 25, 2024
a4c65ba
Merge branch 'fix/ChunkLifetimes' of github.com:dashevo/grovedb into …
QuantumExplorer May 26, 2024
5f75f85
more fixes
ogabrielides May 26, 2024
d23d181
fmt
ogabrielides May 27, 2024
44a357c
Merge branch 'fix/ChunkLifetimes' into feat/QuerySumTree
QuantumExplorer May 27, 2024
56b824c
small helper
QuantumExplorer May 30, 2024
17e9193
additional helpers
QuantumExplorer May 30, 2024
229b7f2
added new reference type
QuantumExplorer May 31, 2024
d7474f4
some fixes
QuantumExplorer Jun 3, 2024
3e581c8
some fixes
QuantumExplorer Jun 3, 2024
c3d78a3
some fixes
QuantumExplorer Jun 3, 2024
ca40298
added convenience method
QuantumExplorer Jun 4, 2024
b297918
added a new function
QuantumExplorer Jun 5, 2024
07a5a19
made a struct copyable
QuantumExplorer Jun 6, 2024
b2483a0
added a little more information for an error
QuantumExplorer Jun 13, 2024
c66cb90
added a few more helper methods
QuantumExplorer Jun 17, 2024
964809f
added a few more helper methods
QuantumExplorer Jun 18, 2024
0b32606
fmt
QuantumExplorer Jun 18, 2024
8664b72
better internal error fix
QuantumExplorer Jun 24, 2024
31b5d21
fix
ogabrielides Jun 25, 2024
ea4bf6a
fixed import
QuantumExplorer Jun 25, 2024
8886695
fmt
QuantumExplorer Jun 25, 2024
c46194e
small fixes
QuantumExplorer Jun 25, 2024
cb03383
some clippy fixes
QuantumExplorer Jun 25, 2024
adb8fd1
query sum tree
fominok Jun 25, 2024
d77bbf5
qfix
fominok Jun 25, 2024
c0d810e
better error messages for proof errors
QuantumExplorer Jun 27, 2024
61dc98a
Merge branch 'feat/QuerySumTree' of github.com:dashevo/grovedb into f…
QuantumExplorer Jun 27, 2024
1696c2e
added debug
QuantumExplorer Jun 27, 2024
53642ed
make hex required
QuantumExplorer Jun 27, 2024
36eb5a9
a few improvements
QuantumExplorer Jun 30, 2024
c44aec6
a few improvements
QuantumExplorer Jun 30, 2024
5fb76c0
a few improvements
QuantumExplorer Jun 30, 2024
27e9a67
a few improvements
QuantumExplorer Jun 30, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions costs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ pub struct OperationCost {
}

impl OperationCost {
/// Is Nothing
pub fn is_nothing(&self) -> bool {
self == &Self::default()
}

/// Helper function to build default `OperationCost` with different
/// `seek_count`.
pub fn with_seek_count(seek_count: u16) -> Self {
Expand Down
3 changes: 1 addition & 2 deletions grovedb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ tempfile = { version = "3.10.1", optional = true }
bincode = { version = "2.0.0-rc.3" }
grovedb-storage = { version = "1.0.0-rc.2", path = "../storage", optional = true }
grovedb-visualize = { version = "1.0.0-rc.2", path = "../visualize", optional = true }
hex = { version = "0.4.3", optional = true }
hex = { version = "0.4.3"}
itertools = { version = "0.12.1", optional = true }
integer-encoding = { version = "4.0.0", optional = true }
grovedb-costs = { version = "1.0.0-rc.2", path = "../costs", optional = true }
Expand Down Expand Up @@ -51,7 +51,6 @@ full = [
"tempfile",
"grovedb-storage/rocksdb_storage",
"visualize",
"hex",
"itertools",
"integer-encoding",
"grovedb-costs",
Expand Down
2 changes: 1 addition & 1 deletion grovedb/src/batch/estimated_costs/average_case_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
.estimated_to_be_empty();

// Then we have to get the tree
if self.cached_merks.get(path).is_none() {

Check warning on line 231 in grovedb/src/batch/estimated_costs/average_case_costs.rs

View workflow job for this annotation

GitHub Actions / clippy

unnecessary use of `get(path).is_none()`

warning: unnecessary use of `get(path).is_none()` --> grovedb/src/batch/estimated_costs/average_case_costs.rs:231:30 | 231 | if self.cached_merks.get(path).is_none() { | ------------------^^^^^^^^^^^^^^^^^^^ | | | help: replace it with: `!self.cached_merks.contains_key(path)` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_get_then_check = note: `#[warn(clippy::unnecessary_get_then_check)]` on by default
let layer_info = cost_return_on_error_no_add!(
&cost,
self.paths.get(path).ok_or_else(|| {
Expand Down Expand Up @@ -274,18 +274,18 @@
let base_path = KeyInfoPath(vec![]);
if let Some(estimated_layer_info) = self.paths.get(&base_path) {
// Then we have to get the tree
if self.cached_merks.get(&base_path).is_none() {
if !self.cached_merks.contains_key(&base_path) {
GroveDb::add_average_case_get_merk_at_path::<RocksDbStorage>(
&mut cost,
&base_path,
estimated_layer_info
.estimated_layer_count
.estimated_to_be_empty(),
estimated_layer_info.is_sum_tree,
);
self.cached_merks
.insert(base_path, estimated_layer_info.is_sum_tree);
}

Check warning on line 288 in grovedb/src/batch/estimated_costs/average_case_costs.rs

View workflow job for this annotation

GitHub Actions / clippy

usage of `contains_key` followed by `insert` on a `HashMap`

warning: usage of `contains_key` followed by `insert` on a `HashMap` --> grovedb/src/batch/estimated_costs/average_case_costs.rs:277:13 | 277 | / if !self.cached_merks.contains_key(&base_path) { 278 | | GroveDb::add_average_case_get_merk_at_path::<RocksDbStorage>( 279 | | &mut cost, 280 | | &base_path, ... | 287 | | .insert(base_path, estimated_layer_info.is_sum_tree); 288 | | } | |_____________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#map_entry = note: `#[warn(clippy::map_entry)]` on by default help: try | 277 ~ self.cached_merks.entry(base_path).or_insert_with(|| { 278 + GroveDb::add_average_case_get_merk_at_path::<RocksDbStorage>( 279 + &mut cost, 280 + &base_path, 281 + estimated_layer_info 282 + .estimated_layer_count 283 + .estimated_to_be_empty(), 284 + estimated_layer_info.is_sum_tree, 285 + ); 286 + estimated_layer_info.is_sum_tree 287 + }); |
}
Ok(()).wrap_with_cost(cost)
}
Expand Down
4 changes: 2 additions & 2 deletions grovedb/src/batch/estimated_costs/worst_case_costs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ impl<G, SR> TreeCache<G, SR> for WorstCaseTreeCacheKnownPaths {
);

// Then we have to get the tree
if self.cached_merks.get(path).is_none() {
if !self.cached_merks.contains(path) {
GroveDb::add_worst_case_get_merk_at_path::<RocksDbStorage>(&mut cost, path, false);
self.cached_merks.insert(path.clone());
}
Expand All @@ -239,7 +239,7 @@ impl<G, SR> TreeCache<G, SR> for WorstCaseTreeCacheKnownPaths {
let base_path = KeyInfoPath(vec![]);
if let Some(_estimated_layer_info) = self.paths.get(&base_path) {
// Then we have to get the tree
if self.cached_merks.get(&base_path).is_none() {
if !self.cached_merks.contains(&base_path) {
GroveDb::add_worst_case_get_merk_at_path::<RocksDbStorage>(
&mut cost, &base_path, false,
);
Expand Down
10 changes: 10 additions & 0 deletions grovedb/src/debugger.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//! GroveDB debugging support module.

use std::{fs, net::Ipv4Addr, sync::Weak};

Check warning on line 3 in grovedb/src/debugger.rs

View workflow job for this annotation

GitHub Actions / clippy

unused import: `net::Ipv4Addr`

warning: unused import: `net::Ipv4Addr` --> grovedb/src/debugger.rs:3:15 | 3 | use std::{fs, net::Ipv4Addr, sync::Weak}; | ^^^^^^^^^^^^^ | = note: `#[warn(unused_imports)]` on by default

use axum::{extract::State, http::StatusCode, response::IntoResponse, routing::post, Json, Router};
use grovedb_merk::debugger::NodeDbg;
Expand All @@ -27,7 +27,7 @@
let grovedbg_zip = grovedbg_tmp.path().join("grovedbg.zip");
let grovedbg_www = grovedbg_tmp.path().join("grovedbg_www");

fs::write(&grovedbg_zip, &GROVEDBG_ZIP).expect("cannot crate grovedbg.zip");

Check warning on line 30 in grovedb/src/debugger.rs

View workflow job for this annotation

GitHub Actions / clippy

the borrowed expression implements the required traits

warning: the borrowed expression implements the required traits --> grovedb/src/debugger.rs:30:34 | 30 | fs::write(&grovedbg_zip, &GROVEDBG_ZIP).expect("cannot crate grovedbg.zip"); | ^^^^^^^^^^^^^ help: change this to: `GROVEDBG_ZIP` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_borrows_for_generic_args = note: `#[warn(clippy::needless_borrows_for_generic_args)]` on by default
zip_extensions::read::zip_extract(&grovedbg_zip, &grovedbg_www)
.expect("cannot extract grovedbg contents");

Expand Down Expand Up @@ -144,6 +144,16 @@
n_keep: n_keep.into(),
path_append,
},
crate::Element::Reference(
ReferencePathType::UpstreamRootHeightWithParentPathAdditionReference(
n_keep,
path_append,
),
..,
) => grovedbg_types::Element::UpstreamRootHeightWithParentPathAdditionReference {
n_keep: n_keep.into(),
path_append,
},
crate::Element::Reference(
ReferencePathType::UpstreamFromElementHeightReference(n_remove, path_append),
..,
Expand Down
8 changes: 6 additions & 2 deletions grovedb/src/element/get.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,12 @@ impl Element {
let value = result?;
value.ok_or_else(|| {
Error::PathKeyNotFound(format!(
"key not found in Merk for get: {}",
hex::encode(key)
"get: key \"{}\" not found in Merk that has a root key [{}] and is of type {}",
hex::encode(key),
merk.root_key()
.map(hex::encode)
.unwrap_or("None".to_string()),
merk.merk_type
))
})
})
Expand Down
48 changes: 45 additions & 3 deletions grovedb/src/element/helpers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@
#[cfg(feature = "full")]
use integer_encoding::VarInt;

#[cfg(any(feature = "full", feature = "verify"))]
use crate::reference_path::{path_from_reference_path_type, ReferencePathType};
#[cfg(any(feature = "full", feature = "verify"))]
use crate::{element::SUM_ITEM_COST_SIZE, Element, Error};
#[cfg(feature = "full")]
use crate::{
element::{SUM_TREE_COST_SIZE, TREE_COST_SIZE},
reference_path::{path_from_reference_path_type, ReferencePathType},
ElementFlags,
};

Expand All @@ -64,15 +65,41 @@
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Decoded the integer value in the SumItem element type, returns 0 for
/// everything else
/// Decoded the integer value in the SumItem element type
pub fn as_sum_item_value(&self) -> Result<i64, Error> {
match self {
Element::SumItem(value, _) => Ok(*value),
_ => Err(Error::WrongElementType("expected a sum item")),
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Decoded the integer value in the SumItem element type
pub fn into_sum_item_value(self) -> Result<i64, Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the purpose of this method? as_sum_item_value is just fine because i64 is Copy

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

still should be faster right as you are not copying memory. I agree it's not very important though.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It returns from the function so the stack frame is cleared and memory will be copied from there anyways, we're not avoiding memory copies by using self unless we doing so to avoid doing explicit clonings

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Look, it really doesn't matter, we have a lot of into and as. While I could remove this, I just don't think it matters, so I prefer to keep it.

match self {
Element::SumItem(value, _) => Ok(value),
_ => Err(Error::WrongElementType("expected a sum item")),
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Decoded the integer value in the SumTree element type
pub fn as_sum_tree_value(&self) -> Result<i64, Error> {
match self {
Element::SumTree(_, value, _) => Ok(*value),
_ => Err(Error::WrongElementType("expected a sum tree")),
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Decoded the integer value in the SumTree element type
pub fn into_sum_tree_value(self) -> Result<i64, Error> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as_sum_tree_value is fine

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

match self {
Element::SumTree(_, value, _) => Ok(value),
_ => Err(Error::WrongElementType("expected a sum tree")),
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Gives the item value in the Item element type
pub fn as_item_bytes(&self) -> Result<&[u8], Error> {
Expand All @@ -91,6 +118,15 @@
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Gives the reference path type in the Reference element type
pub fn into_reference_path_type(self) -> Result<ReferencePathType, Error> {
match self {
Element::Reference(value, ..) => Ok(value),
_ => Err(Error::WrongElementType("expected a reference")),
}
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Check if the element is a sum tree
pub fn is_sum_tree(&self) -> bool {
Expand All @@ -103,6 +139,12 @@
matches!(self, Element::SumTree(..) | Element::Tree(..))
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Check if the element is a reference
pub fn is_reference(&self) -> bool {
matches!(self, Element::Reference(..))
}

#[cfg(any(feature = "full", feature = "verify"))]
/// Check if the element is an item
pub fn is_item(&self) -> bool {
Expand Down Expand Up @@ -245,7 +287,7 @@
#[cfg(feature = "full")]
/// Get tree costs for a key value
pub fn specialized_costs_for_key_value(
key: &Vec<u8>,

Check warning on line 290 in grovedb/src/element/helpers.rs

View workflow job for this annotation

GitHub Actions / clippy

writing `&Vec` instead of `&[_]` involves a new object where a slice will do

warning: writing `&Vec` instead of `&[_]` involves a new object where a slice will do --> grovedb/src/element/helpers.rs:290:14 | 290 | key: &Vec<u8>, | ^^^^^^^^ help: change this to: `&[u8]` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#ptr_arg = note: `#[warn(clippy::ptr_arg)]` on by default
value: &[u8],
is_sum_node: bool,
) -> Result<u32, Error> {
Expand Down Expand Up @@ -316,9 +358,9 @@
#[cfg(feature = "full")]
/// Get the value defined cost for a serialized value
pub fn value_defined_cost(&self) -> Option<ValueDefinedCostType> {
let Some(value_cost) = self.get_specialized_cost().ok() else {
return None;
};

Check warning on line 363 in grovedb/src/element/helpers.rs

View workflow job for this annotation

GitHub Actions / clippy

this `let...else` may be rewritten with the `?` operator

warning: this `let...else` may be rewritten with the `?` operator --> grovedb/src/element/helpers.rs:361:9 | 361 | / let Some(value_cost) = self.get_specialized_cost().ok() else { 362 | | return None; 363 | | }; | |__________^ help: replace it with: `let value_cost = self.get_specialized_cost().ok()?;` | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#question_mark = note: `#[warn(clippy::question_mark)]` on by default

let cost = value_cost
+ self.get_flags().as_ref().map_or(0, |flags| {
Expand Down
14 changes: 13 additions & 1 deletion grovedb/src/element/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ pub enum Element {
Item(Vec<u8>, Option<ElementFlags>),
/// A reference to an object by its path
Reference(ReferencePathType, MaxReferenceHop, Option<ElementFlags>),
/// A subtree, contains the a prefixed key representing the root of the
/// A subtree, contains the prefixed key representing the root of the
/// subtree.
Tree(Option<Vec<u8>>, Option<ElementFlags>),
/// Signed integer value that can be totaled in a sum tree
Expand All @@ -111,6 +111,18 @@ pub enum Element {
SumTree(Option<Vec<u8>>, SumValue, Option<ElementFlags>),
}

impl Element {
pub fn type_str(&self) -> &str {
match self {
Element::Item(..) => "item",
Element::Reference(..) => "reference",
Element::Tree(..) => "tree",
Element::SumItem(..) => "sum item",
Element::SumTree(..) => "sum tree",
}
}
}

#[cfg(any(feature = "full", feature = "visualize"))]
impl fmt::Debug for Element {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
Expand Down
4 changes: 2 additions & 2 deletions grovedb/src/element/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
QueryPathKeyElementTrioResultType,
},
},
util::{merk_optional_tx, storage_context_optional_tx},
util::{merk_optional_tx, merk_optional_tx_internal_error, storage_context_optional_tx},
Error, PathQuery, TransactionArg,
};
#[cfg(any(feature = "full", feature = "verify"))]
Expand Down Expand Up @@ -543,19 +543,19 @@
/// expensive query.
#[cfg(feature = "full")]
// TODO: refactor
fn query_item(
storage: &RocksDbStorage,
item: &QueryItem,
results: &mut Vec<QueryResultElement>,
path: &[&[u8]],
sized_query: &SizedQuery,
transaction: TransactionArg,
limit: &mut Option<u16>,
offset: &mut Option<u16>,
query_options: QueryOptions,
result_type: QueryResultType,
add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>,
) -> CostResult<(), Error> {

Check warning on line 558 in grovedb/src/element/query.rs

View workflow job for this annotation

GitHub Actions / clippy

this function has too many arguments (11/7)

warning: this function has too many arguments (11/7) --> grovedb/src/element/query.rs:546:5 | 546 | / fn query_item( 547 | | storage: &RocksDbStorage, 548 | | item: &QueryItem, 549 | | results: &mut Vec<QueryResultElement>, ... | 557 | | add_element_function: fn(PathQueryPushArgs) -> CostResult<(), Error>, 558 | | ) -> CostResult<(), Error> { | |______________________________^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#too_many_arguments = note: `#[warn(clippy::too_many_arguments)]` on by default
let mut cost = OperationCost::default();

let subtree_path: SubtreePath<_> = path.into();
Expand All @@ -563,7 +563,7 @@
if !item.is_range() {
// this is a query on a key
if let QueryItem::Key(key) = item {
let element_res = merk_optional_tx!(
let element_res = merk_optional_tx_internal_error!(
&mut cost,
storage,
subtree_path,
Expand Down
2 changes: 1 addition & 1 deletion grovedb/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ pub enum Error {
InternalError(&'static str),
#[error("invalid proof: {0}")]
/// Invalid proof
InvalidProof(&'static str),
InvalidProof(String),
#[error("invalid input: {0}")]
/// Invalid input
InvalidInput(&'static str),
Expand Down
7 changes: 3 additions & 4 deletions grovedb/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@
mod tests;
#[cfg(feature = "full")]
mod util;
#[cfg(any(feature = "full", feature = "verify"))]
mod versioning;
#[cfg(feature = "full")]
mod visualize;
Expand Down Expand Up @@ -336,11 +335,11 @@

/// Opens a Merk at given path for with direct write access. Intended for
/// replication purposes.
fn open_merk_for_replication<'db, 'b, B>(
fn open_merk_for_replication<'tx, 'db: 'tx, 'b, B>(
&'db self,
path: SubtreePath<'b, B>,
tx: &'db Transaction,
) -> Result<Merk<PrefixedRocksDbImmediateStorageContext<'db>>, Error>
tx: &'tx Transaction<'db>,
) -> Result<Merk<PrefixedRocksDbImmediateStorageContext<'tx>>, Error>
where
B: AsRef<[u8]> + 'b,
{
Expand Down Expand Up @@ -859,7 +858,7 @@
pub fn verify_grovedb(
&self,
transaction: TransactionArg,
) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {

Check warning on line 861 in grovedb/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:861:10 | 861 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity = note: `#[warn(clippy::type_complexity)]` on by default
if let Some(transaction) = transaction {
let root_merk = self
.open_transactional_merk_at_path(SubtreePath::empty(), transaction, None)
Expand All @@ -885,7 +884,7 @@
merk: Merk<S>,
path: &SubtreePath<B>,
batch: Option<&'db StorageBatch>,
) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {

Check warning on line 887 in grovedb/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:887:10 | 887 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
let mut all_query = Query::new();
all_query.insert_all();

Expand Down Expand Up @@ -955,7 +954,7 @@
path: &SubtreePath<B>,
batch: Option<&'db StorageBatch>,
transaction: &Transaction,
) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> {

Check warning on line 957 in grovedb/src/lib.rs

View workflow job for this annotation

GitHub Actions / clippy

very complex type used. Consider factoring parts into `type` definitions

warning: very complex type used. Consider factoring parts into `type` definitions --> grovedb/src/lib.rs:957:10 | 957 | ) -> Result<HashMap<Vec<Vec<u8>>, (CryptoHash, CryptoHash, CryptoHash)>, Error> { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#type_complexity
let mut all_query = Query::new();
all_query.insert_all();

Expand Down
3 changes: 3 additions & 0 deletions grovedb/src/operations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,6 @@ pub mod insert;
pub(crate) mod is_empty_tree;
#[cfg(any(feature = "full", feature = "verify"))]
pub mod proof;

#[cfg(feature = "full")]
pub use get::{QueryItemOrSumReturnType, MAX_REFERENCE_HOPS};
2 changes: 2 additions & 0 deletions grovedb/src/operations/get/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
mod average_case;
#[cfg(feature = "full")]
mod query;
#[cfg(feature = "full")]
pub use query::QueryItemOrSumReturnType;
#[cfg(feature = "estimated_costs")]
mod worst_case;

Expand Down
Loading
Loading