Skip to content

Commit d3572af

Browse files
authored
fix: correctly adjust depth when calling cheatcodes with --isolate (#8273)
fix: correctly adjust depth when calling cheatcodes with --isolate
1 parent bf51895 commit d3572af

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

crates/evm/evm/src/inspectors/stack.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -702,13 +702,16 @@ impl<'a, DB: DatabaseExt> Inspector<DB> for InspectorStackRefMut<'a> {
702702
ecx
703703
);
704704

705+
ecx.journaled_state.depth += self.in_inner_context as usize;
705706
if let Some(cheatcodes) = self.cheatcodes.as_deref_mut() {
706707
if let Some(output) = cheatcodes.call_with_executor(ecx, call, self.inner) {
707708
if output.result.result != InstructionResult::Continue {
709+
ecx.journaled_state.depth -= self.in_inner_context as usize;
708710
return Some(output)
709711
}
710712
}
711713
}
714+
ecx.journaled_state.depth -= self.in_inner_context as usize;
712715

713716
if self.enable_isolation &&
714717
call.scheme == CallScheme::Call &&

0 commit comments

Comments
 (0)