Skip to content

Commit

Permalink
Apply comments
Browse files Browse the repository at this point in the history
  • Loading branch information
LindaGuiga committed Jul 29, 2024
1 parent 1a7e9da commit c9c12a8
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions evm_arithmetization/src/generation/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,17 @@ impl<F: Field> GenerationState<F> {
/// we're jumping to a special location.
pub(crate) fn jump_to(&mut self, dst: usize) -> Result<(), ProgramError> {
self.registers.program_counter = dst;
if dst == KERNEL.global_labels["observe_new_address"] && self.get_registers().stack_len > 0
{
let tip_u256 = stack_peek(self, 0).expect("There cannot be a stack underflow");
if self.stack().is_empty() {
// We cannot observe anything as the stack is empty.
return Ok(());
}
if dst == KERNEL.global_labels["observe_new_address"] {
let tip_u256 = stack_peek(self, 0)?;
let tip_h256 = H256::from_uint(&tip_u256);
let tip_h160 = H160::from(tip_h256);
self.observe_address(tip_h160);
} else if dst == KERNEL.global_labels["observe_new_contract"]
&& self.get_registers().stack_len > 0
{
let tip_u256 = stack_peek(self, 0).expect("There cannot be a stack underflow");
} else if dst == KERNEL.global_labels["observe_new_contract"] {
let tip_u256 = stack_peek(self, 0)?;
let tip_h256 = H256::from_uint(&tip_u256);
self.observe_contract(tip_h256)?;
}
Expand Down

0 comments on commit c9c12a8

Please sign in to comment.