Skip to content

Commit

Permalink
use IndexMap for multiproof
Browse files Browse the repository at this point in the history
  • Loading branch information
kariy committed Dec 19, 2024
1 parent 9108a12 commit d2741d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ starknet-types-core = { version = "0.1.7", default-features = false, features =
rocksdb = { optional = true, version = "0.22", features = [
"multi-threaded-cf",
] }
indexmap = "2.2.6"

[dev-dependencies]
env_logger = "0.11.3"
Expand Down
5 changes: 3 additions & 2 deletions src/trie/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ use crate::{
merkle_node::{Node, NodeHandle},
tree::NodeKey,
},
BitSlice, BitVec, BonsaiDatabase, BonsaiStorageError, HashMap, HashSet,
BitSlice, BitVec, BonsaiDatabase, BonsaiStorageError, HashSet,
};
use core::{marker::PhantomData, mem};
use hashbrown::hash_set;
use indexmap::IndexMap;
use starknet_types_core::{felt::Felt, hash::StarkHash};

#[derive(Debug, thiserror::Error)]
Expand Down Expand Up @@ -58,7 +59,7 @@ impl ProofNode {
}

#[derive(Debug, Clone)]
pub struct MultiProof(pub HashMap<Felt, ProofNode>);
pub struct MultiProof(pub IndexMap<Felt, ProofNode>);
impl MultiProof {
/// If the proof proves more than just the provided `key_values`, this function will not fail.
/// Not the most optimized way of doing it, but we don't actually need to verify proofs in madara.
Expand Down

0 comments on commit d2741d4

Please sign in to comment.