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

Use IndexMap to preserve insertion ordering #1

Open
wants to merge 1 commit into
base: kariy/public-path
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading