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

chore: some more ToEthers removals #6755

Merged
merged 1 commit into from
Jan 10, 2024
Merged
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
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.

Loading