Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
refactor: use Bytecode::hash
  • Loading branch information
onbjerg committed Aug 1, 2022
commit 10ccd106dc9176f6fdce3941b77a5c4af5e9ad05
13 changes: 3 additions & 10 deletions evm/src/executor/fork/cache.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
//! Cache related abstraction
use ethers::{
types::{Address, H256, U256},
utils::keccak256,
};
use ethers::types::{Address, H256, U256};
use parking_lot::RwLock;
use revm::{Account, AccountInfo, DatabaseCommit, Filth, KECCAK_EMPTY};
use serde::{ser::SerializeMap, Deserialize, Deserializer, Serialize, Serializer};
Expand Down Expand Up @@ -197,12 +194,8 @@ impl MemDb {
storage.remove(&add);
} else {
// insert account
if let Some(code_hash) = acc
.info
.code
.as_ref()
.filter(|code| !code.is_empty())
.map(|code| H256::from_slice(&keccak256(code.bytes())))
if let Some(code_hash) =
acc.info.code.as_ref().filter(|code| !code.is_empty()).map(|code| code.hash())
{
acc.info.code_hash = code_hash;
} else if acc.info.code_hash.is_zero() {
Expand Down