Skip to content

Commit

Permalink
clippy and fmt issues
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj committed Nov 19, 2024
1 parent 45ce12c commit 59950e8
Showing 1 changed file with 11 additions and 13 deletions.
24 changes: 11 additions & 13 deletions forc-test/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,8 @@ impl TestExecutor {
test_entry: test_entry.clone(),
name,
jump_instruction_index,
relative_jump_in_bytes: (test_instruction_index - jump_instruction_index as u32) * Instruction::SIZE as u32,
relative_jump_in_bytes: (test_instruction_index - jump_instruction_index as u32)
* Instruction::SIZE as u32,
})
}

Expand Down Expand Up @@ -206,10 +207,8 @@ impl TestExecutor {

self.interpreter.set_single_stepping(true);
let mut state = {
let transition = self
.interpreter
.transact(self.tx.clone());
Ok(transition.unwrap().state().clone())
let transition = self.interpreter.transact(self.tx.clone());
Ok(*transition.unwrap().state())
};

loop {
Expand All @@ -219,21 +218,20 @@ impl TestExecutor {
state = Ok(ProgramState::Revert(0));
break;
}
Ok(ProgramState::Return(_) | ProgramState::ReturnData(_) | ProgramState::Revert(_)) => {
break
}
Ok(
ProgramState::Return(_) | ProgramState::ReturnData(_) | ProgramState::Revert(_),
) => break,
Ok(ProgramState::RunProgram(eval) | ProgramState::VerifyPredicate(eval)) => {
// time to jump into the specified test
if let Some(b) = eval.breakpoint() {
if b.pc() == jump_pc {
self.interpreter.registers_mut()[RegId::PC] += self.relative_jump_in_bytes as u64;
if b.pc() == jump_pc {
self.interpreter.registers_mut()[RegId::PC] +=
self.relative_jump_in_bytes as u64;
self.interpreter.set_single_stepping(false);
}
}

state = self
.interpreter
.resume();
state = self.interpreter.resume();
}
}
}
Expand Down

0 comments on commit 59950e8

Please sign in to comment.