From f791f393481d69e9bfed149888e85ffa3f3dc04f Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Sun, 22 Dec 2024 18:47:53 +0100 Subject: [PATCH] fix: reth-trie no_std case hashmap (#13497) Co-authored-by: lightsing --- crates/trie/db/src/prefix_set.rs | 11 +++++------ crates/trie/db/src/storage.rs | 4 +--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/crates/trie/db/src/prefix_set.rs b/crates/trie/db/src/prefix_set.rs index 95ff6d91f374..63098c1ec8c2 100644 --- a/crates/trie/db/src/prefix_set.rs +++ b/crates/trie/db/src/prefix_set.rs @@ -1,4 +1,8 @@ -use alloy_primitives::{BlockNumber, B256}; +use alloy_primitives::{ + map::{HashMap, HashSet}, + BlockNumber, B256, +}; +use core::{marker::PhantomData, ops::RangeInclusive}; use derive_more::Deref; use reth_db::tables; use reth_db_api::{ @@ -12,11 +16,6 @@ use reth_trie::{ prefix_set::{PrefixSetMut, TriePrefixSets}, KeyHasher, Nibbles, }; -use std::{ - collections::{HashMap, HashSet}, - marker::PhantomData, - ops::RangeInclusive, -}; /// A wrapper around a database transaction that loads prefix sets within a given block range. #[derive(Debug)] diff --git a/crates/trie/db/src/storage.rs b/crates/trie/db/src/storage.rs index 3e40b298fac9..5b143ac7eeea 100644 --- a/crates/trie/db/src/storage.rs +++ b/crates/trie/db/src/storage.rs @@ -1,7 +1,5 @@ -use std::collections::hash_map; - use crate::{DatabaseHashedCursorFactory, DatabaseTrieCursorFactory}; -use alloy_primitives::{keccak256, Address, BlockNumber, B256}; +use alloy_primitives::{keccak256, map::hash_map, Address, BlockNumber, B256}; use reth_db::{cursor::DbCursorRO, models::BlockNumberAddress, tables, DatabaseError}; use reth_db_api::transaction::DbTx; use reth_execution_errors::StorageRootError;