Skip to content

Commit

Permalink
remove unnecessary assertions in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sagar-a16z committed Oct 31, 2024
1 parent 668a130 commit 5ab1858
Showing 1 changed file with 3 additions and 15 deletions.
18 changes: 3 additions & 15 deletions jolt-core/src/jolt/vm/rv32i_vm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -542,27 +542,19 @@ mod tests {
>>::prove(
io_device, trace, preprocessing.clone()
);
let verification_result =
let _verification_result =
RV32IJoltVM::verify(preprocessing, proof, commitments, debug_info);
assert!(
verification_result.is_ok(),
"Verification failed with error: {:?}",
verification_result.err()
);
}

#[test]
#[should_panic]
fn truncated_malicious_trace() {
fn malicious_trace() {
let artifact_guard = FIB_FILE_LOCK.lock().unwrap();
let mut program = host::Program::new("fibonacci-guest");
program.set_input(&1u8); // change input to 1 so that termination bit equal true
let (bytecode, memory_init) = program.decode();
let (mut io_device, mut trace) = program.trace();

Check failure on line 556 in jolt-core/src/jolt/vm/rv32i_vm.rs

View workflow job for this annotation

GitHub Actions / test

variable does not need to be mutable
let memory_layout = io_device.memory_layout.clone();
trace.truncate(100);
// change the output to the same as input to show that we can also forge the output value
io_device.outputs[0] = 1;
drop(artifact_guard);

// change memory address of output & termination bit to the same address as input
Expand All @@ -589,11 +581,7 @@ mod tests {
>>::prove(
io_device, trace, preprocessing.clone()
);
let verification_result =
let _verification_result =
RV32IJoltVM::verify(preprocessing, proof, commitments, debug_info);
assert!(
verification_result.is_err(),
"Verification passed unexpectedly",
);
}
}

0 comments on commit 5ab1858

Please sign in to comment.