Skip to content

Commit

Permalink
chore: some more ToEthers removals (#6755)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored and RPate97 committed Jan 12, 2024
1 parent e53b6e4 commit 7b5da01
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 91 deletions.
4 changes: 1 addition & 3 deletions crates/evm/fuzz/src/inspector.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
use crate::{invariant::RandomCallGenerator, strategies::EvmFuzzState};
use alloy_primitives::Bytes;
use foundry_common::types::ToEthers;
use foundry_evm_core::utils;
use revm::{
interpreter::{CallInputs, CallScheme, Gas, InstructionResult, Interpreter},
Database, EVMData, Inspector,
Expand Down Expand Up @@ -73,7 +71,7 @@ impl Fuzzer {
let mut state = self.fuzz_state.write();

for slot in interpreter.stack().data() {
state.values_mut().insert(utils::u256_to_h256_be(slot.to_ethers()).into());
state.values_mut().insert(slot.to_be_bytes());
}

// TODO: disabled for now since it's flooding the dictionary
Expand Down
7 changes: 2 additions & 5 deletions crates/evm/fuzz/src/strategies/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ use alloy_dyn_abi::{DynSolType, JsonAbiExt};
use alloy_json_abi::Function;
use alloy_primitives::{Address, Bytes, B256, U256};
use ethers_core::types::Log;
use foundry_common::{
contracts::{ContractsByAddress, ContractsByArtifact},
types::ToEthers,
};
use foundry_common::contracts::{ContractsByAddress, ContractsByArtifact};
use foundry_config::FuzzDictionaryConfig;
use foundry_evm_core::utils::StateChangeset;
use hashbrown::HashSet;
Expand Down Expand Up @@ -232,7 +229,7 @@ fn collect_push_bytes(code: &[u8]) -> Vec<[u8; 32]> {
}

let push_value = U256::try_from_be_slice(&code[push_start..push_end]).unwrap();
bytes.push(push_value.to_ethers().into());
bytes.push(push_value.to_be_bytes());
// also add the value below and above the push value to the dictionary.
if push_value != U256::ZERO {
bytes.push((push_value - U256::from(1)).to_be_bytes());
Expand Down
83 changes: 0 additions & 83 deletions crates/evm/traces/src/node.rs

This file was deleted.

0 comments on commit 7b5da01

Please sign in to comment.