Skip to content

Commit 5e8b836

Browse files
committed
update "should terminate abnormally" test to trigger a different ARG_CHECK
We can no longer produce non-verification context objects, so instead produce an invalid public key.
1 parent 4beae32 commit 5e8b836

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/lib.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -650,10 +650,9 @@ mod tests {
650650
#[ignore] // Panicking from C may trap (SIGILL) intentionally, so we test this manually.
651651
#[cfg(any(feature = "alloc", feature = "std"))]
652652
fn test_panic_raw_ctx_should_terminate_abnormally() {
653-
let ctx_vrfy = Secp256k1::verification_only();
654-
let raw_ctx_verify_as_full = unsafe {Secp256k1::from_raw_all(ctx_vrfy.ctx)};
655-
// Generating a key pair in verify context will panic (ARG_CHECK).
656-
raw_ctx_verify_as_full.generate_keypair(&mut thread_rng());
653+
// Trying to use an all-zeros public key should cause an ARG_CHECK to trigger.
654+
let pk = PublicKey::from(unsafe { ffi::PublicKey::new() });
655+
pk.serialize();
657656
}
658657

659658
#[test]

0 commit comments

Comments
 (0)