Skip to content

Commit

Permalink
adapt test
Browse files Browse the repository at this point in the history
  • Loading branch information
enitrat committed Sep 17, 2024
1 parent 38eae4b commit b290974
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
12 changes: 4 additions & 8 deletions crates/evm/src/instructions/memory_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -713,10 +713,8 @@ mod tests {

// Then
let pc = vm.pc();
// ideally we should assert that it incremented, but incrementing is done by
// `decode_and_execute`
// so we can assume that will be done
assert(pc == old_pc, 'PC should be same');
// If the jump is not taken, the PC should be incremented by 1
assert_eq!(pc, old_pc + 1);
}

#[test]
Expand Down Expand Up @@ -758,10 +756,8 @@ mod tests {

// Then
let pc = vm.pc();
// ideally we should assert that it incremented, but incrementing is done by
// `decode_and_execute`
// so we can assume that will be done
assert(pc == old_pc, 'PC should be same');
// If the jump is not taken, the PC should be incremented by 1
assert_eq!(pc, old_pc + 1);
}

#[test]
Expand Down
3 changes: 3 additions & 0 deletions crates/evm/src/instructions/push_operations.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -329,8 +329,11 @@ mod tests {
}
}

/// Get a span of 0xFF bytes of length n preceded by a 0x00 byte
/// to account for the argument offset in push operations
fn get_n_0xFF(mut n: u8) -> Span<u8> {
let mut array: Array<u8> = ArrayTrait::new();
array.append(0x00);
while n != 0 {
array.append(0xFF);
n -= 1;
Expand Down

0 comments on commit b290974

Please sign in to comment.