From 6a5d04d51ad541552c7c66e3e61f6910d06e7d44 Mon Sep 17 00:00:00 2001 From: grandizzy Date: Thu, 28 Mar 2024 08:09:45 +0200 Subject: [PATCH] chore: remove misleading/unneeded FxIndexSet type --- crates/evm/fuzz/src/strategies/state.rs | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/crates/evm/fuzz/src/strategies/state.rs b/crates/evm/fuzz/src/strategies/state.rs index a01c5566810b..df70ba88520a 100644 --- a/crates/evm/fuzz/src/strategies/state.rs +++ b/crates/evm/fuzz/src/strategies/state.rs @@ -6,6 +6,7 @@ use alloy_primitives::{Address, Bytes, Log, B256, U256}; use foundry_common::contracts::{ContractsByAddress, ContractsByArtifact}; use foundry_config::FuzzDictionaryConfig; use foundry_evm_core::utils::StateChangeset; +use indexmap::IndexSet; use parking_lot::RwLock; use proptest::prelude::{BoxedStrategy, Strategy}; use revm::{ @@ -15,21 +16,19 @@ use revm::{ }; use std::{fmt, sync::Arc}; -// We're using `IndexSet` to have a stable element order when restoring persisted state, as well as -// for performance when iterating over the sets. -type FxIndexSet = indexmap::set::IndexSet; - /// A set of arbitrary 32 byte data from the VM used to generate values for the strategy. /// /// Wrapped in a shareable container. pub type EvmFuzzState = Arc>; +// We're using `IndexSet` to have a stable element order when restoring persisted state, as well as +// for performance when iterating over the sets. #[derive(Default)] pub struct FuzzDictionary { /// Collected state values. - state_values: FxIndexSet<[u8; 32]>, + state_values: IndexSet<[u8; 32]>, /// Addresses that already had their PUSH bytes collected. - addresses: FxIndexSet
, + addresses: IndexSet
, } impl fmt::Debug for FuzzDictionary { @@ -43,22 +42,22 @@ impl fmt::Debug for FuzzDictionary { impl FuzzDictionary { #[inline] - pub fn values(&self) -> &FxIndexSet<[u8; 32]> { + pub fn values(&self) -> &IndexSet<[u8; 32]> { &self.state_values } #[inline] - pub fn values_mut(&mut self) -> &mut FxIndexSet<[u8; 32]> { + pub fn values_mut(&mut self) -> &mut IndexSet<[u8; 32]> { &mut self.state_values } #[inline] - pub fn addresses(&self) -> &FxIndexSet
{ + pub fn addresses(&self) -> &IndexSet
{ &self.addresses } #[inline] - pub fn addresses_mut(&mut self) -> &mut FxIndexSet
{ + pub fn addresses_mut(&mut self) -> &mut IndexSet
{ &mut self.addresses } }