Skip to content

Commit e48bde7

Browse files
committed
chore: use contract.hash
1 parent 2715489 commit e48bde7

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

crates/evm/src/executor/inspector/coverage.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@ impl<DB: Database> Inspector<DB> for CoverageCollector {
2121
interpreter: &mut Interpreter,
2222
_: &mut EVMData<'_, DB>,
2323
) -> InstructionResult {
24-
// TODO(Evalir): This needs to be changed to contract.hash so it's not ultra slow.
25-
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
24+
let hash = b256_to_h256(interpreter.contract.hash);
2625
self.maps.entry(hash).or_insert_with(|| {
2726
HitMap::new(Bytes::copy_from_slice(
2827
interpreter.contract.bytecode.original_bytecode_slice(),
@@ -38,8 +37,7 @@ impl<DB: Database> Inspector<DB> for CoverageCollector {
3837
interpreter: &mut Interpreter,
3938
_: &mut EVMData<'_, DB>,
4039
) -> InstructionResult {
41-
// TODO(Evalir): This needs to be changed to contract.hash so it's not ultra slow.
42-
let hash = b256_to_h256(interpreter.contract.bytecode.clone().unlock().hash_slow());
40+
let hash = b256_to_h256(interpreter.contract.hash);
4341
self.maps.entry(hash).and_modify(|map| map.hit(interpreter.program_counter()));
4442

4543
InstructionResult::Continue

0 commit comments

Comments
 (0)