Skip to content

Commit 3d839cd

Browse files
committed
imp: review item
1 parent 45741ed commit 3d839cd

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

crates/cheatcodes/src/inspector.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -872,13 +872,8 @@ impl<FEN: FoundryEvmNetwork> Cheatcodes<FEN> {
872872
&& mock.value.is_none_or(|value| Some(value) == call.transfer_value())
873873
})
874874
.map(|(_, v)| v),
875-
} && let Some(return_data) = if return_data_queue.len() == 1 {
876-
// If the mocked calls stack has a single element in it, don't empty it
877-
return_data_queue.front().map(|x| x.to_owned())
878-
} else {
879-
// Else, we pop the front element
880-
return_data_queue.pop_front()
881-
} {
875+
} && let Some(return_data) = return_data_queue.front().map(|x| x.to_owned())
876+
{
882877
if let Some(value) = call.transfer_value() {
883878
let checkpoint = ecx.journal_mut().checkpoint();
884879
match ecx.journal_mut().transfer_loaded(
@@ -909,6 +904,11 @@ impl<FEN: FoundryEvmNetwork> Cheatcodes<FEN> {
909904
}
910905
}
911906

907+
// If the mocked calls stack has a single element in it, don't empty it
908+
if return_data_queue.len() > 1 {
909+
return_data_queue.pop_front();
910+
}
911+
912912
return Some(CallOutcome {
913913
result: InterpreterResult {
914914
result: return_data.ret_type,

0 commit comments

Comments
 (0)