Skip to content

Commit e973022

Browse files
committed
Add empty test case for Mina FFI
1 parent 27c2f85 commit e973022

File tree

1 file changed

+24
-2
lines changed

1 file changed

+24
-2
lines changed

operator/mina/lib/src/lib.rs

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ mod test {
272272
}
273273

274274
#[test]
275-
fn empty_mina_state_proof_does_not_verify() {
275+
fn zeroized_mina_state_proof_does_not_verify() {
276276
const PROOF_SIZE: usize = PROOF_BYTES.len();
277277
let empty_proof_buffer = [0u8; PROOF_SIZE];
278278

@@ -286,7 +286,7 @@ mod test {
286286
}
287287

288288
#[test]
289-
fn valid_mina_state_proof_with_empty_pub_input_does_not_verify() {
289+
fn valid_mina_state_proof_with_zeroized_pub_input_does_not_verify() {
290290
const PUB_INPUT_SIZE: usize = PUB_INPUT_BYTES.len();
291291
let empty_pub_input_buffer = [0u8; PUB_INPUT_SIZE];
292292

@@ -320,4 +320,26 @@ mod test {
320320
);
321321
assert_eq!(result, 0);
322322
}
323+
324+
#[test]
325+
fn empty_mina_state_proof_does_not_verify() {
326+
let result = verify_mina_state_ffi(
327+
PROOF_BYTES.as_ptr(),
328+
0,
329+
PUB_INPUT_BYTES.as_ptr(),
330+
PUB_INPUT_BYTES.len() as u32,
331+
);
332+
assert_eq!(result, 0);
333+
}
334+
335+
#[test]
336+
fn valid_mina_state_proof_with_empty_pub_input_does_not_verify() {
337+
let result = verify_mina_state_ffi(
338+
PROOF_BYTES.as_ptr(),
339+
PROOF_BYTES.len() as u32,
340+
PUB_INPUT_BYTES.as_ptr(),
341+
0,
342+
);
343+
assert_eq!(result, 0);
344+
}
323345
}

0 commit comments

Comments
 (0)