Skip to content

Commit

Permalink
Add tests for empty proof and empty pub inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielbosio committed Sep 19, 2024
1 parent 7a2b555 commit 1d5265b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions batcher/aligned-batcher/src/mina/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ mod test {
use super::verify_proof_integrity;

const PROTOCOL_STATE_PROOF_BYTES: &[u8] =
include_bytes!("../../../../batcher/aligned/test_files/mina/protocol_state.proof");
include_bytes!("../../../../scripts/test_files/mina/mina_state.proof");
const PROTOCOL_STATE_PUB_BYTES: &[u8] =
include_bytes!("../../../../batcher/aligned/test_files/mina/protocol_state.pub");
include_bytes!("../../../../scripts/test_files/mina/mina_state.pub");

#[test]
fn verify_proof_integrity_does_not_fail() {
Expand All @@ -33,4 +33,14 @@ mod test {
PROTOCOL_STATE_PUB_BYTES,
));
}

#[test]
fn verify_empty_proof() {
assert!(!verify_proof_integrity(&[], PROTOCOL_STATE_PUB_BYTES));
}

#[test]
fn verify_empty_pub_inputs() {
assert!(!verify_proof_integrity(PROTOCOL_STATE_PROOF_BYTES, &[]));
}
}

0 comments on commit 1d5265b

Please sign in to comment.