Skip to content

Commit

Permalink
fix: sneaky little bug
Browse files Browse the repository at this point in the history
  • Loading branch information
cchudant committed Sep 28, 2024
1 parent 95da8db commit 6c84019
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 390 deletions.
4 changes: 0 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ rocksdb = { optional = true, version = "0.21.0", features = [
env_logger = "0.11.3"
once_cell = "1.19.0"
pprof = { version = "0.3", features = ["flamegraph"] }
pathfinder-common = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-common", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" }
pathfinder-crypto = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-crypto", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" }
pathfinder-merkle-tree = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-merkle-tree", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" }
pathfinder-storage = { git = "https://github.com/massalabs/pathfinder.git", package = "pathfinder-storage", rev = "b7b6d76a76ab0e10f92e5f84ce099b5f727cb4db" }
rand = { version = "0.8.5", features = ["small_rng"] }
tempfile = "3.8.0"
rstest = "0.18.2"
Expand Down
18 changes: 8 additions & 10 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl<T: parity_scale_codec::Encode> EncodeExt for T {}
use changes::ChangeBatch;
use key_value_db::KeyValueDB;
use starknet_types_core::{felt::Felt, hash::StarkHash};
use trie::{tree::bytes_to_bitvec, trees::MerkleTrees};
use trie::{proof::MultiProof, tree::bytes_to_bitvec, trees::MerkleTrees};

/// Structure that contains the configuration for the BonsaiStorage.
/// A default implementation is provided with coherent values.
Expand Down Expand Up @@ -473,15 +473,13 @@ where
self.tries.db_ref().get_latest_id()
}

// /// Verifies a merkle-proof for a given `key` and `value`.
// pub fn verify_proof(
// root: Felt,
// key: &BitSlice,
// value: Felt,
// proofs: &[ProofNode],
// ) -> Option<Membership> {
// MerkleTree::<Pedersen>::verify_proof(root, key, value, proofs)
// }
pub fn get_multi_proof(
&mut self,
identifier: &[u8],
keys: impl IntoIterator<Item = impl AsRef<BitSlice>>,
) -> Result<MultiProof, BonsaiStorageError<DB::DatabaseError>> {
self.tries.get_multi_proof(identifier, keys)
}
}

impl<ChangeID, DB, H> BonsaiStorage<ChangeID, DB, H>
Expand Down
1 change: 0 additions & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
mod madara_comparison;
mod merge;
// mod proof;
mod merkle_tree;
mod proptest;
mod simple;
Expand Down
Loading

0 comments on commit 6c84019

Please sign in to comment.