From d2741d49d14210f675195a9a607910bf76bbed04 Mon Sep 17 00:00:00 2001 From: Ammar Arif Date: Wed, 18 Dec 2024 21:15:40 -0500 Subject: [PATCH] use `IndexMap` for multiproof --- Cargo.toml | 1 + src/trie/proof.rs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 596679a..17c19cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -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" diff --git a/src/trie/proof.rs b/src/trie/proof.rs index bba8afe..ac6e2cc 100644 --- a/src/trie/proof.rs +++ b/src/trie/proof.rs @@ -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)] @@ -58,7 +59,7 @@ impl ProofNode { } #[derive(Debug, Clone)] -pub struct MultiProof(pub HashMap); +pub struct MultiProof(pub IndexMap); 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.